:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --line: #e7ecf3;
    --blue: #1288c9;
    --blue-dark: #0b4f88;
    --blue-soft: #eaf7ff;
    --black: #05070a;
    --success: #087443;
    --warning: #b86b00;
    --danger: #c62828;
    --shadow: 0 22px 60px rgba(16, 24, 40, .09);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 90% 0%, rgba(18,136,201,.18), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-body { padding: 18px; }
.app-shell {
    min-height: calc(100vh - 36px);
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 18px;
}
.sidebar {
    position: sticky;
    top: 18px;
    height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: 30px;
    background: var(--black);
    color: white;
    box-shadow: 0 28px 60px rgba(0,0,0,.22);
    z-index: 40;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff !important;
    font-weight: 950;
    letter-spacing: -.04em;
    text-decoration: none !important;
}
.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 16px;
    background: #06111a;
}
.side-nav {
    display: grid;
    gap: 8px;
    margin: 34px 0;
}
.nav-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    padding: 0 12px;
    color: rgba(255,255,255,.72) !important;
    border-radius: 16px;
    text-decoration: none !important;
}
.nav-item span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    font-weight: 900;
}
.nav-item strong { font-size: 14px; }
.nav-item:hover,
.nav-item.active {
    background: #fff;
    color: #000 !important;
}
.nav-item:hover span,
.nav-item.active span {
    background: var(--blue-soft);
    color: var(--blue-dark);
}
.logout {
    margin-top: auto;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 850;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.topbar {
    position: sticky;
    top: 18px;
    z-index: 30;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 28px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(231,236,243,.9);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
    font-weight: 600;
    font-family: poppins !important;
}
.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
}
.top-title h1 {
    margin: 4px 0 0;
    font-size: clamp(20px, 2vw, 30px);
    letter-spacing: -.05em;
    line-height: 1;
}
.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: #000;
    color: #fff;
    font-size: 22px;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}
