/* =====================================================================
   Z3US.AI visual skin — full PHP / HTML / CSS / vanilla JS
   Visual language based on the reference screens supplied for this project.
   ===================================================================== */

:root {
    --z-bg: #070707;
    --z-panel: rgba(12, 12, 12, 0.94);
    --z-panel-soft: rgba(18, 18, 18, 0.90);
    --z-panel-2: #141414;
    --z-line: rgba(255, 255, 255, 0.12);
    --z-line-soft: rgba(255, 255, 255, 0.075);
    --z-orange: #ff9d1c;
    --z-orange-2: #ffb03b;
    --z-yellow: #ffc400;
    --z-green: #10d58d;
    --z-red: #f12f31;
    --z-muted: #8b8b8b;
    --z-dim: #5f5f5f;
    --z-white: #f5f5f5;
    --z-radius: 18px;
    --z-radius-sm: 12px;
    --z-shadow: 0 18px 60px rgba(0,0,0,.46);
}

html, body { min-height: 100%; }
body {
    background: #050505;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--z-white);
}

.app-shell {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(rgba(4,4,4,.52), rgba(4,4,4,.66)),
        url('../images/warehouse-bg.jpg') center / cover fixed no-repeat,
        #050505;
}

.app-shell::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 28% 18%, rgba(255,157,28,.13), transparent 34%),
        radial-gradient(circle at 72% 68%, rgba(255,157,28,.045), transparent 42%),
        linear-gradient(90deg, rgba(0,0,0,.18), transparent 24%, transparent 76%, rgba(0,0,0,.25));
}

/* ----------------------------- topbar -------------------------------- */
.topbar {
    min-height: 54px;
    padding: 7px 18px;
    background: rgba(6,6,6,.76);
    border-bottom: 1px solid rgba(255,255,255,.065);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 80;
}

.topbar-left { gap: 10px; }
.topbar-right { gap: 8px; }
.topbar-back {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border-color: rgba(255,255,255,.14);
    background: rgba(10,10,10,.64);
    color: #c7c7c7;
}
.topbar-back:hover { border-color: var(--z-orange); color: var(--z-orange); }

.topbar-brand {
    width: 92px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}
.topbar-brand-logo {
    width: 88px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
}
.topbar-titles { margin-left: -2px; }
.topbar-titles .title {
    font-size: 11px;
    color: #b4b4b4;
    font-weight: 500;
}
.topbar-titles .subtitle {
    font-size: 10px;
    color: #777;
    line-height: 1.2;
}

.topbar-user {
    padding: 7px 13px;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(8,8,8,.82);
    min-height: 34px;
}
.topbar-user .avatar,
.topbar-user .user-meta .user-role { display: none; }
.topbar-user .user-meta { display: block; }
.topbar-user .user-name { font-size: 12px; font-weight: 500; color: #9b9b9b; }
.tenant-pill { display: none; }
.topbar-actions { gap: 6px; }
.topbar .btn-icon,
.topbar-actions .btn-icon,
.topbar-actions a.btn-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.11);
    background: rgba(8,8,8,.72);
    color: var(--z-orange);
}
.topbar .btn-icon:hover,
.topbar-actions .btn-icon:hover,
.topbar-actions a.btn-icon:hover {
    color: #ffc15d;
    border-color: rgba(255,157,28,.6);
    background: rgba(255,157,28,.08);
}
.topbar .btn-icon:disabled { opacity: .45; }

/* ------------------------------ shared -------------------------------- */
.page-container {
    width: 100%;
    max-width: none;
    padding: 42px 44px 58px;
}
.card,
.toolbar,
.table-wrapper {
    background: rgba(12,12,12,.92);
    border-color: rgba(255,255,255,.13);
    box-shadow: none;
}
.card { border-radius: 15px; }
.card-header { border-color: rgba(255,255,255,.12); }

