:root {
    --bg: #f5f8fb;
    --surface: #ffffff;
    --text: #1f2329;
    --muted: #5d6671;
    --line: #dbe3ec;
    --accent: #2173b5;
    --accent-dark: #003b7a;
}
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        linear-gradient(120deg, rgba(33, 115, 181, 0.10), transparent 34rem),
        var(--bg);
    font-family: "Outfit", "Geist", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(100% - 32px, 1240px);
    margin: 0 auto;
}

.site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 28px 0;
}

.brand,
.nav-action,
.button {
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), border-color 280ms ease, background 280ms ease;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    font-weight: 700;
    letter-spacing: 0;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 5px;
    background: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav-action {
    padding: 10px 14px;
    justify-self: end;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), border-color 220ms ease, background 220ms ease;
}

.nav-toggle:hover {
    border-color: rgba(33, 115, 181, 0.34);
    transform: translateY(-2px);
}

.nav-toggle:active {
    transform: translateY(1px) scale(0.98);
}

.nav-toggle:focus-visible {
    outline: 2px solid rgba(33, 115, 181, 0.34);
    outline-offset: 3px;
}

.nav-toggle-icon {
    position: relative;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: background 180ms ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: inherit;
    background: currentColor;
    transition: transform 220ms ease, top 220ms ease;
}

.nav-toggle-icon::before {
    top: -6px;
}

.nav-toggle-icon::after {
    top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.app-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.app-nav form {
    margin: 0;
}

.app-nav button.nav-action {
    cursor: pointer;
    font-family: inherit;
}

.app-nav a:not(.nav-action) {
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 220ms ease, background 220ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.app-nav a:not(.nav-action):hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.64);
    transform: translateY(-2px);
}

.nav-action:hover {
    color: var(--text);
    background: var(--surface);
}

.hero {
    display: block;
    min-height: calc(100dvh - 92px);
    padding: 58px 0 84px;
}

.hero-copy,
.error-copy {
    max-width: 760px;
}

.error-page {
    display: grid;
    align-items: center;
    min-height: calc(100dvh - 92px);
    padding: 58px 0 84px;
}

.signup-page {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(360px, 0.88fr);
    gap: clamp(36px, 8vw, 108px);
    align-items: start;
    padding: 58px 0 96px;
}

.auth-page {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(340px, 0.7fr);
    gap: clamp(36px, 9vw, 140px);
    align-items: center;
    min-height: calc(100dvh - 92px);
    padding: 58px 0 96px;
}

.app-hero,
.app-page {
    padding: 58px 0 96px;
}

.app-hero {
    max-width: 780px;
    min-height: calc(100dvh - 92px);
}

.app-page {
    min-height: calc(100dvh - 92px);
}

.app-page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 36px;
}

.app-page-narrow {
    max-width: 920px;
}

.app-title {
    max-width: none;
    margin-bottom: 0;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
}

.app-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.stacked-actions {
    justify-content: flex-start;
    margin-top: 22px;
}

.signup-intro {
    position: sticky;
    top: 40px;
    max-width: 620px;
}

.error-code {
    margin-bottom: 20px;
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 26px;
    font-size: clamp(3rem, 7vw, 5.8rem);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: 0;
    max-width: 10.5ch;
}

.hero-text,
.role-copy p {
    max-width: 62ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.signup-form {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 48px rgba(43, 55, 74, 0.08);
}

.role-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0 0 24px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(245, 248, 251, 0.84);
}

.form-notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(33, 115, 181, 0.26);
    border-radius: 16px;
    color: var(--accent-dark);
    background: rgba(33, 115, 181, 0.08);
    font-weight: 700;
}

.form-error {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(150, 50, 50, 0.24);
    border-radius: 16px;
    color: #873b3b;
    background: rgba(150, 50, 50, 0.08);
    font-weight: 700;
}

.form-error p {
    margin-bottom: 6px;
}

.form-error p:last-child {
    margin-bottom: 0;
}

