/*
 * Internship logbook. One stylesheet, no external resources.
 *
 * Look: frosted glass panels over a soft, still colour field. The glass is kept
 * mostly opaque so text always reads comfortably; transparency is a finish, not
 * a feature. Honours dark mode, reduced transparency and reduced motion.
 */

/* ---- tokens ------------------------------------------------------------- */

:root {
    color-scheme: light;

    --bg: #eef1f7;
    --blob-1: rgba(129, 140, 248, 0.45);
    --blob-2: rgba(94, 234, 212, 0.38);
    --blob-3: rgba(244, 170, 200, 0.36);
    --blob-4: rgba(253, 224, 150, 0.34);

    --glass: rgba(255, 255, 255, 0.58);
    --glass-strong: rgba(255, 255, 255, 0.78);
    --glass-border: rgba(255, 255, 255, 0.72);
    --glass-rim: rgba(255, 255, 255, 0.9);
    --sheen: rgba(255, 255, 255, 0.45);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 36px -14px rgba(30, 41, 80, 0.22);
    --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.05), 0 28px 60px -20px rgba(30, 41, 80, 0.3);
    --blur: blur(22px) saturate(170%);

    --ink: #0f172a;
    --ink-soft: #475569;
    --ink-faint: #64748b;
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.15);
    --field: rgba(255, 255, 255, 0.72);
    --cell: rgba(255, 255, 255, 0.42);

    --accent: #4f5bd5;
    --accent-top: #6c78ee;
    --accent-ink: #ffffff;
    --accent-text: #4350c8;
    --accent-soft: rgba(79, 91, 213, 0.12);
    --accent-glow: rgba(79, 91, 213, 0.45);

    --ok: #15803d;
    --ok-soft: rgba(22, 163, 74, 0.14);
    --warn: #b45309;
    --warn-soft: rgba(217, 119, 6, 0.15);
    --bad: #b91c1c;
    --bad-soft: rgba(220, 38, 38, 0.11);
    --neutral-soft: rgba(100, 116, 139, 0.13);

    --r-sm: 10px;
    --r: 14px;
    --r-lg: 20px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --bg: #0a0f1e;
        --blob-1: rgba(79, 70, 229, 0.42);
        --blob-2: rgba(13, 148, 136, 0.32);
        --blob-3: rgba(190, 24, 93, 0.26);
        --blob-4: rgba(180, 120, 20, 0.18);

        --glass: rgba(23, 30, 50, 0.58);
        --glass-strong: rgba(32, 41, 66, 0.78);
        --glass-border: rgba(255, 255, 255, 0.09);
        --glass-rim: rgba(255, 255, 255, 0.12);
        --sheen: rgba(255, 255, 255, 0.05);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px -14px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 28px 60px -20px rgba(0, 0, 0, 0.7);

        --ink: #e8ecf5;
        --ink-soft: #a9b3c7;
        --ink-faint: #8591a8;
        --line: rgba(255, 255, 255, 0.08);
        --line-strong: rgba(255, 255, 255, 0.16);
        --field: rgba(10, 15, 30, 0.45);
        --cell: rgba(255, 255, 255, 0.04);

        --accent: #5663dc;
        --accent-top: #7480f0;
        --accent-text: #a5b0ff;
        --accent-soft: rgba(129, 140, 248, 0.18);
        --accent-glow: rgba(99, 110, 240, 0.5);

        --ok: #4ade80;
        --ok-soft: rgba(74, 222, 128, 0.14);
        --warn: #fbbf24;
        --warn-soft: rgba(251, 191, 36, 0.14);
        --bad: #f87171;
        --bad-soft: rgba(248, 113, 113, 0.14);
        --neutral-soft: rgba(148, 163, 184, 0.14);
    }
}

/* ---- base --------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* The colour field behind the glass. Fixed, so panels slide over it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(42% 38% at 12% 12%, var(--blob-1), transparent 70%),
        radial-gradient(36% 34% at 88% 8%, var(--blob-2), transparent 70%),
        radial-gradient(44% 42% at 78% 88%, var(--blob-3), transparent 70%),
        radial-gradient(34% 34% at 6% 92%, var(--blob-4), transparent 70%),
        var(--bg);
}

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

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
}

code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    letter-spacing: 0.04em;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    vertical-align: -3px;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- glass surface -------------------------------------------------------- */

.glass,
.card,
.stat,
.panel,
.topbar-inner,
.role-choice,
.pick-item,
.alert {
    background: linear-gradient(160deg, var(--sheen) 0%, transparent 42%), var(--glass);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-rim), var(--shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root {
        --glass: rgba(255, 255, 255, 0.9);
    }
}