.user-chip > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--black);
    color: #fff;
    font-weight: 950;
}
.user-chip strong,
.user-chip small { display: block; line-height: 1.1; }
.user-chip strong {
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.user-chip small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.container {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    margin-top: 50px !important;
}
.footer {
    padding: 20px 8px;
    color: var(--muted);
    text-align: center;
}

.card,
.stat-card,
.hero {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}
.card { padding: clamp(16px, 2vw, 24px); }
.card h1, .card h2, .card h3 { margin-top: 0; letter-spacing: -.04em; }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.hero {
    min-height: 240px;
    display: grid;
    grid-template-columns: 1fr minmax(160px, 260px);
    gap: 22px;
    align-items: center;
    padding: clamp(24px, 4vw, 46px);
    overflow: hidden;
    background:
        radial-gradient(circle at 84% 50%, rgba(18,136,201,.20), transparent 36%),
        #fff;
}
.hero h1 {
    margin: 10px 0 10px;
    font-size: clamp(38px, 6vw, 74px);
    line-height: .95;
    letter-spacing: -.08em;
}
.hero p {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 1.5vw, 18px);
}
.hero img {
    width: 100%;
    max-height: 230px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(18,136,201,.25));
}
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.hero .actions { margin-top: 24px; }
.btn,
button.btn {
    min-height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid var(--black);
    border-radius: 14px;
    background: var(--black);
    color: #fff !important;
    font-weight: 850;
    cursor: pointer;
    text-decoration: none !important;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline {
    background: #fff;
    color: var(--black) !important;
    border-color: #d8dee9;
}
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 12px; border-radius: 10px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(5, minmax(140px, 1fr)); margin: 18px 0; }
.stat-card {
    min-height: 114px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.kpi {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.06em;
}
.muted { color: var(--muted); }

.alert {
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}
.alert-success { background: #ecfff5; color: var(--success); border-color: rgba(8,116,67,.22); }
.alert-error { background: #fff0f0; color: var(--danger); border-color: rgba(198,40,40,.22); }
.alert-warning { background: #fff8e8; color: var(--warning); border-color: rgba(184,107,0,.22); }
.alert-info { background: #eef9ff; color: var(--blue-dark); border-color: rgba(18,136,201,.22); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: 12px;
    font-weight: 900;
}
.badge-warning { background: #fff5df; color: var(--warning); }
.badge-danger { background: #ffecec; color: var(--danger); }
.badge-success { background: #e9fff4; color: var(--success); }
.badge-info { background: var(--blue-soft); color: var(--blue-dark); }

.table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}
table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}
th, td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
th {
    color: #7a8799;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
}
tr:hover td { background: #f8fbff; }

form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
label {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 850;
}
input, select, textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfdff;
    color: var(--text);
    outline: none;
    font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(18,136,201,.10);
}
.searchbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.searchbar input,
.searchbar select { flex: 1 1 190px; }

.notification-center { position: relative; z-index: 80; }
.notif-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #000;
    color: #fff;
    font-weight: 950;
    cursor: pointer;
}
.notification-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(410px, calc(100vw - 30px));
    max-height: min(560px, calc(100vh - 120px));
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 28px 70px rgba(0,0,0,.22);
    z-index: 9000;
}
.notification-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}
.notification-head strong { display:block; font-size:18px; }
.notification-head small { display:block; margin-top:2px; color:var(--muted); font-size:12px; }
.category-strip {
    display:flex;
    gap:8px;
    padding:10px 12px;
    overflow-x:auto;
    border-bottom:1px solid var(--line);
}
.category-strip span {
    flex:0 0 auto;
    padding:6px 9px;
    border-radius:999px;
    background:#f2f7fb;
    color:var(--blue-dark);
    font-size:12px;
    font-weight:850;
}
.notification-list-mini { max-height:410px; overflow:auto; padding:10px; }
.notif-mini {
    display:grid;
    grid-template-columns:12px 1fr;
    gap:12px;
    padding:13px;
    border-radius:18px;
    color:var(--text)!important;
    text-decoration:none!important;
}
.notif-mini:hover { background:#f7fbff; }
.notif-mini i {
    width:10px;
    height:10px;
    margin-top:4px;
    border-radius:50%;
    background:var(--blue);
}
.notif-mini i.warning { background:var(--warning); }
.notif-mini i.danger { background:var(--danger); }
.notif-mini i.success { background:var(--success); }
.notif-mini em {
    display:block;
    color:var(--blue-dark);
    font-size:11px;
    font-style:normal;
    font-weight: 600;
    text-transform:uppercase;
    letter-spacing:.07em;
    font-family: poppins !important;
}
.notif-mini strong { display:block; font-size:14px; }
.notif-mini small { display:block; margin-top:3px; color:var(--muted); font-size:12px; }
.empty { padding:28px; color:var(--muted); text-align:center; font-weight:800; }

.auth-header {
    width: min(1160px, calc(100% - 32px));
    margin: 20px auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}
.auth-logo {
    display:flex;
    align-items:center;
    gap:12px;
    color:var(--text);
    font-weight:950;
    text-decoration:none!important;
}
.auth-logo img { width:54px; height:54px; object-fit:contain; }
.auth-header nav { display:flex; gap:12px; align-items:center; }
.auth-container { width:min(1160px, calc(100% - 32px)); margin:32px auto; }

.mobile-overlay { display:none; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 18px;
        top: 18px;
        bottom: 18px;
        width: min(310px, calc(100vw - 36px));
        height: auto;
        transform: translateX(calc(-100% - 40px));
        transition: transform .22s ease;
        z-index: 5000;
    }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .mobile-overlay {
        display:block;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.36);
        z-index:4990;
    }
    .menu-toggle { display:grid; place-items:center; flex:0 0 auto; }
    .topbar {
        position:relative;
        top:auto;
        align-items:flex-start;
    }
    .top-actions {
        width:100%;
        justify-content:space-between;
    }
    .hero { grid-template-columns: 1fr; }
    .hero img {
        width: 220px;
        opacity: .25;
        position: absolute;
        right: 20px;
        bottom: 10px;
    }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .grid-3, .grid-4, form .row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .app-body { padding: 10px; }
    .app-shell { min-height: calc(100vh - 20px); }
    .topbar { flex-wrap: wrap; border-radius: 22px; }
    .user-chip strong { max-width: 110px; }
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 44px; }
    .notification-popover {
        position: fixed;
        left: 14px;
        right: 14px;
        top: 86px;
        width: auto;
    }
}