.role-switch legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.role-switch input,
.segmented-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-switch label,
.segmented-control label {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    transition: color 220ms ease, background 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.role-switch input:checked + label,
.segmented-control input:checked + label {
    color: #f9fbfd;
    background: var(--accent-dark);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.field-block {
    display: grid;
    gap: 8px;
}

.field-block label,
.field-block > span,
.field-label {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.field-block input[type="text"],
.field-block input[type="email"],
.field-block input[type="number"],
.field-block input[type="password"],
.field-block input[type="date"],
.field-block textarea,
.field-block select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
}

.field-block textarea {
    min-height: 180px;
    padding: 14px;
    resize: vertical;
    line-height: 1.55;
}

.field-block input:focus,
.field-block textarea:focus,
.field-block select:focus,
.check-row input:focus,
.role-switch label:focus-within {
    outline: 2px solid rgba(33, 115, 181, 0.28);
    outline-offset: 2px;
}

.field-error {
    color: #873b3b;
    font-size: 0.88rem;
    font-weight: 700;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
    grid-column: 1 / -1;
}

.app-form,
.detail-panel,
.empty-state {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 48px rgba(43, 55, 74, 0.08);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.form-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin: 22px 0 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(245, 248, 251, 0.68);
}

.form-choice-group legend {
    width: 100%;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.form-choice-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.form-choice-group input {
    accent-color: var(--accent-dark);
}

.delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.field-help {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.check-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 20px;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.5;
}

.check-row input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-dark);
}

.coach-field {
    display: none;
}

.signup-form:has(#role-coach:checked) .student-field {
    display: none;
}

.signup-form:has(#role-coach:checked) .coach-field {
    display: grid;
}

.signup-form:has(#role-jury:checked) .student-field,
.signup-form:has(#role-jury:checked) .coach-field {
    display: none;
}

.signup-submit {
    width: 100%;
    margin-top: 24px;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.auth-form {
    align-self: center;
}

.availability-card {
    display: grid;
    gap: 10px;
}

.availability-columns {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 18px;
}

.availability-day {
    display: grid;
    gap: 12px;
    align-content: start;
}

.availability-day h3 {
    margin-bottom: 4px;
    color: var(--accent-dark);
    font-size: 0.92rem;
}

.availability-trigger,
.confirmation-trigger,
.popover-close {
    min-height: 44px;
    width: max-content;
    padding: 0 18px;
    border: 1px solid var(--accent-dark);
    border-radius: 999px;
    color: #f9fbfd;
    background: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), background 280ms ease;
}

.availability-trigger:hover,
.confirmation-trigger:hover,
.popover-close:hover {
    transform: translateY(-2px);
}

.availability-trigger:active,
.confirmation-trigger:active,
.popover-close:active {
    transform: translateY(1px) scale(0.98);
}

.availability-popover,
.confirmation-popover,
.feedback-popover{
    width: min(100% - 48px, 1040px);
    max-height: min(86dvh, 760px);
    overflow: auto;
    margin: auto;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 28px;
    color: var(--text);
    background: rgba(245, 248, 251, 0.96);
    box-shadow: 0 28px 80px rgba(31, 35, 41, 0.18);
    z-index: 9999;
}

.feedback-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -65%);
    text-align: center;
}

.availability-popover::backdrop,
.feedback-popover::backdrop {
    background: rgba(31, 35, 41, 0.22);
    backdrop-filter: blur(5px);
}

.availability-popover-header,
.confirmation-popover-header,
.feedback-popover-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 28px;
}

.availability-popover-header strong,
.confirmation-popover-header strong,
.feedback-popover-header strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.35rem;
}

.availability-popover-header p,
.confirmation-popover-header p {
    margin-bottom: 0;
    color: var(--muted);
}

.popover-close {
    min-height: 40px;
    color: var(--text);
    background: var(--surface);
    border-color: var(--line);
}

.availability-row {
    display: grid;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    font-weight: 700;
}

.availability-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.availability-row strong {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #245433;
    background: rgba(97, 185, 107, 0.22);
    font-size: 0.92rem;
}

.availability-row input:not(:checked) + strong {
    color: #843d3d;
    background: rgba(215, 91, 91, 0.22);
}

.availability-row input:not(:checked) + strong .available-text,
.availability-row input:checked + strong .unavailable-text {
    display: none;
}

