:root {
  /* Kohinoor Avantara brand palette (sampled from kohinoorpune.com) */
  --navy: #1a1512;           /* near-black, matches the site's nav bar */
  --navy-light: #2b2420;
  --maroon: #6b2f38;         /* the deep wine/maroon of the "AVANTARA" wordmark */
  --maroon-light: #8a4552;
  --rust: #d4572e;           /* the orange-red of the "K" mark / Enquire tab */
  --rust-light: #e57d54;
  --gold: #d4572e;           /* alias so existing gold-styled elements pick up rust */
  --gold-light: #e57d54;
  --grey-bg: #f7f5f3;        /* warm off-white background */
  --white: #ffffff;
  --text-dark: #211c1a;
  --text-muted: #7a7069;
  --green: #1f9d55;
  --green-bg: #e8f7ee;
  --yellow: #b8860b;
  --yellow-bg: #fff8e1;
  --red: #c0392b;
  --red-bg: #fdecea;
  --grey: #7a7f87;
  --grey-full-bg: #ececec;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(26, 21, 18, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--grey-bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-name {
  color: var(--white);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 2px;
}
.brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.25);
}
.brand-project {
  color: var(--rust-light);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 3px;
}

.page-wrap {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

h1.form-title {
  font-size: 22px;
  color: var(--maroon);
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
p.form-subtitle {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.field label .req { color: var(--red); }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d8dce3;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.15s;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--maroon);
}
.field input.error, .field select.error { border-color: var(--red); }
.field .error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 4px;
  display: none;
}
.field .error-msg.show { display: block; }

.global-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.global-error.show { display: block; }

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 20px;
  background: var(--rust);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--rust-light); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-gold {
  background: var(--maroon);
  color: var(--white);
}
.btn-gold:hover { background: var(--maroon-light); }
.btn-outline {
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--maroon);
}

.slot-date {
  text-align: center;
  font-weight: 700;
  color: var(--maroon);
  font-size: 17px;
  margin-bottom: 4px;
}
.slot-note {
  background: var(--yellow-bg);
  color: #8a6d00;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin: 16px 0 20px;
}

.slot-list { display: flex; flex-direction: column; gap: 10px; }
.slot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1.5px solid #e2e5ea;
  cursor: pointer;
  transition: all 0.15s;
}
.slot-item:hover:not(.full) { border-color: var(--maroon); }
.slot-item.selected {
  border-color: var(--maroon);
  background: #f5ecee;
}
.slot-item.full {
  opacity: 0.6;
  cursor: not-allowed;
}
.slot-time { font-weight: 600; font-size: 14.5px; }
.slot-badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: var(--grey-full-bg); color: var(--grey); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 18px;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }
.dot-grey { background: var(--grey); }

.confirm-icon {
  width: 64px; height: 64px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 18px;
}
.confirm-title {
  text-align: center;
  color: var(--maroon);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eceef1;
  font-size: 14.5px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 600; color: var(--text-dark); text-align: right; }

.footer {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Admin */
.admin-login-wrap { max-width: 380px; margin: 60px auto; }
.flash-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}
.admin-wide { max-width: 1100px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.admin-header h1 { font-size: 20px; color: var(--maroon); margin: 0; }
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 22px; font-weight: 800; color: var(--maroon); }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.slot-mini {
  background: var(--white);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.slot-mini .st-time { font-weight: 700; margin-bottom: 4px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--white);
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.filters input, .filters select {
  padding: 10px 12px;
  border: 1.5px solid #d8dce3;
  border-radius: 6px;
  font-size: 14px;
}
.filters input[type=text] { flex: 1; min-width: 180px; }

.table-wrap {
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
table.bookings {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 800px;
}
table.bookings th {
  background: var(--navy);
  color: var(--gold-light);
  text-align: left;
  padding: 10px 12px;
  position: sticky;
  top: 0;
}
table.bookings td {
  padding: 10px 12px;
  border-bottom: 1px solid #eceef1;
}
table.bookings tr:hover td { background: #f8f9fb; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: var(--navy);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.download-btn:hover { background: var(--rust-light); }

.delete-btn {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(192,57,43,0.3);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.delete-btn:hover { background: var(--red); color: var(--white); }

.spinner-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

@media (max-width: 480px) {
  .page-wrap { padding: 18px 12px 30px; }
  .card { padding: 20px 16px; }
  .detail-value { text-align: right; max-width: 60%; }
}
