:root {
    --navy: #0b2341;
    --blue: #123f73;
    --yellow: #f4c430;
    --red: #c9232d;
    --white: #ffffff;
    --surface: #f5f7fb;
    --line: #dbe3ef;
    --text: #172033;
    --muted: #64748b;
    --whatsapp: #1fa855;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--surface);
    font-family: Arial, Helvetica, sans-serif;
}

body.theme-dark {
    --surface: #111827;
    --white: #182235;
    --line: #334155;
    --text: #e5e7eb;
    --muted: #aab4c3;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    color: var(--text);
    background: #111827;
    border-color: var(--line);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #94a3b8;
}

body.theme-dark .stat-card strong,
body.theme-dark .form-section h2,
body.theme-dark .data-card strong,
body.theme-dark .topbar h1,
body.theme-dark th {
    color: var(--text);
}

body.theme-dark th {
    background: #0f172a;
}

body.theme-dark .button.ghost,
body.theme-dark .table-scroll-arrow,
body.theme-dark .table-nav-btn {
    color: #dbeafe;
    background: #1e3a5f;
    border-color: #355279;
}

body.theme-dark .badge {
    color: #1f2937;
    background: #fde68a;
}

body.theme-dark .table-scroll,
body.theme-dark .table-wrap,
body.theme-dark .report-table-block,
body.theme-dark .data-card,
body.theme-dark .summary-box {
    background: var(--white);
    border-color: var(--line);
}

body.theme-dark .table-scroll-track,
body.theme-dark .table-scroll-progress {
    background: #334155;
}

body.theme-dark .table-scroll-thumb,
body.theme-dark .table-scroll-progress-bar {
    background: #60a5fa;
}

a {
    color: inherit;
}

.auth-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--navy), var(--blue));
}

.auth-card {
    width: min(100%, 420px);
    padding: 28px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--navy);
    background: var(--yellow);
    border-radius: 8px;
    font-weight: 700;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex: 0 0 auto;
    background: var(--white);
    border-radius: 50%;
}

.brand-logo.large {
    width: 72px;
    height: 72px;
}

.brand span,
.eyebrow,
.user-chip small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.auth-brand {
    margin-bottom: 24px;
}

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

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.password-visibility-field {
    position: relative;
    display: block;
    width: 100%;
}

.password-visibility-field input {
    padding-right: 56px;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 3px;
    width: 44px;
    min-width: 44px;
    min-height: 40px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    transform: translateY(-50%);
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
    color: var(--navy);
    background: #eaf0f8;
}

.password-visibility-toggle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.theme-dark .password-visibility-toggle:hover,
body.theme-dark .password-visibility-toggle:focus-visible {
    color: #dbeafe;
    background: #1e3a5f;
}

select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    font: inherit;
}

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

button,
.button {
    display: inline-flex;
    justify-content: center;
    padding: 12px 16px;
    color: var(--white);
    background: var(--navy);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #f6c344;
    outline-offset: 2px;
}

.button.ghost,
button.ghost {
    color: var(--navy);
    background: #eaf0f8;
}

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

.button.small,
button.small {
    padding: 10px 12px;
    min-height: 44px;
    font-size: 13px;
}

@media (hover: none) and (pointer: coarse), (max-width: 800px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    button,
    .button,
    .button.small,
    button.small,
    .table-scroll-button,
    [data-table-scroll] {
        min-width: 44px;
        min-height: 44px;
    }
}

.button.stat-action {
    align-self: center;
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 54px;
    padding: 7px 10px;
    font-size: 11px;
}

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

