/* public/css/style.css */
body { font-family: 'Segoe UI', sans-serif; margin: 0; display: flex; background: #f4f6f9; height: 100vh; overflow: hidden; }

/* SIDEBAR */
#sidebar-container { width: 250px; background: #1e293b; color: white; display: flex; flex-direction: column; padding: 20px; flex-shrink: 0; }
.brand { font-size: 20px; font-weight: bold; margin-bottom: 30px; text-align: center; color: #60a5fa; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 12px; color: #cbd5e1; text-decoration: none; border-radius: 8px; margin-bottom: 5px; cursor: pointer; transition: 0.2s; }
.menu-item:hover { background: #334155; color: white; }
.menu-item.active { background: #2563eb; color: white; }
.logout { margin-top: auto; color: #ef4444; }
.logout:hover { background: #451a1a; }

/* MAIN CONTENT */
.main-content { flex-grow: 1; padding: 30px; overflow-y: auto; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.page-title { font-size: 24px; font-weight: bold; color: #1e293b; }
.user-badge { background: #e2e8f0; padding: 5px 15px; border-radius: 20px; font-weight: 600; color: #475569; }

/* CARDS & TABLES */
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th { text-align: left; padding: 12px; background: #f8fafc; border-bottom: 2px solid #e2e8f0; color: #64748b; font-size: 13px; }
td { padding: 12px; border-bottom: 1px solid #e2e8f0; color: #334155; }
input, select { padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; width: 100%; margin-bottom: 15px; box-sizing: border-box; }
.btn { padding: 10px 20px; background: #2563eb; color: white; border: none; border-radius: 6px; cursor: pointer; }
.btn:hover { background: #1d4ed8; }
/* LOGO STYLES */
.login-logo {
    max-width: 150px; /* Adjust size as needed */
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
/* --- 1. CORPORATE VARIABLES & RESET --- */
:root {
    --primary: #2563eb;       /* Corporate Blue */
    --primary-dark: #1e40af;
    --sidebar-bg: #0f172a;    /* Navy/Black */
    --text-main: #334155;     /* Slate Gray */
    --text-light: #94a3b8;    /* Muted Text */
    --bg-body: #f1f5f9;       /* Light Gray Background */
    --white: #ffffff;
    --border: #e2e8f0;
    --danger: #ef4444;        /* Red for alerts/logout */
    
    /* Dimensions */
    --sidebar-width: 260px;
    --sidebar-mini-width: 70px;
    --header-height: 60px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    font-size: 14px; /* Professional data density */
}

/* --- 2. MOBILE HEADER (Hidden on Desktop) --- */
#mobile-header {
    display: none; /* Only shows on phone via media query */
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--sidebar-bg);
    color: var(--white);
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#mobile-menu-btn {
    font-size: 20px;
    cursor: pointer;
    background: none; border: none; color: white;
    margin-right: 15px;
}

/* --- 3. SIDEBAR (Navigation Drawer) --- */
#sidebar-container {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 999;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-x: hidden;
    white-space: nowrap; /* Prevents text wrap during animation */
}

/* Brand Section */
.brand {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

/* Menu Items */
.menu-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}
.menu-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.menu-item.active { background: var(--primary); color: var(--white); border-right: 4px solid #60a5fa; }
.menu-item .icon { width: 30px; text-align: center; margin-right: 10px; font-size: 16px; }

/* Logout */
.logout { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.1); color: var(--danger); }

/* --- 4. MINI SIDEBAR (Desktop Collapse Mode) --- */
#sidebar-container.collapsed {
    width: var(--sidebar-mini-width);
}
/* Hide text labels when collapsed */
#sidebar-container.collapsed .text-label, 
#sidebar-container.collapsed .brand h3 {
    opacity: 0; pointer-events: none; display: none;
}
/* Center icons */
#sidebar-container.collapsed .menu-item {
    justify-content: center; padding: 15px 0;
}
#sidebar-container.collapsed .menu-item .icon { margin-right: 0; }

/* Toggle Button (The Arrow) */
.desktop-toggle {
    display: none; /* Hidden on mobile */
    position: absolute; bottom: 20px; right: 20px;
    color: #94a3b8; cursor: pointer; font-size: 20px;
    transition: transform 0.3s;
}
#sidebar-container.collapsed .desktop-toggle {
    right: 50%; transform: translateX(50%) rotate(180deg);
}
@media (min-width: 769px) { .desktop-toggle { display: block; } }

/* --- 5. MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}
.main-content.wide {
    margin-left: var(--sidebar-mini-width);
    width: calc(100% - var(--sidebar-mini-width));
}

/* --- 6. CARDS & FORMS --- */
.card {
    background: var(--white); padding: 20px;
    border-radius: 8px; border: 1px solid var(--border);
    margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
input, select {
    width: 100%; padding: 10px 12px; margin: 5px 0 15px 0;
    border: 1px solid var(--border); border-radius: 6px; background: #f8fafc;
}
input:focus { outline: none; border-color: var(--primary); background: #fff; }

.btn {
    background: var(--primary); color: white; border: none;
    padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer;
}

/* --- 7. RESPONSIVE TABLES & MOBILE LAYOUT --- */
/* Makes tables swipeable on phones */
.table-responsive {
    width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: 6px;
}
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #f8fafc; text-align: left; padding: 12px; border-bottom: 2px solid var(--border); color: #64748b; font-size: 12px; text-transform: uppercase; }
td { padding: 12px; border-bottom: 1px solid var(--border); }

/* MOBILE BREAKPOINT (Phones) */
@media (max-width: 768px) {
    #mobile-header { display: flex; } /* Show header */
    
    #sidebar-container {
        transform: translateX(-100%); /* Hide sidebar off-screen */
        top: var(--header-height); 
        height: calc(100vh - var(--header-height));
    }
    #sidebar-container.open { transform: translateX(0); } /* Slide in */
    
    .main-content { 
        margin-left: 0 !important; 
        width: 100% !important; 
        padding: 20px; 
        margin-top: var(--header-height); 
    }
}