/* Documentation and client-safe profile additions */
.user-chip-link {
    color: var(--text) !important;
    text-decoration: none !important;
}
.user-chip-link:hover {
    border-color: rgba(18,136,201,.38);
    box-shadow: 0 8px 22px rgba(18,136,201,.10);
}
.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.doc-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 210px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow);
}
.doc-card h3 { margin: 0 0 8px; letter-spacing: -.04em; }
.doc-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.doc-card .actions { margin-top: 18px; }
.safe-profile-list {
    display: grid;
    gap: 12px;
}
.safe-profile-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfdff;
}
.safe-profile-item span { display:block; color:var(--muted); font-size:12px; font-weight:850; text-transform:uppercase; letter-spacing:.06em; }
.safe-profile-item strong { display:block; margin-top:4px; font-size:16px; }
@media (max-width: 980px) { .docs-grid { grid-template-columns: 1fr; } }

.price-preview {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid rgba(17, 66, 105, .12);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(7, 132, 181, .08), rgba(255, 255, 255, .88));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.price-preview span {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--blue-dark);
}

.voucher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    border-left: 3px solid var(--blue);
    padding: 10px 12px;
    background: rgba(7, 132, 181, .06);
    border-radius: 12px;
}

.timeline-item strong,
.timeline-item span {
    display: block;
}

.timeline-item p {
    margin: 6px 0 0;
}

.checkline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0 16px;
    font-weight: 700;
}

.checkline input {
    width: auto;
}

/* =========================================================
   Modern tech UI layer — lightweight, no external libraries
   ========================================================= */
:root {
    --tech-bg: #07111f;
    --tech-surface: rgba(255, 255, 255, .82);
    --tech-surface-solid: #ffffff;
    --tech-line: rgba(140, 170, 205, .24);
    --tech-cyan: #17c6ff;
    --tech-cyan-soft: rgba(23, 198, 255, .12);
    --tech-blue: #1268ff;
    --tech-violet: #7657ff;
    --tech-green: #2ee59d;
    --tech-glow: 0 18px 55px rgba(18, 104, 255, .13), 0 2px 10px rgba(23, 198, 255, .08);
    --tech-radius: 26px;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 9% 6%, rgba(23, 198, 255, .14), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(118, 87, 255, .13), transparent 24%),
        linear-gradient(135deg, #f6fbff 0%, #eef5ff 46%, #f9fbff 100%);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(10, 33, 61, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 33, 61, .045) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 88%);
}

body::after {
    content: '';
    position: fixed;
    inset: auto -8% -18% auto;
    width: 46vw;
    height: 46vw;
    min-width: 360px;
    min-height: 360px;
    z-index: -2;
    border-radius: 999px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(23,198,255,.16), rgba(18,104,255,.08) 36%, transparent 66%);
    filter: blur(8px);
}

.ambient-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.ambient-layer span {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(23,198,255,.18), transparent 66%);
    filter: blur(14px);
    opacity: .62;
    animation: ambientFloat 14s ease-in-out infinite;
}
.ambient-layer span:nth-child(1) { left: 18%; top: 7%; }
.ambient-layer span:nth-child(2) { right: 10%; top: 42%; animation-delay: -4s; background: radial-gradient(circle, rgba(118,87,255,.14), transparent 66%); }
.ambient-layer span:nth-child(3) { left: 8%; bottom: 4%; animation-delay: -8s; background: radial-gradient(circle, rgba(46,229,157,.10), transparent 66%); }

