:root {
    --bs-body-bg: #12181F;
    --bs-body-color: #D1D5DB;
    --sidebar-bg: #151D24;
    --card-bg: #1A232E;
    --card-border: #2A3644;
    --inner-bg: #12181F;
    --accent-green: #00E676;
    --accent-green-hover: #00C853;
    --accent-green-alpha: rgba(0, 230, 118, 0.18);
    --accent-cyan: #00E5FF;
    --accent-cyan-alpha: rgba(0, 229, 255, 0.18);
    --accent-red: #FF5252;
    --accent-red-alpha: rgba(255, 82, 82, 0.18);
    --accent-orange: #FF9100;
    --accent-amber: #FFD600;
    --accent-blue: #2979FF;
    --accent-purple: #D500F9;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow-x: hidden;
}

/* Sidebar Navigation */
.sidebar {
    width: 240px;
    min-width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

.sidebar .nav-link {
    color: #8E9BAE;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.86rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease-in-out;
    margin-bottom: 2px;
    text-decoration: none;
}

.sidebar .nav-link:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.04);
}

.sidebar .nav-link.active-nav {
    background-color: var(--accent-green-alpha);
    color: var(--accent-green) !important;
    font-weight: 600;
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.unit-logo-img {
    width: 38px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
}

.bg-card-custom {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
}

.bg-inner-custom {
    background-color: var(--inner-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.form-control-tactical, .form-select-tactical {
    background-color: var(--inner-bg) !important;
    border: 1px solid var(--card-border) !important;
    color: #E5E7EB !important;
    font-size: 0.85rem;
    border-radius: 6px;
    padding: 7px 12px;
}

.form-control-tactical:focus, .form-select-tactical:focus {
    border-color: var(--accent-green) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 230, 118, 0.2) !important;
}

.btn-green-tactical {
    background-color: var(--accent-green);
    color: #02240F;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-green-tactical:hover {
    background-color: var(--accent-green-hover);
    color: #FFFFFF;
}

.btn-cancel-tactical {
    background-color: #1A222F;
    color: #8E9BAE;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-cancel-tactical:hover {
    background-color: #253042;
    color: #FFFFFF;
}

.badge-kpi-pill {
    background-color: rgba(0, 230, 118, 0.15);
    color: var(--accent-green);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-block;
}

.kpi-icon-square {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-tabs-tactical {
    border-bottom: 1px solid var(--card-border);
}

.nav-tabs-tactical .nav-link {
    color: #8E9BAE;
    border: none;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 0;
    font-weight: 500;
    background: transparent;
}

.nav-tabs-tactical .nav-link.active {
    color: #FFFFFF;
    border-bottom: 2px solid var(--accent-green);
    font-weight: 600;
    background: transparent;
}

.badge-direction {
    font-weight: 600;
    padding: 3px 8px;
    font-size: 0.72rem;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.badge-fpv { background-color: rgba(0, 229, 255, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 229, 255, 0.3); }
.badge-bombers { background-color: rgba(255, 145, 0, 0.15); color: var(--accent-orange); border: 1px solid rgba(255, 145, 0, 0.3); }
.badge-nrk { background-color: rgba(41, 121, 255, 0.15); color: var(--accent-blue); border: 1px solid rgba(41, 121, 255, 0.3); }
.badge-reb { background-color: rgba(255, 214, 0, 0.15); color: var(--accent-amber); border: 1px solid rgba(255, 214, 0, 0.3); }
.badge-rer { background-color: rgba(213, 0, 249, 0.15); color: var(--accent-purple); border: 1px solid rgba(213, 0, 249, 0.3); }

.status-badge-position { background-color: rgba(0, 230, 118, 0.18); color: #00E676; border: 1px solid rgba(0, 230, 118, 0.3); }
.status-badge-recovery { background-color: rgba(255, 214, 0, 0.18); color: #FFD600; border: 1px solid rgba(255, 214, 0, 0.3); }
.status-badge-vacation { background-color: rgba(0, 229, 255, 0.18); color: #00E5FF; border: 1px solid rgba(0, 229, 255, 0.3); }
.status-badge-workshop { background-color: rgba(255, 145, 0, 0.18); color: #FF9100; border: 1px solid rgba(255, 145, 0, 0.3); }

.table-tactical {
    --bs-table-bg: transparent;
    --bs-table-color: #D1D5DB;
    font-size: 0.85rem;
}

.table-tactical th {
    color: #8E9BAE;
    font-weight: 500;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    padding-top: 10px;
}

.table-tactical td {
    border-bottom: 1px solid #18202A;
    padding: 10px 8px;
    vertical-align: middle;
}

.rer-transmission-card {
    background-color: #161E28;
    border-left: 3px solid #AB47BC;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.rer-urgency-bar {
    height: 12px;
    width: 80px;
    background-color: #EF5350;
    border-radius: 3px;
}

.dropdown-menu-dark-custom {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-radius: 8px;
}

.dropdown-menu-dark-custom .dropdown-item {
    color: #D1D5DB;
    font-size: 0.85rem;
    padding: 7px 14px;
}

.dropdown-menu-dark-custom .dropdown-item:hover {
    background-color: var(--card-border);
    color: var(--accent-green);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sidebar-bg); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
/* === VER-06 visual integration === */
.main-shell { min-height:100vh; background:var(--bs-body-bg); }
.topbar {
    background-color:var(--sidebar-bg);
    border-bottom:1px solid var(--card-border);
    min-height:70px;
}
.topbar .page-title { font-size:1.05rem; line-height:1.1; }
.topbar .page-subtitle { font-size:.72rem; }
.topbar .commander-btn {
    background:var(--card-bg);
    border:1px solid var(--card-border);
    color:#fff;
    border-radius:8px;
    padding:5px 10px;
}
.topbar .commander-btn:hover { border-color:#405064; background:#202b38; }
.btn-icon {
    width:32px;height:32px;padding:0;
    display:inline-flex;align-items:center;justify-content:center;
}
.action-icon {
    width:30px;height:30px;
    padding:0 !important;
    display:inline-flex;align-items:center;justify-content:center;
    border-radius:6px;
}
.kpi-card {
    min-height:88px;
    transition:transform .15s ease,border-color .15s ease;
}
.kpi-card:hover { transform:translateY(-1px); border-color:#344355; }
.card-title-tactical { font-size:.95rem; font-weight:600; color:#fff; }
.small-label { font-size:11.5px; color:#8E9BAE; }
.table-tactical tbody tr { transition:background-color .15s ease; }
.table-tactical tbody tr:hover { background:rgba(255,255,255,.025); }
.table-tactical .btn-outline-light:hover { color:#fff; background:rgba(255,255,255,.06); }
.modal-content { box-shadow:0 20px 60px rgba(0,0,0,.55); }
.modal-header,.modal-footer { border-color:var(--card-border)!important; }
.form-label { margin-bottom:.35rem; }
.toast { border:1px solid var(--card-border); box-shadow:0 10px 30px rgba(0,0,0,.4); }
.chart-wrap { position:relative; width:100%; }
.sidebar .nav-link svg { flex:0 0 18px; opacity:.92; }
.sidebar .nav-link.active-nav svg { filter:drop-shadow(0 0 4px rgba(0,230,118,.25)); }
@media (max-width: 900px) {
    .sidebar { width:210px; min-width:210px; }
    .topbar { align-items:flex-start!important; gap:12px; flex-wrap:wrap; }
    .topbar > .d-flex:last-child { width:100%; justify-content:flex-end; flex-wrap:wrap; }
}
@media (max-width: 700px) {
    .sidebar { position:fixed; left:-220px; transition:left .2s ease; }
    .sidebar.sidebar-open { left:0; }
    .mobile-sidebar-toggle { display:inline-flex!important; }
    .main-content { width:100%; }
}
.mobile-sidebar-toggle { display:none; }

.badge-direction.badge-fpv{background:rgba(0,229,255,.15);color:#00E5FF;border:1px solid rgba(0,229,255,.3)}
.badge-direction.badge-bombers{background:rgba(255,145,0,.15);color:#FF9100;border:1px solid rgba(255,145,0,.3)}
.badge-direction.badge-nrk{background:rgba(41,121,255,.15);color:#2979FF;border:1px solid rgba(41,121,255,.3)}
.badge-direction.badge-reb{background:rgba(255,214,0,.15);color:#FFD600;border:1px solid rgba(255,214,0,.3)}
.badge-direction.badge-rer{background:rgba(213,0,249,.15);color:#D500F9;border:1px solid rgba(213,0,249,.3)}

/* ================= RER VER-06 PAGE ================= */
.rer-page{--rer-bg:#12181f;--rer-card:#1a232e;--rer-inner:#151d24;--rer-line:#2a3644;--rer-muted:#748398;--rer-green:#00e676;--rer-cyan:#00e5ff;--rer-red:#ff5252;--rer-purple:#d64cf4;}
.rer-eyebrow{font-size:11px;letter-spacing:.12em;color:#00e676;font-weight:700;margin-bottom:4px}.rer-heading{font-size:21px;color:#fff;font-weight:700}.rer-tabs{display:flex;gap:34px;border-bottom:1px solid var(--rer-line);margin-top:18px}.rer-tab{position:relative;padding:13px 2px 12px;color:#8292aa;text-decoration:none;font-weight:600;font-size:15px}.rer-tab:hover{color:#fff}.rer-tab.active{color:#fff}.rer-tab.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#00e676}.rer-kpi-card{position:relative;min-height:112px;padding:23px 20px;background:var(--rer-card);border:1px solid var(--rer-line);border-radius:11px;overflow:hidden}.rer-kpi-label{font-size:13px;color:#718097;margin-bottom:10px}.rer-kpi-value{font-size:39px;line-height:1;font-weight:800;color:#fff;letter-spacing:-.02em}.rer-kpi-badge{position:absolute;right:20px;bottom:24px;padding:7px 11px;border-radius:18px;background:rgba(0,230,118,.14);color:#00e676;font-size:12px;font-weight:700}.rer-kpi-badge.danger{background:rgba(255,82,82,.13);color:#ff5252}.rer-panel{background:var(--rer-card);border:1px solid var(--rer-line);border-radius:11px;padding:20px}.rer-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}.rer-panel-head h3{font-size:17px;color:#fff;font-weight:700;margin:0 0 5px}.rer-panel-head span{font-size:12px;color:#748398}.rer-link{font-size:12px;color:#00e676;text-decoration:none;white-space:nowrap}.rer-count{background:#151d24;border:1px solid #2a3644;padding:6px 10px;border-radius:16px;color:#8e9bae!important}.rer-message-list{display:flex;flex-direction:column;gap:10px}.rer-message-row{position:relative;background:#151d24;border-radius:8px;padding:15px 70px 14px 20px;border-left:3px solid #d64cf4;min-height:77px}.rer-message-row.urgency-high{border-left-color:#ff9100}.rer-message-row.urgency-normal{border-left-color:#00e5ff}.rer-message-meta{color:#6f8199;font-size:13px;margin-bottom:6px}.rer-message-meta span{color:#3c4857;padding:0 4px}.rer-message-text{font-size:14px;color:#9eabbc;font-style:italic;line-height:1.45}.rer-message-actions{position:absolute;right:14px;top:14px;display:flex;gap:3px;align-items:center}.rer-urgency-pill{display:inline-flex;padding:5px 9px;border-radius:5px;background:#183c2e;color:#00e676;font-size:11px;font-weight:700}.rer-urgency-pill.critical{background:#f04e56;color:#fff}.rer-urgency-pill.high{background:#6a3d13;color:#ffb05d}.rer-call-list{display:flex;flex-direction:column}.rer-call-row{display:flex;justify-content:space-between;gap:12px;padding:15px 0;border-bottom:1px solid rgba(42,54,68,.7)}.rer-call-row:last-child{border-bottom:0}.rer-call-row strong{display:block;color:#fff;font-size:15px}.rer-call-row small{display:block;color:#6f8199;font-size:11px;margin-top:5px}.rer-call-row b{align-self:center;color:#ff5252;font-size:13px;white-space:nowrap}.rer-chart-box{height:245px;position:relative}.rer-chart-box.tall{height:390px}.rer-table{margin-bottom:0}.rer-table th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#718097;border-bottom-color:#2a3644}.rer-table td{color:#9eabbc;border-bottom-color:#25303c;font-size:13px}.rer-table tr:hover td{background:rgba(255,255,255,.018)}.rer-text-cell{max-width:460px;min-width:260px;white-space:normal;line-height:1.45}.rer-view-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:#6f8199;margin-bottom:5px}.rer-view-value{color:#fff;font-weight:600;background:#151d24;border:1px solid #2a3644;border-radius:7px;padding:10px 12px;min-height:42px}.rer-view-message{color:#c2cbd6;line-height:1.6;background:#151d24;border:1px solid #2a3644;border-radius:8px;padding:15px;min-height:120px}.rer-page .action-icon{border:1px solid transparent;background:transparent;color:#7e8ca0;width:30px;height:30px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}.rer-page .action-icon:hover{background:#202b38;color:#fff;border-color:#2a3644}.rer-page .action-icon.text-danger:hover{color:#ff5252!important}
@media (max-width:900px){.rer-tabs{gap:18px;overflow-x:auto}.rer-tab{white-space:nowrap}.rer-kpi-value{font-size:32px}.rer-message-row{padding-right:18px}.rer-message-actions{position:static;margin-top:12px;justify-content:flex-end}.rer-chart-box.tall{height:300px}}


/* RER layout: full-width reference design */
.rer-layout .topbar{min-height:89px;padding-left:15px!important;padding-right:11px!important}
.rer-layout .topbar .page-title{font-size:30px;line-height:1;font-weight:800;letter-spacing:-.02em}
.rer-layout .topbar .page-subtitle{font-size:15px;color:#738198!important;margin-top:7px;display:block}
.rer-layout .topbar .input-group{height:38px}
.rer-layout .topbar .input-group-text{background:#12181f!important;border-color:#2a3644!important;color:#718097!important}
.rer-layout .topbar .form-select-tactical{height:38px;width:278px!important;font-size:14px}
.rer-layout .topbar .btn-green-tactical{min-width:134px;height:69px;border-radius:9px;font-size:15px;line-height:1.15;white-space:normal}
.rer-layout .topbar .commander-btn{height:49px;min-width:195px;font-size:15px}
.rer-layout .rer-main + *{display:none}
.rer-main > .p-4{padding:0!important}
.rer-main{background:#12181f}
.rer-main .rer-page{padding:0 14px 26px}
.rer-main .rer-tabs{margin-top:0;padding-top:25px;gap:37px}
.rer-main .rer-kpi-card{min-height:113px}
.rer-main .rer-panel{padding:20px}
.rer-main .rer-chart-box{height:245px}
.rer-main .rer-eyebrow,.rer-main .rer-heading{display:none}

/* Modal fallback/visual polish */
.modal-backdrop{background-color:#05080c}
.modal-backdrop.show{opacity:.72}
.modal-content.bg-card-custom{background:#1a232e!important;border:1px solid #2a3644!important;border-radius:10px!important;color:#d1d5db}
.modal-title{font-size:17px}
.modal .form-label{color:#7f8da0!important;font-size:12px}
.modal .form-control-tactical,.modal .form-select-tactical{min-height:40px}
.modal textarea.form-control-tactical{min-height:120px}
.rer-page .rer-message-actions .action-icon{width:28px;height:28px}
.rer-page .rer-message-actions .rer-urgency-pill{margin-right:3px}
@media(max-width:700px){

.rer-page-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:22px 0 2px}.rer-new-log-btn{min-width:185px;height:42px;border-radius:7px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:7px}.rer-page-toolbar .rer-eyebrow{margin-bottom:5px}.rer-page-toolbar .rer-heading{font-size:21px;line-height:1.2}
@media(max-width:900px){.rer-page-toolbar{align-items:flex-start;flex-direction:column}.rer-new-log-btn{width:100%;max-width:260px}}
 .rer-layout .topbar{padding:12px!important}
 .rer-layout .topbar .d-flex:last-child{width:100%}
 .rer-layout .topbar .form-select-tactical{width:220px!important}
 .rer-layout .topbar .btn-green-tactical{height:48px;min-width:120px}
 .rer-layout .topbar .commander-btn{min-width:160px}
 .rer-main .rer-page{padding:0 8px 20px}
}

/* ================= REB VER-06 PAGE ================= */
.reb-page{--reb-bg:#12181f;--reb-card:#1a232e;--reb-line:#2a3644;--reb-muted:#748398;--reb-green:#00e676;--reb-cyan:#00e5ff;padding:0 10px 26px;background:#12181f}.reb-tabs{display:flex;gap:37px;border-bottom:1px solid #2a3644;padding-top:25px;overflow-x:auto}.reb-tab{position:relative;padding:11px 5px 13px;color:#8292aa;text-decoration:none;font-weight:600;font-size:15px;white-space:nowrap}.reb-tab:hover{color:#fff}.reb-tab.active{color:#fff}.reb-tab.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#00e676}.reb-kpi-card{position:relative;min-height:171px;padding:25px 20px;background:#1a232e;border:1px solid #2a3644;border-radius:11px;overflow:hidden}.reb-kpi-label{font-size:13px;color:#718097;margin-bottom:20px}.reb-kpi-value{font-size:39px;line-height:1;font-weight:800;color:#fff;letter-spacing:-.02em}.reb-kpi-badge{display:inline-flex;margin-top:24px;padding:7px 11px;border-radius:18px;background:rgba(0,230,118,.14);color:#00e676;font-size:12px;font-weight:700}.reb-panel{background:#1a232e;border:1px solid #2a3644;border-radius:11px;padding:20px}.reb-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}.reb-panel-head h3{font-size:17px;color:#fff;font-weight:700;margin:0 0 5px}.reb-panel-head span{font-size:12px;color:#748398}.reb-chart-box{height:365px;position:relative}.reb-chart-box.tall{height:430px}.reb-count{background:#151d24;border:1px solid #2a3644;padding:6px 10px;border-radius:16px;color:#8e9bae!important;font-size:12px}.reb-inline-add{font-size:12px;padding:8px 12px}.reb-page .action-icon{border:1px solid transparent;background:transparent;color:#7e8ca0;width:30px;height:30px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center}.reb-page .action-icon:hover{background:#202b38;color:#fff;border-color:#2a3644}.reb-page .action-icon.text-danger:hover{color:#ff5252!important}.reb-main{background:#12181f}.reb-main>.p-4{padding:0!important}.reb-main .topbar{min-height:89px;padding-left:10px!important;padding-right:20px!important}.reb-main .topbar .page-title{font-size:30px;line-height:1;font-weight:800;letter-spacing:-.02em}.reb-main .topbar .page-subtitle{font-size:15px;color:#738198!important;margin-top:7px;display:block}.reb-main .topbar .input-group{height:38px}.reb-main .topbar .input-group-text{background:#12181f!important;border-color:#2a3644!important;color:#718097!important}.reb-main .topbar .form-select-tactical{height:38px;width:278px!important;font-size:14px}.reb-main .topbar .btn-green-tactical{min-width:134px;height:69px;border-radius:9px;font-size:15px;line-height:1.15;white-space:normal}.reb-main .topbar .commander-btn{height:49px;min-width:195px;font-size:15px}.reb-main+.footer{display:none}
@media(max-width:900px){.reb-tabs{gap:18px}.reb-kpi-value{font-size:32px}.reb-main .topbar{padding:12px!important}.reb-main .topbar .d-flex:last-child{width:100%}.reb-main .topbar .form-select-tactical{width:220px!important}.reb-main .topbar .btn-green-tactical{height:48px;min-width:120px}.reb-main .topbar .commander-btn{min-width:160px}.reb-chart-box.tall{height:320px}}

/* FPV / Bombers module navigation */
.module-tabs{display:flex;align-items:flex-end;gap:0;border-bottom:1px solid #2A3644;overflow-x:auto;white-space:nowrap;}
.module-tab{display:inline-flex;align-items:center;padding:12px 20px;color:#8E9BAE;text-decoration:none;border-bottom:2px solid transparent;font-size:15px;}
.module-tab:hover{color:#fff;background:rgba(255,255,255,.025);}
.module-tab.active{color:#fff;border-bottom-color:#00E676;background:#18222E;font-weight:600;}
.module-tabs + .kpi-card{}
@media(max-width:768px){.module-tab{padding:10px 13px;font-size:13px;}}

/* === Dashboard / date range === */
.date-range-btn {
    min-width: 255px;
    height: 38px;
    padding: 0 12px;
    background: #12181F;
    border: 1px solid #2A3644;
    border-radius: 6px;
    color: #E5E7EB;
    font-size: .86rem;
}
.date-range-btn:hover, .date-range-btn:focus { color:#fff; border-color:#435264; background:#151D24; }
.date-range-menu { width: 360px; }
.dashboard-range-note { color:#718096; font-size:.78rem; }
.dashboard-range-note strong { color:#D1D5DB; font-weight:600; margin-left:5px; }
.dashboard-panel { background:var(--card-bg); border:1px solid var(--card-border); border-radius:10px; padding:16px; }
.dashboard-kpi-card { background:var(--card-bg); border:1px solid var(--card-border); border-radius:9px; padding:16px 20px; min-height:136px; }
.dashboard-kpi-top { display:flex; align-items:center; justify-content:space-between; color:#8E9BAE; font-size:.82rem; }
.dashboard-kpi-bottom { display:flex; align-items:center; gap:9px; margin-top:15px; }
.dashboard-kpi-bottom strong { color:#fff; font-size:2rem; line-height:1; font-weight:750; }
.dashboard-kpi-change { border-radius:7px; padding:4px 8px; font-size:.72rem; font-weight:700; }
.dashboard-kpi-change.positive { color:#00E676; background:rgba(0,230,118,.14); }
.dashboard-kpi-change.negative { color:#FF5252; background:rgba(255,82,82,.14); }
.dashboard-kpi-icon { width:42px; height:42px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:25px; border:1px solid rgba(255,255,255,.06); }
.dashboard-icon-green { color:#00E676; background:rgba(0,230,118,.08); }
.dashboard-icon-red { color:#FF5252; background:rgba(255,82,82,.08); }
.dashboard-icon-yellow { color:#FFD600; background:rgba(255,214,0,.08); }
.dashboard-icon-cyan { color:#00E5FF; background:rgba(0,229,255,.08); }
.dashboard-panel-title { color:#F4F7FA; font-weight:700; font-size:.94rem; margin-bottom:14px; }
.dashboard-results-panel { min-height:252px; }
.dashboard-direction-grid { margin-top:56px; }
.dashboard-direction-card { background:#12181F; border:1px solid var(--card-border); border-radius:8px; padding:17px 16px; min-height:102px; }
.dashboard-direction-name { color:#8E9BAE; font-size:.78rem; display:flex; align-items:center; gap:8px; }
.direction-dot { display:inline-block; width:9px; height:9px; border-radius:50%; flex:0 0 9px; }
.direction-dot.badge-fpv { background:#00E5FF; border:0; }
.direction-dot.badge-bombers { background:#FF9100; border:0; }
.direction-dot.badge-nrk { background:#2979FF; border:0; }
.direction-dot.badge-reb { background:#FFD600; border:0; }
.dashboard-direction-value { display:flex; align-items:baseline; gap:10px; margin-top:18px; }
.dashboard-direction-value strong { color:#fff; font-size:1.8rem; line-height:1; }
.dashboard-direction-value span { color:#00E676; font-size:.78rem; font-weight:700; }
.dashboard-share-panel { min-height:252px; }
.dashboard-donut-wrap { position:relative; height:175px; margin-top:-2px; }
.dashboard-donut-wrap canvas { width:100% !important; height:175px !important; }
.dashboard-donut-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; transform:translateY(-2px); }
.dashboard-donut-center strong { color:#fff; font-size:1.55rem; line-height:1; }
.dashboard-donut-center span { color:#718096; font-size:.7rem; margin-top:3px; }
.dashboard-share-legend { display:grid; grid-template-columns:1fr 1fr; gap:7px 20px; margin-top:4px; }
.dashboard-share-legend > div { display:flex; align-items:center; justify-content:space-between; color:#718096; font-size:.72rem; }
.dashboard-share-legend > div span { display:flex; align-items:center; gap:7px; }
.dashboard-share-legend strong { color:#fff; }
.dashboard-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.dashboard-chart-legend { display:flex; gap:18px; color:#718096; font-size:.72rem; }
.dashboard-chart-legend span { display:flex; align-items:center; gap:5px; }
.dashboard-chart-legend i { width:8px; height:8px; border-radius:50%; display:inline-block; }
.legend-green { background:#00E676; }
.legend-cyan { background:#00E5FF; }
.dashboard-dynamics-panel { min-height:288px; }
.dashboard-dynamics-chart { height:225px; }
.dashboard-recent-panel { min-height:288px; }
.dashboard-all-link { color:#00E676; font-size:.78rem; text-decoration:none; }
.dashboard-all-link:hover { color:#fff; }
.dashboard-recent-list { margin-top:75px; }
.dashboard-recent-item { position:relative; min-height:47px; padding:6px 72px 7px 4px; border-bottom:1px solid #18202A; }
.dashboard-recent-item:last-child { border-bottom:0; }
.dashboard-recent-meta { color:#718096; font-size:.65rem; margin-bottom:1px; }
.dashboard-recent-text { color:#D1D5DB; font-size:.72rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-recent-text strong { color:#fff; }
.dashboard-recent-text span { color:#718096; }
.dashboard-recent-item .badge-direction { position:absolute; right:0; top:15px; min-width:48px; font-size:.62rem; padding:2px 6px; }
@media (max-width: 900px) {
    .date-range-btn { min-width:210px; }
    .dashboard-direction-grid { margin-top:25px; }
}
@media (max-width: 640px) {
    .date-range-btn { min-width:180px; font-size:.74rem; }
    .date-range-menu { width:320px; }
    .dashboard-share-legend { gap:5px 10px; }
}


/* === FIXED GLOBAL TOP MENU === */
.main-content {
    padding-top: 70px;
}
.topbar {
    position: fixed !important;
    top: 0;
    left: 240px;
    right: 0;
    width: auto;
    z-index: 1030 !important;
}
.topbar-message-btn {
    min-width: 0 !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    font-size: .86rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
/* REB/RER previously enlarged the green topbar action; keep it identical everywhere. */
.reb-main .topbar .topbar-message-btn,
.rer-layout .topbar .topbar-message-btn {
    min-width: 0 !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: .86rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
@media (max-width: 900px) {
    .main-content { padding-top: 126px; }
    .topbar { left: 210px; }
}
@media (max-width: 700px) {
    .main-content { padding-top: 145px; }
    .topbar { left: 0; }
}


/* Sidebar: desktop collapse/expand; topbar always begins after the sidebar. */
.sidebar {
    flex: 0 0 240px;
    width: 240px;
    min-width: 240px;
    transition: width .2s ease, min-width .2s ease, flex-basis .2s ease;
    overflow-x: hidden;
}
.sidebar-brand { min-width: 0; }
.sidebar-collapse-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 30px; width: 30px; height: 30px; padding: 0;
    border: 1px solid #2a3644; border-radius: 7px;
    color: #8e9bae; background: #12181f;
}
.sidebar-collapse-btn:hover { color: #00e676; border-color: #00e676; }
body.sidebar-collapsed .sidebar {
    flex-basis: 76px; width: 76px; min-width: 76px; padding-left: 10px !important; padding-right: 10px !important;
}
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
body.sidebar-collapsed .sidebar-brand-text { display: none !important; }
body.sidebar-collapsed .sidebar-brand > div:first-child { width: 42px !important; }
body.sidebar-collapsed .sidebar-collapse-btn { margin: 8px auto 0 !important; }
body.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 11px 0; gap: 0; }
body.sidebar-collapsed .sidebar .nav-link span { display: none; }
body.sidebar-collapsed .sidebar .nav-link svg { width: 20px; height: 20px; }
body.sidebar-collapsed .topbar { left: 76px !important; }
body.sidebar-collapsed .main-content { margin-left: 0; }
@media (max-width: 700px) {
    .sidebar { flex-basis: 240px; width: 240px; min-width: 240px; }
    body.sidebar-collapsed .sidebar { flex-basis: 240px; width: 240px; min-width: 240px; }
    .sidebar-collapse-btn { display: none; }
    body.sidebar-collapsed .topbar { left: 0 !important; }
}

/* === MOBILE NAVIGATION FIX === */
@media (max-width: 700px) {
    html, body { width:100%; min-width:0; overflow-x:hidden; }
    .main-shell { display:block !important; min-height:100vh; }

    /* Mobile header occupies the full viewport width and grows with its contents. */
    .topbar {
        left:0 !important;
        right:0 !important;
        width:100% !important;
        min-height:64px !important;
        height:auto !important;
        padding:10px 12px !important;
        gap:10px !important;
        flex-wrap:wrap !important;
        align-items:center !important;
        z-index:1040 !important;
        box-sizing:border-box;
    }
    .topbar > .d-flex:first-child {
        width:100% !important;
        min-width:0 !important;
        justify-content:flex-start;
    }
    .topbar > .d-flex:first-child > div:last-child {
        min-width:0;
        overflow:hidden;
    }
    .topbar .page-title {
        font-size:20px !important;
        line-height:1.15 !important;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }
    .topbar .page-subtitle {
        display:block;
        font-size:11px !important;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    .mobile-sidebar-toggle {
        display:inline-flex !important;
        flex:0 0 40px;
        width:40px;
        height:40px;
        align-items:center;
        justify-content:center;
    }

    .topbar > .d-flex:last-child {
        width:100% !important;
        min-width:0 !important;
        justify-content:flex-start !important;
        flex-wrap:wrap !important;
        gap:7px !important;
    }
    .topbar > .d-flex:last-child > .dropdown:first-child {
        flex:1 1 auto;
        min-width:0;
    }
    .topbar .date-range-btn {
        width:100%;
        min-width:0 !important;
        max-width:none;
        justify-content:center;
    }
    .topbar-message-btn {
        flex:0 0 auto !important;
        height:38px !important;
        min-height:38px !important;
        padding:0 10px !important;
    }
    .topbar .commander-btn {
        min-width:40px !important;
        width:40px !important;
        height:40px !important;
        padding:0 !important;
        justify-content:center !important;
    }
    .topbar .commander-btn .small,
    .topbar .commander-btn > svg {
        display:none !important;
    }

    /* Let the page itself scroll on phones; the fixed header must not sit over a nested scroller. */
    .main-content {
        width:100% !important;
        max-width:100% !important;
        max-height:none !important;
        min-height:100vh;
        overflow-y:visible !important;
        overflow-x:hidden !important;
        padding-top:150px !important;
        box-sizing:border-box;
    }

    /* Sidebar is a true overlay on phones. It starts below the fixed header. */
    .sidebar,
    body.sidebar-collapsed .sidebar {
        position:fixed !important;
        top:0 !important;
        bottom:0 !important;
        left:-260px !important;
        width:250px !important;
        min-width:250px !important;
        flex:0 0 250px !important;
        height:100dvh !important;
        max-height:100dvh !important;
        padding:12px !important;
        overflow-x:hidden !important;
        overflow-y:auto !important;
        z-index:1050 !important;
        transition:left .2s ease !important;
        box-shadow:8px 0 28px rgba(0,0,0,.45);
    }
    .sidebar.sidebar-open {
        left:0 !important;
    }
    .sidebar-collapse-btn { display:none !important; }

    /* On mobile the menu is always expanded when opened: icons + labels. */
    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .sidebar .nav-link span {
        display:block !important;
    }
    body.sidebar-collapsed .sidebar .nav-link {
        justify-content:flex-start !important;
        padding:8px 12px !important;
        gap:10px !important;
    }
    body.sidebar-collapsed .sidebar .nav-link svg {
        width:18px !important;
        height:18px !important;
    }
    body.sidebar-collapsed .sidebar-brand {
        justify-content:flex-start !important;
        padding-left:4px !important;
        padding-right:4px !important;
    }

    /* Dark backdrop while the mobile menu is open. */
    body.sidebar-open-mobile::before {
        content:"";
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.52);
        z-index:1045;
    }
    body.sidebar-open-mobile .sidebar { z-index:1050 !important; }
    body.sidebar-open-mobile { overflow:hidden; }

    /* RER/REB desktop rules must not force oversized controls onto phones. */
    .reb-main .topbar .btn-green-tactical,
    .rer-layout .topbar .btn-green-tactical {
        min-width:0 !important;
        width:auto !important;
        height:38px !important;
        white-space:nowrap !important;
    }
    .reb-main .topbar .commander-btn,
    .rer-layout .topbar .commander-btn {
        min-width:40px !important;
        width:40px !important;
    }
}

/* === MOBILE MENU BUTTON — HIGH VISIBILITY === */
@media (max-width: 700px) {
    .mobile-sidebar-toggle {
        display:inline-flex !important;
        flex:0 0 44px !important;
        width:44px !important;
        height:44px !important;
        min-width:44px !important;
        min-height:44px !important;
        padding:0 !important;
        margin:0 4px 0 0 !important;
        border:1px solid rgba(0,230,118,.65) !important;
        border-radius:9px !important;
        background:rgba(0,230,118,.12) !important;
        color:#00e676 !important;
        box-shadow:0 0 10px rgba(0,230,118,.18) !important;
        transition:background .15s ease, box-shadow .15s ease, transform .15s ease;
    }
    .mobile-sidebar-toggle svg {
        width:24px !important;
        height:24px !important;
        stroke:#00e676 !important;
        stroke-width:2.6 !important;
        filter:drop-shadow(0 0 3px rgba(0,230,118,.35));
    }
    .mobile-sidebar-toggle:active {
        background:rgba(0,230,118,.24) !important;
        box-shadow:0 0 14px rgba(0,230,118,.32) !important;
        transform:scale(.96);
    }
}

.message-count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:#ff5252;color:#fff;font-size:10px;font-weight:800;line-height:1;margin-left:2px}.message-panel{background:#10171e;border:1px solid #263340;border-radius:10px;padding:16px}.message-panel-title{color:#fff;font-size:15px;font-weight:700;margin-bottom:14px}.message-inbox-count{font-size:11px;color:#00e676;background:rgba(0,230,118,.1);border:1px solid rgba(0,230,118,.2);border-radius:12px;padding:4px 8px}.message-inbox-list{display:flex;flex-direction:column;gap:10px}.message-inbox-item{background:#151d24;border:1px solid #263340;border-left:3px solid #00e676;border-radius:8px;padding:13px 14px}.message-inbox-subject{color:#fff;font-weight:700;font-size:14px}.message-inbox-meta,.message-inbox-time{color:#718096;font-size:11px}.message-inbox-body{color:#c3ccd7;font-size:13px;line-height:1.5;margin-top:10px;white-space:normal;overflow-wrap:anywhere}.message-empty{text-align:center;padding:45px 20px}.message-empty-icon{font-size:28px;color:#00e676;margin-bottom:8px}@media(max-width:700px){.message-panel{padding:13px}.message-inbox-time{white-space:nowrap}.message-count-badge{min-width:16px;height:16px;font-size:9px}}

.message-inbox-item.message-unread{border-left-color:#ff5252;background:#192027;box-shadow:0 0 0 1px rgba(255,82,82,.08)}
.message-inbox-item.message-read{border-left-color:#3b4a57;opacity:.88}
.message-unread-label{display:inline-flex;align-items:center;margin-left:8px;padding:2px 6px;border-radius:8px;background:#ff5252;color:#fff;font-size:9px;font-weight:800;vertical-align:middle;letter-spacing:.4px}
