:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --line: #d9e2ec;
    --text: #16202a;
    --muted: #5f6c7b;
    --accent: #0f766e;
    --accent-soft: #d8f3ef;
    --warm: #c2410c;
    --warm-soft: #ffedd5;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1,
h2,
p {
    margin: 0;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 14px 36px;
}

.page-header {
    display: block;
    margin-bottom: 20px;
}

.eyebrow,
.section-eyebrow {
    margin: 0 0 8px;
    color: var(--warm);
    font-size: 14px;
    font-weight: 700;
}

h1 {
    font-size: 28px;
    line-height: 1.18;
}

.page-copy {
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.day-selector {
    margin-bottom: 24px;
}

.day-selector__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

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

.day-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.day-nav::-webkit-scrollbar {
    height: 8px;
}

.day-nav::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: #cbd5e1;
}

.day-link {
    position: relative;
    display: flex;
    flex: 0 0 clamp(116px, 34vw, 152px);
    flex-direction: column;
    justify-content: space-between;
    min-height: 124px;
    padding: 14px 12px;
    border: 2px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
}

.day-link.is-selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.day-link__weekday {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.day-link__date {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

.day-link__footer {
    display: grid;
    gap: 2px;
}

.day-link__count {
    font-size: 26px;
    line-height: 1.05;
}

.day-link__count-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

.day-link__badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 7px;
    border-radius: 8px;
    background: var(--warm-soft);
    color: var(--warm);
    font-size: 12px;
    font-weight: 700;
}

.day-link.is-selected .day-link__date,
.day-link.is-selected .day-link__count-label {
    color: rgba(255, 255, 255, 0.82);
}

.day-link.is-selected .day-link__badge {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.summary-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.period-summary {
    margin-bottom: 18px;
}

.control-bar {
    margin-bottom: 20px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d92d20;
    border-radius: 8px;
    background: #d92d20;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(217, 45, 32, 0.18);
}

.action-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: rgba(15, 23, 42, 0.48);
}

.modal-backdrop[hidden] {
    display: none;
}

.confirm-modal {
    width: min(100%, 360px);
    padding: 20px;
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18);
}

.confirm-modal__eyebrow {
    margin-bottom: 8px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}

.confirm-modal__title {
    font-size: 24px;
    line-height: 1.28;
}

