/* ══════════════════════════════════════════════
   Sistem Pendaftaran TKA 2026
   SMK Negeri 1 Cipeundeuy
   Design System — v2.0
   ══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    /* Color — Primary */
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-dark: #1e3a8a;

    /* Color — Accent */
    --accent: #ca8a04;
    --accent-hover: #a16207;

    /* Color — Neutral */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;

    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Color — Semantic */
    --success: #059669;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;
    --error: #dc2626;
    --error-light: #fef2f2;
    --error-border: #fecaca;
    --info: #0284c7;
    --info-light: #f0f9ff;
    --info-border: #bae6fd;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);

    /* Layout */
    --sidebar-width: 256px;
    --topbar-height: 56px;
    --container-max: 1200px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}


/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

body {
    width: 100%;
    max-width: 100%;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

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

img { max-width: 100%; height: auto; }

/* ── Scrollbar (subtle) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ════════════════════════════════════════
   UTILITY CLASSES
   (replaces Tailwind CDN)
   ════════════════════════════════════════ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

/* Gap */
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Spacing */
.p-0 { padding: 0; }
.p-2 { padding: var(--sp-2); }
.p-3 { padding: var(--sp-3); }
.p-4 { padding: var(--sp-4); }
.p-5 { padding: var(--sp-5); }
.p-6 { padding: var(--sp-6); }
.p-8 { padding: var(--sp-8); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.px-5 { padding-left: var(--sp-5); padding-right: var(--sp-5); }
.px-6 { padding-left: var(--sp-6); padding-right: var(--sp-6); }
.py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.py-3 { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }
.py-6 { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
.py-8 { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.py-12 { padding-top: var(--sp-12); padding-bottom: var(--sp-12); }
.py-16 { padding-top: var(--sp-16); padding-bottom: var(--sp-16); }
.pb-3 { padding-bottom: var(--sp-3); }
.pb-4 { padding-bottom: var(--sp-4); }
.pt-2 { padding-top: var(--sp-2); }
.pt-20 { padding-top: 80px; }
.pt-24 { padding-top: 96px; }

.m-0 { margin: 0; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.mt-12 { margin-top: var(--sp-12); }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-10 { margin-bottom: var(--sp-10); }
.mr-auto { margin-right: auto; }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-7xl { max-width: 1280px; }
.min-w-200 { min-width: 200px; }

/* Typography */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: var(--leading-tight); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.font-mono { font-family: var(--font-mono); }

/* Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-inverse { color: var(--text-inverse); }
.text-accent-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

.bg-page { background: var(--bg-page); }
.bg-surface { background: var(--bg-surface); }
.bg-subtle { background: var(--bg-subtle); }
.bg-primary { background: var(--primary); }
.bg-primary-dark { background: var(--primary-dark); }

/* Border */
.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Shadow */
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* Object */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Misc */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.space-y-2 > * + * { margin-top: var(--sp-2); }
.space-y-3 > * + * { margin-top: var(--sp-3); }
.space-y-4 > * + * { margin-top: var(--sp-4); }
.space-y-6 > * + * { margin-top: var(--sp-6); }

/* Container */
.container {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
}

/* Responsive grid */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:inline { display: inline; }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:inline { display: inline; }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* ════════════════════════════════════════
   COMPONENT STYLES
   ════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.25;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    outline: none;
}
.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary);
}
.btn:disabled, .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--text-inverse); }

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
    border-color: var(--success);
}
.btn-success:hover { background: #047857; color: var(--text-inverse); }

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

.btn-danger-fill {
    background: var(--error);
    color: var(--text-inverse);
    border-color: var(--error);
}
.btn-danger-fill:hover { background: #b91c1c; }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg-subtle); color: var(--text-primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: var(--text-xs); }
.btn-lg { padding: 10px 20px; font-size: var(--text-sm); }

.btn-icon {
    padding: 6px;
    width: 32px;
    height: 32px;
}
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }
.btn-icon svg { width: 16px; height: 16px; }


/* ── Form Controls ── */
.form-group { margin-bottom: var(--sp-4); }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}

.form-control,
.form-select {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}
.form-control::placeholder {
    color: var(--text-tertiary);
}
.form-control.is-invalid {
    border-color: var(--error);
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-helper {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--sp-1);
}
.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--sp-1);
}

