/* ====================================================
   bluScale Admin — Tech Blue Theme (drone.io inspired)
   Primary: #00ABE4
   Background: #FFFFFF
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ─────────────────────────────────── */
:root {
    /* Brand */
    --primary: #00ABE4;
    --primary-light: #2bc1f5;
    --primary-hover: #0096C7;
    --primary-subtle: #E9F1FA;
    --primary-glow: rgba(0, 171, 228, 0.25);

    /* Backgrounds */
    --bg-main: #F4FAFD;
    --bg-surface: #F4FAFD;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F4FAFD;
    --bg-input: #F7FBFE;

    /* Text */
    --text-primary: #0D1F2D;
    --text-secondary: #2C4558;
    --text-muted: #5A7A8E;

    /* Borders */
    --border: #EEF4F8;
    --border-active: var(--primary);

    /* Sidebar — Expandido para Flow Dinâmico (300px) */
    --sidebar-width: 300px;
    --sidebar-width-collapsed: 64px;

    /* Status */
    --success: #198754;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #0DCAF0;

    /* Transitions — Suavizado para experiência Premium Pro */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scrollbar-color: var(--primary-subtle) var(--bg-surface);
    scrollbar-width: thin;
}

html, body {
    height: 100%;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

/* WebKit scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-subtle);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ─── Layout ─────────────────────────────────────────── */
#app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Navbar (Top) ───────────────────────────────────── */
#top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 1100;
    background: linear-gradient(135deg, #0077A8 0%, #00ABE4 60%, #4FC3F7 100%);
    border-bottom: none;
    display: flex;
    align-items: center;
    padding-left: 0;
    padding-right: 1.5rem;
    gap: 0;
    box-shadow: 0 4px 16px rgba(0,120,168,0.22);
}

#top-navbar .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 0;
    pointer-events: auto;
}

#top-navbar .navbar-brand .brand-icon-svg {
    flex-shrink: 0;
}

#top-navbar .navbar-brand .brand-wordmark {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
}

#sidebar-toggle-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 1.15rem;
    cursor: pointer;
    width: var(--sidebar-width);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 1.45rem;
    transition: width var(--transition), padding-left var(--transition), background var(--transition);
    flex-shrink: 0;
    border-right: 1px solid transparent;
}

body.sidebar-collapsed #sidebar-toggle-btn {
    width: var(--sidebar-width-collapsed);
    justify-content: center;
    padding-left: 0;
    border-right-color: rgba(255,255,255,0.15);
}

#sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.navbar-spacer {
    flex: 1;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
}

.btn-logout {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* ─── Sidebar ────────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #FFFFFF 0%, #EBF4FF 50%, #D6E8FF 100%);
    border-right: 1px solid var(--border);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1050;
    transition: width var(--transition);
    display: flex;
    flex-direction: column;
}

/* ─── Sidebar Decorative Background (Random Drift) ─── */
.sidebar-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 1.0; /* Controlamos a opacidade individualmente nos círculos */
}

.sidebar-bg-dot {
    position: absolute;
    border-radius: 50%;
    /* Cor primaria (#00ABE4) com opacidade forte para garantir visibilidade */
    background: radial-gradient(circle, rgba(0, 171, 228, 0.35) 0%, rgba(0, 171, 228, 0) 75%);
    filter: blur(30px);
    box-shadow: 0 0 40px rgba(0, 171, 228, 0.15);
}

.dot-1 {
    width: 200px; height: 200px; top: -60px; left: -70px;
    background: radial-gradient(circle, rgba(0, 171, 228, 0.45) 0%, rgba(0, 171, 228, 0) 75%);
    animation: sidebar-drift-1 25s infinite alternate ease-in-out;
}
.dot-2 {
    width: 250px; height: 250px; bottom: 5%; right: -100px;
    background: radial-gradient(circle, rgba(0, 171, 228, 0.4) 0%, rgba(0, 171, 228, 0) 75%);
    animation: sidebar-drift-2 30s infinite alternate-reverse ease-in-out;
}
.dot-3 {
    width: 160px; height: 160px; top: 45%; left: -50px;
    background: radial-gradient(circle, rgba(0, 171, 228, 0.35) 0%, rgba(0, 171, 228, 0) 75%);
    animation: sidebar-drift-1 22s infinite alternate-reverse ease-in-out;
}
.dot-4 {
    width: 120px; height: 120px; top: 12%; right: 5%;
    background: radial-gradient(circle, rgba(0, 171, 228, 0.3) 0%, rgba(0, 171, 228, 0) 75%);
    opacity: 0.6;
    animation: sidebar-drift-2 18s infinite alternate ease-in-out;
}