.btn {
    border-radius: 999px;
    font-weight: 700;
}
.btn-primary {
    color: #101010;
    background: linear-gradient(180deg, #ffa62e, #ff9716);
    border-color: #ff9d1c;
    box-shadow: 0 6px 18px rgba(255,157,28,.18);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffb246, #ffa01e);
    border-color: #ffad39;
    color: #0b0b0b;
}
.btn-secondary {
    background: #111;
    color: #aaa;
    border-color: rgba(255,255,255,.12);
}
.btn-secondary:hover:not(:disabled) { border-color: rgba(255,157,28,.5); color: #eee; }

.form-control,
textarea.form-control,
select.form-control {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    color: #eee;
    min-height: 40px;
}
.form-control:focus {
    border-color: #ff9d1c;
    box-shadow: 0 0 0 2px rgba(255,157,28,.11);
}
.form-label { color: #8f8f8f; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.form-hint { color: #717171; }

/* ------------------------------ desktop -------------------------------- */
body.z3us-desktop .topbar-titles { display: none; }
body.z3us-desktop .app-shell {
    background:
        linear-gradient(rgba(4,4,4,.34), rgba(4,4,4,.48)),
        url('../images/warehouse-bg.jpg') center / cover fixed no-repeat,
        #050505;
}
.desktop-stage {
    min-height: calc(100vh - 54px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 42px 24px 78px;
}
.desktop-hero {
    padding: 0;
    text-align: center;
}
.desktop-hero .brand-logo {
    width: 220px;
    height: 98px;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent url('../images/z3us-logo.png') center / contain no-repeat;
    font-size: 0;
}
.desktop-hero h1,
.desktop-hero p { display: none; }
.desktop-hero .brand-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: -3px;
}
.desktop-hero .brand-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--z-orange);
    box-shadow: 0 0 12px rgba(255,157,28,.5);
}
.module-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 900px;
    padding: 0;
    margin: 0;
}
.module-card,
a.module-card {
    width: 160px;
    min-height: 160px;
    flex: 0 0 160px;
    padding: 27px 20px 22px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    background: rgba(10,10,10,.94);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(0,0,0,.28);
    overflow: visible;
}
.module-card::after { display: none; }
.module-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,157,28,.52);
    box-shadow: 0 14px 35px rgba(0,0,0,.38), 0 0 0 1px rgba(255,157,28,.08);
}
.module-card .module-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    border: 1px solid rgba(255,157,28,.6);
    background: #111;
    color: var(--z-orange);
    font-size: 24px;
}
.module-card .module-name {
    font-size: 13px;
    letter-spacing: .14em;
    color: #e7e7e7;
}
.module-card .module-desc {
    max-width: 128px;
    color: #767676;
    font-size: 10px;
    line-height: 1.35;
}
.module-card.module-air:hover,
.module-card.module-air:focus-visible {
    background: linear-gradient(145deg, #ffa62e, #f6a12e);
    border-color: #ffac37;
}
.module-card.module-air:hover .module-icon,
.module-card.module-air:focus-visible .module-icon {
    color: #101010;
    border-color: rgba(0,0,0,.25);
    background: rgba(255,255,255,.12);
}
.module-card.module-air:hover .module-name,
.module-card.module-air:hover .module-desc,
.module-card.module-air:focus-visible .module-name,
.module-card.module-air:focus-visible .module-desc { color: #151515; }
.desktop-footnote {
    font-size: 10px;
    color: rgba(255,255,255,.28);
    letter-spacing: .05em;
}

/* ------------------------------- AIR ----------------------------------- */
body.z3us-air .topbar-titles .title { display: none; }
body.z3us-air .topbar-titles .subtitle {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}
.air-dashboard { padding-top: 42px; }
.air-dashboard .page-header { display: none; }
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 22px;
}
.kpi-card {
    position: relative;
    min-height: 112px;
    padding: 21px 18px;
    display: block;
    background: rgba(15,15,15,.90);
    border: 1px solid rgba(255,255,255,.12);
    border-left-width: 1px;
    border-radius: 16px;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .13;
    pointer-events: none;
}
.kpi-total { border-color: rgba(255,157,28,.78); }
.kpi-total::before { background: linear-gradient(105deg, rgba(255,157,28,.25), transparent 58%); }
.kpi-transit { border-color: rgba(16,213,141,.42); }
.kpi-transit::before { background: linear-gradient(105deg, rgba(16,213,141,.22), transparent 60%); }
.kpi-alert { border-color: rgba(255,157,28,.50); }
.kpi-alert::before { background: linear-gradient(105deg, rgba(255,157,28,.23), transparent 60%); }
.kpi-critical { border-color: rgba(241,47,49,.55); }
.kpi-critical::before { background: linear-gradient(105deg, rgba(241,47,49,.30), transparent 60%); }
.kpi-card .kpi-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    background: rgba(255,255,255,.06);
}
.kpi-card .kpi-label {
    position: relative;
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    color: #999;
}
.kpi-card .kpi-value {
    position: relative;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 10px;
}
.kpi-card .kpi-subtext {
    position: relative;
    font-size: 10px;
}
.kpi-transit .kpi-label, .kpi-transit .kpi-value, .kpi-transit .kpi-subtext, .kpi-transit .kpi-icon { color: #6de3b7; }
.kpi-alert .kpi-label, .kpi-alert .kpi-value, .kpi-alert .kpi-subtext, .kpi-alert .kpi-icon { color: var(--z-orange); }
.kpi-critical .kpi-label, .kpi-critical .kpi-value, .kpi-critical .kpi-subtext, .kpi-critical .kpi-icon { color: var(--z-red); }
.kpi-total .kpi-icon { color: var(--z-orange); }

.air-toolbar {
    background: rgba(12,12,12,.93);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 18px;
}
.air-toolbar form { width: 100%; }
.air-toolbar .search-bar { margin: 0 0 10px; }
.air-toolbar .search-bar input {
    min-height: 34px;
    padding: 8px 14px 8px 42px;
    font-size: 11px;
    background: #0f0f0f;
    border-color: rgba(255,255,255,.18);
    border-radius: 999px;
}
.air-toolbar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
}
.air-filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.air-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #e6e6e6;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    flex-shrink: 0;
}
.air-filter-label .bi { color: var(--z-yellow); }
.air-select {
    width: auto;
    min-width: 110px;
    max-width: 4px;
    min-height: 10px !important;
    border-radius: 999px !important;
    padding: 5px 30px 5px 12px !important;
    font-size: 11px;
    background: #101014;
    flex-shrink: 0;
}
.chip-toggle {
    min-height: 30px;
    padding: 5px 12px;
    border-color: rgba(255,255,255,.16);
    background: #101010;
    color: #aaa;
    font-size: 10px;
    flex-shrink: 0;
}
.air-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.btn-airlines {
    background: #06a66e;
    color: white;
    border-color: #09ba7d;
    font-size: 11px;
    padding: 6px 13px;
    white-space: nowrap;
}
.btn-airlines:hover { background: #08ba7b; color: white; }
.air-refresh { padding: 6px 15px; font-size: 11px; background: #ffd000; border-color: #ffd000; white-space: nowrap; }

.air-results-card {
    background: rgba(12,12,12,.91);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    overflow: hidden;
}
.air-results-card .table-wrapper { border: 0; background: transparent; border-radius: inherit; }
.air-results-card .table { background: transparent; }
.air-results-card .table thead th { background: rgba(7,7,7,.86); }
.air-results-card .table-empty { min-height: 142px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 42px; }
.air-results-card .table-empty .bi { display: none; }
.air-results-card .table-empty strong { font-size: 13px; letter-spacing: .14em; color: #fff; }
.air-results-card .table-empty p { margin: 10px 0 0; font-size: 11px; color: #aaa; }

/* AIR modal: same compact stacked panel from the reference */
.modal-overlay {
    background: rgba(0,0,0,.76);
    backdrop-filter: blur(1.2px);
    -webkit-backdrop-filter: blur(1.2px);
}
.modal-box {
    background: rgba(12,12,12,.98);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,.64);
}
.modal-box-wide { max-width: 790px; max-height: 90vh; }
.modal-header { min-height: 61px; padding: 17px 24px; border-color: rgba(255,255,255,.12); }
.modal-header strong { font-size: 16px; }
.modal-header strong .bi { color: var(--z-orange); margin-right: 7px; }
.modal-body { padding: 16px 24px 22px; }
.modal-body-scroll { scrollbar-width: thin; }
.pdf-dropzone {
    margin: 0 0 16px;
    padding: 28px 20px;
    border-radius: 13px;
    border: 2px dashed rgba(255,157,28,.58);
    background: #101010;
    font-size: 12px;
}
.pdf-dropzone .bi { color: var(--z-orange); font-size: 28px; }
#awb-form.card-stack { gap: 8px; }
#awb-form details.card { background: #171717; border-color: rgba(255,255,255,.14); border-radius: 12px; }
#awb-form details.card > summary.card-header {
    min-height: 48px;
    padding: 12px 16px;
    color: #eee;
    font-size: 12px;
    background: #171717;
}
#awb-form .card-body { padding: 15px 16px 18px; }
#awb-form .form-row { gap: 10px; }
#awb-form .form-group { margin-bottom: 10px; }
#awb-form .form-control { min-height: 38px; font-size: 12px; }
#awb-form .field-count { background: #2a2a2a; color: #969696; border-radius: 999px; padding: 4px 8px; font-size: 9px; }
#awb-form .page-actions { justify-content: flex-end; margin-top: 10px; }
#awb-form .page-actions .btn-secondary { display: none; }
#awb-form .page-actions .btn-primary { padding: 9px 17px; }

/* Airline modal */
.airline-list-modal { max-width: 690px; }
.airline-list-modal .modal-body { padding-top: 4px; }
.airline-list-title { display: flex; align-items: center; gap: 8px; color: #eee; }
.airline-list-title .bi { color: #18e4ad; }
.airline-list-sub { font-size: 12px; color: #aaa; margin: 2px 0 16px; }
.airline-list-wrap { max-height: 520px; overflow: auto; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.airline-list-table { width: 100%; }
.airline-list-table th { padding: 12px 14px; text-align: left; font-size: 10px; color: #9a9a9a; text-transform: uppercase; letter-spacing: .08em; background: #050505; }
.airline-list-table td { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; }
.airline-list-table td:first-child { color: #3ef0be; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; width: 160px; }
.airline-list-footer { padding-top: 16px; text-align: center; font-size: 10px; color: #888; }

/* ------------------------------- admin --------------------------------- */
body.z3us-admin .page-container { max-width: 1180px; margin: 0 auto; }
.admin-hub-grid { gap: 12px; }
.admin-hub-card { background: rgba(12,12,12,.94); border: 1px solid rgba(255,255,255,.13); border-radius: 15px; }

.analyst-panel {
    width: min(760px, calc(100vw - 36px));
    margin: 50px auto;
    background: rgba(12,12,12,.98);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 17px;
    box-shadow: var(--z-shadow);
    overflow: hidden;
}
.analyst-panel-head {
    padding: 22px 26px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid rgba(255,157,28,.55);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.analyst-panel-title { display: flex; align-items: center; gap: 13px; }
.analyst-back {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
    display: grid; place-items: center; color: #aaa; background: #151515;
}
.analyst-panel-title h1 { font-size: 17px; margin: 0; }
.analyst-panel-title p { font-size: 10px; color: #777; margin: 3px 0 0; }
.analyst-count { display: inline-flex; margin-left: 8px; padding: 4px 10px; border-radius: 999px; font-size: 9px; color: #ffb22f; background: rgba(255,157,28,.14); border: 1px solid rgba(255,157,28,.32); vertical-align: middle; }
.analyst-panel-actions { display: flex; justify-content: flex-end; padding: 20px 26px 8px; }
.analyst-panel-list { padding: 8px 26px 26px; display: grid; gap: 10px; }
.analyst-row {
    min-height: 70px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 11px;
    background: #151515;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.analyst-row.is-current { border-color: rgba(255,157,28,.27); background: linear-gradient(90deg, rgba(255,157,28,.07), #151515 70%); }
.analyst-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #292929; border: 1px solid #3a3a3a; color: #aaa; font-size: 11px; font-weight: 700; position: relative; }
.analyst-avatar::after { content:''; position:absolute; width:8px; height:8px; border-radius:50%; background:#21d475; right:-1px; bottom:0; border:2px solid #151515; }
.analyst-row.is-current .analyst-avatar { background: rgba(255,157,28,.18); color: #f7b43e; border-color: rgba(255,157,28,.36); }
.analyst-data { min-width: 0; flex: 1; }
.analyst-name { font-size: 12px; font-weight: 700; color: #eee; }
.analyst-email { font-size: 10px; color: #727272; }
.analyst-roles { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.analyst-role { padding: 5px 9px; border-radius: 999px; background: #2a2a2a; color: #aaa; font-size: 9px; }
.analyst-role.admin { color: #ffb72f; background: rgba(255,157,28,.13); border: 1px solid rgba(255,157,28,.25); }
.analyst-row .row-actions { margin-left: 5px; }
.analyst-row .row-actions .btn-icon { border-radius: 50%; }

/* ------------------------------- manual -------------------------------- */
.manual-shell { max-width: 1600px; margin: 0 auto; padding: 28px 44px 60px; display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 22px; }
.manual-sidebar { align-self: start; position: sticky; top: 82px; background: rgba(10,10,10,.94); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; padding: 10px 0; overflow: hidden; }
.manual-sidebar-title { padding: 10px 16px; font-size: 12px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.08); }
.manual-sidebar a { display:flex; gap:10px; align-items:center; padding: 10px 16px; font-size: 11px; color:#aaa; border-left: 2px solid transparent; }
.manual-sidebar a:hover, .manual-sidebar a.active { color:#ffd02a; background: rgba(255,157,28,.12); border-left-color:#ffd02a; }
.manual-content { min-width:0; }
.manual-search { margin-bottom: 18px; position: relative; }
.manual-search input { width:100%; min-height:38px; border-radius:999px; background:rgba(15,15,15,.84); border:1px solid rgba(255,255,255,.15); color:#eee; padding:8px 16px 8px 40px; }
.manual-search .bi { position:absolute; left:15px; top:50%; transform:translateY(-50%); color:#777; }
.manual-section { margin-bottom: 18px; padding: 20px; background: rgba(12,12,12,.94); border:1px solid rgba(255,255,255,.13); border-radius:14px; }
.manual-section h2 { font-size: 16px; margin-bottom: 16px; }
.manual-section h2 .bi { color:#ffd000; margin-right:8px; }
.manual-section p { color:#d1d1d1; font-size:12px; }
.manual-mini-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.manual-mini-card { background:#191919; border:1px solid rgba(255,255,255,.10); border-radius:10px; padding:18px 14px; min-height:90px; }
.manual-mini-card .bi { color:#ffd000; font-size:22px; }
.manual-mini-card strong { display:block; margin:8px 0 4px; font-size:12px; }
.manual-mini-card span { color:#888; font-size:10px; }
.manual-kpi-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.manual-kpi-demo { border:1px solid rgba(255,255,255,.12); border-radius:8px; padding:13px; background:#191919; font-size:10px; color:#aaa; }
.manual-kpi-demo strong { display:inline-block; padding:4px 8px; border-radius:999px; margin-bottom:8px; font-size:9px; }
.manual-kpi-demo.total strong { background:#69717f; color:white; }
.manual-kpi-demo.transit strong { background:#ff9d1c; color:#111; }
.manual-kpi-demo.alert strong { background:#f24d4d; color:#111; }
.manual-kpi-demo.done strong { background:#18d888; color:#052e20; }
.manual-tip { margin-top:12px; padding:10px 12px; border:1px solid rgba(255,157,28,.28); background:rgba(255,157,28,.09); color:#ffad32; font-size:10px; border-radius:6px; }

@media (max-width: 1050px) {
    .page-container { padding: 28px 22px 44px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .air-toolbar-bottom { align-items: flex-start; flex-direction: column; }
    .air-toolbar-actions { margin-left: 0; width: 100%; }
    .manual-shell { grid-template-columns: 1fr; padding: 22px; }
    .manual-sidebar { position: static; }
}

@media (max-width: 680px) {
    .topbar { padding: 7px 10px; }
    .topbar-brand { width: 76px; }
    .topbar-brand-logo { width: 73px; }
    .topbar-titles { display: none; }
    .topbar-user { display: none; }
    .desktop-stage { justify-content: flex-start; padding-top: 85px; }
    .desktop-hero .brand-logo { width: 190px; height: 88px; }
    .module-grid { gap: 12px; }
    .module-card, a.module-card { width: 145px; flex-basis: 145px; min-height: 150px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .kpi-card { min-height: 102px; }
    .air-filter-group { width: 100%; }
    .air-select { min-width: 0; flex: 1 1 140px; }
    .air-toolbar-actions { flex-wrap: wrap; }
    .analyst-panel { margin: 22px auto; }
    .analyst-panel-head, .analyst-panel-actions, .analyst-panel-list { padding-left: 16px; padding-right: 16px; }
    .analyst-row { align-items: flex-start; flex-wrap: wrap; }
    .analyst-roles { width: 100%; padding-left: 50px; }
    .manual-mini-grid, .manual-kpi-grid { grid-template-columns: 1fr; }
}

/* Login / autenticação */
.auth-shell {
    background:
        linear-gradient(rgba(3,3,3,.58), rgba(3,3,3,.72)),
        url('../images/warehouse-bg.jpg') center / cover fixed no-repeat,
        #050505;
}
.auth-card {
    max-width: 420px;
    padding: 34px 36px 30px;
    background: rgba(10,10,10,.95);
    border: 1px solid rgba(255,255,255,.13);
    border-top-color: rgba(255,157,28,.5);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(0,0,0,.62);
}
.auth-card::before { display: none; }
.auth-card .z3us-auth-logo {
    width: 210px;
    height: 88px;
    margin: 0 auto 8px;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}
.auth-card .z3us-auth-logo img { width: 100%; height: 100%; object-fit: contain; }
.auth-card h1 { display: none; }
.auth-card .auth-subtitle { letter-spacing: .16em; font-size: 9px; color: #777; margin-bottom: 26px; }
.auth-card .btn-primary { min-height: 42px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 11px; }
.auth-footer { margin-top: 22px; text-align: center; font-size: 9px; color: #555; }

/* Personalização de logo do hub */
.branding-modal { max-width: 470px; }
.branding-modal .modal-header .bi { color: var(--z-orange); margin-right: 7px; }
.branding-preview-label { text-align: center; font-size: 10px; color: #777; margin-bottom: 8px; }
.branding-preview { height: 168px; display: grid; place-items: center; background: #080808; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 18px; }
.branding-preview img { max-width: 100%; max-height: 130px; object-fit: contain; }
.branding-toggle-row { margin: 18px 0; padding: 13px 14px; display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; font-size: 11px; color: #ddd; }
.branding-toggle-row .bi { color: var(--z-orange); margin-right: 7px; }
.branding-switch { width: 44px; height: 24px; border-radius: 999px; background: #333; padding: 3px; display: flex; justify-content: flex-start; }
.branding-switch.is-on { background: var(--z-orange); justify-content: flex-end; }
.branding-switch span { width: 18px; height: 18px; border-radius: 50%; background: #111; }
.branding-upload-btn { width: 100%; justify-content: center; min-height: 40px; }
.branding-formats { text-align: center; color: #777; font-size: 10px; margin: 14px 0 16px; }
.branding-remove-btn { width: 100%; justify-content: center; background: transparent; color: #ff6464; border: 1px solid rgba(239,68,68,.55); min-height: 38px; }
.branding-remove-btn:hover { color: #ff8282; border-color: #ef4444; background: rgba(239,68,68,.06); }

/* ---------- Menu lateral (side-nav) — global, presente em toda página autenticada ---------- */
.topbar-menu-toggle { margin-right: 4px; }

.side-nav-overlay {
    justify-content: flex-start;
    padding: 0;
}
.side-nav-panel {
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-right: 1px solid var(--border-glass);
    box-shadow: var(--shadow-card-deep);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.side-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.side-nav-logo { height: 26px; max-width: 160px; object-fit: contain; }
.side-nav-body { flex: 1; padding: 10px; }
.side-nav-category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 16px 12px 6px;
}
.side-nav-category:first-child { padding-top: 6px; }
.side-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}
.side-nav-item:hover { background: var(--bg-card-hover); }
.side-nav-item i { color: var(--accent-gold); font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.side-nav-footer { padding: 10px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
