:root {
  color-scheme: light;
  --ink: #17233b;
  --muted: #7d879a;
  --line: #e9edf4;
  --surface: #fff;
  --canvas: #f5f7fb;
  --primary: #4f6ce5;
  --primary-dark: #3e58ca;
  --pale-blue: #eff2ff;
  --green: #29a879;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input { font: inherit; }
button { cursor: pointer; }

.shell { max-width: 1160px; margin: 0 auto; padding: 0 32px 40px; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; font-size: 17px; text-decoration: none; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--primary); color: white; font-size: 16px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 44px 0 26px; }
.eyebrow { margin: 0 0 9px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Segoe UI", Arial, sans-serif; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 4vw, 34px); letter-spacing: -1.2px; }
.subheading { margin: 0; color: var(--muted); font-size: 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button-primary { color: white; background: var(--primary); box-shadow: 0 4px 10px #4f6ce526; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: #35415b; border-color: var(--line); background: var(--surface); }
.button-secondary:hover { border-color: #cbd3e1; background: #fafbfe; }
.upload-button { min-height: 44px; padding: 0 17px; }
.upload-button span { font-size: 19px; font-weight: 400; }
input[type="file"] { display: none; }
.notice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid #e2e8ff; border-radius: 9px; background: #f2f5ff; color: #55617a; }
.notice p { margin: 1px 0 0; font-size: 11px; line-height: 1.65; }
.notice-icon { flex: 0 0 17px; width: 17px; height: 17px; border-radius: 50%; background: #dfe5ff; color: var(--primary); text-align: center; font-size: 11px; font-weight: 700; line-height: 17px; }
.card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 2px 8px #18233b05; }
.settings-panel { margin-top: 18px; padding: 20px; }
.settings-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr auto; align-items: end; gap: 12px; }
.settings-form label { display: grid; gap: 7px; color: #647088; font-size: 11px; font-weight: 600; }
.settings-form input, .month-picker input { min-width: 0; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; outline: none; color: var(--ink); background: white; }
.settings-form input:focus, .month-picker input:focus { border-color: #9aaafa; box-shadow: 0 0 0 3px #4f6ce51a; }
.dashboard { margin-top: 31px; }
.dashboard-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-heading { margin-bottom: 16px; }
h2 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.3px; }
.dashboard-heading p, .section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.month-picker { display: flex; align-items: center; gap: 7px; }
.month-picker input { height: 34px; padding: 0 8px; color: #4e5a70; font-size: 11px; }
.icon-button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #68748a; font-size: 20px; line-height: 1; }
.icon-button:hover { background: #f7f8fc; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 15px; }
.stat-card { min-height: 112px; padding: 17px 19px; }
.stat-label, .stat-note { display: block; color: var(--muted); font-size: 11px; }
.stat-value { display: block; margin: 9px 0 2px; font-family: "Segoe UI", Arial, sans-serif; font-size: 28px; letter-spacing: -.8px; }
.stat-note { font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .85fr); gap: 15px; }
.calendar-card, .day-card { min-height: 325px; padding: 19px; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.legend-exclusion { width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: #f3e8d1; }
.legend-weekend { width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; background: #eef0f4; }
.calendar { margin-top: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.calendar-weekday { padding: 0 0 7px; color: #a0a8b7; font-size: 9px; font-weight: 700; }
.calendar-day { display: grid; min-height: 35px; place-items: center; border: 1px solid transparent; border-radius: 8px; color: #68748a; font-size: 11px; }
.calendar-day.is-office { background: var(--pale-blue); color: var(--primary); font-weight: 700; }
.calendar-day.is-excluded { background: #fbf3e5; color: #916b2e; font-weight: 700; }
.calendar-day.is-office.is-excluded { box-shadow: inset 0 0 0 1px #d7c49e; }
.calendar-day.is-weekend:not(.is-office):not(.is-excluded) { color: #a0a8b7; }
.calendar-day.is-selected { border-color: var(--primary); }
.calendar-day.is-today:not(.is-office) { color: var(--primary); font-weight: 700; }
.calendar-day.is-empty { visibility: hidden; }
.calendar-day.is-clickable { cursor: pointer; }
.calendar-day.is-clickable:hover { background: #f3f5fa; }
.calendar-day.is-office.is-clickable:hover { background: #e5eaff; }
.day-card { display: flex; flex-direction: column; }
.day-visits { margin-top: 16px; overflow: auto; }
.visit-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-top: 1px solid #f0f2f6; }
.visit-marker { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--green); }
.visit-details { min-width: 0; }
.visit-name { margin: 0 0 4px; overflow: hidden; color: #34405a; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.visit-time { margin: 0; color: var(--muted); font-size: 10px; }
.date-exclusion-controls { margin-top: 14px; padding: 11px 12px; border-radius: 8px; background: #f8f9fc; }
.date-exclusion-status { margin: 0 0 9px; color: #647088; font-size: 10px; }
.date-exclusion-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.date-exclusion-actions .button { min-height: 31px; padding: 0 10px; font-size: 10px; }
.date-exclusion-actions .text-button { padding: 6px; }
.empty-state { display: grid; justify-items: center; padding: 28px 18px 22px; text-align: center; }
.empty-state strong { margin-top: 8px; font-family: "Segoe UI", Arial, sans-serif; font-size: 13px; }
.empty-state p { max-width: 400px; margin: 6px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.compact-empty { align-content: center; flex: 1; padding: 15px; color: var(--muted); font-size: 11px; }
.empty-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--pale-blue); color: var(--primary); font-size: 23px; }
.data-panel { margin-top: 15px; padding: 18px 19px 0; }
.data-actions { display: flex; align-items: center; gap: 13px; }
.data-actions .button { min-height: 34px; font-size: 10px; }
.text-button { border: 0; background: none; color: #a04a4a; font-size: 10px; font-weight: 600; }
.text-button:disabled, .button:disabled { cursor: not-allowed; opacity: .45; }
.status-message { min-height: 0; color: #347a5f; font-size: 11px; }
.status-message:not(:empty) { margin-top: 13px; }
.status-message.is-error { color: #b14545; }
.data-panel .empty-state { border-top: 1px solid #f0f2f6; margin-top: 15px; }
.data-panel.has-data .empty-state { display: none; }
footer { padding: 22px 0 0; color: #a0a8b7; text-align: center; font-size: 10px; }

@media (max-width: 760px) {
  .shell { padding-right: 20px; padding-left: 20px; }
  .settings-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-form button { grid-column: span 2; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .calendar-card, .day-card { min-height: 0; }
  .day-card { min-height: 230px; }
}

@media (max-width: 520px) {
  .shell { padding-right: 15px; padding-left: 15px; }
  .topbar { height: 64px; }
  .intro { align-items: flex-start; flex-direction: column; padding: 31px 0 20px; }
  .upload-button { align-self: stretch; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .month-picker { align-self: flex-end; margin-top: -3px; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 100px; padding: 13px 11px; }
  .stat-label { min-height: 25px; font-size: 10px; }
  .stat-value { margin-top: 4px; font-size: 24px; }
  .stat-note { font-size: 9px; }
  .section-heading { align-items: flex-start; }
  .data-panel { padding: 15px 12px 0; }
  .data-panel .section-heading { flex-direction: column; }
  .data-actions { align-self: flex-end; }
  .calendar-card, .day-card { padding: 15px 12px; }
}
