/* ══════════════════════════════════════════
   DAY STAR 民泊清掃管理 - スタイルシート
   ══════════════════════════════════════════ */

:root {
    --color-bg: #f4f5f9;
    --color-surface: #ffffff;
    --color-text: #1f2533;
    --color-text-secondary: #6b7280;
    --color-border: #e5e7ef;
    --color-navy: #1a1d29;
    --color-navy-light: #2a2f42;
    --color-gold: #e9b949;
    --color-primary: #3b6fe0;
    --color-primary-soft: #e8effc;
    --color-success: #16a07c;
    --color-success-soft: #e3f6f0;
    --color-warning: #d97706;
    --color-warning-soft: #fdf3e3;
    --color-danger: #dc2626;
    --color-danger-soft: #fdecec;
    --color-stay: #4f7df0;
    --color-stay-soft: #93b0f5;
    --color-today-bg: #fffbea;
    --shadow-sm: 0 1px 3px rgba(20, 24, 40, 0.07);
    --shadow-md: 0 6px 18px rgba(20, 24, 40, 0.10);
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
                 "Noto Sans JP", "Yu Gothic", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 14px;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── ナビゲーション ── */
.navbar {
    background: var(--color-navy);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.nav-brand a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}
.nav-brand a:hover { text-decoration: none; }

.brand-mark {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--color-gold);
    font-family: "Avenir Next", "Helvetica Neue", -apple-system, sans-serif;
}
.brand-sub {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.04em;
}

.nav-links { display: flex; gap: 2px; }