.form-required::after {
    content: " *";
    color: var(--error);
}


/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1.5;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--error-light); color: var(--error); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }


/* ── Data Table ── */
.data-table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
}
.table-toolbar-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-right: auto;
}
.table-filters {
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-page);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr:hover {
    background: var(--bg-page);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-1);
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    list-style: none;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: var(--text-sm);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--transition-fast);
}
.pagination a {
    color: var(--text-secondary);
}
.pagination a:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.pagination .active {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
}
.pagination .disabled {
    color: var(--text-tertiary);
    pointer-events: none;
}


/* ── Stat Card (dashboard) ── */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}
.stat-card .stat-content {
    flex: 1;
}
.stat-card .stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}
.stat-card .stat-number {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 4px;
}
.stat-card .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.stat-card.blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.green .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.orange .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.red .stat-icon { background: var(--error-light); color: var(--error); }


/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: var(--sp-5);
    right: var(--sp-5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease;
    border: 1px solid;
}
.toast.success {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success-border);
}
.toast.error {
    background: var(--error-light);
    color: var(--error);
    border-color: var(--error-border);
}
.toast.warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning-border);
}
.toast.info {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info-border);
}
.toast .toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    font-size: var(--text-lg);
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    line-height: 1;
}
.toast .toast-close:hover { opacity: 1; }

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


/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    animation: fadeIn 0.15s ease;
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalScaleIn 0.2s ease;
}
.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-2);
}
.modal-body {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--sp-6);
}
.modal-footer {
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalScaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* ════════════════════════════════════════
   LAYOUT — PUBLIC NAVBAR
   ════════════════════════════════════════ */
.navbar-public {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition-base);
}
.navbar-public.scrolled {
    box-shadow: var(--shadow-sm);
}
.navbar-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
}
.logo-grid {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.logo-grid img {
    height: 36px;
    object-fit: contain;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}
.nav-links a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color var(--transition-fast);
    text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}
.mobile-menu a.active {
    color: var(--primary);
    font-weight: 600;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--sp-2);
}
.mobile-menu-btn svg { width: 24px; height: 24px; }

.mobile-menu {
    display: none;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}
.mobile-menu a {
    display: block;
    padding: var(--sp-2) 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
}
.mobile-menu a:hover { color: var(--primary); }

@media (max-width: 767px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
    .mobile-menu.open { display: block; }
    .logo-grid img { height: 28px; }
}


/* ════════════════════════════════════════
   LAYOUT — ADMIN SIDEBAR
   ════════════════════════════════════════ */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: var(--sp-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}
.sidebar-header img {
    height: 36px;
    flex-shrink: 0;
}
.sidebar-header .school-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: #fff;
    line-height: var(--leading-tight);
}
.sidebar-header .school-sub {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.45);
}
.sidebar-close-btn svg { width: 16px; height: 16px; }

.sidebar-nav { padding: var(--sp-3) 0; flex: 1; }

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: var(--sp-4) var(--sp-5) var(--sp-2);
    font-weight: 600;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 8px var(--sp-5);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    margin: 1px 0;
    border-left: 3px solid transparent;
}
.admin-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}
.admin-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 500;
    border-left-color: #fff;
}
.admin-sidebar .nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}
.admin-sidebar .nav-link.active svg {
    opacity: 1;
}


/* ── Admin Main ── */
.admin-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    flex: 1 1 auto;
    min-height: 100vh;
    background: var(--bg-page);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* ── Admin Topbar ── */
.admin-topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0 var(--sp-6);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-topbar .page-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}
.admin-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}
.admin-topbar .user-info {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.admin-topbar .user-info strong {
    color: var(--text-primary);
    font-weight: 600;
}
.sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    width: 34px;
    height: 34px;
    color: var(--text-secondary);
    margin-right: var(--sp-3);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: var(--bg-subtle);
    color: var(--primary);
    border-color: var(--primary);
}
.sidebar-toggle svg { width: 18px; height: 18px; }

.admin-content {
    padding: var(--sp-6);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 49;
}
.sidebar-overlay.active { display: block; }

