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

/* CSS Variables for Theme Support */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --accent-color: #16a34a;
    --accent-hover: #15803d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme Styles */
body.theme-dark {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --card-bg: #1f2937;
    --border-color: #374151;
}

body.theme-dark .sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}

body.theme-dark .main-content {
    background: #111827;
}

body.theme-dark .content-header h1 {
    color: #f3f4f6;
}

body.theme-dark .content-header p {
    color: #9ca3af;
}

body.theme-dark .table-card {
    background: #1f2937;
    border-color: #374151;
}

body.theme-dark .table-card h3 {
    color: #f3f4f6;
}

body.theme-dark table th {
    background: #374151;
    color: #f3f4f6;
}

body.theme-dark table td {
    color: #d1d5db;
    border-color: #374151;
}

body.theme-dark table tr:hover {
    background: #374151;
}

body.theme-dark .btn-secondary {
    background: #374151;
    color: #d1d5db;
}

body.theme-dark .btn-secondary:hover {
    background: #4b5563;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

body.theme-dark .stats-card {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

body.theme-dark .stats-card h3,
body.theme-dark .stats-card .stat-value {
    color: #f3f4f6;
}

/* Modal Popup Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease-out;
    z-index: 1;
}

.modal-content.error {
    border-top: 4px solid #ef4444;
}

.modal-content.success {
    border-top: 4px solid #22c55e;
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease-out;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.modal-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 20px;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

.logo-text h2 {
    font-size: 18px;
    color: #1f2937;
}

.logo-text p {
    font-size: 11px;
    color: #6b7280;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-link.active {
    background: #dcfce7;
    color: #16a34a;
    font-weight: 500;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.main-content {
    margin-left: 260px;
    padding: 20px 30px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    color: #1f2937;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 10px 15px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 250px;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: #22c55e;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    transition: color 0.3s;
}

.search-icon:hover {
    color: #22c55e;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
}

.user-profile:hover {
    background: #f3f4f6;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.avatar-dropdown {
    position: absolute;
    top: 60px;
    right: 30px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-width: 220px;
    z-index: 1000;
}

/* User info next to avatar in header */
.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.header-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}
.header-email {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Avatar dropdown header with user info */
.avatar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}
.dropdown-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}
.dropdown-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    overflow: hidden;
}
.dropdown-username {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}
.dropdown-email {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.avatar-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.avatar-dropdown li {
    padding: 12px 20px;
    cursor: pointer;
    color: #1f2937;
    transition: background 0.2s;
}
.avatar-dropdown li:hover {
    background: #f3f4f6;
    color: #16a34a;
}

/* Notification Bell Styles */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    background: #f3f4f6;
}

.bell-icon {
    font-size: 20px;
}

.alert-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse 2s infinite;
}

.alert-badge.hidden {
    display: none;
}

/* Nav Badge for Sidebar */
.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    margin-left: auto;
}

.nav-badge.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.page-content {
    display: none;
    animation: fadeIn 0.3s;
}

.page-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.table-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.table-card h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: #f9fafb;
}

th {
    text-align: left;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #1f2937;
}

tbody tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #16a34a;
    color: white;
}

.btn-primary:hover {
    background: #15803d;
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #22c55e;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 20px;
    color: #1f2937;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #dc2626;
}

/* Login Page Layout */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: url('adminlogin_bg.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
}

/* Left side with brand and background */
.login-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: transparent;
    position: relative;
}

.login-left::before {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.1), transparent);
    border-radius: 50%;
}