@media (prefers-reduced-transparency: reduce) {
    :root {
        --glass: #ffffff;
        --glass-strong: #ffffff;
        --sheen: transparent;
    }

    body::before {
        background: var(--bg);
    }
}

@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
    :root {
        --glass: #151c2e;
        --glass-strong: #1c2439;
    }
}

/* ---- top bar and footer ------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: 14px;
}

.topbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    padding: 8px 10px 8px 14px;
    border-radius: var(--r-lg);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 650;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(145deg, var(--accent-top), var(--accent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px -6px var(--accent-glow);
}

.brand-mark .icon {
    width: 17px;
    height: 17px;
}

.site-nav {
    display: flex;
    gap: 4px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 11px;
    color: var(--ink-soft);
    font-weight: 550;
    font-size: 14px;
}

.site-nav a:hover {
    color: var(--ink);
    background: var(--accent-soft);
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    color: var(--ink);
    background: var(--glass-strong);
    box-shadow: inset 0 1px 0 var(--glass-rim), 0 2px 8px -3px rgba(15, 23, 42, 0.18);
}

.header-role {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-chip .icon {
    width: 15px;
    height: 15px;
}

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

.main-content {
    flex: 1;
    padding-top: 28px;
    padding-bottom: 56px;
}

.site-footer {
    padding: 18px 0 26px;
    color: var(--ink-faint);
    font-size: 13px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
}

/* ---- centred panel pages: role choice, verify, errors --------------------- */

.body-narrow {
    justify-content: center;
}

.panel-wrap {
    width: 100%;
    max-width: 540px;
    margin: auto;
    padding: 40px 18px;
}

.panel {
    border-radius: 26px;
    padding: 34px 32px 28px;
    box-shadow: inset 0 1px 0 var(--glass-rim), var(--shadow-lg);
}

.panel-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 26px;
    font-family: var(--font-display);
    font-weight: 650;
    font-size: 15px;
    color: var(--ink-soft);
}

.panel-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.panel-intro {
    margin: 0 0 24px;
    color: var(--ink-soft);
    font-size: 16px;
}