/* Desktop Collapsed Sidebar */
@media (min-width: 768px) {
    html.sidebar-collapsed .admin-sidebar,
    body.sidebar-collapsed .admin-sidebar {
        transform: translateX(-100%);
    }
    html.sidebar-collapsed .admin-main,
    body.sidebar-collapsed .admin-main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Mobile Sidebar & Layout */
@media (max-width: 767px) {
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 270px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 999 !important;
        transform: translateX(-105%) !important;
        box-shadow: none !important;
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.28s ease !important;
        visibility: hidden !important;
    }
    .admin-sidebar.open {
        transform: translateX(0) !important;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45) !important;
        visibility: visible !important;
    }
    .sidebar-overlay {
        z-index: 998 !important;
    }
    .admin-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 100% !important;
        box-sizing: border-box !important;
    }
    .admin-topbar {
        padding: 0 14px !important;
        height: 54px !important;
    }
    .admin-topbar .page-title {
        font-size: 0.95rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    .admin-content {
        padding: 14px 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .sidebar-toggle {
        display: inline-flex !important;
    }
}


/* ════════════════════════════════════════
   HERO SECTION (Landing Page)
   ════════════════════════════════════════ */
.hero-section {
    background: var(--primary-dark);
    color: var(--text-inverse);
    padding: 120px 0 64px;
    position: relative;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.06);
}
.hero-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
    text-align: center;
}
.hero-eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--sp-4);
}
.hero-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: var(--sp-4);
}
.hero-desc {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.65);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--sp-8);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .hero-section { padding: 140px 0 80px; }
    .hero-title { font-size: 2.5rem; }
}

@media (max-width: 767px) {
    .hero-section {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: calc(var(--topbar-height) + 20px) 0 32px;
        box-sizing: border-box;
    }
    .hero-inner {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}


/* ── CTA Button (primary action on hero/landing) ── */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--text-inverse);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn-cta:hover {
    background: #f1f5f9;
    color: var(--primary-dark);
}
.btn-cta svg { width: 16px; height: 16px; }

.btn-cta-outline {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: transparent;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.25);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-cta-outline:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}


/* ════════════════════════════════════════
   INFO SECTION (Landing)
   ════════════════════════════════════════ */
.info-section {
    background: var(--bg-surface);
    padding: 64px 0;
}
.info-card {
    padding: var(--sp-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
}
.info-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-3);
}
.info-card ul {
    list-style: none;
    padding: 0;
}
.info-card li {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.check-icon {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}
.dot-icon {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
}

/* ── Steps / Timeline (Landing) ── */
.steps-section {
    background: var(--bg-page);
    padding: 64px 0;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-6);
    position: relative;
}
.step-item {
    text-align: center;
    position: relative;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--sp-3);
}
.step-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}
.step-desc {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

@media (max-width: 767px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .steps-grid { grid-template-columns: 1fr; }
}


/* ════════════════════════════════════════
   REGISTRATION WIZARD / STEPPER
   ════════════════════════════════════════ */
.wizard-header {
    background: var(--primary-dark);
    color: var(--text-inverse);
    padding: 96px 0 var(--sp-8);
    text-align: center;
}
.wizard-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--sp-2);
}
.wizard-header p {
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.6);
}

.stepper {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--sp-8);
    padding: 0 var(--sp-4);
}
.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 180px;
}
.stepper-item::before {
    content: '';
    position: absolute;
    top: 16px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.stepper-item:first-child::before { display: none; }

.stepper-item.completed::before {
    background: var(--success);
}
.stepper-item.active::before {
    background: var(--primary);
}

.stepper-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-xs);
    position: relative;
    z-index: 1;
    transition: all var(--transition-base);
}
.stepper-item.active .stepper-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}
.stepper-item.completed .stepper-circle {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-inverse);
}
.stepper-label {
    margin-top: var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-tertiary);
    text-align: center;
}
.stepper-item.active .stepper-label {
    color: var(--primary);
    font-weight: 600;
}
.stepper-item.completed .stepper-label {
    color: var(--success);
}


/* ── Step Content ── */
.step-content {
    display: none;
    animation: stepFadeIn 0.25s ease;
}
.step-content.active { display: block; }

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

/* ── Wizard Card (replaces glass-card) ── */
.wizard-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}
.wizard-card h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
}
.wizard-card > p:first-of-type {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--sp-6);
}