.login-brand {
    text-align: left;
    position: relative;
    z-index: 2;
    max-width: 400px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.brand-kicker {
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 700;
    color: #f59e0b;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.brand-title {
    font-size: 56px;
    line-height: 1.1;
    font-weight: 800;
    background: linear-gradient(135deg, #14532d, #15803d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
}

.brand-name {
    font-size: 40px;
    font-weight: 700;
    color: #15803d;
    margin-top: 4px;
}

/* Right side with login form */
.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: transparent;
}

.login-form {
    width: 100%;
    max-width: 480px;
}

.login-form.hidden {
    display: none;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-container {
    width: 100%;
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    display: block;
}

.login-card-header h3 {
    font-size: 20px;
    color: #111827;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-card-header p {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 24px;
}

.input-icon-group {
    position: relative;
}

.input-icon-group input {
    padding-right: 40px;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    margin-bottom: 20px;
}

.link-muted {
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.modal.show { display: flex; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 10000; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.3); }
.modal-content { position: relative; background: #fff; border-radius: 12px; padding: 32px 24px; min-width: 320px; z-index: 1; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.modal-title { font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { display: block; margin-bottom: 6px; color: #1f2937; }
.modal .form-group input { width: 100%; padding: 10px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 15px; }
.modal .btn.full { width: 100%; }
.modal .error-message { color: #ef4444; margin-bottom: 10px; }
.modal .success-message { color: #16a34a; margin-bottom: 10px; }

.link-muted:hover {
    color: #16a34a;
    text-decoration: underline;
}

.btn.full {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.helper-text {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: #6b7280;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 15px;
    padding: 0 20px;
}

.bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, #16a34a, #22c55e);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
    cursor: pointer;
}

.bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.success-message {
    background: #dcfce7;
    color: #16a34a;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

.error-message.show {
    display: block;
}

.hidden {
    display: none !important;
}

/* ========== STATS & CHARTS STYLES ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.stat-card .change {
    font-size: 13px;
    color: #16a34a;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chart-card {
    position: relative;
}

.chart-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    font-size: 14px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.chart-zoom-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

.chart-card.zoomed .chart-zoom-btn {
    display: none;
}

.chart-card h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 20px;
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
}

/* Zoom interactions */
.chart-card.zoomable {
    cursor: zoom-in;
}

.chart-card.zoomed {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.25);
    width: min(1100px, 95vw);
    max-height: 95vh;
    overflow: auto;
    z-index: 2100;
    box-shadow: 0 12px 45px rgba(0,0,0,0.25);
    cursor: zoom-out;
    background: white;
}

.chart-card.zoomed .chart-placeholder {
    height: 420px;
}

.chart-card.zoomed svg {
    max-width: 100%;
    max-height: 420px;
}

.chart-zoom-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 2000;
}

.chart-zoom-backdrop.show {
    opacity: 1;
    visibility: visible;
}

body.chart-zoom-active {
    overflow: hidden;
}

/* ========== TABLE & CARD STYLES ========== */
.table-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.table-card h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

thead {
    background: #f9fafb;
}

th {
    text-align: left;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #1f2937;
}

tbody tr:hover {
    background: #f9fafb;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background: #dcfce7;
    color: #16a34a;
}

.status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

/* ========== BAR CHART STYLES ========== */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    gap: 15px;
    padding: 0 20px;
}

.bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, #16a34a, #22c55e);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
    cursor: pointer;
}

.bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

/* ========== CONTROL BUTTONS ========== */
.scan-controls,
.pest-controls,
.knowledge-controls,
.users-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.scan-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

/* ========== SETTINGS STYLES ========== */
.settings-content {
    background: white;
    border-radius: 12px;
}

.settings-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f3f4f6;
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section strong {
    color: #1f2937;
    font-size: 15px;
}

.settings-section p {
    font-size: 13px;
    color: #6b7280;
    margin-top: 5px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #16a34a;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Responsive Design for Login Page */
@media (max-width: 1024px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 20px;
    }

    .login-card {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 24px;
        border-radius: 12px;
    }

    .login-card-header h3 {
        font-size: 18px;
    }

    .brand-kicker {
        font-size: 14px;
    }

    .brand-title {
        font-size: 32px;
    }

    .brand-name {
        font-size: 28px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
    }
}

/* =============================================
   COMPREHENSIVE RESPONSIVE / MOBILE STYLES
   ============================================= */

/* Hamburger Button (hidden on desktop) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    z-index: 201;
}

.hamburger-btn:hover {
    background: #f3f4f6;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Header left group for title + hamburger */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-left h1 {
    font-size: 24px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 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;
}

/* ===== TABLET BREAKPOINT (≤1024px) ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .main-content {
        margin-left: 0;
        padding: 15px 20px;
    }

    .hamburger-btn {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .header {
        padding: 15px 20px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .search-box input {
        width: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .chart-card.zoomed {
        width: 95vw;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== MOBILE BREAKPOINT (≤768px) ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 12px 15px;
    }

    .header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 15px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        flex: 1;
    }

    .search-box input {
        width: 100%;
    }

    .user-info {
        display: none;
    }

    .user-profile {
        padding: 6px 8px;
    }

    .avatar-dropdown {
        right: 10px;
        top: 50px;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .value {
        font-size: 24px;
    }

    .stat-card h3 {
        font-size: 12px;
    }

    /* Charts */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chart-card {
        height: auto;
        max-height: none;
    }

    .chart-container {
        height: 220px;
        min-height: 180px;
    }

    /* Tables */
    .table-card {
        padding: 15px;
        border-radius: 10px;
        margin-bottom: 15px;
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Buttons & Controls */
    .scan-controls,
    .pest-controls,
    .knowledge-controls,
    .users-controls {
        flex-wrap: wrap;
    }

    .action-btns {
        flex-direction: column;
        gap: 4px;
    }

    .action-btns .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 10px;
    }

    /* Settings */
    .settings-content {
        max-width: 100%;
    }

    .settings-category {
        padding: 18px 16px;
    }

    /* Zoom Modal */
    #chartZoomModal {
        padding: 15px;
    }

    #chartZoomModal .zoom-content {
        width: 100%;
        max-width: 100%;
        height: 90%;
        max-height: 90%;
        border-radius: 12px;
        padding: 16px;
    }

    .chart-card.zoomed {
        width: 98vw;
        max-height: 90vh;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== SMALL MOBILE BREAKPOINT (≤480px) ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 10px 12px;
    }

    .header {
        padding: 10px 12px;
        margin-bottom: 15px;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .search-box input {
        padding: 8px 12px 8px 36px;
        font-size: 13px;
    }

    /* Stats on very small screens: single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .stat-card .value {
        font-size: 22px;
        margin-bottom: 0;
    }

    .stat-card h3 {
        font-size: 13px;
        margin-bottom: 0;
    }

    .stat-card .change {
        display: none;
    }

    /* Table scroll hint */
    .table-card {
        padding: 12px;
        position: relative;
    }

    .table-card::after {
        content: '← Scroll →';
        display: block;
        text-align: center;
        font-size: 11px;
        color: #9ca3af;
        padding: 6px 0 0;
    }

    table {
        min-width: 500px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Controls */
    .scan-controls,
    .pest-controls,
    .knowledge-controls,
    .users-controls {
        flex-direction: column;
    }

    .scan-controls .btn,
    .pest-controls .btn,
    .knowledge-controls .btn,
    .users-controls .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Bar chart */
    .bar-chart {
        height: 150px;
        gap: 8px;
        padding: 0 10px;
    }

    .bar-label {
        font-size: 10px;
    }

    /* Login adjustments */
    .login-right {
        padding: 15px;
    }

    .login-card {
        padding: 20px;
    }

    .login-card-header h3 {
        font-size: 16px;
    }

    .login-card-header p {
        font-size: 12px;
    }
}

/* ===== TOUCH DEVICE ENHANCEMENTS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Bigger tap targets */
    .nav-link {
        padding: 14px 16px;
    }

    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .action-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .toggle-switch {
        width: 52px;
        height: 28px;
    }

    .slider:before {
        height: 20px;
        width: 20px;
    }

    /* Disable hover effects that are confusing on touch */
    .stat-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .chart-card::after {
        display: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .hamburger-btn,
    .sidebar-overlay,
    .header-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .chart-card,
    .stat-card,
    .table-card {
        box-shadow: none !important;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
    }
}