.alert {
    margin: 16px 0;
    padding: 12px;
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar {
    padding: 24px;
    color: var(--white);
    background: var(--navy);
}

.sidebar .brand span {
    color: #cbd5e1;
}

.nav-list {
    display: grid;
    gap: 8px;
    margin-top: 28px;
}

.nav-list a,
.bottom-nav a {
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
}

.nav-list a.active,
.nav-list a:hover {
    color: var(--navy);
    background: var(--yellow);
}

.main-panel {
    min-width: 0;
    padding: 24px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

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

.topbar-title {
    display: flex;
    gap: 12px;
    align-items: center;
}

.topbar h1 {
    margin: 4px 0 0;
}

.user-chip {
    display: grid;
    gap: 2px;
    min-width: 180px;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.user-chip a,
.logout-form button {
    color: var(--red);
    padding: 0;
    justify-content: flex-start;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    border-radius: 0;
}

.logout-form {
    margin: 0;
}

.content {
    display: grid;
    gap: 16px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.notice,
.panel {
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

.stat-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
}

.stat-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    font-size: 28px;
    color: var(--navy);
    overflow-wrap: anywhere;
}

.panel h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.panel p {
    margin: 0;
}

.section-head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

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

.form-steps {
    gap: 18px;
}

.form-section {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
}

body.theme-dark .form-section {
    background: #111827;
}

.form-section h2 {
    margin: 0;
    color: var(--navy);
    font-size: 15px;
}

.span-2 {
    grid-column: span 2;
}

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

.filter-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-form label {
    min-width: 180px;
}

.table-wrap,
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    display: block;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.table-wrap table,
.table-scroll table {
    min-width: 760px;
    width: max-content;
    border-collapse: collapse;
}

.card,
.container,
.content,
.page,
.main-content,
.panel,
.section,
.data-card {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.mobile-card-list {
    display: none;
}

.mobile-card-list.always-show {
    display: grid;
    gap: 10px;
}

.data-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.data-card p {
    margin: 0;
}

.card-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
}

.summary-box {
    display: grid;
    gap: 6px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.summary-box span {
    color: var(--muted);
    font-size: 13px;
}

.summary-box strong {
    color: var(--navy);
    font-size: 20px;
}

.notice.compact {
    padding: 12px;
    font-size: 13px;
}

.progress-meter {
    display: grid;
    gap: 6px;
    min-width: 120px;
}

.progress-meter small {
    color: var(--muted);
}

table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

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

th {
    color: var(--navy);
    background: #f8fafc;
    font-size: 13px;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.badge {
    display: inline-flex;
    padding: 5px 8px;
    color: var(--navy);
    background: #fff3bf;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.holiday {
    color: #1e3a8a;
    background: #dbeafe;
}

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

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

.inline-form select {
    min-width: 124px;
    padding: 8px;
    font-size: 12px;
}

.button.danger {
    background: #991b1b;
    border-color: #b91c1c;
    color: #fff;
}

.button.danger:hover,
.button.danger:focus-visible {
    background: #7f1d1d;
}

.bars {
    display: grid;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 40px;
    gap: 10px;
    align-items: center;
}

.bar-track {
    height: 12px;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.bar-track div {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--yellow));
}

.public-card {
    width: min(100%, 1100px);
    max-width: calc(100vw - 24px);
    padding: 24px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}

.auth-body {
    overflow-x: hidden;
}

.public-table-block {
    display: grid;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}

.public-token-table table {
    min-width: 960px;
}

.public-scroll-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.public-scroll-actions .table-scroll-arrow {
    width: auto;
    min-width: 72px;
    padding: 0 12px;
    font-size: 13px;
}

.bottom-nav {
    display: none;
}

.participant-summary {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.participant-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.participant-heading h2 {
    margin: 0 0 4px;
    overflow-wrap: anywhere;
    word-break: normal;
}

.avatar-dot {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: #eaf2ff;
    border-radius: 50%;
    font-weight: 800;
    flex: 0 0 auto;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.summary-grid p {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.summary-grid strong {
    color: var(--muted);
    font-size: 12px;
}

.schedule-stage {
    margin-top: 14px;
    min-width: 0;
}

.schedule-stage h2 {
    margin-top: 0;
    overflow-wrap: anywhere;
}

.table-hint {
    margin: -4px 0 10px;
    color: var(--muted);
    font-size: 12px;
}

.table-scroll-controls {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: center;
    margin: 6px 0 8px;
    max-width: 100%;
}

.table-scroll-controls.has-vertical {
    grid-template-columns: 36px 36px minmax(0, 1fr) 36px 36px;
}

.table-scroll-arrow {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 32px;
    padding: 0;
    color: var(--navy);
    background: #eaf0f8;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}

.table-scroll-arrow-vertical {
    font-size: 14px;
}

.table-scroll-arrow:disabled {
    opacity: .42;
    cursor: default;
}

.table-scroll-track {
    position: relative;
    height: 5px;
    overflow: hidden;
    background: #dbe3ef;
    border-radius: 999px;
}

.table-scroll-thumb {
    position: absolute;
    inset: 0 auto 0 0;
    width: 100%;
    background: var(--blue);
    border-radius: inherit;
    transition: transform .15s ease, width .15s ease;
}

.table-scroll-hint {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.report-table-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    margin-top: 12px;
}

.table-mobile-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.table-nav-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f4fa8;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.table-nav-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.table-scroll-progress {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

.table-scroll-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: left .15s ease, width .15s ease;
}

.report-table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    touch-action: pan-x pan-y;
}

.report-table {
    min-width: 760px;
    width: max-content;
}

.schedule-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

@media (max-width: 800px) {
    html,
    body {
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
        padding-bottom: 72px;
    }

    .sidebar {
        display: none;
    }

    .main-panel {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-chip {
        width: 100%;
    }

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

    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .section-head,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .filter-form {
        display: grid;
    }

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

    .bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        gap: 4px;
        padding: 8px;
        background: var(--white);
        border-top: 1px solid var(--line);
        box-shadow: 0 -12px 30px rgba(15, 23, 42, .08);
    }

    .bottom-nav a,
    .bottom-more summary {
        flex: 1 1 0;
        padding: 8px 4px;
        color: var(--muted);
        text-align: center;
        font-size: 11px;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .bottom-nav a.active {
        color: var(--navy);
        background: #fff3bf;
        font-weight: 700;
    }

    .bottom-more {
        flex: 1 1 0;
        position: relative;
    }

    .bottom-more summary {
        list-style: none;
        border-radius: 8px;
        cursor: pointer;
    }

    .bottom-more summary::-webkit-details-marker {
        display: none;
    }

    .bottom-more[open] summary {
        color: var(--navy);
        background: #fff3bf;
        font-weight: 700;
    }

    .bottom-more-panel {
        position: fixed;
        right: 10px;
        bottom: 64px;
        left: 10px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    }

    .bottom-more-panel a {
        flex: none;
        min-width: 0;
        padding: 10px;
        background: #f8fafc;
        border: 1px solid var(--line);
        text-align: left;
        font-size: 12px;
    }

    .responsive-table {
        display: none;
    }

    .table-wrap,
    .table-scroll {
        max-width: 100%;
        overflow-x: auto;
    }

    .table-wrap table,
    .table-scroll table {
        min-width: 760px;
    }

    .stat-card {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 14px;
    }

    .stat-card strong {
        font-size: 22px;
    }

    .mobile-card-list {
        display: grid;
        gap: 10px;
    }

    .data-card .actions {
        margin-top: 4px;
    }

    .form-section {
        padding: 12px;
    }

    .topbar-title h1 {
        font-size: 22px;
    }

    .participant-heading {
        align-items: flex-start;
    }

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

    .schedule-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .schedule-actions .button {
        justify-content: center;
        width: 100%;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .page,
    .container,
    .content {
        max-width: 100%;
    }

    .main-panel {
        max-width: 100%;
    }

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

    .table-wrap table,
    .table-scroll table {
        min-width: 900px;
    }
}

/* Final hotfix: keep dark mode readable across all TMS pages. */
body.theme-dark {
    --surface: #0f172a;
    --white: #182235;
    --line: #334155;
    --text: #e5e7eb;
    --muted: #b6c2d2;
    color: var(--text);
    background: var(--surface);
}

body.theme-dark .sidebar {
    color: #f8fafc;
    background: #08213e;
}

body.theme-dark .brand strong,
body.theme-dark .nav-list a {
    color: #f8fafc;
}

body.theme-dark .sidebar .brand span,
body.theme-dark .eyebrow,
body.theme-dark .muted,
body.theme-dark .user-chip small,
body.theme-dark .stat-card span,
body.theme-dark .summary-box span,
body.theme-dark .table-scroll-hint {
    color: var(--muted);
}

body.theme-dark .nav-list a.active,
body.theme-dark .nav-list a:hover {
    color: #08213e;
    background: var(--yellow);
}

body.theme-dark .main-panel {
    background: var(--surface);
}

body.theme-dark .user-chip,
body.theme-dark .stat-card,
body.theme-dark .form-section,
body.theme-dark .filter-form,
body.theme-dark .table-scroll,
body.theme-dark .table-wrap,
body.theme-dark .report-table-block,
body.theme-dark .data-card,
body.theme-dark .summary-box,
body.theme-dark .notice,
body.theme-dark .bottom-nav,
body.theme-dark .bottom-more-panel {
    color: var(--text);
    background: var(--white);
    border-color: var(--line);
}

body.theme-dark .topbar h1,
body.theme-dark .form-section h2,
body.theme-dark .stat-card strong,
body.theme-dark .summary-box strong,
body.theme-dark .data-card strong,
body.theme-dark label,
body.theme-dark th,
body.theme-dark td {
    color: var(--text);
}

body.theme-dark th {
    background: #111827;
}

body.theme-dark tr,
body.theme-dark td,
body.theme-dark th {
    border-color: var(--line);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    color: var(--text);
    background: #0f172a;
    border-color: #475569;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #94a3b8;
}

body.theme-dark .button,
body.theme-dark button {
    color: #ffffff;
}

body.theme-dark .button.ghost,
body.theme-dark button.ghost,
body.theme-dark .table-scroll-arrow,
body.theme-dark .table-nav-btn {
    color: #dbeafe;
    background: #1e3a5f;
    border-color: #355279;
}

body.theme-dark .bottom-nav a,
body.theme-dark .bottom-more summary {
    color: var(--muted);
}

body.theme-dark .bottom-nav a.active,
body.theme-dark .bottom-more[open] summary {
    color: #08213e;
    background: #fde68a;
}

body.theme-dark .bottom-more-panel a {
    color: var(--text);
    background: #111827;
    border-color: var(--line);
}

/* Final responsive containment for dashboard tables and participant schedule. */
.app-shell,
.main-panel,
.content,
.panel,
.table-scroll,
.report-table-block {
    min-width: 0;
}

.dashboard-status-table table {
    min-width: 1120px;
}

.schedule-stage .table-scroll table {
    min-width: 760px;
}

.table-scroll-controls,
.table-mobile-control {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.table-scroll-track,
.table-scroll-progress {
    min-width: 0;
}

body.theme-dark .panel,
body.theme-dark .participant-summary,
body.theme-dark .schedule-stage,
body.theme-dark .schedule-actions {
    color: var(--text);
    background: var(--white);
    border-color: var(--line);
}

body.theme-dark .summary-grid p {
    color: var(--text);
    background: #0f172a;
    border-color: #475569;
}

body.theme-dark .summary-grid strong {
    color: #b6c2d2;
}

body.theme-dark .summary-grid span,
body.theme-dark .participant-heading h2,
body.theme-dark .schedule-stage h2,
body.theme-dark .schedule-actions .muted {
    color: var(--text);
}

body.theme-dark .avatar-dot {
    color: #08213e;
    background: #eaf2ff;
}

body.theme-dark .bar-track {
    background: #e5e7eb;
}

body.theme-dark .report-table-block,
body.theme-dark .dashboard-status-table,
body.theme-dark .schedule-stage .table-scroll {
    background: var(--white);
}

body.theme-dark .table-mobile-control .table-nav-btn,
body.theme-dark .table-scroll-controls .table-scroll-arrow {
    color: #dbeafe;
    background: #1e3a5f;
    border-color: #355279;
}

body.theme-dark .table-mobile-control .table-scroll-progress,
body.theme-dark .table-scroll-controls .table-scroll-track {
    background: #334155;
}

body.theme-dark .table-mobile-control .table-scroll-progress-bar,
body.theme-dark .table-scroll-controls .table-scroll-thumb {
    background: #60a5fa;
}

body.theme-dark .badge.holiday {
    color: #dbeafe;
    background: #1e3a8a;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .main-panel {
        width: 100%;
        padding: 14px 12px 84px;
    }

    .topbar,
    .section-head,
    .schedule-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .user-chip {
        width: 100%;
        min-width: 0;
    }

    .filter-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .filter-form label {
        min-width: 0;
    }

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

    .responsive-table {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 10px;
    }

    .table-scroll,
    .report-table-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }

    .table-scroll table,
    .report-table table {
        min-width: 760px;
        width: max-content;
    }

    .dashboard-status-table table {
        min-width: 1120px;
    }

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

    .summary-grid p,
    .participant-heading,
    .topbar-title {
        min-width: 0;
    }

    .data-card .progress-meter {
        display: grid;
        gap: 8px;
        margin-top: 4px;
    }

    .data-card .progress-meter .bar-track {
        width: 100%;
        height: 10px;
        display: block;
    }

    .data-card .progress-meter small {
        display: block;
        line-height: 1.35;
        margin-top: 0;
        position: static;
    }

    .data-card .actions {
        align-items: center;
        gap: 8px;
        margin-top: 8px;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .main-panel {
        width: 100%;
        padding-left: 14px;
        padding-right: 14px;
    }

    .schedule-stage .table-scroll table,
    .table-scroll table {
        min-width: 900px;
    }

    .dashboard-status-table table {
        min-width: 1120px;
    }
}

/* Hotfix 2026-07-19: tahapan pelatihan, instruktur otomatis, invoice WA */
.training-stage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 12px;
}
.training-stage-card {
    border: 1px solid var(--line, #2f4563);
    border-radius: 12px;
    padding: 14px;
    background: rgba(255,255,255,.025);
}
.stage-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.stage-detail-grid p,
.stage-detail-grid label {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stage-detail-grid span {
    color: var(--muted, #aebbd0);
}
.invoice-action-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
input[readonly][data-instructor-manual],
input[readonly][data-instructor-phone],
input[readonly][data-instructor-unit] {
    opacity: .86;
    cursor: not-allowed;
}
@media (max-width: 760px) {
    .training-stage-list,
    .stage-detail-grid {
        grid-template-columns: 1fr;
    }
    .invoice-action-panel {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Mobile audit hotfix 2026-07-20 — containment, controls, cards, and safe tables. */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    max-width: none;
    padding: 0;
    flex: 0 0 auto;
}

.checkbox-line {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.checkbox-line input[type="checkbox"],
.checkbox-line input[type="radio"] {
    margin: 2px 0 0;
}

.summary-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.summary-card span {
    color: var(--muted);
    font-size: 13px;
}

.summary-card strong {
    color: var(--navy);
    font-size: 21px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.detail-grid p {
    display: grid;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 11px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow-wrap: anywhere;
}

.detail-grid p strong {
    color: var(--muted);
    font-size: 12px;
}

.phone-prefix-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.phone-prefix-field__prefix {
    display: grid;
    place-items: center;
    min-width: 50px;
    padding: 0 12px;
    color: var(--navy);
    background: #eaf0f8;
    border-right: 1px solid var(--line);
    font-weight: 800;
}

.phone-prefix-field input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.phone-prefix-field input:focus {
    outline: 2px solid rgba(18, 63, 115, .28);
    outline-offset: -2px;
}

.phone-prefix-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

body.theme-dark .summary-card,
body.theme-dark .detail-grid p,
body.theme-dark .phone-prefix-field {
    color: var(--text);
    background: var(--white);
    border-color: var(--line);
}

body.theme-dark .summary-card strong {
    color: var(--text);
}

body.theme-dark .phone-prefix-field__prefix {
    color: #dbeafe;
    background: #1e3a5f;
    border-color: #355279;
}

/* Keep operational tables visible on mobile when no replacement cards exist. */
@media (max-width: 800px) {
    .responsive-table.mobile-table-keep {
        display: block;
    }

    .bottom-nav {
        z-index: 1000;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .bottom-more-panel {
        z-index: 1001;
        max-height: min(68vh, 480px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .bottom-more-panel a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .topbar-title,
    .user-chip,
    .document-toolbar,
    .document-detail-head,
    .invoice-action-panel,
    .panel,
    .form-section {
        min-width: 0;
    }

    .user-chip form,
    .user-chip button {
        max-width: 100%;
    }

    .actions > .button,
    .actions > button,
    .actions > form {
        max-width: 100%;
    }

    .data-card .actions,
    .invoice-action-panel .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .data-card .actions > .button,
    .data-card .actions > button,
    .data-card .actions > form,
    .data-card .actions form > button,
    .invoice-action-panel .actions > .button,
    .invoice-action-panel .actions > form,
    .invoice-action-panel .actions form > button {
        width: 100%;
    }

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

    .summary-card {
        padding: 13px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .table-scroll.mobile-table-keep table {
        min-width: 680px;
    }

    .main-panel {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 420px) {
    .main-panel {
        padding-right: 10px;
        padding-left: 10px;
    }

    .notice,
    .panel {
        padding: 14px;
    }

    .bottom-nav a,
    .bottom-more summary {
        min-height: 44px;
        font-size: 11px;
        line-height: 1.2;
        padding-right: 2px;
        padding-left: 2px;
    }

    .bottom-more-panel {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 800px) {
    .bottom-more.active-context > summary {
        color: var(--navy);
        background: #fff3bf;
        font-weight: 700;
    }
    body.theme-dark .bottom-more.active-context > summary {
        color: #08213e;
        background: #fde68a;
    }
}


/* V4.2 — force mobile navigation on phones even when browser uses desktop-style viewport. */
@media (hover: none) and (pointer: coarse), (max-width: 1024px) and (orientation: portrait) {
  html,body{overflow-x:hidden!important}
  .app-shell{display:block!important;padding-bottom:calc(82px + env(safe-area-inset-bottom))!important}
  .sidebar{display:none!important}
  .main-panel{padding:14px!important;padding-bottom:calc(96px + env(safe-area-inset-bottom))!important;overflow-x:hidden!important}
  .topbar{align-items:flex-start!important;flex-direction:column!important}
  .user-chip{width:100%!important}
  .bottom-nav{display:flex!important;z-index:1000!important;padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
  .bottom-more-panel{z-index:1001!important;max-height:min(68vh,480px)!important;overflow-y:auto!important}
}

/* Hotfix kumulatif: jadwal publik instruktur dan daftar peserta per instruktur. */
.public-schedule-body {
    display: block;
    min-height: 100dvh;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
}

.public-schedule-body .public-card {
    width: min(100%, 1180px);
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    overflow: visible;
}

.public-schedule-body .public-table-block,
.public-schedule-body .public-token-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.public-schedule-body .public-token-table {
    position: relative;
    display: block;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-gutter: stable;
}

.public-schedule-body .public-token-table table {
    width: max-content;
    min-width: 960px;
}

.public-schedule-body .public-token-table::-webkit-scrollbar,
.instructor-roster-table::-webkit-scrollbar,
.instructor-roster-index::-webkit-scrollbar {
    height: 12px;
}

.public-schedule-body .public-token-table::-webkit-scrollbar-thumb,
.instructor-roster-table::-webkit-scrollbar-thumb,
.instructor-roster-index::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.public-scroll-actions-horizontal {
    justify-content: space-between;
}

.public-table-hint {
    margin: 0;
    font-weight: 700;
}

.instructor-roster-intro {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.instructor-roster-intro h2,
.instructor-roster-title h2 {
    margin: 0 0 6px;
}

.instructor-roster-intro p,
.instructor-roster-title p {
    margin: 0;
}

.instructor-roster-stats {
    margin-bottom: 16px;
}

.instructor-roster-index {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 16px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.instructor-roster-index a {
    display: grid;
    gap: 3px;
    min-width: max-content;
    padding: 10px 14px;
    color: var(--navy);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
}

.instructor-roster-index a:hover,
.instructor-roster-index a:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18, 63, 115, .12);
}

.instructor-roster-index span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.instructor-roster-list {
    display: grid;
    gap: 18px;
}

.instructor-roster-section {
    min-width: 0;
    scroll-margin-top: 16px;
}

.instructor-roster-header {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.instructor-roster-title {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.instructor-roster-actions {
    justify-content: flex-end;
}

.roster-hint {
    margin: 0 0 8px;
}

.instructor-roster-table {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-gutter: stable;
}

.instructor-roster-table table {
    width: max-content;
    min-width: 1120px;
}

.instructor-roster-table td,
.instructor-roster-table th {
    white-space: normal;
}

.instructor-roster-table td:nth-child(2),
.instructor-roster-table td:nth-child(3) {
    min-width: 170px;
}

.badge.status-lulus {
    color: #14532d;
    background: #dcfce7;
}

.badge.status-aktif {
    color: #1e3a8a;
    background: #dbeafe;
}

.badge.status-tertunda {
    color: #854d0e;
    background: #fef3c7;
}

.badge.status-batal {
    color: #991b1b;
    background: #fee2e2;
}

body.theme-dark .instructor-roster-index a {
    color: var(--text);
    background: var(--white);
    border-color: var(--line);
}

body.theme-dark .badge.status-lulus {
    color: #dcfce7;
    background: #166534;
}

body.theme-dark .badge.status-aktif {
    color: #dbeafe;
    background: #1e3a8a;
}

body.theme-dark .badge.status-tertunda {
    color: #fef3c7;
    background: #854d0e;
}

body.theme-dark .badge.status-batal {
    color: #fee2e2;
    background: #991b1b;
}

@media (max-width: 800px) {
    .public-schedule-body {
        padding: 8px;
    }

    .public-schedule-body .public-card {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .public-schedule-body .public-token-table table {
        min-width: 920px;
    }

    .public-scroll-actions-horizontal .table-scroll-arrow {
        flex: 1 1 0;
        min-width: 0;
        height: 42px;
    }

    .instructor-roster-intro,
    .instructor-roster-header {
        align-items: stretch;
        flex-direction: column;
    }

    .instructor-roster-intro .button,
    .instructor-roster-actions .button,
    .instructor-roster-actions .notice {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .instructor-roster-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .instructor-roster-table table {
        min-width: 1080px;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .public-schedule-body .public-card {
        width: 100%;
    }

    .public-schedule-body .public-token-table table,
    .instructor-roster-table table {
        min-width: 980px;
    }
}

/* V6.8: roster mengikuti instruktur pada setiap tahap jadwal peserta. */
.instructor-roster-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.instructor-roster-table table {
    min-width: 1280px;
}

.instructor-roster-table td:nth-child(4),
.instructor-roster-table th:nth-child(4) {
    min-width: 190px;
}

.badge.status-upcoming {
    color: #075985;
    background: #e0f2fe;
}

body.theme-dark .badge.status-upcoming {
    color: #e0f2fe;
    background: #075985;
}

@media (max-width: 1100px) and (min-width: 801px) {
    .instructor-roster-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .instructor-roster-stats {
        grid-template-columns: 1fr;
    }

    .instructor-roster-table table {
        min-width: 1220px;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .instructor-roster-table table {
        min-width: 1160px;
    }
}

/* V6.9 - Jalur peserta dan data Program Desa */
.route-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-weight: 700;
}

.route-badge.program-desa {
    background: #7c3aed;
    color: #fff;
}

.route-badge.pribadi {
    background: #0f766e;
    color: #fff;
}

.route-badge.legacy {
    background: rgba(148, 163, 184, .22);
    color: var(--muted, #94a3b8);
    border: 1px solid rgba(148, 163, 184, .35);
}

.program-desa-group h2 {
    margin: .4rem 0 .25rem;
}

.program-desa-group .section-head {
    align-items: flex-start;
}

.program-desa-stats {
    margin-bottom: 1rem;
}

[data-keterangan-jalur][aria-invalid="true"] {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .15);
}

@media (max-width: 760px) {
    .program-desa-group .section-head {
        gap: .75rem;
    }

    .program-desa-group .section-head > div:first-child {
        min-width: 0;
    }

    .program-desa-group h2 {
        overflow-wrap: anywhere;
    }
}

/* V7.4 — pilihan instruktur Tahap 1 dan Tahap 2 tanpa mengubah tabel dasar. */
.stage-instructor-parking,
.stage-instructor-fields {
    display: contents;
}
.stage-instructor-slot {
    display: contents;
}
.training-stage-card .stage-instructor-fields label {
    min-width: 0;
}
.training-stage-card .stage-instructor-fields small {
    display: block;
    margin-top: 2px;
}
.stage-instructor-fields[hidden] {
    display: none !important;
}


/* V8.0 — Pusat Pengaturan Jadwal Aktif, mobile-first. */
.schedule-center-alert { margin-bottom: 12px; }
.schedule-center-hero { display: flex; gap: 18px; justify-content: space-between; align-items: center; }
.schedule-center-hero h2 { margin: 0 0 6px; }
.schedule-center-hero p { margin: 0; max-width: 760px; color: var(--muted); line-height: 1.55; }
.schedule-center-links { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.schedule-center-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.schedule-center-stats article { padding: 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.schedule-center-stats span { display: block; color: var(--muted); font-size: .82rem; }
.schedule-center-stats strong { display: block; margin-top: 5px; font-size: 1.55rem; }
.schedule-center-search { margin-bottom: 14px; }
.schedule-center-search > label { display: block; font-weight: 700; margin-bottom: 8px; }
.schedule-center-search > div { display: flex; gap: 8px; }
.schedule-center-search input { min-width: 0; flex: 1; }
.schedule-center-list { display: grid; gap: 14px; }
.schedule-participant-card { padding: 0; overflow: hidden; }
.schedule-participant-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 16px 16px 10px; }
.schedule-participant-identity { display: flex; gap: 11px; align-items: center; min-width: 0; }
.schedule-participant-identity h2 { margin: 0; font-size: 1.06rem; overflow-wrap: anywhere; }
.schedule-participant-identity p { margin: 3px 0 0; color: var(--muted); font-size: .84rem; }
.schedule-participant-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-participant-summary p { margin: 0; padding: 11px 13px; background: var(--white); min-width: 0; }
.schedule-participant-summary span { display: block; color: var(--muted); font-size: .72rem; }
.schedule-participant-summary strong { display: block; margin-top: 3px; font-size: .84rem; overflow-wrap: anywhere; }
.schedule-stage-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; }
.schedule-stage-strip span { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(59, 130, 246, .05); }
.schedule-stage-strip small { display: block; color: var(--muted); font-size: .72rem; }
.schedule-stage-strip strong { display: block; margin-top: 3px; font-size: .88rem; }
.schedule-control-details { border-top: 1px solid var(--line); }
.schedule-control-details > summary { cursor: pointer; padding: 13px 16px; font-weight: 800; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.schedule-control-details > summary::-webkit-details-marker { display: none; }
.schedule-control-details > summary::after { content: '+'; font-size: 1.2rem; }
.schedule-control-details[open] > summary::after { content: '−'; }
.schedule-control-form { padding: 0 14px 14px; display: grid; gap: 12px; }
.schedule-control-section { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(148, 163, 184, .05); display: grid; gap: 11px; }
.schedule-control-section h3 { margin: 0; font-size: .96rem; }
.schedule-control-section label { display: grid; gap: 5px; font-size: .82rem; font-weight: 700; min-width: 0; }
.schedule-manual-fields, .schedule-time-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.schedule-stage-two { border-color: rgba(14, 165, 233, .35); background: rgba(14, 165, 233, .055); }
.schedule-sunday-toggle { display: flex !important; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; font-weight: 400 !important; }
.schedule-sunday-toggle input { width: 19px; height: 19px; margin-top: 1px; flex: 0 0 auto; }
.schedule-sunday-toggle span { min-width: 0; }
.schedule-sunday-toggle strong, .schedule-sunday-toggle small { display: block; }
.schedule-sunday-toggle small { margin-top: 2px; color: var(--muted); line-height: 1.35; }
.schedule-save-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; position: sticky; bottom: 64px; z-index: 4; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 -8px 24px rgba(15, 23, 42, .08); }
.schedule-save-bar p { margin: 0; color: var(--muted); font-size: .78rem; }
.schedule-save-bar button { flex: 0 0 auto; }
.schedule-graduation-form { display: grid; gap: 12px; padding: 14px; }
.schedule-graduation-form textarea { width: 100%; }
.schedule-graduation-confirm { align-items: flex-start; }
.schedule-graduation-control > summary { color: #b42318; }
.schedule-graduation-form .danger { justify-self: start; }
.session-editor { background: rgba(148, 163, 184, .025); }
.schedule-session-list { display: grid; gap: 10px; padding: 0 14px 14px; }
.schedule-session-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.schedule-session-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.schedule-session-card > header strong, .schedule-session-card > header small { display: block; }
.schedule-session-card > header small { color: var(--muted); margin-top: 2px; }
.schedule-session-card > header > span { font-size: .78rem; font-weight: 800; }
.schedule-session-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.schedule-session-fields label { display: grid; gap: 4px; font-size: .75rem; font-weight: 700; min-width: 0; }
.schedule-session-fields .session-unit { grid-column: span 2; }
.schedule-session-fields .schedule-sunday-toggle { grid-column: span 2; }
.schedule-sunday-toggle.compact { padding: 8px; }
.progress-correction-editor { background: rgba(245, 158, 11, .035); }
.progress-correction-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px 12px; }
.progress-correction-heading p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.progress-correction-heading > strong { flex: 0 0 auto; padding: 7px 9px; border: 1px solid rgba(245, 158, 11, .38); border-radius: 8px; background: rgba(245, 158, 11, .08); font-size: .82rem; }
.progress-correction-list { border-top: 1px solid var(--line); padding: 0 14px 14px; }
.progress-correction-card { padding: 12px 0; border-bottom: 1px solid var(--line); }
.progress-correction-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.progress-correction-card > header strong, .progress-correction-card > header small { display: block; }
.progress-correction-card > header small { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.progress-correction-card .badge.warning { border-color: rgba(245, 158, 11, .38); background: rgba(245, 158, 11, .1); color: #92400e; }
.progress-correction-fields { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(190px, 1fr) minmax(260px, 1.5fr); gap: 8px; margin-bottom: 10px; }
.progress-correction-fields label { display: grid; gap: 4px; min-width: 0; font-size: .75rem; font-weight: 700; }
.progress-correction-card button { min-height: 40px; }
.schedule-participant-footer { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }

/* V8.2 - pilihan durasi Sarana LV per peserta. */
.daily-duration-control { display: grid; gap: 8px; padding: 12px; border: 1px solid rgba(14, 165, 233, .38); border-radius: 8px; background: rgba(14, 165, 233, .06); }
.daily-duration-control > small { color: var(--muted); line-height: 1.4; }
.daily-duration-summary { margin: 0; font-size: .8rem; line-height: 1.45; }
.duration-badge { margin-top: 4px; border-color: rgba(14, 165, 233, .36); background: rgba(14, 165, 233, .1); color: #075985; white-space: normal; }
.theme-dark .duration-badge { color: #bae6fd; }

@media (max-width: 800px) {
    .schedule-center-hero { align-items: stretch; flex-direction: column; }
    .schedule-center-links .button { flex: 1 1 0; text-align: center; }
    .schedule-center-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .schedule-center-stats article { padding: 12px; }
    .schedule-center-stats strong { font-size: 1.28rem; }
    .schedule-center-search > div { display: grid; grid-template-columns: 1fr auto; }
    .schedule-center-search > div .button { grid-column: 1 / -1; text-align: center; }
    .schedule-participant-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-stage-strip { grid-template-columns: 1fr; }
    .schedule-manual-fields, .schedule-time-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-save-bar { align-items: stretch; flex-direction: column; bottom: 58px; }
    .schedule-save-bar button { width: 100%; }
    .schedule-graduation-form .danger { width: 100%; }
    .schedule-session-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-session-fields .session-unit, .schedule-session-fields .schedule-sunday-toggle { grid-column: 1 / -1; }
    .progress-correction-heading { align-items: flex-start; flex-direction: column; }
    .progress-correction-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .progress-correction-fields .correction-reason { grid-column: 1 / -1; }
    .daily-duration-control select { min-height: 44px; }
}

@media (max-width: 420px) {
    .schedule-participant-head { padding: 13px 12px 9px; }
    .schedule-participant-summary p { padding: 9px 10px; }
    .schedule-stage-strip { padding: 10px 12px; }
    .schedule-control-details > summary { padding: 12px; }
    .schedule-control-form, .schedule-session-list, .progress-correction-heading, .progress-correction-list { padding-left: 10px; padding-right: 10px; }
    .schedule-control-section { padding: 11px; }
    .schedule-manual-fields, .schedule-time-grid, .schedule-session-fields { grid-template-columns: 1fr; }
    .schedule-session-fields .session-unit, .schedule-session-fields .schedule-sunday-toggle { grid-column: auto; }
    .progress-correction-fields { grid-template-columns: 1fr; }
    .progress-correction-fields .correction-reason { grid-column: auto; }
    .progress-correction-card > header { align-items: stretch; flex-direction: column; }
    .progress-correction-card > header .badge { align-self: flex-start; }
    .progress-correction-card button { width: 100%; }
}

/* V9.2 — slot jam cepat, kendaraan fisik, dan sentuhan HP. */
[data-time-slot-target] { min-height: 44px; }
.schedule-control-section input[type="time"],
.schedule-control-section input[list],
.stage-instructor-fields input[list] { min-height: 44px; }
.schedule-control-section label > small,
.stage-instructor-fields label > small { color: var(--muted); line-height: 1.4; font-weight: 500; }

@media (max-width: 800px) {
    [data-time-slot-target],
    .schedule-control-section input[type="time"],
    .schedule-control-section input[list],
    .stage-instructor-fields input[list] {
        font-size: 16px;
        touch-action: manipulation;
    }
}

/* V9.3 — pilihan hari latihan khusus per peserta, mobile-first. */
.training-weekday-picker {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(14, 165, 233, .38);
    border-radius: 13px;
    background: rgba(14, 165, 233, .055);
}
.training-weekday-picker legend {
    padding: 0 6px;
    font-size: .9rem;
    font-weight: 800;
}
.training-weekday-picker > p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.45;
}
.weekday-preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}
.weekday-preset-actions .button {
    min-height: 38px;
}
.training-weekday-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.training-weekday-option {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px !important;
    min-height: 46px;
    padding: 9px 8px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--white);
    cursor: pointer;
    font-size: .8rem !important;
    font-weight: 750 !important;
    text-align: center;
    touch-action: manipulation;
}
.training-weekday-option:has(input:checked) {
    border-color: rgba(14, 165, 233, .7);
    background: rgba(14, 165, 233, .12);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, .08);
}
.training-weekday-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
}
.training-weekday-summary {
    display: block;
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(15, 118, 110, .1);
    color: #0f766e;
    font-size: .8rem;
    line-height: 1.4;
}
.training-weekday-summary.is-empty {
    background: rgba(239, 68, 68, .1);
    color: #b91c1c;
}
.training-weekday-picker > small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.45;
}
.theme-dark .training-weekday-summary {
    color: #99f6e4;
}
.theme-dark .training-weekday-summary.is-empty {
    color: #fecaca;
}

@media (max-width: 800px) {
    .training-weekday-picker {
        padding: 12px;
    }
    .training-weekday-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .training-weekday-option {
        min-height: 50px;
        font-size: .86rem !important;
    }
    .weekday-preset-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .weekday-preset-actions .button {
        width: 100%;
        min-height: 44px;
    }
}


/* V9.3.2 — Hari ke- tersinkron pada seluruh Peserta per Instruktur. */
.instructor-roster-table .roster-day-progress {
    min-width: 118px;
    text-align: center;
}

.instructor-roster-table .roster-day-progress strong {
    display: block;
    color: #1d4ed8;
    white-space: nowrap;
}

.instructor-roster-table .roster-day-progress .muted {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
}

body.theme-dark .instructor-roster-table .roster-day-progress strong {
    color: #93c5fd;
}

.instructor-roster-table table {
    min-width: 1390px;
}

@media (max-width: 800px) {
    .instructor-roster-table table {
        min-width: 1320px;
    }
}

@media (orientation: landscape) and (max-width: 1024px) {
    .instructor-roster-table table {
        min-width: 1260px;
    }
}

/* V9.3.1 — pembeda warna jalur peserta pada mode terang dan gelap. */
.route-badge.program-desa,
body.theme-dark .route-badge.program-desa {
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #60a5fa;
}

.route-badge.pribadi,
body.theme-dark .route-badge.pribadi {
    color: #ffffff;
    background: #16a34a;
    border: 1px solid #4ade80;
}

/* V9.9.1 FINAL — target sentuh navigasi HP dan umpan balik sentuhan. */
@media (max-width: 800px), (hover: none) and (pointer: coarse) {
    .bottom-nav > a,
    .bottom-more > summary,
    .bottom-more-panel a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(244, 196, 48, .26);
        transition: transform .12s ease, filter .12s ease, background-color .12s ease;
    }

    .bottom-more-panel a {
        justify-content: flex-start;
    }

    .bottom-nav > a:active,
    .bottom-more > summary:active,
    .bottom-more-panel a:active {
        transform: scale(.96);
        filter: brightness(.94);
    }
}
