/* Eduquest 2026 interface refresh.
   Loaded after legacy page styles to preserve markup and database workflows. */
:root {
    --color-primary: var(--primary-color, #087b78);
    --color-secondary: var(--secondary-color, #07545a);
    --color-accent: #e9ad26;
    --color-success: #177245;
    --color-warning: #8a5a00;
    --color-danger: #9b1c2d;
    --color-info: #12647a;
    --color-background: #f4f7f6;
    --color-surface: #ffffff;
    --color-border: #dce8e5;
    --color-text: #17312f;
    --color-text-secondary: #60716f;
    --space-xs: .25rem;
    --space-sm: .5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --font-size-sm: .875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-weight-regular: 400;
    --font-weight-semibold: 650;
    --font-weight-bold: 750;
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    --primary: var(--primary-color, #087b78);
    --primary-dark: var(--secondary-color, #07545a);
    --primary-light: #e7f6f4;
    --secondary: #173f48;
    --secondary-dark: #0c3038;
    --accent: #e9ad26;
    --accent-soft: #fff6dc;
    --surface: #ffffff;
    --surface-muted: #f3f7f6;
    --ink: #17312f;
    --ink-muted: #60716f;
    --border: #dce8e5;
    --border-strong: #c6d7d3;
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(9, 52, 51, 0.05);
    --shadow-md: 0 12px 30px rgba(9, 52, 51, 0.08);
    --shadow-lg: 0 24px 60px rgba(9, 52, 51, 0.14);
}

.eq-actions,
.page-actions { display:flex; flex-wrap:wrap; gap:var(--space-sm); }

.eq-form-grid,
.form-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));
    gap:var(--space-md);
}

.eq-empty-state,
.empty-state {
    padding:clamp(2rem,7vw,4rem) var(--space-lg);
    text-align:center;
    color:var(--color-text-secondary);
    background:var(--color-surface);
    border:1px dashed var(--border-strong);
    border-radius:var(--radius-md);
}

.eq-table-scroll,
.table-responsive {
    max-width:100%;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
}

label { display:inline-block; margin-bottom:var(--space-xs); color:var(--color-text); font-weight:var(--font-weight-semibold); }
.required-indicator, .field-error, [aria-invalid="true"] + .help-text { color:var(--color-danger); }
[aria-invalid="true"] { border-color:var(--color-danger) !important; }

.skip-link {
    position:fixed; z-index:9999; top:var(--space-sm); left:var(--space-sm);
    padding:.7rem 1rem; color:#fff; background:#07545a;
    border-radius:var(--radius-xs); transform:translateY(-160%);
}
.skip-link:focus { transform:translateY(0); }

@media (forced-colors: active) {
    .btn, button, .card, .alert { border:1px solid ButtonText !important; }
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 92% 2%, rgba(233, 173, 38, 0.11), transparent 24rem),
        #f4f7f6;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-family: Poppins, Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

a {
    color: var(--primary);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: rgba(233, 173, 38, 0.35);
    color: var(--secondary-dark);
}

.dashboard-container {
    min-height: calc(100vh - 72px);
}

.main-content {
    background: transparent !important;
    padding: 88px 16px 28px;
}

@media (min-width: 992px) {
    .main-content {
        padding: 30px clamp(24px, 3vw, 48px) 48px;
    }
}

.header {
    min-height: 72px;
    padding: 12px clamp(16px, 3vw, 36px);
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid rgba(198, 215, 211, 0.85);
    box-shadow: 0 8px 26px rgba(9, 52, 51, 0.05) !important;
    backdrop-filter: blur(14px);
}

.header-logo {
    gap: 13px;
    min-width: 0;
}

.header-logo img {
    width: auto;
    height: 48px;
    max-width: 172px;
    max-height: 48px !important;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(198, 215, 211, 0.55);
}

.header-logo h1 {
    color: var(--primary) !important;
    font-size: 1.08rem;
    font-weight: 700;
}

.header-logo p {
    color: var(--ink-muted);
    font-size: 0.72rem;
}

.sidebar {
    color: #ecfffc;
    background:
        radial-gradient(circle at 8% 0%, rgba(233, 173, 38, 0.22), transparent 15rem),
        linear-gradient(180deg, #0a4f54 0%, #073b43 100%) !important;
    border-right: 0 !important;
    box-shadow: 18px 0 50px rgba(8, 55, 61, 0.11) !important;
}

.sidebar-header {
    min-height: 76px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sidebar-logo {
    min-width: 0;
}

.sidebar-logo-img {
    max-width: 176px;
    max-height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.18));
}

.logo-icon {
    background: var(--accent) !important;
    color: var(--secondary-dark) !important;
}

.logo-text,
.sidebar .user-name,
.sidebar .nav-text {
    color: #f4fffd !important;
}

.sidebar-user {
    margin: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.075) !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    border-radius: var(--radius-md);
}

