:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --danger: #ef4444;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

* {
    box-sizing: border-box;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f1f5f9;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.layout {
    display: flex;
    min-height: 100vh;
    max-width: 100%;
    overflow: hidden;
}

.content {
    flex: 1;
    padding: 24px;
    min-width: 0;
    background: #f8fafc;
    box-sizing: border-box;
    overflow-x: hidden;
    width: calc(100% - 240px);
    max-width: calc(100vw - 240px);
}

@media (max-width: 1024px) {
    .content {
        width: calc(100% - 200px);
        max-width: calc(100vw - 200px);
    }
}

@media (max-width: 768px) {
    .content {
        width: 100%;
        max-width: 100vw;
    }
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

a {
    color: #0f4c81;
    text-decoration: none;
}

.sidebar {
    width: 240px;
    background: #0f172a;
    color: #fff;
    padding: 24px 18px;
    flex-shrink: 0;
}

.brand h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    color: #fff;
}

.brand p {
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
}

.brand-logo {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.brand-logo-image {
    width: 84px;
    height: auto;
    display: block;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #cbd5e1;
}

.brand-tagline {
    margin-top: 3px;
    font-size: 12px;
    color: #f8fafc;
    font-weight: 600;
}

.login-logo {
    display: block;
    width: min(320px, 100%);
    height: auto;
    margin: 0 auto 18px;
}

.receipt-logo {
    width: min(320px, 100%);
    height: auto;
    margin-bottom: 12px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
}

.nav a {
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: block;
}

.nav a:hover {
    background: #1e293b;
    color: #fff;
}

.topbar {
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.accordion {
    display: grid;
    gap: 14px;
}

.accordion-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid #dbe4f0;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.accordion-panel.is-open {
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(15, 76, 129, 0.12);
}

.accordion-panel.is-open .accordion-trigger {
    background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.accordion-trigger {
    width: 100%;
    border: none;
    background: #fff;
    color: #0f172a;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.accordion-trigger:hover {
    background: #f8fbff;
}

.accordion-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.accordion-subtitle {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
}

.accordion-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #dbeafe;
    color: #0f4c81;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.22s ease, background 0.22s ease;
    flex-shrink: 0;
}

.accordion-panel.is-open .accordion-icon {
    transform: rotate(180deg);
    background: #bfdbfe;
}

.accordion-body {
    padding: 0 20px 20px;
    overflow: hidden;
    transition: max-height 0.22s ease;
}

.accordion-body[hidden] {
    display: block;
}

.accordion-panel.is-collapsed .accordion-body {
    padding-top: 0;
    padding-bottom: 0;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.catalog-group {
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.catalog-group h4 {
    margin: 0 0 12px;
    color: #0f4c81;
    font-size: 18px;
}

.catalog-group p {
    margin: 0 0 10px;
    line-height: 1.5;
}

.hero-note {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.hero-note strong {
    color: #0f4c81;
}

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.dashboard-toolbar .field {
    min-width: 180px;
    flex: 1;
}

.kpi-note {
    margin-top: 12px;
    color: #475569;
    font-size: 14px;
}

.grid {
    display: grid;
    gap: 20px;
}

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

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

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

.stat h3 {
    margin: 0 0 10px;
    color: #475569;
    font-size: 15px;
}

.stat p {
    margin: 0;
    font-size: 30px;
    font-weight: bold;
}

.chart-card {
    min-height: 360px;
}

.chart-wrap {
    position: relative;
    height: 300px;
    width: 100%;
}

.page-container {
    display: grid;
    gap: 22px;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
    justify-content: space-between;
}

.page-header h1 {
    margin: 0;
    font-size: 34px;
    line-height: 1.1;
    color: var(--slate-900);
}

.page-header p {
    margin: 6px 0 0;
    max-width: 760px;
    color: var(--slate-500);
    font-size: 15px;
}

.settings-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    padding: 28px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.26), transparent 28%),
        radial-gradient(circle at bottom left, rgba(251, 191, 36, 0.20), transparent 24%),
        linear-gradient(135deg, #0f172a 0%, #15314f 44%, #1d4f91 100%);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    color: #fff;
    min-width: 0;
}

.settings-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent 55%);
    pointer-events: none;
}

.settings-hero-copy,
.settings-hero-steps {
    position: relative;
    z-index: 1;
}

.settings-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-hero-copy h2 {
    margin: 16px 0 12px;
    font-size: 34px;
    line-height: 1.15;
    max-width: 760px;
}

.settings-hero-copy p {
    margin: 0;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 15px;
    line-height: 1.65;
}

.settings-hero-steps {
    display: grid;
    gap: 12px;
    align-content: center;
}

.settings-step-card {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.settings-step-card strong {
    display: block;
    margin-top: 6px;
    font-size: 16px;
}

.settings-step-card p {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.5;
}

.settings-step-index {
    display: inline-flex;
    min-width: 42px;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fde68a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.users-hero {
    background:
        radial-gradient(circle at top right, rgba(196, 181, 253, 0.22), transparent 24%),
        radial-gradient(circle at bottom left, rgba(147, 197, 253, 0.24), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #17365d 46%, #0f4c81 100%);
}

.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.settings-summary-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.settings-summary-card:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.settings-summary-label {
    display: block;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.settings-summary-value {
    display: block;
    color: var(--slate-900);
    font-size: 28px;
    line-height: 1;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px;
    background: #eaf1fb;
    border: 1px solid #d7e1ef;
    border-radius: 16px;
}

.tab-btn {
    background: transparent;
    color: var(--slate-600);
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: none;
    transform: none;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: none;
    transform: none;
}

.tab-btn.active {
    background: linear-gradient(135deg, #0f4c81, #2563eb);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.settings-inline-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #dbe4f0;
    color: var(--slate-600);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.settings-inline-note strong {
    color: #0f4c81;
}

.users-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.users-role-card {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.users-role-card h3 {
    margin: 0 0 8px;
    color: var(--slate-900);
    font-size: 18px;
}

.users-role-card p {
    margin: 0;
    color: var(--slate-600);
    font-size: 14px;
    line-height: 1.6;
}

.users-role-card--accent {
    background: linear-gradient(180deg, #eff6ff, #f8fbff);
    border-color: #bfdbfe;
}

.users-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.users-help-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef5ff;
    color: #0f4c81;
    font-size: 13px;
    font-weight: 600;
}

.settings-section-intro {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: space-between;
}

.settings-section-intro h2 {
    margin: 0;
    color: var(--slate-900);
    font-size: 24px;
}

.settings-section-intro p {
    margin: 0;
    color: var(--slate-500);
    max-width: 720px;
}

.settings-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.settings-card-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: var(--slate-900);
}

.card-subtitle {
    margin: 0;
    color: var(--slate-500);
    font-size: 14px;
    max-width: 620px;
}

.form-stack {
    display: grid;
    gap: 16px;
}

.compact-form {
    align-content: start;
}

.form-group {
    min-width: 0;
}

.form-input,
.form-select {
    width: 100%;
}

.form-input--short {
    max-width: 130px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 28px;
}

.checkbox-group input {
    width: auto;
    margin: 0;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: #fff;
}

.data-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef5ff;
    color: var(--slate-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table tbody tr:nth-child(even) td {
    background: #fbfdff;
}

.data-table tbody tr:hover td {
    background: #f7fbff;
}

.data-table td {
    vertical-align: middle;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 8px 8px 0;
}

.inline-form--wrap {
    max-width: 100%;
}

.users-table-wrap {
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: #fff;
    margin-top: 14px;
}

.users-data-table {
    min-width: 920px;
}

.users-name-cell {
    display: grid;
    gap: 4px;
}

.users-username-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 600;
}

.users-edit-form {
    min-width: min(520px, 100%);
    background: #f8fbff;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    padding: 16px;
}

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

.registry-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.registry-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: #eef5ff;
    color: #0f4c81;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #dbeafe;
}

.settings-seat-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.settings-seat-preview > div {
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.settings-seat-preview span {
    display: block;
    color: var(--slate-500);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-seat-preview strong {
    display: block;
    margin-top: 6px;
    color: var(--slate-900);
    font-size: 22px;
}

.timeline {
    position: relative;
    display: grid;
    gap: 16px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dbe4f0;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 14px;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #0f4c81;
    border: 4px solid #dbeafe;
    position: relative;
    z-index: 1;
    margin-top: 3px;
}

.timeline-content {
    background: #f8fbff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    padding: 12px 14px;
}

.timeline-content p {
    margin: 8px 0 0;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: #64748b;
    font-size: 13px;
}

.btn,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f4c81;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary {
    background: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #64748b;
}

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

/* Import page stats */
.import-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.import-stat {
    background: var(--slate-50);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--slate-200);
    transition: all 0.2s ease;
}

.import-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.import-stat strong {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--slate-800);
    line-height: 1.2;
}

.import-stat span {
    font-size: 13px;
    color: var(--slate-500);
    margin-top: 4px;
    display: block;
}

.import-stat.ready {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    border-color: var(--success);
}

.import-stat.ready strong {
    color: var(--success);
}

.import-stat.duplicate {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: var(--warning);
}

.import-stat.invalid {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: var(--danger);
}

/* Form styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    margin: 0 0 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-title:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 2px;
}

.form-field {
    margin-bottom: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--slate-700);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-600);
    margin-bottom: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--slate-200);
    margin-top: 24px;
}

.form-actions,
.form-actions-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-remove {
    padding: 8px 16px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-add {
    padding: 14px 24px;
    background: var(--slate-50);
    color: var(--slate-500);
    border: 2px dashed var(--slate-200);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    display: block;
    box-sizing: border-box;
}

.btn-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

/* Responsive */
@media (max-width: 1024px) {
    .settings-hero {
        grid-template-columns: 1fr;
    }

    .settings-hero .settings-hero-steps,
    .settings-hero .admissions-step-grid,
    .settings-hero .reports-step-grid {
        grid-template-columns: 1fr;
    }

    .settings-hero-copy h2 {
        font-size: 30px;
    }

    .form-row,
    .form-row-3,
    .form-row-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-seat-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .settings-hero .settings-hero-steps,
    .settings-hero .admissions-step-grid,
    .settings-hero .reports-step-grid {
        grid-template-columns: 1fr;
    }

    .settings-hero {
        padding: 20px;
    }

    .settings-hero-copy h2 {
        font-size: 24px;
    }
}

.admissions-step-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .form-row,
    .form-row-3,
    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .settings-hero {
        padding: 20px;
        border-radius: 18px;
    }

    .settings-hero-copy h2 {
        font-size: 24px;
    }

    .settings-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tab-btn {
        width: 100%;
    }

    .settings-seat-preview {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-danger {
    background: #b91c1c;
}

.btn-success {
    background: #15803d;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eff6ff;
}

form .row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

form .row > div {
    flex: 1 1 220px;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.filters,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0 0;
}

.pagination-form,
.pagination-links,
.pagination-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pagination-summary {
    color: #475569;
    font-size: 14px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #dc3545;
    color: #fff;
}

.badge-purple {
    background: #6f42c1;
    color: #fff;
}

.badge-primary {
    background: #007bff;
    color: #fff;
}

.badge-info {
    background: #17a2b8;
    color: #fff;
}

.badge-warning {
    background: #ffc107;
    color: #1f2937;
}

.badge-secondary {
    background: #6c757d;
    color: #fff;
}

.badge-inactive {
    background: #e2e8f0;
    color: #475569;
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-form {
    display: inline-flex;
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    color: #0f4c81;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.link-button:hover {
    text-decoration: underline;
}

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

.btn-outline:hover {
    background: var(--slate-100);
    color: var(--slate-800);
    box-shadow: none;
    transform: none;
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-form input,
.filter-form select {
    padding: 10px 12px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
}

.filter-form input[type="text"],
.filter-form input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000;
    padding: 24px;
}

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

.modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 18px;
    width: min(560px, 100%);
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    border: 1px solid #dbe4f0;
}

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

.modal-body {
    display: grid;
    gap: 14px;
}

.close {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: var(--slate-500);
}

.master-inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.master-inline-form input[type="text"] {
    flex: 1 1 240px;
    min-width: 0;
}

.master-inline-form .toggle-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-600);
    font-size: 13px;
    font-weight: 600;
}

.stack-gap-lg {
    margin-top: 24px;
}

.inline-form input[type="text"] {
    min-width: 220px;
}

details summary {
    cursor: pointer;
    color: #0f4c81;
    font-weight: bold;
}

.edit-branch-form {
    min-width: 420px;
    margin-top: 12px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.muted {
    color: #64748b;
    font-size: 13px;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: #0f4c81;
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .topbar {
        padding-left: 50px;
        padding-right: 50px;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        width: 85%;
    }
    
    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }
    
    .grid {
        gap: 12px;
    }
    
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    form .row {
        flex-direction: column;
        gap: 12px;
    }
    
    form .row > div {
        width: 100%;
    }

    .card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 12px;
        min-width: 600px;
    }

    h1, h2, h3 {
        font-size: 18px;
    }

    .accordion-trigger {
        padding: 14px;
        font-size: 14px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .search-bar {
        flex-direction: column;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .actions {
        flex-direction: column;
    }

    .topbar h1 {
        font-size: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Module card styles */
.module-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--slate-200);
    margin-bottom: 24px;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.module-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--slate-800);
}

.module-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 2px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 24px;
}

.filter-bar .field {
    flex: 1;
    min-width: 150px;
}

.filter-bar label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-600);
    margin-bottom: 6px;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: var(--slate-700);
    transition: border-color 0.2s;
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-bar .btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.filter-bar .btn-secondary {
    background: var(--slate-100);
    color: var(--slate-600);
}

.filter-bar .btn-secondary:hover {
    background: var(--slate-200);
}

/* Stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--slate-200);
    transition: all 0.2s ease;
}

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

.stat-card.blue { border-left: 4px solid var(--primary); }
.stat-card.green { border-left: 4px solid var(--success); }
.stat-card.yellow { border-left: 4px solid var(--warning); }
.stat-card.purple { border-left: 4px solid var(--purple); }

.stat-card h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--slate-900);
}

.stat-card p small {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-500);
}

/* Action cards grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.action-card .icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card .icon.primary { background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.action-card .icon.success { background: linear-gradient(135deg, var(--success), #059669); }
.action-card .icon.warning { background: linear-gradient(135deg, var(--warning), #d97706); }
.action-card .icon.purple { background: linear-gradient(135deg, var(--purple), #7c3aed); }
.action-card .icon.danger { background: linear-gradient(135deg, var(--danger), #dc2626); }

.action-card span {
    color: #1e293b;
    font-weight: 600;
    font-size: 15px;
}

/* Search card */
.search-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.search-card h2 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.search-card p {
    margin: 4px 0 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.search-card input {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.search-card .btn {
    padding: 14px 28px;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

/* Table improvements */
.module-card table {
    width: 100%;
    border-collapse: collapse;
}

.module-card th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--slate-100);
}

.module-card td {
    padding: 14px 12px;
    font-size: 14px;
    color: var(--slate-700);
    border-bottom: 1px solid var(--slate-100);
}

.module-card tr:hover td {
    background: var(--slate-50);
}

.module-card .badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--slate-100);
    color: var(--slate-600);
}

.module-card .badge.success { background: #d1fae5; color: #065f46; }
.module-card .badge.warning { background: #fef3c7; color: #92400e; }
.module-card .badge.primary { background: #dbeafe; color: #1e40af; }
.module-card .badge.purple { background: #ede9fe; color: #5b21b6; }
.module-card .badge.danger { background: #fee2e2; color: #991b1b; }

/* Responsive */
@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar .field {
        width: 100%;
    }
}

/* Mobile sidebar */
@media (max-width: 1024px) {
    .layout {
        flex-wrap: wrap;
    }
    
    .sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content {
        width: 100%;
        padding: 16px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
}
