/* ===========================================================
   Student Request — Light theme, mobile-first, RTL
   =========================================================== */

:root {
    color-scheme: light only;

    /* Palette */
    --bg: #eef3f8;
    --bg-alt: #f5f8fb;
    --surface: #ffffff;
    --surface-soft: #f7fafc;
    --border: #dbe3eb;
    --border-strong: #b8c4d0;

    --text: #1a2433;
    --text-soft: #3b4a5d;
    --muted: #5e6e7e;

    --primary: #176b87;
    --primary-hover: #0e5970;
    --primary-soft: #e6f0f4;
    --primary-ring: rgba(23, 107, 135, 0.25);

    --success: #1a7d3d;
    --success-bg: #e8f7ed;
    --success-border: #b9e3c6;

    --error: #b91c1c;
    --error-bg: #fdf0f0;
    --error-border: #f1b8b8;

    --info-bg: #e8f1f6;
    --info-border: #b8d2e0;

    /* Tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(15, 31, 56, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 31, 56, 0.07);
    --shadow-lg: 0 18px 48px rgba(15, 31, 56, 0.14);

    --gap-1: 4px;
    --gap-2: 8px;
    --gap-3: 12px;
    --gap-4: 16px;
    --gap-5: 20px;
    --gap-6: 24px;
    --gap-8: 32px;

    --tap: 44px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light only;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Arial, 'Noto Sans Arabic', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    direction: rtl;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.page {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 16px 14px 32px;
}

.shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-md);
}

.topbar {
    display: flex;
    flex-direction: column;
    gap: var(--gap-3);
    align-items: stretch;
    margin-bottom: var(--gap-5);
    padding-bottom: var(--gap-4);
    border-bottom: 1px solid var(--border);
}

.topbar > div {
    min-width: 0;
}

h1 {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.3;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.muted {
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
    font-size: 13.5px;
}

/* ---------- Form grid: every question is its own row ---------- */

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.field {
    display: grid;
    gap: 10px;
    min-width: 0;
    grid-column: 1 / -1;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color .15s ease, box-shadow .15s ease;
    position: relative;
}

.field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.field.full {
    grid-column: 1 / -1;
}

label,
.field-title {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
    padding: 0;
    line-height: 1.4;
}

.field > label:not(.choice),
.field > .field-title {
    border-inline-start: 3px solid var(--primary);
    padding-inline-start: 10px;
    margin-bottom: 2px;
}

.field .muted {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Inputs (text-like only — preserve native radio/checkbox) ---------- */

input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    min-height: var(--tap);
    padding: 10px 14px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: left 14px top 50%, left 19px top 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-left: 34px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

input[readonly] {
    background: var(--surface-soft);
    color: var(--text);
    cursor: default;
}

input[aria-invalid="true"] {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

/* Native radio / checkbox: keep the OS rendering but bigger + branded color */
input[type="radio"],
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
    -webkit-appearance: auto;
    appearance: auto;
}

/* ---------- Choices (radio / checkbox groups) ---------- */

.choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    min-height: var(--tap);
    background: var(--surface);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    user-select: none;
    line-height: 1.5;
}

.choice:hover {
    background: var(--surface-soft);
    border-color: var(--primary);
}

.choice:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* ---------- Buttons ---------- */

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--gap-6);
}

button,
.button {
    border: 0;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    min-height: var(--tap);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color .15s ease, transform .05s ease;
    width: 100%;
}

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

button:active,
.button:active {
    transform: translateY(1px);
}

.button.secondary {
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.button.secondary:hover {
    background: var(--bg-alt);
}

/* ---------- Notices ---------- */

.notice {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: var(--gap-4);
    line-height: 1.7;
    font-size: 14px;
    border: 1px solid transparent;
}

.notice.info {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--text);
}

.notice.success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.notice.error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.error-text {
    color: var(--error);
    font-size: 13px;
    font-weight: 600;
    min-height: 1em;
}

.error-text:empty {
    display: none;
}

/* ---------- Admin link (used in admin.php topbar) ---------- */

.admin-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    align-self: flex-start;
}

.admin-link:hover {
    background: var(--primary-soft);
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--gap-6) 0;
}

/* ---------- Tables ---------- */

.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: right;
    white-space: nowrap;
}

th {
    background: var(--surface-soft);
    font-weight: 700;
    color: var(--text-soft);
    position: sticky;
    top: 0;
}

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

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

/* ===========================================================
   Custom Date Picker
   =========================================================== */

.date-picker {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
}

.date-picker input {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    padding-inline-end: 12px;
    background: var(--surface);
    cursor: pointer;
}