.confirm-modal__copy {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.confirm-modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.modal-button--danger {
    border-color: #d92d20;
    background: #d92d20;
    color: #ffffff;
}

.modal-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.summary-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.summary-panel--primary {
    background: #ecfeff;
}

.summary-panel__label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.summary-panel__value {
    margin-top: 10px;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.summary-panel__hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.list-section {
    margin-top: 6px;
    scroll-margin-top: 16px;
}

.table-wrap,
.pagination-bar {
    transition: opacity 0.18s ease;
}

.list-section[aria-busy="true"] .table-wrap,
.list-section[aria-busy="true"] .pagination-bar {
    opacity: 0.72;
}

.section-header {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.list-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px 12px;
}

.list-total {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

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

.error-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #fda29b;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    line-height: 1.5;
}

.list-shell {
    display: grid;
    gap: 14px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.daily-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: var(--panel);
}

.daily-table__head th {
    padding: 11px 8px;
    border-bottom: 1px solid var(--line);
    background: #edf4fb;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.th-full {
    display: none;
}

.th-short {
    display: inline;
}

.daily-table__row:nth-child(even) td {
    background: #fbfcfe;
}

.daily-table__cell {
    padding: 12px 8px;
    border-top: 1px solid #ebf0f5;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.daily-table__cell--order {
    width: 60px;
    padding-left: 6px;
    padding-right: 6px;
}

.daily-table__cell--count {
    width: 44px;
    font-size: 13px;
    font-weight: 800;
}

.daily-table__cell--menu {
    width: 88px;
    text-align: left;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.25;
    font-size: 12px;
    font-weight: 800;
}

.daily-table__cell--status {
    width: 58px;
}

.daily-table__cell--time {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 42px;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.status-badge.is-pending {
    background: #eef2f6;
    color: #475467;
}

.status-badge.is-progress {
    background: var(--warm-soft);
    color: var(--warm);
}

.status-badge.is-complete {
    background: var(--accent-soft);
    color: var(--accent);
}

.status-badge.is-unknown {
    background: #f4f4f5;
    color: #52525b;
}

.order-code {
    display: block;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.daily-table__empty-row td {
    padding: 0;
}

.empty-state {
    padding: 34px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 16px;
}

.pagination-bar {
    display: grid;
    gap: 10px;
}

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

.pagination__edge,
.pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
}

.pagination__edge {
    min-width: 34px;
    padding: 0 8px;
}

.pagination__page.is-current {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.pagination__edge.is-disabled {
    background: #f8fafc;
    color: #98a2b3;
}

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

.admin-page {
    padding-top: 22px;
}

.admin-page__header {
    display: grid;
    gap: 14px;
}

.admin-logout-form {
    margin: 0;
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.16);
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
}

.danger-button {
    border: 1px solid #d92d20;
    background: #d92d20;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(217, 45, 32, 0.14);
}

.admin-summary-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-summary__value {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.32;
}

.admin-panel {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.admin-panel--auth {
    max-width: 520px;
}

.admin-panel__header {
    margin-bottom: 14px;
}

.admin-form {
    display: grid;
    gap: 14px;
}

.admin-form__grid {
    display: grid;
    gap: 12px;
}

.field-label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.text-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.text-input:focus {
    outline: 2px solid rgba(15, 118, 110, 0.18);
    outline-offset: 0;
    border-color: var(--accent);
}

.admin-form__hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.admin-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-date-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-date-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.admin-notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.admin-notice--success {
    border: 1px solid #8dd7ce;
    background: #e7faf6;
    color: var(--accent);
}

.admin-notice--error {
    border: 1px solid #fda29b;
    background: var(--danger-soft);
    color: var(--danger);
}

.event-admin-list {
    display: grid;
    gap: 12px;
}

.event-admin-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbff;
}

.event-admin-item__body {
    display: grid;
    gap: 14px;
}

.event-admin-item__meta {
    display: grid;
    gap: 6px;
}

.event-admin-item__name {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
}

.event-admin-item__period {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.event-admin-item__share {
    display: grid;
    gap: 6px;
}

.event-admin-item__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.event-admin-item__url {
    display: inline-block;
    overflow-wrap: anywhere;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.event-admin-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.event-admin-item__delete-form {
    margin: 0;
}

.guide-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.guide-panel {
    width: min(100%, 520px);
    padding: 28px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

@media (min-width: 768px) {
    .page {
        padding: 28px 20px 44px;
    }

    .admin-page__header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .summary-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    }

    .admin-summary-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
    }

    .summary-panel {
        padding: 24px;
    }

    .summary-panel__value {
        font-size: 58px;
    }

    .section-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        gap: 16px;
    }

    .list-total {
        font-size: 32px;
    }

    .daily-table__head th {
        padding: 14px 16px;
        font-size: 13px;
    }

    .day-link {
        flex-basis: 168px;
        min-height: 140px;
        padding: 18px 16px;
    }

    .day-link__weekday {
        font-size: 32px;
    }

    .day-link__count {
        font-size: 30px;
    }

    .th-full {
        display: inline;
    }

    .th-short {
        display: none;
    }

    .daily-table__cell {
        padding: 15px 16px;
        font-size: 14px;
    }

    .daily-table__cell--order {
        width: 96px;
    }

    .daily-table__cell--count {
        width: 80px;
        font-size: 14px;
    }

    .daily-table__cell--menu {
        width: 180px;
        font-size: 14px;
    }

    .daily-table__cell--status {
        width: 92px;
    }

    .daily-table__cell--time {
        font-size: 14px;
    }

    .status-badge {
        min-width: 52px;
        font-size: 12px;
    }

    .order-code {
        font-size: 20px;
    }

    .admin-panel {
        padding: 22px;
    }

    .admin-form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-admin-item {
        padding: 18px;
    }

}
