/* ==========================================================================
   Client Day — CRM web app
   Editorial calm tool: cream + terracotta, Fraunces display + DM Sans body.
   ========================================================================== */

:root {
  --cream:        #F5EEE2;
  --cream-deep:   #ECE1CE;
  --cream-edge:   #E3D3B8;
  --paper:        #FAF6EE;
  --ink:          #1F1A14;
  --ink-soft:     #5C5448;
  --ink-mute:     #948875;
  --ink-faint:    #C8BDA8;
  --terracotta:   #B04A2E;
  --terracotta-2: #8A3721;
  --terracotta-w: #EFD6C5;
  --sage:         #67785B;
  --gold:         #C19A36;
  --hair:         rgba(31, 26, 20, 0.14);
  --hair-soft:    rgba(31, 26, 20, 0.07);
  --shadow:       0 24px 60px -30px rgba(31, 26, 20, 0.30);
  --shadow-warm:  0 12px 32px -16px rgba(176, 74, 46, 0.30);

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, system-ui, sans-serif;

  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);

  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 88% -10%, rgba(176, 74, 46, 0.10), transparent 55%),
    radial-gradient(circle at -10% 18%, rgba(103, 120, 91, 0.08), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, #EFE7D6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "kern";
  letter-spacing: 0.005em;
  min-height: 100vh;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.45;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0.14 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 260px 260px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 36px 28px 24px;
  border-right: 1px solid var(--hair);
  background: linear-gradient(180deg, var(--paper), transparent);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.05;
  color: var(--ink);
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.brand-name em {
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
}

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

.nav-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 14px 12px 0;
  border-radius: 0;
  position: relative;
  color: var(--ink-soft);
  transition: all 0.3s var(--ease);
}
.nav-item:hover { color: var(--ink); }
.nav-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.3s var(--ease);
}
.nav-item:hover::before { background: var(--terracotta-w); }
.nav-item.active::before { background: var(--terracotta); }
.nav-item.active { color: var(--ink); }
.nav-item.active .nav-num { color: var(--terracotta); }

.nav-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-mute);
  font-variation-settings: "opsz" 24;
  width: 22px;
}

.nav-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.me-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  font-variation-settings: "opsz" 32, "SOFT" 40;
  line-height: 1.1;
}
.me-role {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 3px;
}
.logout-form { margin: 0; }
.logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
}
.logout-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */

.main {
  padding: 56px 64px 80px;
  max-width: 1080px;
}

.page-head {
  margin-bottom: 56px;
  position: relative;
  padding-bottom: 28px;
}
.page-head::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 2px;
  background: var(--ink);
}

.overline {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--terracotta);
  margin-bottom: 18px;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 96, "SOFT" 40;
}
.page-title em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 60, "WONK" 1;
}

.page-meta {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.page-meta .dot { color: var(--ink-faint); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hair);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 60, "SOFT" 40;
}
.section-title em {
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 60, "WONK" 1;
}
.section-title.small {
  font-size: 22px;
  margin-bottom: 18px;
}

.counter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-mute);
  font-variation-settings: "opsz" 36, "SOFT" 50;
}

