/* ════════════════════════════════════════════
   ReklamPilotu - Global Styles v3
   ════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0f1117;
    color: #e2e8f0;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* ════════════════════════════════════════════
   PAGE LAYOUT
   ════════════════════════════════════════════ */

.page {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar-container {
    width: 230px;
    min-width: 230px;
    flex-shrink: 0;
    background: #0d1117;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease;
    z-index: 200;
}

.sidebar-container::-webkit-scrollbar { width: 3px; }
.sidebar-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); }

/* ── Main ── */
main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #0f1117;
}

/* ── Header ── */
.glass-header {
    height: 56px;
    background: rgba(13,17,23,0.95);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-indicator {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Hamburger ── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hamburger-btn:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 150;
}

/* ── Account ── */
.account-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
}
.account-control:hover { background: rgba(255,255,255,0.06); }

.user-info { display: flex; flex-direction: column; text-align: right; }
.user-display-name { font-size: 0.78rem; font-weight: 600; color: #e2e8f0; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.user-role { font-size: 0.62rem; color: #64748b; }
.dropdown-trigger i { color: #64748b; font-size: 0.7rem; }

.premium-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    min-width: 175px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 500;
}
.account-control:hover .premium-dropdown { display: block; }

.premium-dropdown a,
.premium-dropdown .logout-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.82rem;
    transition: background 0.12s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.premium-dropdown a:hover, .premium-dropdown .logout-action:hover { background: rgba(255,255,255,0.06); }

.auth-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn-premium {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white !important;
    padding: 0.4rem 0.9rem;
    border-radius: 7px;
    text-decoration: none !important;
    font-size: 0.78rem;
    font-weight: 600;
}

.login-link { color: #94a3b8; text-decoration: none; font-size: 0.8rem; }
.login-link:hover { color: #e2e8f0; }

/* ── Content area ── */
.main-content-scroll { flex: 1; overflow-y: auto; }
.content-container { min-height: calc(100vh - 56px); }
.content-viewport { padding: 1.25rem 1.5rem 2rem; }

/* ── Status banner ── */
.status-banner { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid; margin-bottom: 1rem; }
.status-banner.pending { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.25); color: #fbbf24; }
.status-banner.suspended { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #f87171; }
.banner-icon { font-size: 1.2rem; }
.banner-text { display: flex; flex-direction: column; }
.banner-text strong { font-size: 0.85rem; }
.banner-text span { font-size: 0.78rem; opacity: 0.8; }

/* ════════════════════════════════════════════
   UI COMPONENTS
   ════════════════════════════════════════════ */

.glass-card, .premium-card {
    background: #161b22;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 1.25rem;
}

.text-gradient {
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge-premium { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; border: 1px solid transparent; }
.badge-active   { background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.25);  color: #4ade80; }
.badge-inactive { background: rgba(100,116,139,0.12); border-color: rgba(100,116,139,0.25); color: #94a3b8; }
.badge-revoked  { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.25);  color: #f87171; }
.badge-warning  { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.25); color: #fbbf24; }

.btn-nexus { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1.1rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600; border: none; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-nexus-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; box-shadow: 0 2px 10px rgba(99,102,241,0.3); }
.btn-nexus-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-nexus-secondary { background: rgba(255,255,255,0.06); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.1); }
.btn-nexus-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-nexus-danger { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-nexus-danger:hover { background: rgba(239,68,68,0.2); }

.nexus-input, .nexus-select { width: 100%; background: #0d1117; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #e2e8f0; padding: 0.5rem 0.75rem; font-size: 0.85rem; outline: none; transition: border-color 0.15s; }
.nexus-input:focus, .nexus-select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.nexus-input::placeholder { color: #475569; }
.nexus-label { display: block; font-size: 0.78rem; font-weight: 600; color: #94a3b8; margin-bottom: 0.3rem; }

.nexus-table { width: 100%; border-collapse: collapse; }
.nexus-table th { text-align: left; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: #475569; padding: 0.6rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nexus-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.04); color: #cbd5e1; font-size: 0.85rem; vertical-align: middle; }
.nexus-table tr:hover td { background: rgba(255,255,255,0.02); }

.section-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; margin-bottom: 0.25rem; }
.section-sub { font-size: 0.82rem; color: #64748b; margin-bottom: 1.25rem; }
.nexus-divider { border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 1rem 0; }

.nexus-alert { padding: 0.65rem 1rem; border-radius: 8px; font-size: 0.82rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.nexus-alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #4ade80; }
.nexus-alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }
.nexus-alert-info { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); color: #a5b4fc; }

.nexus-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.15); border-top-color: #6366f1; border-radius: 50%; animation: nexus-spin 0.7s linear infinite; display: inline-block; }
@keyframes nexus-spin { to { transform: rotate(360deg); } }

/* Product guidance surfaces */
.nx-dashboard,
.nx-auditor-hub {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1120px;
    margin: 0 auto;
}

.nx-hero-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #161b22;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 1.25rem;
}

.nx-kicker {
    display: inline-flex;
    align-items: center;
    color: #8b5cf6;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.nx-hero-panel h1,
.nx-section-head h2,
.nx-score-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: 0;
}

.nx-hero-panel p,
.nx-section-head p,
.nx-score-card p,
.nx-check-copy p,
.nx-platform-card span {
    margin: 0;
    color: #94a3b8;
    font-size: 0.84rem;
    line-height: 1.45;
}

.nx-primary-action,
.nx-row-action,
.nx-quick-action,
.nx-platform-card {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.nx-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.65rem 0.95rem;
    color: #fff;
    background: #4f46e5;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.nx-readiness-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
    gap: 1rem;
}

.nx-score-card,
.nx-credit-card,
.nx-checklist,
.nx-quick-action,
.nx-platform-card {
    background: #161b22;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}

.nx-score-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.nx-score-ring {
    --score: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at center, #161b22 57%, transparent 58%),
        conic-gradient(#22c55e calc(var(--score) * 1%), rgba(255,255,255,0.08) 0);
}

.nx-score-ring span {
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 800;
}

.nx-credit-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
}

.nx-credit-card strong {
    color: #f8fafc;
    font-size: 1.8rem;
    line-height: 1;
}

.nx-credit-card span:not(.nx-kicker) {
    color: #94a3b8;
    font-size: 0.78rem;
}

.nx-credit-card a {
    color: #a5b4fc;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    text-decoration: none;
}

.nx-checklist {
    padding: 1rem;
}

.nx-section-head {
    margin-bottom: 0.9rem;
}

.nx-check-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.nx-check-row:first-of-type {
    border-top: 0;
}

.nx-check-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #a5b4fc;
    background: rgba(99,102,241,0.12);
}

.nx-check-row.done .nx-check-icon {
    color: #22c55e;
    background: rgba(34,197,94,0.12);
}

.nx-check-copy h3 {
    margin: 0 0 0.15rem;
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 700;
}

.nx-row-action {
    min-width: 72px;
    min-height: 34px;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    color: #e2e8f0;
    background: rgba(255,255,255,0.07);
    font-size: 0.78rem;
    font-weight: 700;
}

.nx-check-row.todo .nx-row-action {
    background: #4f46e5;
    color: #fff;
}

.nx-quick-grid,
.nx-platform-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.nx-platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nx-quick-action,
.nx-platform-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem;
    color: #e2e8f0;
    text-align: left;
}

.nx-quick-action i,
.nx-platform-card i {
    color: #a5b4fc;
    font-size: 1.1rem;
}

.nx-platform-card {
    min-height: 150px;
    flex-direction: column;
    align-items: flex-start;
}

.nx-platform-card strong {
    color: #f8fafc;
}

.nx-empty-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

#blazor-error-ui { background: #1e293b; border-top: 1px solid rgba(239,68,68,0.3); bottom: 0; color: #f87171; display: none; left: 0; padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; font-size: 0.82rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.valid.modified:not([type=checkbox]) { border-color: #4ade80 !important; }
.invalid { border-color: #f87171 !important; }
.validation-message { color: #f87171; font-size: 0.78rem; margin-top: 0.2rem; }

/* ════════════════════════════════════════════
   MOBILE  ≤ 768px
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

    .hamburger-btn {
        display: flex !important;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar-container {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh !important;
        width: 260px !important;
        min-width: 260px !important;
        transform: translateX(-260px);
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }

    .sidebar-container.sidebar-open {
        transform: translateX(0) !important;
    }

    .content-viewport {
        padding: 0.75rem 0.75rem 3rem !important;
    }

    .page-indicator { display: none; }

    .glass-card, .premium-card { padding: 0.875rem !important; }

    .animate-fade-in.p-4 {
        padding: 0.35rem !important;
    }

    .display-5 {
        font-size: 1.65rem !important;
        line-height: 1.2;
    }

    .d-flex.justify-content-between.align-items-center {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .btn,
    .btn-premium,
    .btn-nexus {
        min-height: 40px;
    }

    .user-info,
    .dropdown-trigger {
        display: none;
    }

    .account-control {
        padding: 0.25rem;
    }

    .nx-dashboard,
    .nx-auditor-hub {
        gap: 0.75rem;
    }

    .nx-hero-panel {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .nx-primary-action {
        width: 100%;
    }

    .nx-readiness-grid,
    .nx-quick-grid,
    .nx-platform-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .nx-checklist {
        padding: 0.85rem;
    }

    .nx-check-row {
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        gap: 0.7rem;
    }

    .nx-row-action {
        grid-column: 2;
        width: 100%;
    }

    .nx-score-card {
        align-items: center;
    }

    .nx-platform-card {
        min-height: 120px;
    }
}
