:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-text: #22252a;
    --color-muted: #6b7280;
    --color-border: #e2e5ea;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-danger: #dc2626;
    --color-saturday: #2563eb;

    --cal-reported: #d9f2d9;
    --cal-overdue: #fbd0d0;
    --cal-border: #d7dae0;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

a { color: var(--color-primary); }

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }
.btn-icon-label { display: inline-flex; align-items: center; gap: 0.3rem; }

button {
    font-family: inherit;
    cursor: pointer;
}

.btn {
    display: inline-block;
    padding: 0.6em 1.2em;
    border-radius: 8px;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
}
.btn:hover { background: var(--color-primary-dark); }
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-danger { background: var(--color-danger); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--color-muted); }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
    width: 100%;
    padding: 0.55em 0.7em;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
}

.radio-row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.field .radio-row label { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0; color: var(--color-text); }
.radio-row input[type="radio"] { width: auto; }
.field-error { color: var(--color-danger); font-size: 0.85rem; margin-top: 0.25rem; }

.error-box {
    background: #fdecec;
    color: var(--color-danger);
    border: 1px solid #f5b5b5;
    border-radius: 6px;
    padding: 0.6em 0.9em;
    margin-bottom: 1rem;
    white-space: pre-line;
    font-size: 0.9rem;
}

.card {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 1.5rem;
}

/* --- 共通ヘッダー(User/Admin両方で使用) --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.app-header-title { font-weight: 600; }
.app-header-actions { display: flex; align-items: center; gap: 0.8rem; }

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.2rem;
}
.badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.65rem;
    min-width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}

.status-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.status-reported { background: var(--cal-reported); }
.status-pending { background: #fde68a; }
.status-na { background: #e5e7eb; color: var(--color-muted); }
.status-walkin { background: #fef3c7; color: #92400e; margin-left: 0.4rem; }

/* --- landing --- */
.landing {
    max-width: 640px;
    margin: 8vh auto;
    padding: 0 1.5rem;
    text-align: center;
}
.landing h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.landing-lead { color: var(--color-muted); margin-bottom: 2.5rem; }
.landing-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-card {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 1.8rem 1.2rem;
    text-decoration: none;
    color: var(--color-text);
}
.landing-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.14); }
.landing-card-title { font-size: 1.1rem; font-weight: 600; }
.landing-card-desc { font-size: 0.85rem; color: var(--color-muted); }
.landing-card-admin .landing-card-title { color: var(--color-danger); }

/* --- auth pages (login/register) --- */
.auth-page {
    max-width: 420px;
    margin: 8vh auto;
    padding: 0 1.5rem;
}
.auth-page h1 { font-size: 1.3rem; text-align: center; margin-bottom: 1.5rem; }
.auth-links { margin-top: 1rem; text-align: center; font-size: 0.9rem; }

/* --- modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal-box {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box h2 { margin-top: 0; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; }
.hidden { display: none !important; }