/* --------------------------------------------------------------------------
   Today
   -------------------------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 44px;
}
.metric {
  border-top: 1px solid var(--hair);
  padding-top: 18px;
}
.metric-label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}
.metric-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  font-variation-settings: "opsz" 96, "SOFT" 30;
}
.metric-unit {
  font-size: 18px;
  color: var(--ink-soft);
  font-style: italic;
}

.next-card {
  margin-bottom: 56px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--ink) 0%, #2C261E 100%);
  border-radius: 4px;
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.next-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(176, 74, 46, 0.25), transparent 40%);
  pointer-events: none;
}
.next-overline {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta-w);
  margin-bottom: 14px;
  position: relative;
}
.next-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}
.next-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 38px);
  font-style: italic;
  font-variation-settings: "opsz" 72, "SOFT" 60, "WONK" 1;
  margin-bottom: 8px;
}
.next-meta {
  font-family: var(--font-body);
  color: var(--cream-edge);
  font-size: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.next-time { font-weight: 500; color: var(--cream); }

.schedule { margin-bottom: 56px; }

.schedule-list {
  display: flex;
  flex-direction: column;
}
.schedule-row {
  display: grid;
  grid-template-columns: 64px 4px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--hair);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.schedule-row:hover { padding-left: 8px; background: var(--hair-soft); border-radius: 2px; }
.schedule-row:last-child { border-bottom: 1px solid var(--hair); }

.schedule-time {
  text-align: left;
}
.time-start {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}
.time-end {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.schedule-bar {
  height: 38px;
  border-radius: 1px;
  background: var(--terracotta);
}
.bar-planned { background: var(--terracotta); }
.bar-done    { background: var(--sage); }
.bar-cancelled { background: var(--ink-faint); }
.bar-no_show { background: var(--terracotta-2); }

.schedule-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 30;
  display: block;
}
.schedule-meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-top: 2px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.schedule-meta .dot { color: var(--ink-faint); }

.schedule-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid currentColor;
  color: var(--ink-soft);
  background: transparent;
}
.pill-paid    { color: var(--sage); }
.pill-due     { color: var(--terracotta); }
.pill-partial { color: var(--gold); }
.pill-free    { color: var(--ink-mute); }
.pill-active  { color: var(--ink); }
.pill-paused  { color: var(--gold); }
.pill-archived{ color: var(--ink-mute); }

.quick-menu {
  position: relative;
}
.quick-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 18px;
  color: var(--ink-mute);
  border: 1px solid transparent;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
}
.quick-menu summary::-webkit-details-marker { display: none; }
.quick-menu summary:hover { color: var(--ink); border-color: var(--hair); }
.quick-menu[open] summary { color: var(--ink); border-color: var(--hair); }
.quick-menu-body {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 2px;
  box-shadow: var(--shadow);
  z-index: 5;
  min-width: 160px;
  padding: 4px;
}
.quick-menu-body form { margin: 0; }
.quick-menu-body button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  border-radius: 1px;
}
.quick-menu-body button:hover { background: var(--cream-deep); }

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.empty {
  text-align: center;
  padding: 80px 0;
  color: var(--ink-mute);
}
.empty-icon {
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--ink-faint);
  margin-bottom: 12px;
  font-variation-settings: "opsz" 144;
}
.empty p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-mute);
  margin: 0 0 20px;
  font-variation-settings: "opsz" 32, "SOFT" 50;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--hair);
  border-radius: 99px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  text-decoration: none;
}
.ghost-btn:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--cream);
}
.ghost-btn.primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.ghost-btn.primary:hover {
  background: var(--terracotta);
  border-color: var(--terracotta);
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 8px;
  text-decoration: none;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--terracotta-2); }
.link-btn.danger:hover { color: var(--terracotta); }

/* --------------------------------------------------------------------------
   Toolbar
   -------------------------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.search {
  flex: 1;
  position: relative;
}
.search input {
  width: 100%;
  padding: 12px 16px 12px 16px;
  border: none;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s var(--ease);
  font-variation-settings: "opsz" 32, "SOFT" 30;
}
.search input::placeholder {
  color: var(--ink-mute);
  font-style: italic;
}
.search input:focus {
  border-bottom-color: var(--terracotta);
}
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--ink-mute);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.search-clear:hover { color: var(--ink); }

.debt-pill {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--terracotta-w);
  color: var(--terracotta-2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Data table (clients list)
   -------------------------------------------------------------------------- */

.data-table { border-top: 1px solid var(--hair); }

.dt-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 0.8fr 40px;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
  align-items: center;
  cursor: pointer;
  transition: padding 0.25s var(--ease), background 0.25s var(--ease);
  text-decoration: none;
  color: inherit;
}
.dt-row:hover { padding-left: 12px; background: var(--hair-soft); }

