:root {
    color-scheme: light;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    background: #f1f5f9;
    color: #1d252c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f1f5f9;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
}

.top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 0 24px;
    border-bottom: 1px solid #d7dde2;
    background: #ffffff;
}

.top-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 700;
    text-decoration: none;
    color: #2d3748;
}

.brand-title {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subtitle {
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #5a6b7c;
    font-size: 14px;
}

.primary-nav a {
    text-decoration: none;
}

.primary-nav a:hover {
    color: #2d3748;
}

.nav-user {
    color: #2d3748;
    font-weight: 600;
}

.main-content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 32px 24px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.25;
}

.page-header p {
    margin: 0;
    color: #5a6b7c;
}

.login-page {
    display: flex;
    justify-content: center;
}

.login-panel {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid #d7dde2;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.12);
}

.login-subtitle {
    margin-top: 8px;
    color: #5a6b7c;
}

.login-error {
    margin: 16px 0;
    padding: 10px 12px;
    border: 1px solid #f0b7c3;
    border-radius: 8px;
    background: #fff4f6;
    color: #a42318;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #5a6b7c;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d1d8;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
}

.login-button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #2d6b79;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.login-button:hover {
    background: #25576a;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    margin-bottom: 16px;
}

.legend-card {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid #dbe3ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
}

.legend-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-chip {
    width: 14px;
    height: 14px;
    border-radius: 5px;
    border: 1px solid transparent;
}

.legend-empty {
    background: #f8fafc;
    border-color: #dbe3ea;
}

.legend-caution {
    background: #facc15;
    border-color: #eab308;
}

.legend-full {
    background: #ef4444;
    border-color: #dc2626;
}

.calendar-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #c8d1d8;
    border-radius: 10px;
    background: #ffffff;
    color: #2d3748;
    font-weight: 600;
    text-decoration: none;
}

.button-link:hover {
    background: #eef3f5;
}

.panel {
    padding: 20px;
    border: 1px solid #d7dde2;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.07);
}

.panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.panel ul {
    margin: 0;
    padding-left: 20px;
}

.panel li + li {
    margin-top: 6px;
}