@keyframes ambientFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(18px, -22px, 0) scale(1.06); }
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 28%, rgba(23,198,255,.18), transparent 32%),
        linear-gradient(135deg, #07111f, #091a31 58%, #06101e);
    color: #fff;
    transition: opacity .28s ease, visibility .28s ease;
}
body.is-loaded .app-loader {
    opacity: 0;
    visibility: hidden;
}
.loader-card {
    width: min(360px, calc(100vw - 44px));
    min-height: 210px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 28px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 30px;
    background: rgba(255,255,255,.07);
    box-shadow: 0 28px 85px rgba(0,0,0,.38);
    backdrop-filter: blur(14px);
    text-align: center;
}
.loader-card strong {
    font-size: 18px;
    letter-spacing: -.02em;
}
.loader-card small {
    color: rgba(255,255,255,.68);
    font-weight: 750;
}
.loader-mark {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.14);
    background: radial-gradient(circle, rgba(23,198,255,.22), rgba(255,255,255,.04));
    box-shadow: 0 0 40px rgba(23,198,255,.25), inset 0 0 24px rgba(23,198,255,.08);
}
.loader-mark::before,
.loader-mark::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--tech-cyan);
    animation: techSpin .8s linear infinite;
}
.loader-mark::after {
    inset: 9px;
    border-top-color: var(--tech-green);
    animation-duration: 1.1s;
    animation-direction: reverse;
}
@keyframes techSpin { to { transform: rotate(360deg); } }

.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 20001;
    background: linear-gradient(90deg, var(--tech-cyan), var(--tech-blue), var(--tech-violet));
    box-shadow: 0 0 18px rgba(23,198,255,.55);
    opacity: 0;
    transition: width .32s ease, opacity .18s ease;
}
body.is-navigating .page-progress,
body.is-submitting .page-progress {
    width: 82%;
    opacity: 1;
}

.app-shell {
    position: relative;
}
.sidebar {
    border: 1px solid rgba(255,255,255,.10);
    background:
        linear-gradient(180deg, rgba(13, 29, 52, .96), rgba(4, 7, 12, .98)),
        radial-gradient(circle at 50% 0%, rgba(23,198,255,.22), transparent 35%);
    box-shadow: 0 32px 80px rgba(3, 10, 22, .35);
    overflow: hidden;
}
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255,255,255,.10), transparent 30%),
        linear-gradient(rgba(23,198,255,.07) 1px, transparent 1px);
    background-size: auto, 100% 38px;
    opacity: .55;
}
.sidebar > * {
    position: relative;
    z-index: 1;
}
.brand img {
    box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 0 28px rgba(23,198,255,.16);
}
.brand span {
    text-shadow: 0 0 18px rgba(23,198,255,.28);
}
.nav-item {
    position: relative;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.nav-item:hover {
    transform: translateX(4px);
}
.nav-item:hover::after,
.nav-item.active::after {
    border-color: rgba(23,198,255,.24);
    box-shadow: inset 0 0 0 1px rgba(23,198,255,.06), 0 12px 28px rgba(23,198,255,.08);
}
.nav-item.active {
    background: linear-gradient(135deg, #ffffff, #eef9ff);
}
.nav-item span {
    transition: transform .18s ease, box-shadow .18s ease;
}
.nav-item:hover span,
.nav-item.active span {
    transform: scale(1.04);
    box-shadow: 0 0 18px rgba(23,198,255,.18);
}
.logout {
    border: 1px solid rgba(255,255,255,.10);
    transition: transform .18s ease, background .18s ease;
}
.logout:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.14);
}

.topbar,
.card,
.stat-card,
.hero,
.doc-card,
.table-wrap,
.safe-profile-item,
.notification-popover,
.price-preview {
    border-color: var(--tech-line);
    box-shadow: var(--tech-glow);
}
.topbar {
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(18px) saturate(1.18);
}
.topbar::before,
.card::before,
.stat-card::before,
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.62), rgba(255,255,255,0) 36%);
    opacity: .7;
}
.topbar,
.card,
.stat-card,
.hero {
    position: relative;
    overflow: hidden;
}
.topbar > *,
.card > *,
.stat-card > *,
.hero > * {
    position: relative;
    z-index: 1;
}

.system-chip {
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid var(--tech-line);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: #0a2540;
    box-shadow: 0 10px 26px rgba(18,104,255,.07);
    white-space: nowrap;
}
.system-chip i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tech-green);
    box-shadow: 0 0 0 5px rgba(46,229,157,.13), 0 0 16px rgba(46,229,157,.45);
    animation: onlinePulse 1.8s ease-in-out infinite;
}
.system-chip span {
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.system-chip small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
@keyframes onlinePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.72); opacity: .72; }
}