.dt-head {
  cursor: default;
}
.dt-head:hover { padding-left: 0; background: transparent; }
.dt-head .dt-col {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.dt-name .dt-primary {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
  display: block;
  font-variation-settings: "opsz" 48, "SOFT" 30;
}
.dt-name .dt-secondary {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dt-phone {
  font-family: var(--font-body);
  color: var(--ink-soft);
  font-size: 14px;
}

.dt-act {
  text-align: right;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 18px;
}
.dt-row:hover .dt-act { color: var(--terracotta); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form { max-width: 720px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-bottom: 28px;
}
.field { display: flex; flex-direction: column; }
.field label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field label .hint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-mute);
  font-weight: 400;
  margin-left: 6px;
}
.field input,
.field textarea,
.field select {
  padding: 8px 0 10px;
  border: none;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 19px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s var(--ease);
  font-variation-settings: "opsz" 32, "SOFT" 30;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus { border-bottom-color: var(--terracotta); }
.field textarea { resize: vertical; min-height: 80px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%231F1A14' stroke-width='1.4'><path d='M2 4l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}

.switch-field {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.switch-field label { margin-bottom: 0; }
.switch-field input[type="checkbox"] {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
  position: relative;
}
.switch-field input[type="checkbox"]:checked {
  background: var(--ink);
}
.switch-field input[type="checkbox"]:checked::after {
  content: "✓";
  color: var(--cream);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--ink);
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: all 0.35s var(--ease);
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
}
.auth-submit svg { transition: transform 0.35s var(--ease); }
.auth-submit:hover {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}
.auth-submit:hover svg { transform: translateX(6px); }

.danger-form {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--hair-soft);
  display: flex;
  gap: 16px;
}
.inline-form { display: inline; margin: 0; }

/* --------------------------------------------------------------------------
   Notes
   -------------------------------------------------------------------------- */

.note-form { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--hair); }
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.note-card {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 2px;
  position: relative;
  transition: all 0.3s var(--ease);
}
.note-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.note-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 6px;
  font-variation-settings: "opsz" 32, "SOFT" 50, "WONK" 1;
}
.note-body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.55;
}
.note-next {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--terracotta);
  margin-bottom: 12px;
  font-variation-settings: "opsz" 24, "SOFT" 40;
}
.note-foot, .note-date {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.note-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--hair-soft);
  padding-top: 10px;
  margin-top: 8px;
}
.note-foot .dot { opacity: 0.5; }
.note-foot a { color: var(--ink); border-bottom: 1px solid var(--hair); }
.note-foot a:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */

.cal-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  align-items: center;
}
.cal-nav .ghost-btn.primary { margin-left: auto; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day {
  border-top: 1px solid var(--hair);
  padding-top: 14px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.cal-day-today { border-top: 2px solid var(--terracotta); }
.cal-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-day-name {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  font-weight: 500;
}
.cal-day-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  color: var(--ink);
  font-variation-settings: "opsz" 60;
}
.cal-day-today .cal-day-num { color: var(--terracotta); }

.cal-day-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-event {
  padding: 8px 10px;
  background: var(--paper);
  border-left: 2px solid var(--terracotta);
  border-radius: 1px;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s var(--ease);
}
.cal-event:hover {
  background: var(--cream-deep);
  transform: translateX(2px);
}
.cal-event-planned    { border-left-color: var(--terracotta); }
.cal-event-done       { border-left-color: var(--sage); }
.cal-event-cancelled  { border-left-color: var(--ink-faint); }
.cal-event-no_show    { border-left-color: var(--terracotta-2); }

.cal-event-time {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.cal-event-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink);
  font-weight: 400;
  margin-top: 2px;
  font-variation-settings: "opsz" 24;
}
.cal-event-meta {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--ink-mute);
  margin-top: 2px;
}
.cal-empty {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 18px;
  text-align: center;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Settings
   -------------------------------------------------------------------------- */

.settings-block {
  margin-bottom: 64px;
}
.public-link {
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--paper);
  border-left: 2px solid var(--terracotta);
  border-radius: 1px;
}
.public-link a {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  margin-top: 6px;
  word-break: break-all;
  font-variation-settings: "opsz" 36, "SOFT" 50;
}
.public-link a:hover { color: var(--terracotta); }

