:root {
  color-scheme: light;
  --ink: #143033;
  --muted: #637274;
  --paper: #f5f7f4;
  --panel: #ffffff;
  --line: #dbe3df;
  --teal: #1f6f78;
  --teal-dark: #14343a;
  --gold: #d9a51d;
  --rose: #b85c5c;
  --green: #4d7d50;
  --shadow: 0 18px 55px rgba(20, 48, 51, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(155, 212, 203, 0.32), transparent 360px),
    var(--paper);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a.secondary {
  min-height: 44px;
}

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

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

.auth-panel.wide {
  width: min(100%, 680px);
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--teal-dark);
  color: white;
  border-radius: 8px;
  font-weight: 800;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.05;
  margin-bottom: 20px;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span {
  grid-column: 1 / -1;
}

.compact {
  gap: 11px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.14);
}

button,
a.secondary {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  color: inherit;
}

.primary {
  background: var(--teal-dark);
  color: #fff;
}

.secondary,
a.secondary {
  background: #eef4f1;
  color: var(--ink);
}

.ghost {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.danger {
  color: #8d3131;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px 28px;
}

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

.topbar h1 {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 750;
  font-size: 13px;
}

.top-actions,
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.calendar-panel,
.tool-section {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(20, 48, 51, 0.08);
}

.calendar-panel {
  padding: 14px;
}

.tool-section {
  padding: 16px;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.section-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-button {
  width: 44px;
  padding: 0;
  background: #eef4f1;
  font-size: 28px;
  line-height: 1;
}

.weekday-row,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 0 8px;
}

.weekday-row span {
  text-align: center;
}

.month-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.day-cell {
  min-height: 116px;
  height: 100%;
  border-radius: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 8px;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 7px;
  text-align: left;
}

.day-cell:hover {
  background: #f8fbf9;
}

.day-cell.muted {
  background: rgba(241, 244, 241, 0.74);
}

.day-cell.today .day-number {
  background: var(--teal-dark);
  color: white;
}

.day-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.day-events {
  display: grid;
  gap: 4px;
}

.event-chip,
.more-chip {
  min-height: 24px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 800;
}

.event-chip {
  background: color-mix(in srgb, var(--user-color) 22%, white);
  border-left: 4px solid var(--user-color);
}

.event-chip.pending {
  border-style: dashed;
}

.more-chip {
  color: var(--muted);
  background: #eef4f1;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-list p {
  margin: 0;
  display: grid;
  gap: 3px;
}

.detail-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: #eef4f1;
}

.status-pill.confirmed {
  background: rgba(77, 125, 80, 0.16);
  color: #315d34;
}

.status-pill.pending {
  background: rgba(217, 165, 29, 0.18);
  color: #74530c;
}

.status-pill.declined,
.status-pill.cancelled {
  background: rgba(184, 92, 92, 0.15);
  color: #7a3838;
}

.admin-decision {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.admin-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.user-list,
.pending-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.user-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.pending-row {
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 58px;
}

.pending-row span,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.notice {
  padding: 11px 13px;
  border-radius: 8px;
  margin: 12px 0;
  font-weight: 750;
}

.notice.error {
  background: rgba(184, 92, 92, 0.13);
  color: #7a3838;
}

.notice.success {
  background: rgba(77, 125, 80, 0.13);
  color: #315d34;
}

.empty-state {
  min-height: 120px;
  color: var(--muted);
}

@media (max-width: 1050px) {
  .workspace,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

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

  .top-actions,
  .top-actions button {
    width: 100%;
  }

  .side-panel,
  .split,
  .stack.two-col {
    grid-template-columns: 1fr;
  }

  .span {
    grid-column: auto;
  }

  .calendar-panel {
    padding: 8px;
  }

  .weekday-row {
    display: none;
  }

  .month-grid {
    grid-template-columns: 1fr;
    border: 0;
    gap: 8px;
  }

  .day-cell {
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .day-cell.muted {
    display: none;
  }
}
