/* ================================================
   COLEGIOS PIONEROS - DESIGN SYSTEM
   ================================================ */

:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-dark: #1e40af;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #065f46;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;
    --error: #ef4444;
    --error-light: #fee2e2;
    --error-dark: #991b1b;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #1e40af;

    /* Neutral Colors */
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --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);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
}

/* ================================================
   RESET & BASE
   ================================================ */

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ================================================
   NAVIGATION
   ================================================ */

nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    height: 60px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-right: var(--space-6);
    padding: var(--space-2) 0;
}

nav .logo svg {
    width: 24px;
    height: 24px;
}

nav .logo .nav-logo-img {
    height: 32px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

nav a:not(.logo) {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

nav a:not(.logo):hover {
    color: var(--text);
    background: var(--bg);
}

nav a:not(.logo).active {
    color: var(--primary);
    background: var(--primary-light);
}

nav a:not(.logo) svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-2);
    cursor: pointer;
    color: var(--text);
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

/* User info in nav */
.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-admin {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-profesor {
    background: var(--info-light);
    color: var(--info-dark);
}

.btn-logout {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-logout:hover {
    background: var(--error-light);
    border-color: var(--error);
    color: var(--error);
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

/* ================================================
   LAYOUT
   ================================================ */

main {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) var(--space-12);
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-6);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header h1 svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
    color: var(--text);
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* ================================================
   STAT CARDS (Dashboard)
   ================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.green {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.yellow {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.red {
    background: var(--error-light);
    color: var(--error);
}

.stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-card .trend {
    font-size: 0.75rem;
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.stat-card .trend.up {
    color: var(--success);
}

.stat-card .trend.down {
    color: var(--error);
}

/* ================================================
   TABLES
   ================================================ */

.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.table-header h2 {
    margin: 0;
    font-size: 1rem;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    white-space: nowrap;
}

td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--surface-hover);
}

td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
}

/* Table actions */
.table-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.btn-table-action {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-table-action:hover {
    background: var(--bg);
    color: var(--primary);
}

.btn-table-action svg {
    width: 18px;
    height: 18px;
}

/* Legacy btn-icon support */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    text-decoration: none !important;
    font-size: 1rem;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ================================================
   BADGES
   ================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge svg {
    width: 12px;
    height: 12px;
}

.badge-descargado {
    background: var(--info-light);
    color: var(--info-dark);
}

.badge-procesado {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-error {
    background: var(--error-light);
    color: var(--error-dark);
}

.badge-pi {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-seminario {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-sin-tipo {
    background: var(--bg-alt);
    color: var(--text-secondary);
}

.badge-enviado {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-pendiente {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-generado {
    background: var(--info-light);
    color: var(--info-dark);
}

/* ================================================
   BUTTONS
   ================================================ */

.actions {
    margin-bottom: var(--space-5);
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--error);
    color: white;
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
}

.btn:disabled,
.btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ================================================
   FORMS & FILTERS
   ================================================ */

.filters {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filter-group label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filters select,
.filters input[type="text"],
.filters input[type="number"],
.filters input[type="date"] {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Search input with icon */
.search-input {
    position: relative;
}

.search-input svg {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input input {
    padding-left: 40px !important;
    min-width: 200px;
}

/* Inline form */
.inline-form {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    flex-wrap: wrap;
}

.inline-form label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.inline-form select,
.inline-form input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
}

/* Generate actions panel */
.generate-actions {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.generate-actions .inline-form {
    background: var(--bg);
    padding: var(--space-3);
    border-radius: var(--radius);
}

.generate-actions .actions-row {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ================================================
   DETAIL PAGE
   ================================================ */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.detail-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.detail-item .value {
    font-size: 0.9375rem;
    color: var(--text);
}

.content-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.content-block h2 {
    font-size: 1rem;
    margin-bottom: var(--space-4);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.content-block h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.content-block pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    padding: var(--space-4);
    border-radius: var(--radius);
    max-height: 500px;
    overflow-y: auto;
}

/* Report content */
.report-content {
    line-height: 1.8;
    padding: var(--space-4);
    background: var(--bg);
    border-radius: var(--radius);
}

.report-content h2 {
    margin-top: var(--space-4);
    font-size: 1.125rem;
}

.report-content h3 {
    margin-top: var(--space-3);
    font-size: 1rem;
}

.report-content ul {
    margin-left: var(--space-6);
    margin-bottom: var(--space-3);
}

/* ================================================
   STATUS MESSAGES & ALERTS
   ================================================ */

.status-msg {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.status-msg svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.status-msg.success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid #a7f3d0;
}

.status-msg.error {
    background: var(--error-light);
    color: var(--error-dark);
    border: 1px solid #fecaca;
}

.status-msg.warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid #fde68a;
}

.status-msg.info {
    background: var(--info-light);
    color: var(--info-dark);
    border: 1px solid #bfdbfe;
}

/* ================================================
   LOADING STATES
   ================================================ */

.loading {
    text-align: center;
    padding: var(--space-12);
    color: var(--text-secondary);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    gap: var(--space-4);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-2);
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 100px;
    border-radius: var(--radius-lg);
}

/* ================================================
   EMPTY STATES
   ================================================ */

.empty {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-secondary);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: var(--space-6);
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 280px;
    max-width: 400px;
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--error); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    padding: var(--space-1);
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--bg);
    color: var(--text);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* ================================================
   ADMIN PAGE
   ================================================ */

.admin-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.admin-section h2 {
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.admin-section h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 1024px) {
    nav {
        padding: 0 var(--space-4);
    }

    main {
        padding: var(--space-4);
    }
}

@media (max-width: 768px) {
    /* Mobile navigation */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: var(--space-2);
        display: none;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: var(--space-3) var(--space-4);
    }

    .user-info {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .user-email {
        display: none;
    }

    /* Layout */
    main {
        padding: var(--space-4) var(--space-3);
    }

    h1 {
        font-size: 1.25rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    /* Tables */
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }

    /* Forms */
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        flex: 1;
    }

    .generate-actions .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .generate-actions .inline-form label {
        margin-bottom: var(--space-1);
    }

    /* Detail grid */
    .detail-grid {
        grid-template-columns: 1fr;
    }

    /* Toast */
    .toast-container {
        left: var(--space-3);
        right: var(--space-3);
        bottom: var(--space-3);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

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

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================
   UTILITIES
   ================================================ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }

/* Hide admin-only elements via JS */
.admin-only {
    /* Shown by default, hidden via JS for non-admin users */
}