.nav-links a {
    padding: 7px 14px;
    border-radius: 99px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-links a:hover {
    background: var(--color-navy-light);
    color: #fff;
    text-decoration: none;
}
.nav-links a.active {
    background: var(--color-gold);
    color: var(--color-navy);
}

/* ── コンテナ ── */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── フラッシュメッセージ ── */
.flash-messages { margin-bottom: 16px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}
.flash-success { background: var(--color-success-soft); color: #0f6e55; }
.flash-error { background: var(--color-danger-soft); color: #991b1b; }
.flash-close {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: inherit; opacity: 0.7;
}
.flash-close:hover { opacity: 1; }

/* ── ページヘッダー ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.page-subtitle { color: var(--color-text-secondary); font-size: 13px; font-weight: 500; }
.back-link {
    font-size: 13px;
    color: var(--color-text-secondary);
    display: inline-block;
    margin-bottom: 4px;
}
.property-meta { color: var(--color-text-secondary); font-size: 13px; margin-top: 4px; }

/* ── 統計カード ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 14px 8px 12px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid transparent;
}
.stat-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.stat-out .stat-value { color: var(--color-warning); }
.stat-in .stat-value { color: var(--color-success); }
.stat-card-alert {
    background: var(--color-danger-soft);
    border-color: #f5c2c2;
}
.stat-card-alert .stat-value { color: var(--color-danger); }
.stat-card-alert .stat-label { color: #b91c1c; }
.stat-card-warning .stat-value { color: var(--color-danger); }

/* ── 同日IN/OUTアラート ── */
.alert-section {
    background: linear-gradient(135deg, #fdf0f0 0%, #fde8e8 100%);
    border: 1.5px solid #f3b8b8;
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.alert-section-empty {
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    color: var(--color-text-secondary);
    text-align: center;
    font-size: 13px;
    padding: 14px;
}

.alert-section-head { margin-bottom: 14px; }
.alert-section-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 800;
    color: var(--color-danger);
}
.alert-icon { font-size: 18px; color: var(--color-danger); margin-right: 6px; }
.alert-count {
    background: var(--color-danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 10px;
    border-radius: 99px;
}
.alert-section-head p {
    font-size: 12.5px;
    color: #9f3535;
    margin-top: 4px;
}

.alert-list { display: flex; flex-direction: column; gap: 10px; }

.alert-day-group {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.alert-day-label {
    min-width: 74px;
    text-align: center;
    background: #fff;
    border: 1px solid #f0caca;
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    flex-shrink: 0;
}
.alert-day-date {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--color-danger);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.alert-day-wd { font-size: 12px; color: #9f3535; font-weight: 600; }
.alert-day-group.is-today .alert-day-label {
    background: var(--color-danger);
    border-color: var(--color-danger);
}
.alert-day-group.is-today .alert-day-date,
.alert-day-group.is-today .alert-day-wd { color: #fff; }

.alert-day-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.alert-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid #f0caca;
    border-left: 4px solid var(--color-danger);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow 0.15s, transform 0.15s;
    flex-wrap: wrap;
}
a.alert-card:hover {
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.alert-property {
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.alert-times {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.time-out {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    padding: 2px 10px;
    border-radius: 6px;
}
.time-in {
    color: var(--color-success);
    background: var(--color-success-soft);
    padding: 2px 10px;
    border-radius: 6px;
}
.time-clean {
    color: var(--color-text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}
.time-arrow { color: #c8a0a0; font-size: 12px; }

/* ── 週間サマリー ── */
.week-section { margin-bottom: 20px; }

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.week-day {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 10px 8px 8px;
    text-align: center;
    border: 1.5px solid transparent;
    position: relative;
}
.week-day.is-today {
    border-color: var(--color-gold);
    background: var(--color-today-bg);
}
.week-day.has-same-day { border-color: #f3b8b8; }
.week-day.is-today.has-same-day { border-color: var(--color-danger); }

.week-day-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}
.week-day-date { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.week-day-wd { font-size: 11px; font-weight: 600; color: var(--color-text-secondary); }
.wd-土 { color: var(--color-primary); }
.wd-日 { color: var(--color-danger); }

.week-day-body { display: flex; gap: 4px; justify-content: center; }

.week-count {
    flex: 1;
    max-width: 56px;
    border-radius: 6px;
    padding: 3px 2px;
    line-height: 1.3;
}
.count-out { background: var(--color-warning-soft); }
.count-in { background: var(--color-success-soft); }
.week-count.is-zero { background: #f3f4f8; opacity: 0.55; }

.count-label {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
}
.count-out .count-label { color: var(--color-warning); }
.count-in .count-label { color: var(--color-success); }
.week-count.is-zero .count-label { color: var(--color-text-secondary); }

.count-num { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

.week-same-day {
    margin-top: 6px;
    background: var(--color-danger);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 99px;
    padding: 1px 4px;
}

/* ── セクションタイトル ── */
.section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
}

/* ── カレンダー ── */
.calendar-section { margin-bottom: 24px; }

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

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

.date-nav input[type="date"] {
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--color-surface);
}
.date-sep { color: var(--color-text-secondary); }

.calendar-wrapper {
    overflow-x: auto;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

.calendar-table th,
.calendar-table td {
    text-align: center;
    padding: 0;
    border-bottom: 1px solid var(--color-border);
}

.calendar-table thead th {
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 5;
    border-bottom: 2px solid var(--color-border);
}

.property-col {
    min-width: 168px;
    max-width: 210px;
    text-align: left !important;
    padding: 10px 14px !important;
    font-size: 12px;
    color: var(--color-text-secondary);
    position: sticky;
    left: 0;
    z-index: 11 !important;
    background: var(--color-surface);
}

.property-cell {
    text-align: left !important;
    padding: 8px 14px !important;
    font-weight: 600;
    font-size: 12.5px;
    background: var(--color-surface);
    position: sticky;
    left: 0;
    z-index: 10;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 4px 0 8px -4px rgba(20, 24, 40, 0.10);
}
.property-cell a { color: var(--color-text); }
.property-cell a:hover { color: var(--color-primary); text-decoration: none; }

.date-col { min-width: 42px; padding: 6px 2px !important; }

.date-header { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.3; }
.date-day { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.date-wd { font-size: 10px; color: var(--color-text-secondary); font-weight: 600; }

.today-col {
    background: var(--color-today-bg) !important;
    box-shadow: inset 0 -2px 0 var(--color-gold);
}
.weekend-col { background: #fafbfd; }

.day-cell {
    height: 38px;
    min-width: 42px;
    position: relative;
    cursor: default;
}
.weekend-cell { background: #fafbfd; }
.today-cell { background: var(--color-today-bg) !important; }

/* 予約バー */
.bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    background: var(--color-stay);
    z-index: 1;
}
.bar-mid { left: 0; right: 0; }
.bar-in { left: 50%; right: 0; border-radius: 8px 0 0 8px; }
.bar-out { left: 0; right: 50%; border-radius: 0 8px 8px 0; }
.bar-alert { background: var(--color-danger); }

.cell-flag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: #fff;
    color: var(--color-danger);
    border: 2px solid var(--color-danger);
    width: 18px;
    height: 18px;
    line-height: 14px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
}

/* ── 凡例 ── */
.legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-top: 10px;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.legend-bar { width: 22px; height: 12px; border-radius: 6px; }
.legend-stay { background: var(--color-stay); }
.legend-in { background: linear-gradient(to right, transparent 50%, var(--color-stay) 50%); border-radius: 0; }
.legend-out { background: linear-gradient(to right, var(--color-stay) 50%, transparent 50%); border-radius: 0; }
.legend-alert { background: var(--color-danger); }
.legend-today { background: var(--color-today-bg); border: 1px solid var(--color-gold); }

/* ── バッジ ── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.6;
}
.badge-urgent { background: #fff; color: var(--color-danger); }
.badge-priority { background: var(--color-danger); color: #fff; }
.badge-active { background: var(--color-success-soft); color: #0f6e55; }
.badge-inactive { background: #eceef3; color: #6c757d; }
.badge-error { background: var(--color-danger-soft); color: #991b1b; }
.badge-confirmed { background: var(--color-success-soft); color: #0f6e55; }
.badge-cancelled { background: #eceef3; color: #6c757d; text-decoration: line-through; }
.badge-checked_in { background: var(--color-primary-soft); color: #1d4ed8; }
.badge-checked_out { background: var(--color-warning-soft); color: #92400e; }
.badge-source-beds24 { background: #667eea; color: #fff; }
.badge-source-temairazu { background: #f093fb; color: #fff; }
.badge-source-demo { background: var(--color-warning-soft); color: #92400e; }
.badge-source-manual { background: #eceef3; color: #374151; }

/* ── データテーブル ── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}
.data-table th {
    background: #f8f9fc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}
.data-table tr:hover { background: #f8f9fc; }
.row-turnover { background: var(--color-danger-soft) !important; }
.row-inactive { opacity: 0.5; }

.time-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.time-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f8;
    border-radius: 8px;
    padding: 4px 8px;
}
.time-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
}
.time-field input[type="time"] {
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    width: 74px;
}
.time-field input[type="time"]:focus { outline: none; }
.time-field:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px var(--color-primary-soft);
}

.note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* ── カード ── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

/* ── フォーム ── */
.form-inline {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12.5px; font-weight: 700; color: var(--color-text-secondary); }
.form-group input {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    min-width: 180px;
}
.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-group input[type="number"] { min-width: 80px; }
.required { color: var(--color-danger); }

/* ── ボタン ── */
.btn {
    padding: 7px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { background: #f3f4f8; }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: #2f5cc4; }
.btn-outline { background: transparent; }
.btn-sm { padding: 4px 12px; font-size: 12.5px; }
.btn-icon { padding: 7px 11px; }

.header-actions { display: flex; gap: 8px; }

/* ── 同期ページ ── */
.sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.sync-description { color: var(--color-text-secondary); margin-bottom: 16px; }
.sync-status-badge { margin-bottom: 12px; }

.setup-guide {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}
.setup-guide h3 { font-size: 14px; margin-bottom: 8px; }
.setup-guide ol { padding-left: 20px; font-size: 13px; }
.setup-guide li { margin-bottom: 4px; }
.setup-guide .note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.upload-form { margin-bottom: 16px; }
.file-upload { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.file-label {
    padding: 8px 16px;
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
}
.file-label:hover { border-color: var(--color-primary); }
.file-name { font-size: 13px; color: var(--color-text-secondary); }

.test-result {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-height: 20px;
}
.test-success { background: var(--color-success-soft); color: #0f6e55; }
.test-error { background: var(--color-danger-soft); color: #991b1b; }

/* ── 空状態 ── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* ── ログインページ ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(160deg, #1a1d29 0%, #2a3148 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
}

.login-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}
.login-brand .brand-mark { font-size: 22px; }
.login-brand .brand-sub { font-size: 13px; color: var(--color-text-secondary); }

.login-desc {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-form label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-secondary);
}
.login-form input[type="password"] {
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
}
.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.btn-login {
    margin-top: 8px;
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.nav-logout {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 12.5px !important;
}
.nav-logout:hover {
    color: #fff !important;
    background: transparent !important;
}

.sync-updated {
    text-align: center;
    padding: 14px 16px;
    margin-top: 8px;
    margin-bottom: 24px;
    font-size: 12.5px;
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

/* ── フッター ── */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--color-text-secondary);
    font-size: 12px;
    margin-top: 24px;
}

/* ══════════════════════════════════════════
   レスポンシブ
   ══════════════════════════════════════════ */

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (max-width: 768px) {
    body { font-size: 13.5px; }

    .navbar {
        padding: 0 12px;
        height: auto;
        min-height: 54px;
        flex-wrap: wrap;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .brand-mark { font-size: 17px; }
    .brand-sub { font-size: 11px; }
    .nav-links {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-links a { padding: 6px 12px; font-size: 12.5px; }

    .container { padding: 14px 10px; }

    .page-header h1 { font-size: 19px; }

    .stat-card { padding: 10px 4px 8px; border-radius: var(--radius-sm); }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 10px; }

    /* アラート: 縦積み */
    .alert-section { padding: 14px 12px; }
    .alert-section-head h2 { font-size: 15px; }
    .alert-section-head p { font-size: 11.5px; }
    .alert-day-group { flex-direction: row; gap: 8px; }
    .alert-day-label { min-width: 56px; padding: 6px 4px; }
    .alert-day-date { font-size: 15px; }
    .alert-day-wd { font-size: 11px; }
    .alert-card {
        padding: 8px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .alert-property { white-space: normal; font-size: 13px; line-height: 1.4; }
    .alert-times { font-size: 12px; gap: 5px; }

    /* 週間サマリー: 横スクロール */
    .week-strip {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        gap: 6px;
    }
    .week-day { min-width: 96px; flex-shrink: 0; }

    /* カレンダー */
    .calendar-nav { flex-direction: column; align-items: stretch; }
    .date-nav { justify-content: center; }
    .property-col { min-width: 110px; max-width: 130px; padding: 8px 10px !important; }
    .property-cell {
        max-width: 130px;
        padding: 6px 10px !important;
        font-size: 11.5px;
    }
    .date-col, .day-cell { min-width: 36px; }
    .day-cell { height: 34px; }
    .bar { height: 13px; }
    .cell-flag { width: 16px; height: 16px; line-height: 12px; font-size: 11px; }

    .legend { gap: 10px; padding: 10px 12px; }
    .legend-item { font-size: 11px; }

    .form-inline { flex-direction: column; align-items: stretch; }
    .form-group input { min-width: auto; }
    .sync-grid { grid-template-columns: 1fr; }

    .data-table th, .data-table td { padding: 8px 10px; font-size: 12.5px; }

    /* 物件一覧: スマホでは補助列を隠して時刻フォームを見やすく */
    .data-table .col-mobile-hide { display: none; }
    .time-form { gap: 6px; }
    .time-field { padding: 5px 8px; }
    .time-field input[type="time"] { font-size: 16px; width: 84px; }
    .time-form .btn-sm { padding: 6px 14px; font-size: 13px; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .stat-value { font-size: 19px; }
    .stat-label { font-size: 9px; }
}