/* ── Siswa Card (selection) ── */
.siswa-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--bg-surface);
}
.siswa-card:hover {
    border-color: var(--primary);
}
.siswa-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.siswa-card.disabled {
    opacity: 0.45;
    pointer-events: none;
    background: var(--bg-subtle);
}
.siswa-card .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-xs);
    flex-shrink: 0;
}


/* ── Status Option (step 3) ── */
.status-option {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--bg-surface);
}
.status-option:hover {
    border-color: var(--primary);
}
.status-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ── Check Item (mapel) ── */
.check-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
}
.check-item.readonly {
    background: var(--bg-subtle);
    cursor: default;
}


/* ── File Upload ── */
.file-drop-zone {
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-5);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    background: var(--bg-page);
}
.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.file-drop-zone .preview-img {
    max-width: 180px;
    max-height: 180px;
    border-radius: var(--radius);
    margin-top: var(--sp-3);
}


/* ════════════════════════════════════════
   CONFIRMATION PAGE
   ════════════════════════════════════════ */
.confirm-header {
    background: var(--primary-dark);
    color: var(--text-inverse);
    padding: 96px 0 var(--sp-8);
    text-align: center;
}
.confirm-success-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-4);
}
.confirm-success-icon svg { width: 24px; height: 24px; color: #fff; }

.summary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}
.summary-row {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
}
.summary-row:last-child { border-bottom: none; }
.summary-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}
.summary-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: 500;
}


/* ── Thumbnail ── */
.thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border);
}

/* ── Konfirmasi card (legacy compat) ── */
.konfirmasi-card {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
}
.konfirmasi-card:last-child { border-bottom: none; }


/* ── Footer ── */
.site-footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.5);
    padding: var(--sp-8) 0;
    text-align: center;
    font-size: var(--text-xs);
}
.site-footer p + p {
    margin-top: var(--sp-1);
}


/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: var(--sp-4);
}
.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-8);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-sm);
}
.login-card .login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: var(--sp-6);
}
.login-card .login-logo img {
    height: 48px;
}
.login-card h1 {
    font-size: var(--text-xl);
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--sp-1);
}
.login-card .login-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--sp-6);
}


/* ── Section Header (used in admin pages) ── */
.section-header {
    margin-bottom: var(--sp-6);
}
.section-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}
.section-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--sp-1);
}

/* ── Chart wrapper ── */
.chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-sm);
}
.chart-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-light);
}
.chart-card .chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--sp-12) var(--sp-4);
    color: var(--text-tertiary);
}
.empty-state svg {
    width: 40px;
    height: 40px;
    margin-bottom: var(--sp-3);
    opacity: 0.4;
}
.empty-state p {
    font-size: var(--text-sm);
}


/* ══════════════════════════════
   PRINT STYLES
   ══════════════════════════════ */
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .wizard-card, .summary-card { box-shadow: none; border: 1px solid #ddd; }
}


