/* Admin Dashboard Styles */

:root {
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #1f2937;
    --text-light: #4b5563;
    --muted: #8492a6;
    --muted-light: #9ca3af;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #d1faf8;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: #34495e;
    --sidebar-active: #0f766e;
    --danger: #b42318;
    --danger-bg: #fee4e2;
    --danger-light: #fecaca;
    --success: #027a48;
    --success-bg: #d1fadf;
    --success-light: #86efac;
    --warning: #dc2626;
    --warning-light: #fca5a5;
    --info: #1d4ed8;
    --info-bg: #dbeafe;
    --border: #d0d5dd;
    --border-light: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

html {
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    width: 100%;
}

/* Override styles.css constraints for admin pages */
.page-shell {
    min-height: 100vh;
    display: contents;
}

.topbar {
    max-width: none;
    margin: 0;
    padding: 0;
    display: none;
}

.content-area {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* ============================================
   ADMIN WRAPPER & MAIN LAYOUT
   ============================================ */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    width: 100%;
    max-width: 100%;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.admin-sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.admin-sidebar {
    transition: width 0.3s ease;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-group-title {
    padding: 12px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(236, 240, 241, 0.5);
    margin-top: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--sidebar-active);
    border-left-color: #fff;
    color: #fff;
    font-weight: 600;
}

.nav-icon {
    font-size: 1rem;
    min-width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.nav-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 6px;
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar-logout:hover {
    background: rgba(244, 63, 94, 0.2);
    color: #fff;
}

.subnav {
    display: none;
    flex-direction: column;
    margin-left: 8px;
    margin-right: 8px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    padding-left: 4px;
    overflow: hidden;
}

.subnav.open {
    display: flex;
}

.nav-parent {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
}

.nav-parent .nav-expand-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.nav-parent[aria-expanded="true"] .nav-expand-icon {
    transform: rotate(180deg);
}

.subnav-item {
    padding-left: 32px;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.subnav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.admin-sidebar.collapsed .subnav {
    display: none !important;
}

.admin-sidebar.collapsed .nav-parent {
    justify-content: center;
}

.admin-sidebar.collapsed .nav-parent .nav-expand-icon {
    display: none;
}

/* ============================================
   ADMIN CONTENT AREA
   ============================================ */

.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow-y: auto;
}

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

.admin-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-weight: 600;
    color: var(--muted-light);
    font-size: 0.95rem;
}

.admin-container {
    flex: 1;
    padding: 24px 30px;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   DASHBOARD GRID & STATS
   ============================================ */

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    width: 100%;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    min-width: 0;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.stat-icon.categories { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
}

.stat-icon.subcategories { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
}

.stat-icon.questions { 
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); 
}

.stat-icon.devices { 
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); 
}

.stat-info {
    flex: 1;
}

.stat-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-subtitle {
    margin: 4px 0 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.chart-container {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.chart-container h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.chart-subtitle {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: var(--muted);
}

.chart-placeholder {
    min-height: 280px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.05) 0%, rgba(79, 172, 254, 0.05) 100%);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-light);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================
   SECTION LAYOUT
   ============================================ */

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.section-content {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    width: 100%;
}

.content-header {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 180px;
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(15, 118, 110, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-warning {
    background: #f59e0b;
    color: #fff;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-large {
    padding: 10px 16px;
    font-size: 0.95rem;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.btn-small:hover {
    background: #f9fafb;
    border-color: var(--primary);
}

.btn-edit {
    color: var(--info);
}

.btn-delete {
    color: var(--danger);
}

/* ============================================
   DATA TABLES
   ============================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #fff;
}

.data-table thead {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.data-table td {
    padding: 12px;
    border: 1px solid #ddd;
    color: #64748b;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active {
    background: var(--success-bg);
    color: var(--success);
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #b45309;
}

.badge-medium {
    background: #fef3c7;
    color: #b45309;
}

.badge-admin {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    width: 100%;
}

.item-card {
    background: #f9fafb;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 14px;
    text-align: center;
    transition: all 0.2s ease;
    min-width: 0;
}

.item-card:hover {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.15);
}

.item-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.item-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.item-count {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 4px 0 10px;
}

.item-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* ============================================
   FORMS
   ============================================ */

.form-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    width: 100%;
}

.form-group {
    margin-bottom: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-control:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: var(--muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.table-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 18px;
    box-shadow: none;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 7px 10px;
    background: #fff;
}

.search-input input {
    border: none;
    outline: none;
    width: 220px;
    font-size: 0.95rem;
    color: var(--text);
    background: transparent;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.rows-per-page {
    color: var(--text-light);
    font-size: 0.9rem;
}

.rows-per-page select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    font-size: 0.95rem;
}

.table-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-action-icon:hover {
    background: #f3f4f6;
}

.language-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 2fr;
    gap: 24px;
}

.table-card .data-table th,
.table-card .data-table td {
    background: transparent;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   SETTINGS LAYOUT
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
}

.settings-card {
    background: #f9fafb;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 16px;
    min-width: 0;
}

.settings-card h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
}

/* ============================================
   STATUS CARDS
   ============================================ */

.status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
}

.status-card {
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.status-card.status-good {
    background: var(--success-bg);
    border-color: var(--success-light);
}

.status-card.status-info {
    background: var(--info-bg);
    border-color: #93c5fd;
}

.status-icon {
    font-size: 1.3rem;
    font-weight: bold;
}

.status-text h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 600;
}

.status-text p {
    margin: 0;
    font-size: 0.85rem;
}

/* ============================================
   SECTIONS
   ============================================ */

.update-section,
.maintenance-section,
.import-history {
    margin-top: 20px;
}

.update-section h3,
.maintenance-section h3,
.import-history h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
}