@keyframes sidebar-drift-1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15px, 25px) scale(1.1); }
}
@keyframes sidebar-drift-2 {
    0% { transform: translate(0, 0) scale(1.05); }
    100% { transform: translate(-20px, -30px) scale(0.95); }
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    margin: 0.8rem;
    padding: 0.75rem;
    flex: 1;
    /* Subframe de vidro (Ajustado para 300px) */
    background: rgba(255, 255, 255, 0.5); /* Aumentado para melhor definição */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 50, 150, 0.08);
}

/* Collapsed state */
body.sidebar-collapsed #sidebar {
    width: var(--sidebar-width-collapsed);
}

/* Esconder labels, sections e chevrons completamente quando colapsado */
body.sidebar-collapsed #sidebar .nav-label,
body.sidebar-collapsed #sidebar .submenu-label,
body.sidebar-collapsed #sidebar .nav-section-title,
body.sidebar-collapsed #sidebar .chevron {
    display: none;
}

body.sidebar-collapsed #sidebar .collapse.show {
    display: none !important;
}

body.sidebar-collapsed #sidebar .side-nav-link {
    justify-content: center;
    padding: 0.65rem 0;
}

body.sidebar-collapsed #sidebar .side-nav-link i:first-child {
    margin: 0 !important;
    font-size: 1.15rem;
}

/* Main content offset */
#main-content {
    margin-top: 56px;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-height: calc(100vh - 56px);
    transition: margin-left var(--transition);
    width: calc(100% - var(--sidebar-width));
    overflow-y: auto;
    overflow-x: hidden;
}

body.sidebar-collapsed #main-content {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

.dashboard-hero {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.6rem;
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 20%, rgba(255,255,255,0.2), transparent 18%),
        linear-gradient(145deg, #003A54 0%, #0077A8 42%, #00ABE4 78%, #4FC3F7 100%);
    box-shadow: 0 20px 44px rgba(0, 58, 84, 0.18);
    color: white;
}

.dashboard-hero::before,
.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    pointer-events: none;
}

.dashboard-hero::before {
    width: 200px;
    height: 200px;
    right: -70px;
    top: -80px;
}

.dashboard-hero::after {
    width: 120px;
    height: 120px;
    right: 18%;
    bottom: -45px;
}

.dashboard-hero-copy,
.dashboard-hero-actions {
    position: relative;
    z-index: 1;
}

.dashboard-hero-copy {
    min-width: 0;
}

.dashboard-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.95rem;
}

.dashboard-hero .page-title {
    color: white;
}

.dashboard-hero-subtitle {
    max-width: 54ch;
    color: rgba(255,255,255,0.82);
    font-size: 0.96rem;
    line-height: 1.6;
}

.dashboard-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.dashboard-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.92);
    font-size: 0.82rem;
    font-weight: 600;
}

.dashboard-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 0.85rem;
    flex: 0 0 auto;
}

.dashboard-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-status-pill i {
    font-size: 0.58rem;
    color: #B7FFD2;
}

.dashboard-refresh-btn {
    min-height: 44px;
    padding-left: 1rem;
    padding-right: 1rem;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
}

.dashboard-refresh-btn:hover,
.dashboard-refresh-btn:focus {
    background: rgba(255,255,255,0.24);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 10px 22px rgba(0,58,84,0.18);
}

/* Sidebar nav section header — SaaS Premium Typography */
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 1.25rem 1.15rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
    opacity: 0.8;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-secondary);
    padding: 0.6rem 2.25rem 0.6rem 0.75rem; /* Safe zone de 2.25rem no lado direito */
    border-radius: 8px;
    margin: 0.1rem 0;
    transition: all var(--transition);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    position: relative;
    user-select: none;
    min-width: 0; /* Permite truncar o texto interno */
}