.date-picker input:focus {
    z-index: 1;
}

.date-picker-toggle {
    flex: 0 0 auto;
    width: var(--tap);
    min-height: var(--tap);
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 0;
    border-start-end-radius: var(--radius-md);
    border-end-end-radius: var(--radius-md);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease;
}

.date-picker-toggle:hover {
    background: var(--primary-hover);
}

.date-picker-toggle svg {
    pointer-events: none;
}

.date-picker.is-open .date-picker-toggle {
    background: var(--primary-hover);
}

.date-picker-popup {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    width: min(320px, calc(100vw - 32px));
    display: none;
    animation: dpFadeIn .14s ease-out;
}

.date-picker.is-open .date-picker-popup {
    display: block;
}

@keyframes dpFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.date-picker-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.date-picker-nav {
    width: 36px;
    min-height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text-soft);
    border: 1px solid var(--border);
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: background-color .12s ease, color .12s ease;
}

.date-picker-nav:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.date-picker-nav:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.date-picker-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.date-picker-selects select {
    min-height: 36px;
    padding: 4px 28px 4px 10px;
    font-size: 14px;
    background-position: left 10px top 50%, left 15px top 50%;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
}

.date-picker-weekdays,
.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.date-picker-weekdays {
    margin-bottom: 4px;
}

.date-picker-weekday {
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 0;
}

.date-picker-day {
    aspect-ratio: 1 / 1;
    min-height: 36px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0;
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .12s ease, color .12s ease;
}

.date-picker-day:hover:not(:disabled) {
    background: var(--primary-soft);
    color: var(--primary);
}

.date-picker-day.is-outside {
    color: #b6c2cf;
}

.date-picker-day.is-today {
    border-color: var(--primary);
    font-weight: 700;
}

.date-picker-day.is-selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.date-picker-day.is-selected:hover {
    background: var(--primary-hover);
    color: #fff;
}

.date-picker-day:disabled {
    color: #c5cfd8;
    cursor: not-allowed;
    background: transparent;
}

.date-picker-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.date-picker-footer button {
    flex: 1 1 auto;
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13.5px;
    background: var(--surface-soft);
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.date-picker-footer button:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary-soft);
}

/* Backdrop for mobile popup */
.date-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 31, 56, 0.35);
    z-index: 25;
    display: none;
}

.date-picker-backdrop.is-visible {
    display: block;
}

/* On small screens, center the popup as a sheet */
@media (max-width: 520px) {
    .date-picker.is-open .date-picker-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        inset-inline-end: auto;
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 14px 14px max(16px, env(safe-area-inset-bottom));
        animation: dpSlideUp .2s ease-out;
    }

    @keyframes dpSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .date-picker-day {
        min-height: 40px;
        font-size: 14.5px;
    }
}

/* ===========================================================
   Responsive breakpoints (mobile-first)
   =========================================================== */

@media (min-width: 600px) {
    body {
        font-size: 15.5px;
    }

    .page {
        padding: 24px 20px 40px;
    }

    .shell {
        padding: 24px;
    }

    h1 {
        font-size: 23px;
    }

    .muted {
        font-size: 14px;
    }

    .topbar {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--gap-4);
    }

    .field {
        padding: 16px 18px;
    }

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

    .actions {
        flex-direction: row;
        align-items: center;
    }

    button,
    .button {
        width: auto;
    }
}

