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

:root {
    --primary: #2563eb;
    --sidebar-bg: #1e293b;
    --bg-color: #f3f4f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- 1. SIDEBAR (Desktop & Mobile) --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Mobile: Hidden by default */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 280px; box-shadow: 4px 0 15px rgba(0,0,0,0.2); }
    .sidebar.active { transform: translateX(0); }
}

/* Desktop: Always visible, static position */
@media (min-width: 769px) {
    .sidebar { position: sticky; top: 0; transform: none; }
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    padding-left: 10px;
}

.nav-links { list-style: none; margin-top: 10px; }
.nav-links li { margin-bottom: 8px; }

.nav-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px; /* Larger touch target */
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* --- 2. MAIN LAYOUT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Mobile Header (Only visible on mobile) */
.mobile-header {
    display: none;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
}
@media (max-width: 768px) {
    .mobile-header { display: flex; }
}

.content-wrapper {
    padding: 30px 40px;
    overflow-y: auto;
}
@media (max-width: 768px) {
    .content-wrapper { padding: 20px; }
}

/* --- 3. COMPONENTS --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }

/* Dashboard Cards - Responsive Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; } /* Stack on mobile */
}

.card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}
.card-value { font-size: 1.8rem; font-weight: 700; margin: 10px 0; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.text-green { color: var(--success); }

/* Responsive Tables */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto; /* CRITICAL for mobile tables */
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 600px; /* Force scroll on small screens */ }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f9fafb; font-size: 0.75rem; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }

/* Forms & Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
}
input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 16px; /* Prevents iOS zoom */
}
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .grid-form { grid-template-columns: 1fr; } }

/* Mobile Overlay */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 900;
    display: none;
}
.overlay.active { display: block; }