/* Garante que o texto seja TOTALMENTE visível (Anti-Truncation) */
.nav-label, .submenu-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.side-nav-link i:first-child {
    font-size: 1.1rem;
    width: 1.3rem; /* Largura fixa centralizada para alinhamento pixel-perfect */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: margin var(--transition);
}

.side-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    outline: 1px solid rgba(0, 0, 0, 0.12);
    /* Shadow mais forte e vibrante */
    box-shadow: 0 10px 25px rgba(0, 75, 200, 0.15);
    text-decoration: none;
}

.side-nav-link.active,
.submenu-link.active {
    color: var(--primary);
    background: rgba(0, 171, 228, 0.08);
    backdrop-filter: blur(12px);
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: calc(0.75rem - 3px);
    box-shadow: none;
}

.side-nav-link.active i {
    color: var(--primary);
}

/* Collapse toggle chevron */
.side-nav-link .chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.25s ease, opacity var(--transition);
    opacity: 0.7;
}

.side-nav-link[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* Sub-menu */
.sidebar-submenu {
    margin-left: 0.5rem;
    padding-left: 0.75rem; /* Ajustado para melhor fluxo visual */
    border-left: 1px solid rgba(0, 123, 255, 0.15); /* Borda mais sutil */
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-muted);
    padding: 0.5rem 2.25rem 0.5rem 0.75rem; /* Safe zone alinhado */
    border-radius: 6px;
    margin: 0.1rem 0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    min-width: 0;
}

.submenu-link i:first-child {
    font-size: 0.95rem;
    width: 1.3rem; /* Mesma largura dos icones principais para alinhamento vertical */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.submenu-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    outline: 1px solid rgba(0, 0, 0, 0.12);
    /* Sincronização de shadow profundo */
    box-shadow: 0 8px 20px rgba(0, 75, 200, 0.12);
    text-decoration: none;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(8,30,50,0.04);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(8,30,50,0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.85rem 1.1rem;
    border-radius: 16px 16px 0 0 !important;
}

.card-body {
    color: var(--text-primary);
}

/* Stat cards */
.stat-card {
    color: white;
    border: none;
    border-radius: 16px;
}

.stat-card.visitors {
    background: var(--primary);
}

.stat-card.pending {
    background: #F59E0B;
}

.stat-card.whatsapp {
    background: #10B981;
}

.stat-card.system {
    background: #6366F1;
}

/* ─── Tables ─────────────────────────────────────────── */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
}

.table > :not(caption) > * > * {
    padding: 0.85rem;
    border-bottom-color: var(--border);
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    background: var(--bg-surface);
}

.table tbody tr {
    transition: background-color var(--transition);
}

.table tbody tr:hover {
    background-color: var(--bg-surface);
}

.table td {
    vertical-align: middle;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.table tbody tr:hover td {
    background: var(--bg-card-hover);
}

.table-hover>tbody>tr:hover>* {
    color: var(--text-primary);
}

/* ─── Forms ──────────────────────────────────────────── */
.form-control,
.form-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 0.875rem;
    height: 44px;
}

.form-control:focus,
.form-select:focus {
    background: var(--bg-input);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}

.input-group-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4FC3F7 100%);
    border-color: transparent;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(0,171,228,0.3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0,171,228,0.4);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: 12px;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-secondary {
    background: rgba(0,171,228,0.08);
    border-color: transparent;
    color: var(--primary);
    border-radius: 12px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(0,171,228,0.14);
    border-color: transparent;
    color: var(--primary);
}

.btn-success {
    border-radius: 12px;
}

.btn-danger {
    border-radius: 12px;
}

.btn-warning {
    border-radius: 12px;
}

.btn-info {
    border-radius: 12px;
}

.btn-outline-secondary {
    border-color: var(--border);
    color: var(--text-secondary);
    border-radius: 12px;
}

.btn-outline-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

/* ─── Modals ─────────────────────────────────────────── */
.modal {
    z-index: 2000;
}

.modal-backdrop {
    z-index: 1990;
}

.modal-dialog {
    margin-top: max(1.75rem, calc(56px + 1rem));
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    box-shadow: 0 24px 60px rgba(8,30,50,0.18);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: 20px 20px 0 0;
}

.modal-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    border-radius: 0 0 20px 20px;
}

.modal-title {
    color: var(--text-primary);
}