.availability-row:has(input:focus) {
    outline: 2px solid rgba(33, 115, 181, 0.28);
    outline-offset: 2px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.debug-actions a {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.58);
    font-size: 0.86rem;
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
}

.button:hover,
.brand:hover,
.nav-action:hover {
    transform: translateY(-2px);
}

.button:active,
.nav-action:active {
    transform: translateY(1px) scale(0.98);
}

.button-primary {
    color: #f9fbfd;
    background: var(--accent-dark);
    border: 1px solid var(--accent-dark);
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.button-danger {
    color: #873b3b;
    background: rgba(150, 50, 50, 0.08);
    border: 1px solid rgba(150, 50, 50, 0.24);
}

.data-list {
    display: grid;
    border-top: 1px solid var(--line);
}

.data-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), color 220ms ease;
}

.data-row:hover {
    /*transform: translateX(4px);*/
}

.data-row strong,
.detail-copy h2,
.empty-state h2 {
    display: block;
    margin-bottom: 8px;
    font-size: 1.35rem;
}

.data-row small,
.detail-copy p,
.empty-state p {
    display: block;
    max-width: 70ch;
    color: var(--muted);
    line-height: 1.65;
}

.row-link {
    color: var(--accent-dark);
    font-weight: 700;
}

.detail-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.75fr);
    gap: 32px;
}

.compact-detail {
    display: block;
}