.hero {
    background:
        radial-gradient(circle at 83% 38%, rgba(23,198,255,.20), transparent 32%),
        radial-gradient(circle at 16% 0%, rgba(118,87,255,.12), transparent 30%),
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,248,255,.88));
}
.hero::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -110px;
    width: 330px;
    height: 330px;
    border-radius: 50%;
    border: 1px solid rgba(23,198,255,.18);
    background:
        linear-gradient(90deg, transparent 49%, rgba(23,198,255,.12) 50%, transparent 51%),
        linear-gradient(transparent 49%, rgba(23,198,255,.12) 50%, transparent 51%);
    background-size: 44px 44px;
    opacity: .55;
    animation: radarDrift 12s linear infinite;
}
@keyframes radarDrift {
    to { transform: rotate(360deg); }
}
.hero img {
    animation: logoHover 5.8s ease-in-out infinite;
}
@keyframes logoHover {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.eyebrow::before {
    box-shadow: 0 0 0 5px rgba(23,198,255,.12), 0 0 20px rgba(23,198,255,.42);
}

.card,
.stat-card,
.doc-card,
.safe-profile-item {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover,
.stat-card:hover,
.doc-card:hover,
.safe-profile-item:hover {
    transform: translateY(-2px);
    border-color: rgba(23,198,255,.30);
    box-shadow: 0 24px 70px rgba(18,104,255,.16), 0 2px 12px rgba(23,198,255,.08);
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -35px;
    bottom: -45px;
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(23,198,255,.16), transparent 68%);
}
.kpi {
    background: linear-gradient(135deg, #081a2f, #1268ff 60%, #17c6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.btn,
button.btn {
    position: relative;
    overflow: hidden;
    border-color: rgba(3,10,22,.92);
    background: linear-gradient(135deg, #05070a, #0d2644 70%, #123d72);
    box-shadow: 0 12px 26px rgba(5,7,10,.14);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn::before,
button.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-110%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
    transition: transform .5s ease;
}
.btn:hover,
button.btn:hover {
    transform: translateY(-2px);
    border-color: var(--tech-cyan);
    box-shadow: 0 18px 38px rgba(18,104,255,.20);
}
.btn:hover::before,
button.btn:hover::before {
    transform: translateX(110%);
}
.btn-outline {
    background: rgba(255,255,255,.80);
    color: #091a31 !important;
    border-color: var(--tech-line);
    box-shadow: 0 10px 24px rgba(18,104,255,.06);
}
.btn-outline:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #0d2644, #1268ff);
}
.btn-danger {
    background: linear-gradient(135deg, #9d1b1b, #c62828);
    border-color: rgba(198,40,40,.65);
}

input,
select,
textarea {
    background: rgba(255,255,255,.78);
    border-color: var(--tech-line);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}
input:hover,
select:hover,
textarea:hover {
    background: #fff;
    border-color: rgba(23,198,255,.28);
}
input:focus,
select:focus,
textarea:focus {
    transform: translateY(-1px);
    border-color: var(--tech-cyan);
    box-shadow: 0 0 0 4px rgba(23,198,255,.12), 0 10px 24px rgba(18,104,255,.08);
}
label {
    letter-spacing: .01em;
}

.table-wrap {
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(12px);
}
th {
    background: rgba(248,251,255,.78);
    color: #52708d;
}
tr {
    transition: background .16s ease, transform .16s ease;
}
tr:hover td {
    background: rgba(234,247,255,.64);
}
td a strong {
    color: #0a4f88;
}
.badge {
    border: 1px solid rgba(18,104,255,.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.42);
}

.alert {
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(18,104,255,.06);
}
.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: .55;
}

.notif-btn {
    position: relative;
    background: linear-gradient(135deg, #07111f, #0e3158);
    box-shadow: 0 0 0 1px rgba(23,198,255,.10), 0 14px 28px rgba(7,17,31,.18);
    transition: transform .18s ease, box-shadow .18s ease;
}
.notif-btn::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tech-green);
    box-shadow: 0 0 12px rgba(46,229,157,.75);
}
.notif-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(23,198,255,.28), 0 18px 36px rgba(7,17,31,.22);
}
.notification-popover:not([hidden]) {
    animation: popIn .16s ease both;
}
@keyframes popIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-mini {
    transition: background .16s ease, transform .16s ease;
}
.notif-mini:hover {
    transform: translateX(3px);
}
.category-strip span {
    border: 1px solid rgba(18,104,255,.08);
}

.price-preview {
    background:
        radial-gradient(circle at 92% 18%, rgba(23,198,255,.18), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.86), rgba(239,248,255,.76));
}
.price-preview span {
    background: linear-gradient(135deg, #081a2f, #1268ff, #17c6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.timeline-item {
    position: relative;
    border-left: 0;
    background: rgba(255,255,255,.72);
    border: 1px solid var(--tech-line);
    box-shadow: 0 10px 28px rgba(18,104,255,.06);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(var(--tech-cyan), var(--tech-blue));
    box-shadow: 0 0 16px rgba(23,198,255,.35);
}

form.is-loading .btn[type="submit"],
body.is-submitting .btn[type="submit"] {
    pointer-events: none;
    opacity: .82;
}
form.is-loading .btn[type="submit"]::after,
body.is-submitting .btn[type="submit"]::after {
    content: '';
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.42);
    border-top-color: #fff;
    animation: techSpin .75s linear infinite;
}