@media (min-width: 900px) {
    .page {
        padding: 32px 24px 48px;
    }

    .shell {
        padding: 32px;
    }

    h1 {
        font-size: 26px;
    }

    .grid {
        gap: 16px;
    }

    .field {
        padding: 18px 20px;
    }

    .field .choices {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* ===========================================================
   Components: badges, stats, sections, auth, table-cards
   =========================================================== */

/* ---------- Requirements panel ---------- */

.requirements {
    background: linear-gradient(180deg, var(--primary-soft), #f0f7fa);
    border: 1px solid var(--info-border);
    border-radius: var(--radius-md);
    padding: 18px 18px 16px;
    margin-bottom: var(--gap-5);
    box-shadow: var(--shadow-sm);
}

.requirements-title {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.requirements-subtitle {
    margin: 0 0 12px;
    color: var(--text);
    font-weight: 700;
    font-size: 14.5px;
    line-height: 1.6;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: req;
    display: grid;
    gap: 9px;
}

.requirements-list li {
    counter-increment: req;
    position: relative;
    padding-inline-start: 30px;
    padding-block: 2px;
    line-height: 1.75;
    color: var(--text);
    font-size: 14.5px;
}

.requirements-list li::before {
    content: counter(req) ".";
    position: absolute;
    inset-inline-start: 0;
    top: 3px;
    font-weight: 800;
    color: var(--primary);
    font-size: 14.5px;
    min-width: 22px;
    text-align: start;
}

@media (min-width: 600px) {
    .requirements {
        padding: 22px 24px 20px;
    }

    .requirements-title {
        font-size: 18px;
    }

    .requirements-subtitle,
    .requirements-list li {
        font-size: 15px;
    }
}

/* ---------- Status badge ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
    flex-shrink: 0;
}

.badge.open {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
}

.badge.closed {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error);
}

.badge.neutral {
    background: var(--surface-soft);
    border-color: var(--border);
    color: var(--text-soft);
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.topbar-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-meta .muted {
    font-size: 12.5px;
}

@media (min-width: 600px) {
    .topbar-meta {
        align-items: flex-end;
        text-align: end;
    }
}

.page-header .page-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.page-header .page-logo svg {
    width: 22px;
    height: 22px;
}

.page-header-text {
    min-width: 0;
}

/* ---------- Section ---------- */

.section {
    margin-top: var(--gap-6);
    padding-top: var(--gap-5);
    border-top: 1px solid var(--border);
}

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

.section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--gap-4);
}

.section-head h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
    color: var(--text);
    font-weight: 800;
}

.section-head h2 .badge {
    margin-inline-start: 8px;
    vertical-align: middle;
}

.section-head .muted {
    font-size: 13.5px;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (min-width: 600px) {
    .section-head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: var(--gap-4);
    }

    .section-head h2 {
        font-size: 19px;
    }
}

/* ---------- Stat cards ---------- */

.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-height: 72px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
}

.stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

@media (min-width: 600px) {
    .stats {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    .stat-value {
        font-size: 26px;
    }
}

/* ---------- Empty state ---------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 16px;
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--muted);
}

.empty svg {
    width: 44px;
    height: 44px;
    color: var(--border-strong);
}

.empty-title {
    color: var(--text-soft);
    font-weight: 700;
    font-size: 15px;
}

/* ---------- Auth (centered login) ---------- */

body.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.auth-layout .page {
    max-width: 440px;
}

body.auth-layout .shell {
    text-align: center;
}

body.auth-layout .topbar {
    border-bottom: 0;
    margin-bottom: var(--gap-3);
    padding-bottom: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.auth-layout .page-header {
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

body.auth-layout .page-header .page-logo {
    width: 56px;
    height: 56px;
}

body.auth-layout .page-header .page-logo svg {
    width: 28px;
    height: 28px;
}

body.auth-layout form {
    text-align: start;
}

/* ---------- Mobile-friendly applications table (cards on small screens) ---------- */

.table-wrap.cards-on-mobile table {
    min-width: 0;
}

@media (max-width: 720px) {
    .table-wrap.cards-on-mobile {
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .table-wrap.cards-on-mobile table,
    .table-wrap.cards-on-mobile thead,
    .table-wrap.cards-on-mobile tbody,
    .table-wrap.cards-on-mobile tr,
    .table-wrap.cards-on-mobile th,
    .table-wrap.cards-on-mobile td {
        display: block;
        width: 100%;
    }

    .table-wrap.cards-on-mobile thead {
        position: absolute;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        overflow: hidden;
        white-space: nowrap;
        width: 1px;
        height: 1px;
    }

    .table-wrap.cards-on-mobile tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    .table-wrap.cards-on-mobile tbody tr:hover {
        background: var(--surface);
    }

    .table-wrap.cards-on-mobile td {
        border: 0;
        padding: 6px 0;
        white-space: normal;
        display: grid;
        grid-template-columns: 110px 1fr;
        align-items: baseline;
        gap: 10px;
        text-align: start;
        font-size: 14px;
    }

    .table-wrap.cards-on-mobile td + td {
        border-top: 1px dashed var(--border);
        padding-top: 8px;
        margin-top: 4px;
    }

    .table-wrap.cards-on-mobile td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        font-size: 13px;
    }
}

/* ---------- Button refinements ---------- */

button[type="submit"] svg,
.button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

button.is-loading {
    pointer-events: none;
    opacity: 0.85;
    position: relative;
}

button.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

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

/* ---------- Subtle entrance ---------- */

.shell {
    animation: shellIn .25s ease-out;
}

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

/* ---------- Print ---------- */

@media print {
    body {
        background: #fff;
    }

    .shell {
        box-shadow: none;
        border: 0;
        animation: none;
    }

    .admin-link,
    .actions,
    .section-actions,
    .date-picker-toggle {
        display: none !important;
    }

    .table-wrap {
        border-color: #aaa;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
