:root {
  --bg: #f6f4ef;
  --bg-grad-1: #f8f6f1;
  --bg-grad-2: #eeedf5;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --border: #ebe7df;
  --border-soft: #f1eee8;
  --text: #2b2a3a;
  --muted: #8a8694;
  --primary: #6b6fd1;
  --primary-hover: #585cc1;
  --primary-soft: #eeeefb;
  --primary-ring: rgba(107, 111, 209, 0.18);
  --danger: #b14747;
  --pending: #a07a2c;
  --pending-bg: #fbf2dc;
  --confirmed: #4b8b6d;
  --confirmed-bg: #e1f1e8;
  --completed: #7a7785;
  --completed-bg: #ecebef;
  --cancelled: #b15454;
  --cancelled-bg: #f8e3e3;
  --shadow-sm: 0 1px 2px rgba(46, 41, 78, 0.04);
  --shadow-md: 0 1px 2px rgba(46, 41, 78, 0.04), 0 14px 36px rgba(46, 41, 78, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.muted { color: var(--muted); margin: 0; font-size: 0.875rem; }
.center { text-align: center; }
.error { color: var(--danger); min-height: 1.25em; margin: 0; font-size: 0.875rem; }

/* ---------- Brand mark ---------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 0.65rem;
}
.brand-mark .brand-by {
  font-weight: 400;
  color: var(--muted);
  margin: 0 0.05rem;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
  flex-shrink: 0;
}

/* ---------- Login ---------- */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  padding: 2.25rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; letter-spacing: -0.015em; }
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.auth-card label {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  color: var(--muted);
  gap: 0.375rem;
}
input, select {
  font: inherit;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
button {
  font: inherit;
  cursor: pointer;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: white;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
button:hover:not(:disabled) { background: var(--primary-hover); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
.ghost-btn {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.ghost-btn:hover:not(:disabled) { background: var(--surface-soft); border-color: var(--muted); }

/* ---------- Dashboard layout ---------- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.brand .brand-mark { margin-bottom: 0.3rem; }
.brand h1 { font-size: 1.25rem; letter-spacing: -0.015em; }
.content { padding: 1.75rem 1.5rem; max-width: 1400px; margin: 0 auto; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--muted);
  gap: 0.25rem;
}
.filters input[type="search"] { min-width: 260px; }

/* ---------- Table ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
  white-space: nowrap;
}
tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: var(--surface-soft); }

.customer-name { font-weight: 500; }
.phone-cell, .created-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Status pill / select */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.32rem 1.75rem 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='currentColor' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  transition: filter 120ms ease;
}
.status-select:hover { filter: brightness(0.97); }
.status-select:focus { box-shadow: 0 0 0 4px var(--primary-ring); }
.status-pending   { color: var(--pending);   background-color: var(--pending-bg); }
.status-confirmed { color: var(--confirmed); background-color: var(--confirmed-bg); }
.status-completed { color: var(--completed); background-color: var(--completed-bg); }
.status-cancelled { color: var(--cancelled); background-color: var(--cancelled-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .top-bar { padding: 0.875rem 1rem; }
  .content { padding: 1rem; }
  .filters input[type="search"] { min-width: 0; width: 100%; }
  .filters label { width: 100%; }
  thead th, tbody td { padding: 0.625rem 0.75rem; }
}