.services-table {
  margin-bottom: 32px;
  border-top: 1px solid var(--hair);
}
.service-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  align-items: center;
}
.service-row-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: padding 0.25s var(--ease), background 0.25s var(--ease);
}
.service-row-link:hover {
  padding-left: 12px;
  background: var(--hair-soft);
}
.service-arrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-faint);
  font-size: 18px;
}
.service-row-link:hover .service-arrow { color: var(--terracotta); }
.service-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.service-meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.service-meta .dot { opacity: 0.5; margin: 0 4px; }
.service-add-form {
  padding-top: 16px;
  border-top: 1px solid var(--hair-soft);
}

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.msg-card {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}
.msg-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.msg-unread {
  border-left: 3px solid var(--terracotta);
}
.msg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.msg-sender {
  display: flex;
  align-items: center;
  gap: 10px;
}
.msg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terracotta);
  flex-shrink: 0;
}
.msg-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 30;
}
.msg-date {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}
.msg-contacts {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.msg-contacts .dot { opacity: 0.5; }
.msg-body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
  font-variation-settings: "opsz" 32, "SOFT" 50;
}
.msg-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--terracotta);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   Block (intake / note display)
   -------------------------------------------------------------------------- */

.block {
  margin-bottom: 36px;
  padding-left: 20px;
  border-left: 2px solid var(--terracotta-w);
}
.block-overline {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 8px;
  font-weight: 500;
}
.block-body {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.55;
  margin: 0;
  font-variation-settings: "opsz" 32, "SOFT" 50;
}

.muted-line {
  color: var(--ink-mute);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Auth page
   -------------------------------------------------------------------------- */

.auth-body {
  background: var(--cream);
  background-image:
    radial-gradient(circle at 70% -10%, rgba(176, 74, 46, 0.20), transparent 50%),
    radial-gradient(circle at -10% 80%, rgba(103, 120, 91, 0.12), transparent 50%),
    linear-gradient(180deg, var(--cream) 0%, #EFE7D6 100%);
}
.auth-shell {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 60px 64px;
}
.auth-art {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.auth-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: 22px;
  font-variation-settings: "opsz" 60, "SOFT" 50, "WONK" 1;
}
.auth-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(64px, 9vw, 110px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
.auth-display em {
  display: block;
  font-style: italic;
  color: var(--terracotta);
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
}
.auth-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-soft);
  line-height: 1.4;
  font-variation-settings: "opsz" 32, "SOFT" 50;
  margin: 0;
}
.auth-meta {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.auth-form-wrap {
  background: var(--paper);
  padding: 48px 44px;
  border-radius: 2px;
  border: 1px solid var(--hair);
  box-shadow: var(--shadow);
}

.auth-h {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 36px;
  color: var(--ink);
  margin: 0 0 20px;
  font-variation-settings: "opsz" 72, "SOFT" 40;
}
.auth-h em {
  font-style: italic;
  color: var(--terracotta);
  font-variation-settings: "opsz" 72, "SOFT" 60, "WONK" 1;
}

.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--hair);
}
.auth-tab {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-mute);
  padding: 0 0 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
}
.auth-tab.active {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}

.auth-error {
  background: var(--terracotta-w);
  color: var(--terracotta-2);
  padding: 12px 16px;
  border-radius: 2px;
  font-size: 13px;
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.auth-form .field { margin-bottom: 24px; }

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 24px;
  }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 24px;
    border-right: none;
    border-bottom: 1px solid var(--hair);
  }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .nav-item::before { display: none; }
  .nav-item.active { color: var(--terracotta); }
  .sidebar-foot { margin-top: 16px; }
  .main { padding: 32px 24px 64px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .metrics { grid-template-columns: 1fr; gap: 16px; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { min-height: auto; }
}

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.7s var(--ease) forwards;
}
[data-reveal][data-delay="1"] { animation-delay: 0.08s; }
[data-reveal][data-delay="2"] { animation-delay: 0.18s; }
[data-reveal][data-delay="3"] { animation-delay: 0.28s; }
[data-reveal][data-delay="4"] { animation-delay: 0.38s; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { animation: none; opacity: 1; transform: none; }
  * { transition-duration: 0.01ms !important; }
}