.auth-body {
    background:
        radial-gradient(circle at 50% 10%, rgba(23,198,255,.16), transparent 34%),
        linear-gradient(135deg, #f6fbff, #edf5ff 48%, #ffffff);
}
.auth-header {
    padding: 12px 14px;
    border: 1px solid var(--tech-line);
    border-radius: 22px;
    background: rgba(255,255,255,.74);
    box-shadow: var(--tech-glow);
    backdrop-filter: blur(14px);
}
.auth-logo img {
    filter: drop-shadow(0 12px 22px rgba(23,198,255,.18));
}

@media (min-width: 901px) {
    body.is-loaded .card,
    body.is-loaded .stat-card,
    body.is-loaded .hero {
        animation: contentRise .36s ease both;
    }
    body.is-loaded .stats-grid .stat-card:nth-child(2) { animation-delay: .03s; }
    body.is-loaded .stats-grid .stat-card:nth-child(3) { animation-delay: .06s; }
    body.is-loaded .stats-grid .stat-card:nth-child(4) { animation-delay: .09s; }
    body.is-loaded .stats-grid .stat-card:nth-child(5) { animation-delay: .12s; }
    body.is-loaded .stats-grid .stat-card:nth-child(6) { animation-delay: .15s; }
    body.is-loaded .stats-grid .stat-card:nth-child(7) { animation-delay: .18s; }
}
@keyframes contentRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .system-chip { display: none; }
    .top-title { flex: 1; }
    .card:hover,
    .stat-card:hover,
    .doc-card:hover,
    .safe-profile-item:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
    .app-loader { display: none; }
    body::after,
    .ambient-layer { display: none; }
}

/* =========================================================
   Professional settings center
   ========================================================= */