.update-card {
    background: var(--info-bg);
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.update-info h4 {
    margin: 0 0 3px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--info);
}

.update-info p {
    margin: 0 0 3px;
    font-size: 0.85rem;
    color: var(--info);
}

.update-info small {
    color: var(--muted);
}

.maintenance-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   CALENDAR VIEW
   ============================================ */

.calendar-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    width: 100%;
}

.calendar-item {
    background: #f9fafb;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 14px;
    min-width: 0;
}

.date {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.calendar-item .item-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.calendar-item .item-stats {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.calendar-item .item-actions {
    display: flex;
    gap: 6px;
}

/* ============================================
   SIDEBAR COLLAPSED STATE
   ============================================ */

.admin-sidebar.collapsed {
    width: 80px;
}

.admin-sidebar.collapsed .sidebar-title {
    display: none;
}

.admin-sidebar.collapsed .nav-label {
    display: none;
}

.admin-sidebar.collapsed .nav-group-title {
    display: none;
}

.admin-sidebar.collapsed .sidebar-footer {
    padding: 8px;
}

.admin-sidebar.collapsed .sidebar-logout {
    padding: 8px;
    justify-content: center;
}

.admin-sidebar.collapsed .nav-item {
    padding: 14px 8px;
    justify-content: center;
    border-left: none;
    border-top: 3px solid transparent;
}

.admin-sidebar.collapsed .nav-item.active {
    border-left: none;
    border-top-color: #fff;
    background: var(--sidebar-active);
}

.admin-sidebar.collapsed .nav-item:hover {
    background: var(--sidebar-hover);
}

.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.content-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-error { 
    background: var(--danger-bg); 
    color: var(--danger); 
}

.alert-success { 
    background: var(--success-bg); 
    color: var(--success); 
}

.alert-info { 
    background: var(--info-bg); 
    color: var(--info); 
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-view {
        grid-template-columns: repeat(3, 1fr);
    }

    .admin-container {
        padding: 20px 20px;
    }
}

@media (max-width: 900px) {
    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        position: relative;
        max-height: auto;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .admin-sidebar::-webkit-scrollbar {
        height: 6px;
    }

    .sidebar-header {
        justify-content: flex-start;
    }

    .sidebar-nav {
        display: flex;
        padding: 0;
        gap: 0;
        flex-wrap: nowrap;
    }

    .nav-item {
        flex-direction: column;
        padding: 12px 10px;
        font-size: 0.75rem;
        text-align: center;
        border: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-bottom-color: #fff;
        border-left: none;
        background: var(--sidebar-active);
    }

    .nav-label {
        display: block;
    }

    .nav-group-title {
        display: none;
    }

    .sidebar-footer {
        display: flex;
        padding: 8px;
        gap: 8px;
    }

    .sidebar-logout {
        flex: 1;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 20px;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .admin-container {
        padding: 16px 20px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .admin-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .admin-container {
        padding: 12px 16px;
    }

    .stat-card {
        padding: 14px;
    }

    .chart-container {
        padding: 14px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-title {
        font-size: 1.1rem;
    }

    .user-name {
        font-size: 0.85rem;
    }

    .content-header {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .grid-view {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .admin-sidebar.collapsed {
        width: 100%;
        max-height: auto;
    }

    .admin-sidebar.collapsed .sidebar-header {
        width: 100%;
    }

    .admin-sidebar.collapsed .nav-item {
        padding: 12px 10px;
        border-top: 3px solid transparent;
    }

    .admin-sidebar.collapsed .nav-item.active {
        border-top-color: #fff;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 10px 12px;
    }

    .admin-topbar {
        padding: 10px 12px;
    }

    .stat-card {
        padding: 12px;
    }

    .section-content {
        padding: 12px;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .grid-view {
        grid-template-columns: 1fr;
    }
}