/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 767px) {
    .hero-section { padding: 96px 0 48px; }
    .hero-title { font-size: var(--text-2xl); }

    /* Stat Cards (Dashboard) */
    .stat-card {
        padding: 14px 16px !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .stat-card .stat-content {
        flex: 1 !important;
        min-width: 0 !important;
    }
    .stat-card .stat-label {
        font-size: 0.8rem !important;
        line-height: 1.25 !important;
        color: var(--text-secondary) !important;
    }
    .stat-card .stat-number {
        font-size: 1.6rem !important;
        font-weight: 700 !important;
        margin-top: 2px !important;
        line-height: 1.2 !important;
    }
    .stat-card .stat-icon {
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }
    .stat-card .stat-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Charts */
    .chart-card {
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }
    .chart-card .chart-container {
        height: 240px !important;
    }

    /* General Cards */
    .card,
    .card.p-6 {
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }

    /* Table Toolbar */
    .table-toolbar {
        padding: 12px 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .table-toolbar-title,
    .table-toolbar h2 {
        font-size: 0.95rem !important;
        margin-bottom: 2px !important;
        font-weight: 700 !important;
    }
    .table-toolbar > div,
    .table-toolbar > .flex {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }
    .table-toolbar .btn {
        font-size: 0.76rem !important;
        padding: 6px 12px !important;
        flex: 1 1 auto !important;
        min-width: calc(50% - 6px) !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }
    .table-toolbar form {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: calc(50% - 6px) !important;
    }
    .table-toolbar form .btn {
        width: 100% !important;
    }

    /* Table Filters */
    .table-filters {
        padding: 10px 14px !important;
    }
    .table-filters form {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .table-filters form > div,
    .table-filters form .form-control,
    .table-filters form .form-select,
    .table-filters form select,
    .table-filters form input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .table-filters form .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Data Tables */
    .data-table-wrapper {
        border-radius: 12px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 16px !important;
    }
    .data-table-wrapper[style*="padding"] {
        padding: 12px 14px !important;
    }
    
    .data-table thead th {
        padding: 8px 8px;
        font-size: 0.72rem;
        white-space: nowrap;
        line-height: 1.2;
    }
    .data-table tbody td {
        padding: 8px 8px;
        font-size: 0.78rem;
    }
    .data-table .text-sm, .detail-container .text-sm {
        font-size: 0.76rem !important;
        line-height: 1.4 !important;
    }
    .data-table .text-xs, .detail-container .text-xs {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
    }
    .data-table .btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    .data-table .badge {
        padding: 2px 6px;
        font-size: 0.72rem;
    }

    .data-table td:last-child .flex:not(.btn) {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .stepper-label { font-size: 10px; }
    .stepper-circle { width: 30px; height: 30px; font-size: 11px; }
    .stepper-item { max-width: 100px; }

    .wizard-card { padding: var(--sp-4); }
    .btn-cta { padding: 10px 20px; font-size: var(--text-sm); }
    .toast-container { left: var(--sp-4); right: var(--sp-4); }
    .toast { min-width: auto; }
}

@media (max-width: 480px) {
    .stepper-label { display: none; }
    .stepper-circle { width: 28px; height: 28px; }
    .steps-grid { grid-template-columns: 1fr; }
}

/* -- Modal -- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.show {
    opacity: 1;
    visibility: visible;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: var(--bg-surface);
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.show .modal-content {
    transform: scale(1) translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-light);
}
.modal-body {
    padding: var(--sp-5);
    overflow-y: auto;
}
.modal-footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border-light);
    background: var(--bg-page);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Footer sticky fix */
.site-footer {
    margin-top: auto;
}

/* ── Custom Session Division Modal Styles ── */
.modal-overlay .modal-content.ca-modal-content,
.ca-modal-content {
    max-width: 1080px !important;
    width: 95vw !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}
.ca-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.ca-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ca-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ca-modal-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}
.ca-modal-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}
.ca-modal-body {
    padding: 18px 24px;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ca-toolbar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ca-toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ca-label-inline {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.ca-tracker-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
}
.ca-tracker-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ca-tracker-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ca-class-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.ca-class-pill.pill-pending {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}
.ca-class-pill.pill-partial {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.ca-class-pill.pill-complete {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}
.ca-class-pill.pill-overflow {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
    animation: pulseWarning 1.5s infinite;
}
.ca-session-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.ca-session-header {
    background: #f8fafc;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.ca-session-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #1e293b;
}
.ca-session-badge {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    text-transform: uppercase;
}
.ca-session-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ca-session-stat {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
}
.ca-session-stat.stat-full {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.ca-session-stat.stat-overflow {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.ca-table-wrap {
    overflow-x: auto;
}
.ca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.ca-table th {
    background: #fbfcfe;
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.ca-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.ca-class-row:hover td {
    background: #fafcff;
}
.ca-foot-row td {
    background: #f8fafc !important;
    border-top: 1px solid #cbd5e1;
    font-weight: 700;
    color: #334155;
    padding: 10px 12px;
}
.ca-room-input {
    width: 78px;
    height: 32px;
    padding: 4px 6px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #0f172a;
    transition: all 0.15s ease;
    background: #ffffff;
}
.ca-room-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.ca-room-input.input-overflow {
    border-color: #ef4444 !important;
    background: #fff5f5 !important;
    color: #dc2626 !important;
}
.ca-row-class-select {
    width: 100%;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #1e293b;
    background: #ffffff;
    font-weight: 600;
}
.btn-ca-delete {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.btn-ca-delete:hover {
    color: #ef4444;
    background: #fee2e2;
}
.ca-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}
.ca-footer-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    color: #475569;
}
.ca-footer-summary strong {
    color: #0f172a;
}