.detail-copy h2,
.empty-state h2 {
    max-width: none;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.detail-copy p,
.empty-state p {
    margin-bottom: 0;
    white-space: pre-wrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.detail-grid div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(245, 248, 251, 0.68);
}

.detail-grid dt {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.detail-grid dd {
    margin: 0;
    color: var(--text);
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(31, 35, 41, 0.08);
    font-size: 0.88rem;
    font-weight: 700;
}

.status-active {
    color: #245433;
    background: rgba(97, 185, 107, 0.22);
}
.status-danger {
    color: #873b3b;
    background: rgba(150, 50, 50, 0.08);
}

.roles-section {
    display: grid;
    gap: 14px;
}

.workflow-section,
.roles-section {
    padding: 92px 0;
    border-top: 1px solid var(--line);
}

.section-heading {
    display: block;
    margin-bottom: 38px;
}

h2 {
    margin-bottom: 0;
    max-width: 13ch;
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.workflow-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: 16px;
}

.workflow-item {
    padding: 28px;
    border-top: 1px solid rgba(31, 35, 41, 0.16);
    background: rgba(255, 255, 255, 0.34);
}

.workflow-item:first-child {
    grid-row: span 2;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.step-number {
    display: inline-block;
    margin-bottom: 54px;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 700;
}

.workflow-item h3 {
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.workflow-item p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.65;
}

.roles-section {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    max-width: none;
}


.reveal {
    animation: reveal-up 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-1 {
    animation-delay: 120ms;
}

.delay-2 {
    animation-delay: 240ms;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-nav a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.main-nav a:hover {
    opacity: 0.7;
}

.main-nav .nav-action {
    margin-left: 0.5rem;
}
.group-detail {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.group-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.group-label {
    min-width: 110px;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}

.group-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.group-chip {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: rgba(33, 115, 181, 0.12);
    border-radius: 999px;
    text-decoration: none;
    color: var(--accent-dark);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.group-chip:hover {
    background: rgba(33, 115, 181, 0.2);
}

.group-chip.muted {
    background: rgba(33, 115, 181, 0.05);
    color: var(--muted);
    font-style: italic;
}
.field-error {
    color: #b00020;
    font-size: 0.85rem;
    margin-top: 0.3rem;
    display: block;
}

.section-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #e0e0e0;
}

.app-subtitle {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

.row-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Coaches page department sections */
.dept-section {
    margin-bottom: 2rem;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 48px rgba(43, 55, 74, 0.08);
}

.dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.dept-title {
    margin: 0;
    max-width: none;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--text);
}

.dept-approved-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(33, 115, 181, 0.12);
    color: var(--accent-dark);
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Enough approved coaches */
.dept-approved-count-success {
    background: rgba(97, 185, 107, 0.22);
    color: #245433;
}

/* Not enough approved coaches */
.dept-approved-count-danger {
    background: rgba(215, 91, 91, 0.22);
    color: #843d3d;
}

/** attendance group css  */
.qr-code-panel {
    display: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.qr-code-panel h2 {
    margin-top: 0;
}

.qr-code-panel img {
    display: block;
    margin: 1rem 0;
}

.qr-code-panel .qr-url {
    font-size: 0.85rem;
    color: var(--muted);
}

.attendance-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
}

.attendance-badge--present {
    background: #d1fae5;
    color: #065f46;
}

.attendance-badge--absent {
    background: #fee2e2;
    color: #991b1b;
}

.attendance-badge--unknown {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--line);
}

.attendance-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.attendance-remark {
    color: var(--muted);
    font-style: italic;
    font-size: 0.85rem;
}

.attendance-row {
    grid-template-columns: 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
}

.attendance-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.attendance-form select,
.attendance-form input[type="text"] {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.9rem;
}

.attendance-form textarea {
    width: 240px;
    resize: none;
    height: 32px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.4;
}

.attendance-form .button {
    padding: 6px 14px;
    font-size: 0.9rem;
}
@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}

@media (max-width: 840px) {
    .page-shell {
        width: min(100% - 24px, 1240px);
    }

    .site-header {
        position: relative;
        grid-template-columns: 1fr auto;
        gap: 14px;
        padding: 18px 0;
        z-index: 20;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .app-nav {
        position: absolute;
        top: calc(100% - 8px);
        right: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-height: min(72dvh, 520px);
        padding: 12px;
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 24px 54px rgba(43, 55, 74, 0.16);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .app-nav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .app-nav a:not(.nav-action),
    .app-nav .nav-action {
        display: inline-flex;
        min-height: 44px;
        width: 100%;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
    }

    .app-nav a:not(.nav-action) {
        background: rgba(245, 248, 251, 0.72);
    }

    .app-nav a.active {
        color: var(--accent-dark);
        background: rgba(33, 115, 181, 0.12);
    }

    .app-nav form {
        width: 100%;
    }

    .signup-page,
    .auth-page,
    .workflow-grid,
    .roles-section,
    .app-page-header,
    .detail-panel {
        grid-template-columns: 1fr;
    }

    .app-page-header,
    .app-actions {
        align-items: start;
        justify-content: flex-start;
    }

    .hero {
        display: block;
        min-height: auto;
        padding: 38px 0 72px;
    }

    h1 {
        max-width: 11ch;
        font-size: clamp(2.8rem, 16vw, 4.2rem);
    }

    .workflow-item:first-child {
        grid-row: auto;
        min-height: 0;
    }

    .step-number {
        margin-bottom: 34px;
    }

    .signup-intro {
        position: static;
    }

}

@media (max-width: 560px) {
    .site-header {
        padding: 18px 0;
    }

    .brand {
        font-size: 0.95rem;
    }

    .nav-action {
        padding: 9px 12px;
    }

    .hero-actions,
    .button {
        width: 100%;
    }

    .signup-form {
        padding: 20px;
        border-radius: 22px;
    }

    .role-switch {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .workflow-item {
        padding: 22px;
    }

    .workflow-section,
    .roles-section {
        padding: 64px 0;
    }

    .availability-popover {
        padding: 18px;
    }

    .availability-popover-header {
        grid-template-columns: 1fr;
    }

    .availability-columns {
        grid-template-columns: 1fr;
    }

    .app-nav {
        grid-template-columns: 1fr;
    }

    .two-columns,
    .detail-grid,
    .data-row {
        grid-template-columns: 1fr;
    }

    .app-form,
    .detail-panel,
    .empty-state {
        padding: 20px;
        border-radius: 22px;
    }
}


.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.stat-card {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 48px rgba(43, 55, 74, 0.08);
}

.stat-value {
    display: block;
    margin: 0 0 8px;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1;
    color: var(--accent-dark);
}

.stat-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.chart-section {
    margin: 4rem 1.5rem;
}

.chart-container {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 20px 48px rgba(43, 55, 74, 0.08);
}

.chart-container canvas {
    height: 550px;
}

@media (max-width: 840px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
}
