/* 
 * assets/css/style.css
 * Premium Design System v2.0
 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --sidebar-bg: #1e293b;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Kantumruy Pro', 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    line-height: 1.4;
    font-size: 0.85rem; /* Reduced from 1rem default */
}

/* DASHBOARD LAYOUT */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 240px; /* Reduced from 280px */
    background-color: var(--sidebar-bg);
    color: white;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header { margin-bottom: 2.5rem; text-align: center; }

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 0.5rem; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-menu a i { font-size: 1.1rem; width: 24px; text-align: center; }

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem;
    width: calc(100% - 240px);
}

/* RESPONSIVE GRID UTILITIES */
.grid { display: grid; gap: 1.5rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -240px; /* Hide off-canvas */
        width: 240px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

    /* Hamburger Toggle UI */
    .mobile-nav-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        cursor: pointer;
        font-size: 1.25rem;
        color: #1e293b;
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        display: none;
        z-index: 1000;
    }
    .sidebar-overlay.active { display: block; }
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    border: 1px solid #f1f5f9;
}

.card-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 { font-size: 1.1rem; font-weight: 700; color: var(--dark); }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-danger { background: #fee2e2; color: #dc2626; }

/* BADGES */
/* TABS */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.tab-container::-webkit-scrollbar { display: none; }

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* TABLES */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; font-weight: 700; }
td { padding: 12px 10px; border-bottom: 1px solid #f1f5f9; font-size: 0.8rem; }

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 1000;
}

.modal-box {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    margin: 10vh auto;
    box-shadow: var(--shadow-lg);
}

/* FORMS */
input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--primary); }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; color: #475569; }