.settings-hero {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 340px);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 18px;
    background:
        radial-gradient(circle at 88% 18%, rgba(23,198,255,.18), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(238,248,255,.78));
}
.settings-hero h1 {
    margin: 8px 0 8px;
    font-size: clamp(34px, 4vw, 58px);
    line-height: .96;
}
.settings-hero-panel {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--tech-line);
    border-radius: 24px;
    background: rgba(7, 17, 31, .92);
    color: #fff;
    box-shadow: 0 18px 46px rgba(7,17,31,.18);
}
.settings-hero-panel strong {
    font-size: 22px;
    line-height: 1.05;
}
.settings-hero-panel span,
.settings-hero-panel small {
    color: rgba(255,255,255,.72);
    font-weight: 800;
}
.settings-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.settings-nav {
    position: sticky;
    top: 122px;
    display: grid;
    gap: 8px;
    padding: 16px;
}
.settings-nav strong {
    display: block;
    margin: 0 0 8px;
    color: #0a2540;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.settings-nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #294969;
    font-weight: 900;
    text-decoration: none !important;
}
.settings-nav a:hover {
    border-color: rgba(23,198,255,.25);
    background: rgba(234,247,255,.86);
}
.settings-content {
    display: grid;
    gap: 18px;
}
.settings-section {
    scroll-margin-top: 122px;
}
.setting-help {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.setting-kv {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.07);
}
.setting-kv strong {
    color: rgba(255,255,255,.62);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.setting-kv em,
.setting-kv code {
    color: #fff;
    font-style: normal;
    font-weight: 900;
    word-break: break-word;
}
.gateway-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.gateway-card {
    min-height: 230px;
    display: grid;
    align-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.14), transparent 32%),
        linear-gradient(135deg, #07111f, #102947);
    box-shadow: 0 18px 45px rgba(7,17,31,.16);
    overflow: hidden;
    position: relative;
}
.gateway-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .4;
}
.gateway-card > * { position: relative; z-index: 1; }
.gateway-card span {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 6px 9px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.82);
    font-size: 12px;
    font-weight: 950;
}
.gateway-card h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 23px;
}
.gateway-card p {
    margin: 0;
    color: rgba(255,255,255,.72);
    line-height: 1.4;
}
.gateway-card.ready {
    background:
        radial-gradient(circle at 88% 10%, rgba(46,229,157,.22), transparent 34%),
        linear-gradient(135deg, #07111f, #0a3d33 78%);
}
.gateway-card.warning {
    background:
        radial-gradient(circle at 88% 10%, rgba(255,198,76,.22), transparent 34%),
        linear-gradient(135deg, #07111f, #4b3312 78%);
}
.gateway-card.off {
    background:
        radial-gradient(circle at 88% 10%, rgba(255,255,255,.10), transparent 34%),
        linear-gradient(135deg, #111827, #263242 78%);
}
.settings-payment-table input[type="checkbox"] {
    width: auto;
}
.settings-payment-table textarea {
    min-height: 80px;
}
@media (max-width: 1100px) {
    .settings-layout,
    .settings-hero {
        grid-template-columns: 1fr;
    }
    .settings-nav {
        position: relative;
        top: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .settings-nav,
    .gateway-grid {
        grid-template-columns: 1fr;
    }
    .settings-section {
        scroll-margin-top: 20px;
    }
}

/* =========================================================
   Settings DOM tabs: only one panel visible at a time
   ========================================================= */
.settings-section[hidden] {
    display: none !important;
}
.settings-section.active {
    animation: settingsPanelIn .22s ease-out both;
}
@keyframes settingsPanelIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.settings-nav .settings-tab {
    width: 100%;
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    color: #294969;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.settings-nav .settings-tab:hover {
    transform: translateX(2px);
    border-color: rgba(23,198,255,.22);
    background: rgba(234,247,255,.88);
}
.settings-nav .settings-tab.active {
    border-color: rgba(23,198,255,.38);
    background:
        radial-gradient(circle at 92% 16%, rgba(23,198,255,.22), transparent 38%),
        linear-gradient(135deg, rgba(7,17,31,.98), rgba(14,44,76,.94));
    color: #fff;
    box-shadow: 0 16px 34px rgba(7,17,31,.16);
}
.settings-nav .settings-tab b {
    display: inline-flex;
    margin-right: 6px;
    color: inherit;
    opacity: .56;
    font-size: 11px;
    letter-spacing: .08em;
}
.settings-nav-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(23,198,255,.10);
    color: #0a7fb2;
    font-size: 17px;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(23,198,255,.12);
}
.settings-tab.active .settings-nav-icon {
    background: rgba(255,255,255,.13);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 8px 22px rgba(0,0,0,.12);
}
.settings-content {
    min-height: 620px;
}
@media (max-width: 1100px) {
    .settings-nav .settings-tab {
        grid-template-columns: 34px 1fr;
    }
    .settings-nav-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }
}

/* =========================================================
   HEADER / NOTIFICACIONES - FIX 2026-06-23
   Permite que el panel desplegable de notificaciones salga del
   header sin quedar recortado por el efecto glass del topbar.
   ========================================================= */
.topbar {
    overflow: visible !important;
    z-index: 3000;
}
.topbar .top-actions,
.topbar .notification-center {
    overflow: visible !important;
}
.notification-center {
    position: relative;
    z-index: 3200;
}
.notification-popover {
    z-index: 99999 !important;
}
@media (max-width: 640px) {
    .notification-popover {
        z-index: 99999 !important;
    }
}
