/* ==========================================================================
   AUDITOR WANO - DESIGN SYSTEM & STYLESHEET (DARK GLASSMORPHISM)
   ========================================================================== */

:root {
    --bg: #070a13;
    --surface: rgba(17, 24, 39, 0.7);
    --surface-solid: #111827;
    --surface-hover: rgba(31, 41, 55, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(56, 189, 248, 0.3);
    
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --accent: #818cf8;
    --accent-glow: rgba(129, 140, 248, 0.25);
    
    --crit: #ef4444;
    --crit-glow: rgba(239, 68, 68, 0.2);
    --warn: #f59e0b;
    --warn-glow: rgba(245, 158, 11, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* AMBIENT GLOW BLOBS */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}
.blob-1 {
    width: 500px;
    height: 500px;
    background: #0284c7;
    top: -100px;
    right: -100px;
}
.blob-2 {
    width: 600px;
    height: 600px;
    background: #6366f1;
    bottom: -150px;
    left: -150px;
}

/* APP WRAPPER */
.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0284c7, #6366f1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}
.status-disconnected {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}
.status-connected {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-accent {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}
.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-md);
}
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* NAV TABS */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: #fff;
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--border-bright);
}

/* TAB CONTENT */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.step-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.card-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* STEPPER HEADER */
.stepper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 0 10px;
}
.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.45;
    transition: var(--transition);
}
.step-indicator.active {
    opacity: 1;
}
.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
}
.step-indicator.active .step-num {
    background: var(--primary);
    border-color: #38bdf8;
    color: #070a13;
    box-shadow: 0 0 15px var(--primary-glow);
}
.step-label {
    font-size: 13px;
    font-weight: 600;
}
.step-line {
    flex: 1;
    height: 2px;
    background: #1e293b;
    margin: 0 14px;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group.full-width {
    grid-column: 1 / -1;
}
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}
.form-input {
    background: #0b0f19;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* LEGAL NOTICE BOX */
.legal-notice-box {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 28px;
}
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
}
.checkbox-container input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
}
.checkbox-text strong {
    color: #fbbf24;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}
.checkbox-text p {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* STEP ACTIONS */
.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.step-actions.space-between {
    justify-content: space-between;
}

/* TOGGLES GRID (STEP 2) */
.toggles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.toggle-card {
    background: #0c111d;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}
.toggle-card:hover {
    border-color: #334155;
    background: #111827;
}
.toggle-card.full-width {
    grid-column: 1 / -1;
}
.toggle-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #1e293b;
    color: var(--primary);
    margin-bottom: 6px;
}
.tag-purple { color: #c084fc; background: rgba(192, 132, 252, 0.1); }
.tag-amber { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.tag-blue { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }
.tag-red { color: #f87171; background: rgba(248, 113, 113, 0.1); }
.tag-cyan { color: #22d3ee; background: rgba(34, 211, 238, 0.1); }
.tag-yellow { color: #facc15; background: rgba(250, 204, 21, 0.1); }

.toggle-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}
.toggle-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* SWITCH TOGGLE */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #1e293b;
    transition: .3s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* STEP 3: LIVE EXECUTION */
.launch-summary-box {
    display: flex;
    background: #090e18;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}
.summary-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.summary-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 600;
}
.summary-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}
.launch-action-center {
    text-align: center;
    padding: 30px 20px;
}
.hint-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* PIPELINE STEPS */
.live-progress-container {
    background: #090e18;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
}
.progress-title {
    font-size: 16px;
    margin-bottom: 20px;
}
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.p-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    opacity: 0.35;
    transition: var(--transition);
}
.p-step.active {
    opacity: 1;
}
.p-step.completed {
    opacity: 1;
}
.p-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #334155;
    margin-top: 3px;
    flex-shrink: 0;
}
.p-step.active .p-dot {
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary);
    animation: pulse 1.5s infinite;
}
.p-step.completed .p-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}
.p-text strong {
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}
.p-text p {
    font-size: 12px;
    color: var(--text-muted);
}
.progress-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.link-small {
    color: var(--primary);
    text-decoration: none;
}
.link-small:hover { text-decoration: underline; }

/* STEP 4: KPIS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi-card {
    background: #090e18;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}
.kpi-title {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 700;
}
.kpi-val {
    font-size: 32px;
    font-weight: 800;
    margin-top: 6px;
}
.text-red { color: var(--crit); }
.text-amber { color: var(--warn); }
.text-blue { color: var(--primary); }
.text-green { color: var(--success); }

.report-links-bar {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* FINDINGS PREVIEW */
.findings-preview-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.f-preview-card {
    background: #090e18;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}
.f-preview-card.crit { border-left-color: var(--crit); }
.f-preview-card.high { border-left-color: var(--warn); }

/* TABLES */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.modern-table th {
    text-align: left;
    padding: 14px 16px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}
.modern-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--crit); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--success); }

/* TENANTS GRID */
.tenants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 16px;
}
.tenant-card {
    background: #090e18;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
}
.t-badge {
    position: absolute;
    top: 18px; right: 18px;
    font-size: 11px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}
.t-id { font-size: 12px; color: var(--text-muted); margin: 4px 0 10px 0; }
.t-sector { font-size: 13px; color: #cbd5e1; margin-bottom: 12px; }
.t-targets { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.t-targets code { display: block; margin-top: 4px; color: var(--primary); font-family: 'JetBrains Mono', monospace; }
.t-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 14px; }

/* MODAL */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: #090e18;
    border-top: 1px solid var(--border);
}

.hidden { display: none !important; }