.calendar-panel {
    overflow: hidden;
    padding: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 92px;
    padding: 20px 22px;
    background: #1e293b;
    color: #ffffff;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.month-title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.month-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.month-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.month-btn-icon {
    width: 40px;
    padding: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.month-btn-today {
    padding-inline: 16px;
}

.calendar-weekdays {
    border-bottom: 1px solid #dbe3ea;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
}

.weekday-label {
    padding: 12px 6px;
}

.weekday-sunday {
    color: #ef4444;
}

.weekday-saturday {
    color: #2563eb;
}

.calendar-days {
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 170px;
    padding: 12px 10px 10px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.calendar-day:hover {
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.calendar-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.calendar-day-date {
    display: inline-flex;
}

.day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
}

.day-chips {
    display: grid;
    gap: 5px;
    align-content: start;
}

.slot-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.68rem;
    line-height: 1.2;
}

.slot-chip-label {
    font-weight: 800;
}

.slot-chip-value {
    font-weight: 700;
    white-space: nowrap;
}

.slot-chip--empty {
    background: #f8fafc;
    border-color: #dbe3ea;
    color: #94a3b8;
}

.slot-chip--open {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.slot-chip--caution {
    background: #facc15;
    border-color: #eab308;
    color: #1f2937;
}

.slot-chip--full {
    background: #ef4444;
    border-color: #dc2626;
    color: #ffffff;
}

.slot-chip-noassign {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.outside-month {
    background: #f7f9fc;
    color: #94a3b8;
}

.outside-month .day-number {
    opacity: 0.72;
}

.outside-month .day-chips {
    opacity: 0.56;
}

.past-day {
    background: #f7f9fc;
    filter: saturate(0.82) brightness(0.985);
}

.past-day .day-chips {
    opacity: 0.66;
}

.today .day-number {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.day-panel {
    padding: 0;
    overflow: hidden;
}

.day-panel-invalid {
    padding: 24px;
}

.detail-panel {
    padding: 0;
    overflow: hidden;
}

.detail-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 16px 20px;
    background: #1e293b;
    color: #ffffff;
}

.detail-back-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.detail-back-link:hover {
    color: #cbd5e1;
}

.detail-title {
    margin: 0;
    flex: 1;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
}

.detail-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 14px;
    background: #2563eb;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.detail-save-button:hover {
    background: #1d4ed8;
}

.detail-save-button:disabled,
.login-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.detail-banner-wrap {
    padding: 20px 24px 0;
}

.detail-body {
    padding: 24px;
}

.detail-slot-section + .detail-slot-section {
    margin-top: 48px;
}

.detail-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.detail-slot-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-slot-heading h3 {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 800;
}

.detail-slot-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    background: #334155;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 900;
}

.detail-slot-total {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 0.92rem;
    font-weight: 800;
}

.detail-slot-fields {
    display: grid;
    grid-template-columns: 140px minmax(180px, 1fr) minmax(140px, 180px);
    gap: 14px;
}

.detail-content-field {
    grid-column: 1 / -1;
}

.day-sections {
    display: grid;
    gap: 16px;
    padding: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.day-section {
    padding: 18px;
    border: 1px solid #dbe3ea;
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff 0%, #f7fafc 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.day-section h3 {
    margin: 2px 0 0;
    font-size: 1rem;
    color: #1e293b;
}

.day-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.day-slot-code {
    margin: 0;
    color: #2d6b79;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-content {
    min-height: 60px;
}

.empty-state {
    margin: 0;
    color: #a0aeb6;
}

.form-field {
    margin-bottom: 12px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #5a6b7c;
}

.form-field input[type="number"],
.form-field textarea,
.text-input,
.text-area {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d1d8;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    font-family: inherit;
}

.form-field textarea,
.text-area {
    min-height: 84px;
    resize: vertical;
}

.day-caption {
    margin: 0;
    color: #5a6b7c;
    max-width: 420px;
    text-align: right;
}

.detail-count-input {
    text-align: center;
    font-weight: 800;
}

.detail-note-input {
    min-height: 88px;
}

.detail-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.detail-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 24px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
}

.detail-cancel-button:hover {
    background: #f1f5f9;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0;
    padding: 0 24px 24px;
}

.status-banner {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.success-banner {
    border: 1px solid #b7d9bf;
    background: #eef9f0;
    color: #255c2f;
}

.error-banner {
    border: 1px solid #f0b7c3;
    background: #fff4f6;
    color: #a42318;
}

.status-panel {
    margin-top: 20px;
}

.error-panel p {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .top-bar {
        gap: 8px;
        padding: 12px 16px;
    }

    .top-bar-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .primary-nav {
        width: 100%;
        justify-content: flex-end;
    }

    .main-content {
        padding: 24px 16px;
    }

    .calendar-header {
        justify-content: stretch;
    }

    .legend-card {
        width: 100%;
    }

    .month-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .month-controls {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .detail-topbar,
    .detail-slot-header,
    .detail-slot-fields,
    .detail-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-title {
        text-align: left;
    }

    .detail-save-button,
    .detail-cancel-button {
        width: 100%;
    }

    .detail-body,
    .detail-banner-wrap,
    .detail-footer {
        padding: 18px;
    }

    .detail-slot-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .calendar-day {
        min-height: 136px;
        padding: 8px;
    }

    .slot-chip {
        padding: 5px 6px;
        font-size: 0.66rem;
    }
}


/* カレンダーと人工枠入力の共通外観 */
:root {
    --header-height: 40px;
    --header-bg: #1e293b;
    --grid-line: #a8b6c6;
    --table-line: #cbd5e1;
    --total-line: #94a3b8;
    --control-border: #64748b;
    --row-hover: #eff6ff;
    --action: #1d4ed8;
    scrollbar-gutter: stable;
}
button, input, select, textarea { font-family: inherit; }
.top-bar { position: sticky; top: 0; z-index: 10; min-height: 64px; background: #0f172a; color: white; border: 0; box-shadow: 0 2px 5px #0f172a26; }
.top-bar-container { max-width: 1232px; min-height: 64px; padding-block: 10px; flex-wrap: wrap; gap: 8px 24px; }
.brand { flex-direction: row; align-items: center; gap: 12px; color: white; }
.brand-title { color: white; font-size: 20px; font-weight: 700; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: #2563eb; flex: none; }
.primary-nav { gap: 4px; flex-wrap: wrap; color: #cbd5e1; margin-left: auto; }
.account-nav { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; padding-left: 20px; border-left: 1px solid #475569; font-size: 13px; }
.logout-link { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 5px 10px; color: #e2e8f0; text-decoration: none; border: 1px solid #64748b; border-radius: 6px; white-space: nowrap; }
.logout-link:hover { background: #334155; color: white; }
.account-nav a:focus-visible { outline-color: #93c5fd; }
.primary-nav a { color: #cbd5e1; display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 6px; padding: 9px 14px; font-weight: 600; min-height: 38px; white-space: nowrap; }
.primary-nav a:hover { color: white; background: #334155; }
.primary-nav a.active { color: white; background: #334155; border-color: #94a3b8; box-shadow: inset 0 -3px #60a5fa; }
.nav-user { color: #e2e8f0; overflow-wrap: anywhere; }
.main-content { width: min(1280px, 100%); padding: 18px 24px; }
.period-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.period-actions .button-link, .period-actions input, .tab-input-actions .button-link { display: inline-flex; align-items: center; justify-content: center; height: 38px; min-height: 38px; border: 1px solid var(--control-border); border-radius: 6px; background: white; color: #334155; font: inherit; font-weight: 600; padding: 7px 12px; }
.period-actions .period-step { display: grid; place-items: center; width: 38px; padding: 0; line-height: 1; flex: none; }
.period-step svg { display: block; }
.period-actions input { width: 160px; padding-inline: 8px; font-size: 16px; }
.period-actions button:hover:not(:disabled), .tab-input-actions button:hover:not(:disabled) { color: var(--action); border-color: var(--action); background: #f8fafc; }
.period-actions button:disabled, .period-actions input:disabled, .capacity-panel button:disabled, .tab-input-actions button:disabled { color: #64748b; background: #e2e8f0; border-color: #94a3b8; cursor: default; }
.tab-action-row { display: flex; gap: 6px 16px; min-height: 45px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--grid-line); }
.company-tabs { display: flex; flex: 0 0 auto; align-items: stretch; gap: 3px; max-width: 100%; min-width: 0; overflow-x: auto; margin: 0; padding: 0; }
.company-tab { height: 44px; padding: 0 16px; border: 1px solid var(--control-border); border-bottom: 0; border-radius: 8px 8px 0 0; background: #e2e8f0; color: #334155; font: inherit; font-weight: 600; white-space: nowrap; flex-shrink: 0; cursor: pointer; }
.company-tab[aria-pressed="true"] { background: #fff; color: var(--action); box-shadow: inset 0 3px var(--action); }
.company-tab:disabled { opacity: .65; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }
.company-tab:focus-visible { outline-offset: -3px; }
.primary-nav a:focus-visible { outline-color: #93c5fd; }
.company-panel { min-width: 0; background: white; border: 1px solid var(--grid-line); border-top: 0; overflow: hidden; border-radius: 0 0 12px 12px; box-shadow: 0 1px 3px #0f172a0d; }
.company-table-scroll { position: relative; width: 100%; overflow-x: auto; }
.company-slot-table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: center; }
.company-slot-table col:first-child { width: 22%; }
.company-slot-table col:not(:first-child) { width: 15.6%; }
.company-slot-table thead th { height: var(--header-height); padding: 0 8px; background: var(--header-bg); color: white; font-size: 13px; font-weight: 600; }
.company-slot-table thead th:first-child, .company-slot-table tbody th { text-align: left; padding-left: 18px; }
.company-slot-table tbody th { font-weight: 600; background: white; }
.company-slot-table tbody tr:nth-child(even) > * { background: #f8fafc; }
.company-slot-table tbody tr:hover > *, .company-slot-table tbody tr:focus-within > * { background: var(--row-hover); }
.company-slot-table tbody tr > * { padding: 10px 9px; border-bottom: 1px solid var(--table-line); }
.company-slot-table tbody tr:last-child > * { border-bottom: 0; }
.company-slot-table tr > :not(:last-child) { border-right: 1px solid #dbe2ea; }
.company-slot-table thead tr > th:not(:last-child) { border-right-color: #475569; }
.company-slot-table tfoot th, .company-slot-table tfoot td { padding: 15px 9px; border-top: 2px solid var(--total-line); background: #f1f5f9; font-weight: 700; }
.company-slot-table tfoot th { text-align: right; }
.tab-input-actions { align-self: center; display: flex; justify-content: flex-end; gap: 6px 12px; flex-wrap: wrap; margin-left: auto; padding-bottom: 4px; align-items: center; font-size: 12px; color: #475569; }
.tab-input-actions .button-link { height: 36px; min-height: 36px; font-size: 13px; }
.capacity-count-input { width: 100%; min-width: 65px; max-width: 148px; border: 1px solid var(--control-border); border-radius: 6px; padding: 10px 12px; background: #fff; color: #1e293b; text-align: right; font: inherit; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; appearance: textfield; }
.capacity-count-input::-webkit-inner-spin-button, .capacity-count-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.capacity-count-input::placeholder { font-size: 12px; font-weight: 400; color: #475569; text-align: center; opacity: 1; }
.capacity-count-input[data-dirty="true"] { background: #eff6ff; border-color: var(--action); box-shadow: inset 3px 0 var(--action); color: var(--action); }
.capacity-count-input:invalid { border-color: #be123c; background: #fff1f2; }
.capacity-number { font-weight: 700; font-variant-numeric: tabular-nums; }
.capacity-muted, .capacity-note { color: #475569; font-size: 12px; }
.capacity-empty { padding: 12px 18px; }
.capacity-footnote { margin: 12px 2px; }
.capacity-save-bar { min-height: 70px; padding: 16px 18px; border-top: 1px solid var(--table-line); display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.capacity-save-actions { display: flex; margin-left: auto; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.capacity-save-status { font-size: 13px; color: #475569; }
.capacity-save-button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--action); border-radius: 6px; background: var(--action); color: white; font: inherit; font-weight: 600; cursor: pointer; }
.capacity-save-button:hover:not(:disabled) { background: #1e40af; }
.capacity-save-button:disabled { opacity: .6; cursor: default; }
.capacity-message { margin: 0; display: flex; align-items: flex-start; gap: 8px; flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.message-symbol { flex: 0 0 18px; width: 18px; height: 18px; line-height: 16px; text-align: center; border: 1px solid currentColor; border-radius: 50%; }
.capacity-company-panel { margin-top: 20px; border-radius: 8px; padding: 12px 18px; box-shadow: none; }
.capacity-company-panel summary { cursor: pointer; font-weight: 600; }
.capacity-add-company { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.capacity-add-company .text-input { width: min(360px, 100%); }
.capacity-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.capacity-date-content { position: relative; min-width: 0; }
.capacity-date-loading { position: absolute; top: 4px; right: 8px; z-index: 3; margin: 0; padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; pointer-events: none; opacity: 0; animation: capacity-loading-indicator .15s ease .3s forwards; }
@keyframes capacity-loading-indicator { to { opacity: 1; } }
@media (max-width: 800px) {
    .main-content { padding: 12px; }
    .top-bar { padding: 0 12px; }
    .top-bar-container { min-height: 58px; flex-direction: row; }
    .brand-title { font-size: 17px; }
    .brand-icon { width: 32px; height: 32px; }
    .primary-nav { width: auto; justify-content: flex-start; }
    .primary-nav a { font-size: 13px; min-height: 36px; padding: 7px 10px; }
    .period-actions { gap: 5px; }
    .period-actions .button-link, .period-actions input { height: 36px; min-height: 36px; }
    .period-actions .period-step { width: 36px; }
    .period-actions input { width: 148px; font-size: 14px; }
    .company-tab { padding-inline: 12px; }
    .tab-input-actions { margin-left: 0; justify-content: flex-start; }
    .capacity-save-bar { padding: 12px; }
    .capacity-message { flex-basis: 100%; }
}
@media (max-width: 700px) {
    .company-slot-table tr > :first-child { position: sticky; left: 0; z-index: 1; }
    .company-slot-table tfoot th { background: #f1f5f9; }
}

/* 詳細モーダルの表示中は背後のページを固定します。 */
html:has(dialog.overview-dialog[open]) { overflow: hidden; }


/* ログイン画面と会社管理も共通カラー、入力・ボタン仕様に合わせます。 */
.login-page { padding-top: 32px; }
.login-panel { border-color: var(--grid-line); border-radius: 12px; box-shadow: 0 1px 3px #0f172a0d; }
.login-title { margin: 0 0 24px; color: #1e293b; font-size: 20px; font-weight: 700; }
.login-panel .form-group label { color: #334155; font-weight: 600; }
.login-panel .form-group input { border: 1px solid var(--control-border); border-radius: 6px; min-height: 40px; font: inherit; }
.login-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.login-actions button { min-width: 104px; }
@media (max-width: 800px) {
    .top-bar-container { align-items: center; }
    .primary-nav { order: 3; flex-basis: 100%; margin-left: 0; }
    .account-nav { margin-left: auto; padding-left: 12px; gap: 8px; }
}
@media (max-width: 520px) {
    .brand { max-width: 100%; }
    .account-nav { border-left: 0; padding-left: 0; flex-basis: 100%; }
    .primary-nav { order: 2; }
    .account-nav { order: 3; justify-content: flex-end; }
}

.company-management-header {
    margin-bottom: 1rem;
}

.company-management-content {
    display: grid;
    gap: 1rem;
    max-width: 62rem;
    margin: 0 auto;
}

.company-management-panel {
    padding: 1.25rem;
}

.company-management-panel h2 {
    margin-bottom: 1rem;
}

.company-management-feedback {
    margin: 1rem auto 0;
    max-width: 62rem;
}

.company-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.company-management-summary {
    display: flex;
    align-items: center;
    flex: 1 1 12rem;
    min-width: 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.company-management-name {
    overflow-wrap: anywhere;
}

.company-management-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.company-management-editor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    width: 100%;
}

.company-management-editor .text-input {
    width: min(22.5rem, 100%);
}

.company-management-editor label {
    font-weight: 700;
}

.company-management-confirm {
    flex: 1 1 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
}

.company-management-confirm p {
    margin: 0 0 0.75rem;
}

.company-management-status--active {
    color: #1d4ed8;
}

@media (max-width: 40rem) {
    .company-management-actions {
        width: 100%;
    }
    .company-management-editor .text-input {
        width: 100%;
    }
}

/* 会社の新規登録は、日次入力と分離した管理者専用ページにまとめます。 */
.company-management-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.company-management-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.company-management-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 700;
}

.company-management-status--active {
    background: #dbeafe;
    color: #1d4ed8;
}
.company-management-panel { border-color: var(--grid-line); border-radius: 12px; box-shadow: 0 1px 3px #0f172a0d; }
.company-management-panel .button-link { border-color: var(--control-border); border-radius: 6px; }
.company-management-panel .text-input { border-color: var(--control-border); border-radius: 6px; }
.company-management-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.company-management-section-heading h2 { margin: 0; }
