:root {
  color-scheme: light;
  --ink: #202326;
  --muted: #687078;
  --line: #d8dde3;
  --panel: #ffffff;
  --soft: #f5f7f9;
  --brand: #26675b;
  --brand-strong: #174b43;
  --accent: #bf5b2c;
  --danger: #b42318;
  --warning: #956400;
  --ok: #18724f;
  --shadow: 0 16px 40px rgba(33, 38, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #eef2f4;
}

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

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(rgba(18, 37, 34, 0.2), rgba(18, 37, 34, 0.58)),
    url("https://images.unsplash.com/photo-1514933651103-005eec06c04b?auto=format&fit=crop&w=1800&q=80") center / cover;
}

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

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  font-size: 2rem;
  letter-spacing: 0;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 8px;
}

.demo-users {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #384149;
  font-size: 0.9rem;
}

.field-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #3a434b;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c8d0d8;
  border-radius: 7px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 700;
}

.button {
  color: #fff;
  background: var(--brand);
}

.button:hover {
  background: var(--brand-strong);
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.icon-button {
  width: 38px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: #162522;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-subtitle {
  color: #cbd8d6;
  font-size: 0.86rem;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar select {
  width: auto;
  min-width: 230px;
  background: #203934;
  color: #fff;
  border-color: #42615c;
}

.user-chip {
  display: grid;
  gap: 2px;
  padding: 4px 2px;
  text-align: right;
}

.user-chip strong {
  font-size: 0.92rem;
}

.user-chip span {
  color: #cbd8d6;
  font-size: 0.8rem;
}

.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
}

.sidebar {
  padding: 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  justify-content: flex-start;
  width: 100%;
  color: #334047;
  background: transparent;
  border: 1px solid transparent;
}

.nav button.active {
  color: var(--brand-strong);
  background: #e8f1ee;
  border-color: #cfe0dc;
}

.content {
  min-width: 0;
  padding: 22px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.view-header h1 {
  margin: 0;
  font-size: 1.65rem;
  letter-spacing: 0;
}

.view-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  max-width: 320px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.calendar-shell,
.table-shell,
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.calendar-title {
  font-size: 1.1rem;
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(104px, 1fr));
  overflow-x: auto;
}

.weekday,
.day-cell {
  min-width: 104px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weekday {
  padding: 10px;
  color: #52606a;
  background: #f8fafb;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.day-cell {
  min-height: 136px;
  padding: 8px;
  background: #fff;
}

.day-cell.outside {
  background: #f5f6f7;
  color: #87919a;
}

.day-number {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 800;
}

.today-badge {
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.72rem;
}

.booking-pill {
  width: 100%;
  margin-top: 5px;
  padding: 6px;
  border: 1px solid #bcd5cf;
  border-left: 4px solid var(--brand);
  border-radius: 7px;
  background: #edf7f4;
  color: #1b3b35;
  text-align: left;
  font-size: 0.78rem;
}

.booking-pill.dinner {
  border-color: #e4c7b8;
  border-left-color: var(--accent);
  background: #fff2eb;
  color: #57311f;
}

.booking-pill strong,
.booking-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #52606a;
  background: #f8fafb;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  gap: 7px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.badge.admin {
  color: #173e66;
  background: #e2f0ff;
}

.badge.super {
  color: #653c00;
  background: #ffefd0;
}

.badge.user {
  color: #1d4d3b;
  background: #e5f4ed;
}

.badge.inactive {
  color: #5e2730;
  background: #fae4e8;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 23, 21, 0.58);
}

.modal {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-body {
  overflow: auto;
  padding: 18px;
}

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

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 400;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  padding: 12px 14px;
  color: #fff;
  background: #152c28;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .topbar-controls {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 16px;
  }

  .view-header,
  .calendar-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid,
  .form-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .topbar select,
  .search-input {
    width: 100%;
    max-width: none;
  }
}
