:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #eef4ff;
  --line: #d9e1ee;
  --line-strong: #b8c6dd;
  --text: #172033;
  --muted: #6c7890;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --accent-soft: #dbeafe;
  --success: #0f766e;
  --shadow: 0 16px 40px rgba(30, 41, 59, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.login-fields {
  display: grid;
  gap: 14px;
  margin: 22px 0 14px;
}

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

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--accent);
}

.login-error {
  margin: 0 0 14px;
  color: #b42318;
  font-size: 14px;
}

.login-submit,
.text-button,
.primary-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.login-submit {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.text-button {
  padding: 0 14px;
  cursor: pointer;
}

.primary-button {
  padding: 0 16px;
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.text-button:disabled,
.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.draft-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-status {
  min-width: 56px;
  font-size: 13px;
  color: var(--muted);
}

.save-status.dirty {
  color: #b54708;
}

.app-shell {
  width: min(1680px, calc(100vw - 32px));
  margin: 24px auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.month-pill,
.text-button {
  height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.icon-button {
  width: 44px;
  cursor: pointer;
  color: var(--text);
}

.icon-button:hover {
  border-color: var(--line-strong);
}

.text-button:hover {
  border-color: var(--line-strong);
}

.month-pill {
  min-width: 140px;
  display: grid;
  place-items: center;
  padding: 0 16px;
  font-weight: 600;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary-card strong {
  font-size: 22px;
}

.board-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.time-header,
.day-row {
  min-width: 1480px;
  display: grid;
  grid-template-columns: 160px repeat(48, 24px) 88px;
}

.time-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.time-header .meta-placeholder,
.time-header .total-placeholder {
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
}

.time-label {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 4px;
  font-size: 11px;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

.time-label.hour-boundary {
  border-left-color: var(--line-strong);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
}

.slots {
  display: contents;
}

.day-row {
  border-bottom: 1px solid var(--line);
}

.day-row:last-child {
  border-bottom: 0;
}

.day-meta,
.day-total {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
}

.day-meta {
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--line);
}

.day-label {
  font-size: 14px;
}

.day-weekday,
.day-total {
  font-size: 12px;
  color: var(--muted);
}

.day-total {
  position: sticky;
  right: 0;
  z-index: 1;
  align-items: flex-end;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  border-left: 1px solid var(--line);
}

.slot {
  width: 24px;
  height: 48px;
  border: 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  cursor: pointer;
  padding: 0;
}

.slot.hour-boundary {
  border-left-color: var(--line-strong);
}

.slot:hover {
  background: var(--accent-soft);
}

.slot.active {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.slot.active:hover {
  background: linear-gradient(180deg, #4d94ff 0%, #2c6eea 100%);
}

@media (max-width: 1024px) {
  .app-shell {
    width: min(100vw - 20px, 1680px);
    margin: 10px auto 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions,
  .summary-strip {
    width: 100%;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .board-wrap {
    max-height: calc(100vh - 280px);
  }
}