.user-avatar {
    background: var(--accent) !important;
    color: var(--secondary-dark) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.user-role {
    color: rgba(236, 255, 252, 0.72) !important;
}

.nav-divider,
.sidebar-version {
    color: rgba(236, 255, 252, 0.55) !important;
}

.nav-item a {
    min-height: 44px;
    color: rgba(244, 255, 253, 0.82) !important;
    border: 1px solid transparent;
}

.nav-item a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active a {
    color: var(--secondary-dark) !important;
    background: var(--accent) !important;
    box-shadow: 0 8px 22px rgba(233, 173, 38, 0.22);
}

.nav-item.active .nav-text {
    color: var(--secondary-dark) !important;
    font-weight: 700;
}

.sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar-footer .logout {
    color: #ffd7d7 !important;
}

.mobile-menu-toggle,
.menu-toggle {
    width: 46px;
    height: 46px;
    padding: 0;
    background: var(--primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--shadow-md);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.5vw, 2.35rem);
    color: var(--secondary-dark);
}

.page-header p {
    margin: 7px 0 0;
    color: var(--ink-muted);
}

.card,
.section-card,
.quiz-card,
.result-card,
.attempt-card,
.stat-card,
.filter-bar,
.table-responsive {
    background: rgba(255, 255, 255, 0.97) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
}

.card,
.section-card,
.quiz-card,
.result-card,
.attempt-card {
    padding: clamp(16px, 2.3vw, 24px);
}

.card:hover,
.section-card:hover,
.quiz-card:hover {
    border-color: var(--border-strong) !important;
    box-shadow: var(--shadow-md) !important;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    text-align: left;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent);
}

.stat-value,
.stat-number {
    color: var(--primary-dark) !important;
    font-family: Poppins, Inter, sans-serif;
    font-weight: 700;
}

.card-header {
    border-bottom-color: var(--border) !important;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    color: var(--ink-muted);
    background: var(--surface-muted) !important;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

td {
    color: var(--ink);
    border-bottom-color: var(--border) !important;
}

tbody tr:hover {
    background: #f8fbfa;
}

.btn,
button,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-warning,
.btn-success,
.btn-small,
.btn-logout,
.print-btn {
    min-height: 42px;
    border-radius: 11px !important;
    font-weight: 650;
    letter-spacing: -0.01em;
    box-shadow: none;
}

.btn-primary,
.btn-success {
    color: #ffffff !important;
    background: var(--primary) !important;
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 8px 20px rgba(8, 123, 120, 0.2);
}

.btn-secondary {
    color: var(--secondary-dark) !important;
    background: var(--accent-soft) !important;
    border-color: rgba(233, 173, 38, 0.42) !important;
}

.btn-warning {
    color: var(--secondary-dark) !important;
    background: var(--accent) !important;
}

.btn-danger,
.btn-logout {
    color: #9b1c2d !important;
    background: #fff0f1 !important;
    border-color: #ffd5da !important;
}

.form-control,
input,
select,
textarea {
    min-height: 44px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(8, 123, 120, 0.12) !important;
}

.badge,
.status-badge {
    border-radius: 999px;
    font-weight: 700;
}

.alert,
.success-message,
.error-message,
.warning-message {
    border: 1px solid currentColor;
    border-left-width: 4px;
    border-radius: 12px;
}

:focus-visible {
    outline: 3px solid rgba(233, 173, 38, 0.75);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .header-logo img {
        height: 42px;
        max-width: 134px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .card,
    .section-card,
    .quiz-card,
    .result-card,
    .attempt-card {
        border-radius: 14px !important;
    }

    .table-responsive {
        margin-inline: -4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 2026 usability polish: consistent hierarchy, readable forms, and restrained
   iconography across legacy role pages. */
.page-eyebrow {
    margin: 0 0 .35rem !important;
    color: var(--primary) !important;
    font-size: .75rem !important;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.page-actions,
.action-buttons,
.report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

.section-intro,
.help-text,
.optional-label {
    color: var(--ink-muted);
    font-size: .875rem;
}

.optional-label {
    font-weight: 500;
}

.section-card > h2:first-child,
.section-card > h3:first-child,
.card > h2:first-child,
.card > h3:first-child {
    margin-top: 0;
}

.section-card > h2,
.section-card > h3 {
    font-size: 1.08rem;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    margin-bottom: .42rem;
}

textarea {
    min-height: 112px;
    line-height: 1.55;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #83918f;
    opacity: 1;
}

button,
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding-inline: 1rem;
    text-decoration: none;
}

button:disabled,
.btn:disabled,
[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
}

.data-table thead th,
.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td,
.data-table th {
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .25rem .7rem;
}

.success-message {
    color: #0d5d39;
    background: #ecfaf2 !important;
}

.error-message {
    color: #8a1c2d;
    background: #fff2f3 !important;
}

.info-box,
.recipient-info {
    color: var(--ink);
    background: #eef8f7 !important;
    border: 1px solid #cde5e1;
    border-left: 4px solid var(--primary);
}

.empty-state-icon {
    display: block;
    margin: 0 auto 1rem;
    color: var(--primary);
    font-size: 2rem;
}

.report-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.report-detail-section p {
    margin-bottom: 0;
    color: var(--ink);
    line-height: 1.75;
}

.site-footer {
    background: #0a343a !important;
}

.site-footer a {
    color: #d8efeb !important;
}

.site-footer a:hover {
    color: #ffffff !important;
}

@media (max-width: 767px) {
    .page-actions,
    .action-buttons,
    .report-actions {
        width: 100%;
    }

    .page-actions > *,
    .action-buttons > *,
    .report-actions > * {
        flex: 1 1 auto;
    }

    .report-detail-grid {
        grid-template-columns: 1fr;
    }
}