.panel-foot {
    margin: 22px 0 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.panel-foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.role-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.role-choice {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.role-choice:hover {
    transform: translateY(-2px);
    background-color: var(--glass-strong);
    box-shadow: inset 0 1px 0 var(--glass-rim), var(--shadow-lg);
}

.role-choice:focus-visible {
    outline: 3px solid var(--accent-glow);
    outline-offset: 2px;
}

.role-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px rgba(15, 23, 42, 0.45);
}

.role-icon .icon {
    width: 22px;
    height: 22px;
}

.role-icon-student {
    background: linear-gradient(145deg, #7c8cf8, #4f5bd5);
}

.role-icon-supervisor {
    background: linear-gradient(145deg, #34d3b8, #0f8f84);
}

.role-text {
    flex: 1;
}

.role-name {
    display: block;
    font-weight: 650;
    font-size: 16px;
}

.role-help {
    display: block;
    margin-top: 1px;
    color: var(--ink-soft);
    font-size: 14px;
}

.role-arrow {
    color: var(--ink-faint);
}

/* ---- page structure ----------------------------------------------------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
}

.page-intro {
    margin: 0 0 24px;
    color: var(--ink-soft);
}

.page-head .page-intro {
    margin-bottom: 0;
}

.breadcrumb {
    margin: 0 0 12px;
    font-size: 14px;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-soft);
}

.breadcrumb .icon {
    width: 16px;
    height: 16px;
}

.card {
    border-radius: var(--r-lg);
    padding: 22px;
    margin-bottom: 20px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 650;
}

.card-title .icon {
    color: var(--ink-faint);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.card.empty {
    text-align: center;
    padding: 44px 22px;
    color: var(--ink-soft);
}

.card.empty p {
    margin: 0 0 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

/* Grid and flex children default to "never narrower than my content", which lets
   one wide table push the whole page past the screen edge on a phone. */
.grid-2 > *,
.card,
.main-content,
.stat {
    min-width: 0;
}

.grid-calendar {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(130px, 32%) 1fr;
    gap: 9px 16px;
}

.detail-list dt {
    color: var(--ink-faint);
    font-size: 14px;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.detail-compact {
    grid-template-columns: minmax(110px, 45%) 1fr;
    font-size: 14px;
}

/* ---- stat tiles ----------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat {
    border-radius: var(--r-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--ink-soft);
    font-weight: 600;
}

.stat-label .icon {
    width: 16px;
    height: 16px;
    color: var(--ink-faint);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.stat-of {
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-faint);
    letter-spacing: 0;
}

.stat-note {
    font-size: 13px;
    color: var(--ink-faint);
}

/* ---- buttons ------------------------------------------------------------ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--glass-strong);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: inset 0 1px 0 var(--glass-rim), 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.button:hover {
    border-color: var(--accent);
    color: var(--ink);
    text-decoration: none;
}

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

.button:focus-visible,
.pick-item:focus-visible {
    outline: 3px solid var(--accent-glow);
    outline-offset: 2px;
}

.button-primary {
    border-color: transparent;
    background: linear-gradient(180deg, var(--accent-top), var(--accent));
    color: var(--accent-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 20px -8px var(--accent-glow);
}

.button-primary:hover {
    border-color: transparent;
    color: var(--accent-ink);
    filter: brightness(1.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 24px -8px var(--accent-glow);
}

.button-quiet {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--accent-text);
    padding-left: 8px;
    padding-right: 8px;
}

.button-quiet:hover {
    background: var(--accent-soft);
    border-color: transparent;
    color: var(--accent-text);
}

.button-block {
    display: flex;
    width: 100%;
}

.button-small {
    min-height: 30px;
    padding: 4px 11px;
    font-size: 13px;
    border-radius: 9px;
}

.button-danger {
    color: var(--bad);
    background: transparent;
    border-color: var(--bad-soft);
    box-shadow: none;
}

.button-danger:hover {
    background: var(--bad-soft);
    border-color: var(--bad);
    color: var(--bad);
}

.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

/* ---- forms -------------------------------------------------------------- */

.form {
    margin: 0;
}

.field {
    margin-bottom: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

label,
legend {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.field-optional,
.field-hint {
    font-weight: 400;
    color: var(--ink-faint);
    font-size: 13px;
}

.field-hint {
    display: block;
    margin-top: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--field);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-faint);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea {
    opacity: 0.75;
}

.field-error {
    display: block;
    margin-top: 5px;
    color: var(--bad);
    font-size: 13px;
    font-weight: 500;
}

.plain-fieldset,
fieldset.field {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

fieldset.field {
    margin-bottom: 16px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Weekday toggles read as pills. */
.checkbox-row label.checkbox {
    margin: 0;
    padding: 7px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--field);
    cursor: pointer;
    font-weight: 550;
    font-size: 14px;
}

.checkbox-row label.checkbox:has(input:checked) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
}

label.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-weight: 400;
    font-size: 14px;
}

label.checkbox input {
    margin: 3px 0 0;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.hours-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 14px;
}

.hours-preview strong {
    font-variant-numeric: tabular-nums;
}

.danger-zone {
    margin: -6px 0 20px;
    text-align: right;
}

.review-actions {
    display: grid;
    gap: 16px;
}

.review-actions form {
    margin: 0;
}

/* ---- alerts ------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: var(--r);
    font-size: 14px;
    border-left: 4px solid var(--line-strong);
}

.alert a {
    font-weight: 600;
    margin-left: 4px;
}

.alert-success {
    border-left-color: var(--ok);
}

.alert-error {
    border-left-color: var(--bad);
}

.alert-warning {
    border-left-color: var(--warn);
}

/* ---- status badges -------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    line-height: 1.6;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-draft {
    background: var(--neutral-soft);
    color: var(--ink-soft);
}

.badge-submitted {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.badge-revision {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge-approved {
    background: var(--ok-soft);
    color: var(--ok);
}

.badge-signed {
    background: linear-gradient(180deg, #22c55e, #15803d);
    color: #ffffff;
    box-shadow: 0 4px 12px -4px rgba(22, 163, 74, 0.6);
}

.badge-signed::before {
    background: #ffffff;
}

.comment-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    font-size: 12px;
    color: var(--ink-faint);
}

.comment-count .icon {
    width: 13px;
    height: 13px;
}

/* ---- tables ------------------------------------------------------------- */

.table-scroll {
    overflow-x: auto;
    margin: 0 -6px;
    padding: 0 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.table thead th {
    padding-top: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table tbody tr:hover {
    background: var(--accent-soft);
}

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

.table td strong {
    font-weight: 600;
}

/* A table directly on the page gets its own glass. */
.table-card {
    border-radius: var(--r-lg);
    padding: 8px 14px;
}

/* ---- search and pick list ------------------------------------------------- */

.search-bar {
    position: relative;
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    max-width: 540px;
}

.search-bar .icon {
    position: absolute;
    left: 13px;
    top: 12px;
    color: var(--ink-faint);
    pointer-events: none;
}

.search-bar input {
    padding-left: 40px;
}

.pick-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.pick-list form {
    margin: 0;
    height: 100%;
}

.pick-item {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    height: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.pick-item:hover {
    transform: translateY(-2px);
    background-color: var(--glass-strong);
}

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-top), var(--accent));
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pick-name {
    display: block;
    font-weight: 650;
}

.pick-meta {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
}

/* ---- month navigation and calendar -------------------------------------- */

.month-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.month-nav .button {
    min-width: 40px;
    padding: 8px 10px;
}

.month-select {
    display: flex;
    gap: 6px;
    margin: 0;
}

.month-select select {
    width: auto;
    min-width: 170px;
    font-weight: 600;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cal-head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    text-align: center;
    padding-bottom: 2px;
}

.cal-day {
    min-height: 64px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
    background: var(--cell);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cal-day > a,
.cal-day > .cal-num {
    display: block;
    height: 100%;
    padding: 6px 8px;
    color: inherit;
    text-decoration: none;
    border-radius: 11px;
}

.cal-day:has(> a):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.35);
}

.cal-day > a:focus-visible {
    outline: 3px solid var(--accent-glow);
    outline-offset: 1px;
}

.cal-num {
    display: block;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.cal-info {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    font-weight: 550;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-add {
    color: var(--accent-text);
    font-size: 17px;
    line-height: 1;
    opacity: 0.5;
}

.cal-day:hover .cal-add,
.cal-day > a:focus-visible .cal-add {
    opacity: 1;
}

/* Days off can still be logged, but do not invite it. */
.cal-off .cal-add {
    opacity: 0;
}

.cal-blank {
    border: 0;
    background: transparent;
}

.cal-out {
    background: transparent;
    color: var(--ink-faint);
    border-style: dashed;
    opacity: 0.6;
}

.cal-off {
    background: transparent;
    color: var(--ink-faint);
}

.cal-draft {
    background: var(--neutral-soft);
}

.cal-submitted {
    background: var(--accent-soft);
    border-color: transparent;
}

.cal-revision {
    background: var(--warn-soft);
    border-color: transparent;
}

.cal-approved {
    background: var(--ok-soft);
    border-color: transparent;
}

.cal-missing {
    background: var(--bad-soft);
    border-color: transparent;
}

.cal-today {
    box-shadow: 0 0 0 2px var(--accent);
}

.legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 14px 0 0;
    padding: 0;
    font-size: 12px;
    color: var(--ink-soft);
}

.legend li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    border: 1px solid var(--line);
}

/* ---- dashboard lists ------------------------------------------------------ */

.missing-list,
.feedback-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.missing-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.missing-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 13px;
}

.missing-list .icon {
    width: 15px;
    height: 15px;
}

.feedback-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.missing-list li:last-child,
.feedback-list li:last-child {
    border-bottom: 0;
}

.feedback-list a {
    font-weight: 600;
}

.feedback-list p {
    margin: 2px 0 0;
    color: var(--ink-soft);
}

/* ---- comments --------------------------------------------------------------- */

.comments {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    gap: 10px;
}

.comment {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    background: var(--neutral-soft);
}

.comment-supervisor {
    margin-left: auto;
    border-radius: 16px 16px 4px 16px;
    background: var(--accent-soft);
}

.comment-meta {
    margin: 0 0 3px;
    font-size: 12.5px;
}

.comment-body {
    margin: 0;
    overflow-wrap: anywhere;
}

/* ---- signature and stamp ---------------------------------------------------- */

.sig-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.sig-slot {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sig-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
}

.sig-slot-head span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Previews sit on white "paper" so they look as they will on the PDF. */
.sig-preview {
    display: grid;
    place-items: center;
    height: 120px;
    padding: 10px;
    border-radius: var(--r);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Pixel limits: a percentage height is ignored inside the grid cell, which let a
   large stamp spill over the page. */
.sig-preview img {
    display: block;
    max-width: 100%;
    max-height: 98px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sig-preview {
    overflow: hidden;
}

.sig-empty {
    background:
        repeating-linear-gradient(135deg, transparent 0 10px, var(--line) 10px 11px),
        var(--cell);
    border-style: dashed;
    color: var(--ink-faint);
    font-size: 13px;
    text-align: center;
}

.file-input {
    display: block;
    width: 100%;
    font: inherit;
    font-size: 13px;
    color: var(--ink-soft);
}

.file-input::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--glass-strong);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.sign-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: var(--r);
    background: #ffffff;
    border: 1px solid var(--line);
}

.sign-preview-row img {
    max-height: 48px;
    max-width: 45%;
    object-fit: contain;
}

/* ---- misc ---------------------------------------------------------------------- */

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted {
    color: var(--ink-soft);
}

.sub {
    display: block;
    color: var(--ink-faint);
    font-size: 13px;
}

.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.nowrap {
    white-space: nowrap;
}

.clip {
    max-width: 420px;
    color: var(--ink-soft);
}

.actions {
    white-space: nowrap;
    text-align: right !important;
}

.actions > * + * {
    margin-left: 10px;
}

.stack {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.prose {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ---- printable report (on screen: a sheet of paper over the glass) --------- */

.body-print {
    display: block;
}

.print-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 880px;
    margin: 18px auto;
    padding: 10px 12px;
    border-radius: var(--r-lg);
}

.report {
    max-width: 880px;
    margin: 0 auto 48px;
    padding: 44px 48px;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
}

.report a {
    color: #4350c8;
}

.report-head {
    border-bottom: 3px solid #4f5bd5;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.report-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.report-head h1 {
    margin: 2px 0 0;
    font-size: 22px;
    color: #0f172a;
}

.report-draft {
    display: inline-block;
    margin: 8px 0 0;
    padding: 2px 10px;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 600;
    font-size: 12px;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.report-grid dl {
    margin: 0;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 10px;
}

.report-grid dt {
    color: #64748b;
}

.report-grid dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 7px 8px;
    vertical-align: top;
    text-align: left;
    color: #1e293b;
}

.report-table thead th {
    background: #eef2ff;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #334155;
    border-bottom-color: #c7d2fe;
}

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

.report-table tfoot th {
    background: #eef2ff;
    border-bottom: 0;
}

.report-skill {
    margin: 4px 0 0;
    color: #475569;
}

.report-sign {
    display: grid;
    grid-template-columns: 1.3fr auto auto;
    align-items: end;
    gap: 24px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #cbd5e1;
    page-break-inside: avoid;
}

.report-sign p {
    margin: 0 0 4px;
}

.report-sign-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.report-signature {
    display: block;
    max-height: 70px;
    max-width: 260px;
    margin: 4px 0 2px;
}

.report-sign-name {
    font-size: 17px;
    font-weight: 700;
    border-top: 1px solid #334155;
    padding-top: 4px;
    color: #0f172a;
}

.report-sign-line {
    margin-top: 56px !important;
    padding-top: 4px;
    border-top: 1px solid #334155;
    min-width: 280px;
    color: #64748b;
}

.report-stamp {
    max-height: 120px;
    max-width: 160px;
}

.report-code {
    text-align: right;
    font-size: 12px;
    color: #64748b;
}

.report-code strong {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: #0f172a;
}

.report-qr {
    width: 104px;
    height: 104px;
}

@media print {
    body::before,
    .no-print,
    .topbar,
    .site-footer {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .report {
        border: 0;
        padding: 0;
        margin: 0;
        max-width: none;
        box-shadow: none;
    }

    .report-table thead {
        display: table-header-group;
    }

    .report-table tr {
        page-break-inside: avoid;
    }
}

/* ---- motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* ---- tablet ------------------------------------------------------------------ */

@media (max-width: 920px) {
    .grid-2,
    .grid-calendar {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .site-nav a span {
        display: none;
    }
}

/* ---- phone -------------------------------------------------------------- */

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 14px;
    }

    .topbar {
        padding-top: 10px;
    }

    .topbar-inner {
        gap: 8px;
    }

    .header-role {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .page-title {
        font-size: 24px;
    }

    .panel {
        padding: 26px 20px 22px;
    }

    .panel-title {
        font-size: 24px;
    }

    .field-row,
    .field-row-3,
    .sig-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sig-slot {
        margin-bottom: 14px;
    }

    .detail-list {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .detail-list dd {
        margin-bottom: 10px;
    }

    .card {
        padding: 18px 16px;
    }

    .calendar {
        gap: 4px;
    }

    .cal-day {
        min-height: 48px;
        border-radius: 9px;
    }

    .cal-day > a,
    .cal-day > .cal-num {
        padding: 4px 5px;
    }

    .cal-info {
        font-size: 10px;
    }

    .month-select select {
        min-width: 0;
    }

    .comment {
        max-width: 100%;
    }

    .report {
        padding: 24px 18px;
        border-radius: 0;
    }

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

    .report-sign {
        grid-template-columns: 1fr;
    }

    .report-code {
        text-align: left;
    }
}
