/* ================================================================
   AGRIFOWL FARM MANAGEMENT SOFTWARE — Master Stylesheet
   Clean, responsive, mobile-first professional design
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    /* Emerald Greens */
    --primary-color: #059669;
    --primary-dark: #047857;
    --primary-light: #10b981;
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);

    /* Warm amber accent */
    --secondary-color: #f59e0b;

    /* Backgrounds */
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;

    /* Typography */
    --text-color: #1f2937;
    --text-light: #6b7280;

    /* System */
    --danger-color: #ef4444;
    --success-color: #059669;
    --warning-color: #f59e0b;
    --border-color: #e5e7eb;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Spacing & Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar width */
    --sidebar-width: 260px;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    z-index: 50;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-header .logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--primary-dark);
}

.sidebar-logo {
    height: 65px;
    width: auto;
    object-fit: contain;
    margin-bottom: 8px;
}

.sidebar-header h2 {
    display: none;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Navigation Links */
.nav-links {
    list-style: none;
    padding: 20px 15px;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--text-light);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a i {
    font-size: 1.25rem;
    color: inherit;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #ecfdf5;
    color: var(--primary-dark);
    transform: translateX(4px);
}

.nav-links a:hover i,
.nav-links a.active i {
    color: var(--primary-color);
}

/* Sidebar Close Button (mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #fee2e2;
    color: var(--danger-color);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-close:hover {
    background: var(--danger-color);
    color: white;
}

/* Sidebar Overlay (mobile only) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.content-wrapper {
    padding: 30px;
    flex: 1;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
    background-color: var(--card-bg);
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    z-index: 40;
    gap: 12px;
}

.topbar h2 {
    font-size: 1.4rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Mobile Hamburger Toggle */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #ecfdf5;
    color: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--primary-color);
    color: white;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.85rem;
}

.greeting {
    color: var(--text-light);
}

.greeting strong {
    color: var(--text-color);
    font-weight: 600;
}