.btn-close {
    filter: invert(1) brightness(0.7);
}

/* ─── Badges & Bootstrap Overrides ─────────────────────── */
.badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3em 0.6em;
    border-radius: 20px;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

/* ─── Alerts & Notifications ────────────────────────── */
#notification-container {
    position: fixed;
    top: 70px; /* Abaixo da navbar */
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: 380px;
}

.alert {
    pointer-events: auto;
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    /* Texto em PRETO para máxima legibilidade conforme solicitado */
    color: #212529 !important;
    font-weight: 500;
    border-left: 5px solid transparent;
    animation: toast-slide-in 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@keyframes toast-slide-in {
    from { transform: translateX(110%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-info {
    background: #e0f2fe;
    border-left-color: #0ea5e9;
}

.alert-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.alert-danger {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.alert-success {
    background: #dcfce7;
    border-left-color: #22c55e;
}

.alert i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.alert .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
    filter: none; /* Black close icon for high contrast */
}

/* ─── Dropdowns ──────────────────────────────────────── */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border);
}

/* ─── Visitor photo / thumbnails ─────────────────────── */
.visitor-photo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border);
}

/* ─── Permissions Tree ───────────────────────────────── */
.permissions-tree {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    background: var(--bg-surface);
}

.area-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.area-header {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}

.area-header:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.area-header.collapsed {
    background: linear-gradient(135deg, #3D3658 0%, #2D2640 100%);
}

.area-content {
    padding: 1rem;
    display: none;
}

.area-content.expanded {
    display: block;
}

.resource-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.resource-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.resource-section-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.resource-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    font-size: 0.875rem;
}

.resource-actions {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.action-checkbox {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.action-checkbox input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--primary);
}

.action-checkbox label {
    cursor: pointer;
    margin: 0;
    color: var(--text-muted);
}

.action-checkbox input[type="checkbox"]:checked+label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Country selector ───────────────────────────────── */
.country-search-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
}

.country-dropdown-container {
    margin-top: 2px;
    z-index: 9999 !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.country-item {
    transition: background var(--transition);
    color: var(--text-secondary);
}

.country-item:hover,
.country-item.active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.country-item:last-child {
    border-bottom: none !important;
}

/* ─── Text helpers ───────────────────────────────────── */
.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary-color {
    color: var(--text-secondary) !important;
}

small,
.small {
    color: var(--text-muted);
}

/* ─── Nav tabs ───────────────────────────────────────── */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: none;
}

.nav-tabs .nav-link.active {
    color: var(--primary-light);
    background: none;
    border-bottom-color: var(--primary-light);
    font-weight: 600;
}

/* ─── Page heading ───────────────────────────────────── */
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-heading h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-heading h2 i {
    color: var(--primary-light);
}

/* ─── Compact Stats Strip (Tech Blue) ────────────────── */
.stats-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0096C7 100%);
    color: #fff;
    border-radius: 10px;
    padding: 0.8rem 1.4rem;
    margin-bottom: 1.25rem;
}
.stats-strip .stat-total {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
}
.stats-strip .stat-label {
    font-size: 0.78rem;
    opacity: 0.85;
}
.stats-strip .divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.3);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
    }

    body:not(.sidebar-collapsed) #sidebar {
        width: var(--sidebar-width);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    body:not(.sidebar-collapsed) #main-content {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-collapsed #sidebar {
        width: 0;
        overflow: hidden;
    }

    body.sidebar-collapsed #main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ─── Premium Dashboard (Panorama) ───────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(214, 232, 245, 0.92) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 34px rgba(0, 58, 84, 0.08) !important;
    transition: all var(--transition) !important;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(0, 58, 84, 0.12) !important;
    border-color: var(--primary-light) !important;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.glass-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

@media (max-width: 991.98px) {
    .dashboard-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

@media (max-width: 575.98px) {
    .dashboard-hero {
        padding: 1.2rem;
        border-radius: 18px;
    }

    .dashboard-hero-subtitle {
        font-size: 0.9rem;
    }

    .dashboard-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-status-pill,
    .dashboard-refresh-btn {
        justify-content: center;
        width: 100%;
    }
}

.bi-spin {
    animation: bi-spin 1s linear infinite;
}

@keyframes bi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
