/* ==========================================================================
   RADAR10 - PROFESSIONAL DASHBOARD SYSTEM
   ========================================================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --sidebar-bg: #1a1c23;
    --sidebar-text: #adb5bd;
    --sidebar-hover: #24262d;
    --sidebar-active: #ffffff;
    --accent-color: var(--primary); /* From global.css */
    --transition-speed: 0.3s;
}

body.dashboard-open {
    overflow: hidden;
}

/* --- MAIN LAYOUT --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-page);
}

/* --- SIDEBAR --- */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2100;
    transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-label {
    padding: 10px 25px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    font-weight: 700;
}

.menu-item {
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--sidebar-text);
    border-left: 3px solid transparent;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
}

.menu-item.active {
    color: var(--sidebar-active);
    background: rgba(36, 180, 126, 0.1);
    border-left-color: var(--accent-color);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- TOPBAR --- */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex children from overflowing */
}

.dashboard-topbar {
    height: var(--topbar-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 2000;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}

.view-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* --- CONTENT --- */
.dashboard-content {
    padding: 25px;
    flex: 1;
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

/* --- OVERLAY --- */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-speed) ease;
    backdrop-filter: blur(2px);
}

.dashboard-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- RESPONSIVE STATES --- */

/* Mobile (Tablet and Phone) */
@media (max-width: 991px) {
    .dashboard-main {
        margin-left: 0;
    }
    
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.show {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    .dashboard-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Extra utility for items with badges */
.menu-item .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* --- COMPACT UTILITIES (For mobile density) --- */
.compact-item-row {
    padding: 12px 15px !important;
    gap: 10px !important;
}

.compact-item-row b { font-size: 0.95rem !important; }
.compact-item-row small { font-size: 0.8rem !important; }
.compact-item-row .btn { padding: 6px 12px; font-size: 0.8rem; }

.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.compact-table td, .compact-table th {
    padding: 8px 10px;
}

.compact-table input {
    padding: 5px 8px;
    font-size: 0.9rem;
    min-height: 32px;
}

@media (max-width: 768px) {
    .compact-item-row { padding: 8px 12px !important; }
    .compact-table { font-size: 0.8rem; }
    .compact-table td, .compact-table th { padding: 5px 8px; }
}