.role-badge {
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecfdf5;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #fee2e2;
    color: var(--danger-color);
    border-radius: var(--radius);
    font-size: 1.2rem;
    margin-left: 5px;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

/* ================================================================
   DASHBOARD GRID & STAT CARDS
   ================================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    padding: 26px;
    border-radius: 16px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 0 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    box-shadow: 0 12px 30px -4px rgba(5, 150, 105, 0.15), 0 4px 10px rgba(0,0,0,0.04);
    transform: translateY(-5px);
    border-color: rgba(5, 150, 105, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-card h3 {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(5, 150, 105, 0.03) 100%);
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid rgba(5, 150, 105, 0.1);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}

.stat-card .value {
    font-size: clamp(1.2rem, 5vw, 1.8rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* ================================================================
   CARD PANELS
   ================================================================ */
.card-panel {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.card-panel h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
}

/* ================================================================
   PAGE HEADER (title + action button row)
   ================================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header h3 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    background-color: white;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

/* Form Grid — for multi-column inline forms (e.g., admin add user) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-grid .form-group {
    margin-bottom: 0;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.2);
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(5, 150, 105, 0.3);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-warning {
    background: #f59e0b;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
}

.btn-danger {
    background: #ef4444;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: #6c757d;
    box-shadow: 0 4px 6px -1px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    box-shadow: 0 10px 15px -3px rgba(108, 117, 125, 0.3);
}

.btn-block {
    width: 100%;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

th {
    background: #f9fafb;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: #fdfdfd;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Action buttons inside table cells */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons form {
    margin: 0;
}

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.green { background: #d1fae5; color: #047857; }
.badge.orange { background: #fef3c7; color: #d97706; }
.badge.active { background: var(--secondary-color); color: #fff; }
.badge.inactive { background: #6c757d; color: #fff; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    word-break: break-word;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

/* ================================================================
   REPORT FILTERS
   ================================================================ */
.report-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: end;
}

/* ================================================================
   AUDIT LOG ENTRIES
   ================================================================ */
.audit-log-scroll {
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.audit-log-entry {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.audit-log-entry:last-child {
    border-bottom: none;
}

.audit-log-entry .log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-log-entry .log-user {
    font-weight: 600;
    color: var(--primary-dark);
}

.audit-log-entry .log-time {
    color: #999;
    font-size: 0.8rem;
    white-space: nowrap;
}

.audit-log-entry .log-action {
    margin-top: 5px;
    color: var(--text-color);
}

/* ================================================================
   SECTION DIVIDER
   ================================================================ */
.section-divider {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

/* ================================================================
   HELPER / UTILITY CLASSES
   ================================================================ */
.text-muted {
    color: var(--text-light);
}

.text-small {
    font-size: 0.9rem;
}

.mb-0 { margin-bottom: 0; }
.mb-20 { margin-bottom: 20px; }
.mt-0 { margin-top: 0; }

.align-self-start {
    align-self: start;
}

.span-full {
    grid-column: 1 / -1;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-body {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #f3f4f6 0%, #e5e7eb 100%);
}

.login-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 440px;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.login-card .logo-container {
    text-align: center;
    margin-bottom: 35px;
}

.login-card .logo-img {
    height: 85px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 10px;
}

.login-card h2 {
    text-align: center;
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 800;
}

.login-card p.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* Demo Account Section */
.demo-section {
    margin-top: 30px;
    text-align: center;
}

.demo-section .demo-title {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.demo-acc {
    background: var(--bg-color);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px dashed #ccc;
    width: 100%;
}

.demo-acc .demo-role-label {
    font-size: 0.9em;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.demo-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.demo-btn {
    flex: 1;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.demo-btn:hover {
    border-color: var(--primary-color);
    background: #ecfdf5;
}

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
    body * { visibility: hidden; }
    .main-content, .main-content * { visibility: visible; }
    .no-print { display: none !important; }
    .sidebar, .topbar, .mobile-menu-toggle { display: none !important; }
}

/* ================================================================
   RESPONSIVE: TABLET (≤ 1024px)
   ================================================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 230px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .topbar {
        padding: 14px 20px;
    }

    th, td {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .report-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================================
   RESPONSIVE: MOBILE (≤ 768px)
   ================================================================ */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Show sidebar close button */
    .sidebar-close {
        display: flex;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 100;
        border-right: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0;
    }

    .nav-links {
        padding: 15px;
    }

    .nav-links a {
        padding: 11px 16px;
        font-size: 0.92rem;
    }

    .nav-links a:hover,
    .nav-links a.active {
        transform: translateX(0);
    }

    /* Main content full width */
    .main-content {
        width: 100%;
    }

    /* Topbar */
    .topbar {
        padding: 12px 16px;
    }

    .topbar h2 {
        font-size: 1.1rem;
        flex: 1;
    }

    .profile-text {
        display: none;
    }

    /* Content area */
    .content-wrapper {
        padding: 16px;
    }

    /* Dashboard grid: 2 columns on tablets-ish */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-bottom: 20px;
    }

    /* Force full-width cards in grids */
    .span-full {
        grid-column: 1 / -1;
    }

    /* Stat cards */
    .stat-card {
        padding: 18px;
    }

    .stat-card .value {
        font-size: 1.5rem;
        margin-top: 10px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    /* Card panels */
    .card-panel {
        padding: 20px;
        margin-bottom: 20px;
    }

    /* Tables */
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Forms */
    .form-control {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.92rem;
    }

    /* Page header stacks on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Form grid falls to single column */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Report filters */
    .report-filters {
        grid-template-columns: 1fr 1fr;
    }
}

/* ================================================================
   RESPONSIVE: SMALL MOBILE (≤ 480px)
   ================================================================ */
@media (max-width: 480px) {
    /* Stack dashboard to single column */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .value {
        font-size: 1.3rem;
    }

    .stat-card h3 {
        font-size: 0.78rem;
    }

    .content-wrapper {
        padding: 12px;
    }

    .card-panel {
        padding: 16px;
        border-radius: 10px;
    }

    .card-panel h3 {
        font-size: 1rem;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar h2 {
        font-size: 1rem;
    }

    /* Buttons full width */
    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-sm {
        width: auto;
    }

    /* Report filters single column */
    .report-filters {
        grid-template-columns: 1fr;
    }

    /* Login adjustments */
    .login-card {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .login-card h2 {
        font-size: 1.45rem;
    }

    .login-card .logo-img {
        height: 75px;
    }

    .demo-buttons {
        flex-direction: column;
        gap: 8px;
    }

    /* Form labels */
    .form-group label {
        font-size: 0.88rem;
    }

    /* Alerts */
    .alert {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    /* Sidebar narrower */
    .sidebar {
        width: 260px;
        left: -270px;
    }

    .sidebar.open {
        left: 0;
    }

    /* Profile icons smaller */
    .profile-avatar {
        width: 34px;
        height: 34px;
        font-size: 1.5rem;
    }

    .btn-logout {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    /* Action buttons stack vertically */
    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .action-buttons .btn-sm {
        width: 100%;
    }

    /* Tables: smaller text */
    th, td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* ================================================================
   RESPONSIVE: VERY SMALL MOBILE (≤ 360px)
   ================================================================ */
@media (max-width: 360px) {
    .topbar h2 {
        font-size: 0.9rem;
    }

    .stat-card .value {
        font-size: 1.15rem;
    }

    .content-wrapper {
        padding: 10px;
    }

    .card-panel {
        padding: 14px;
    }

    .sidebar {
        width: 240px;
        left: -250px;
    }

    .sidebar.open {
        left: 0;
    }

    .login-wrapper {
        padding: 10px;
    }

    .login-card {
        padding: 24px 16px;
    }
}

/* ================================================================
   UTILITY: Body scroll lock when sidebar is open
   ================================================================ */
body.sidebar-open {
    overflow: hidden;
}
