/* Dreamers Huế Booking — minimal mobile-first CSS (~3 KB) */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2a28;
  --muted: #6f6c66;
  --accent: #c8492f;
  --accent-dark: #a23a25;
  --border: #e4ddd2;
  --error: #c0392b;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

/* Topbar (logged-in only) */
.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar .brand {
  font-weight: 600;
  color: var(--accent);
  flex: 0 0 auto;
}
.topbar .who {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: right;
}
.logout-form {
  display: inline;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.5rem;
}
.btn-link:hover { text-decoration: underline; }

/* Main container */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card h1 {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

.card .subtitle {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}
.form-group input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.form-group input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
}
.btn-primary:hover {
  background: var(--accent-dark);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  background: #fff5f5;
  color: var(--error);
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid #f4d2cf;
}

.info-msg {
  background: #f0f7f4;
  color: #2f6f53;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid #cfe3d7;
}

.help-text {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Divider with "hoặc" label */
.divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}
.divider span {
  padding: 0 0.75rem;
}

/* Zalo OAuth button */
.btn-zalo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem;
  background: #0068ff;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-zalo:hover {
  background: #0052cc;
}
.btn-zalo svg {
  flex: 0 0 auto;
}

/* Tabs (used in dashboard later) */
.tab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.tab-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 500;
}
.tab-grid a:hover { background: #fff3eb; }

/* Mobile tweaks */
@media (max-width: 380px) {
  .container { padding: 1rem 0.75rem; }
  .card { padding: 1.25rem 1rem; }
  .card h1 { font-size: 1.25rem; }
}

/* Desktop: keep it clean, no expansion */
@media (min-width: 768px) {
  .container { padding-top: 2.5rem; }
}

/* ===== Topbar nav links ===== */
.topbar {
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav-links {
  display: flex;
  gap: 0.75rem;
  flex: 1 1 auto;
  margin-left: 1rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.nav-links a:hover {
  color: var(--accent);
  background: #fff3eb;
}
.who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.who-name {
  color: var(--muted);
  font-size: 0.875rem;
}
.role-pill {
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
}
.role-admin { background: #fef3c7; color: #92400e; }
.role-staff { background: #e0e7ff; color: #3730a3; }

/* ===== Dashboard stats grid ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.stat-card {
  background: #faf7f2;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.1s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card.stat-warning {
  background: #fff7ed;
  border-color: #fed7aa;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: 0.25rem;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-sub {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 400;
}
.stat-help {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ===== Quick actions ===== */
.quick-actions {
  margin-top: 1.5rem;
}
.quick-actions h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}
.action-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
}
.action-card:hover {
  border-color: var(--accent);
  background: #fff3eb;
}
.action-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
}
.action-label {
  font-size: 0.875rem;
}

/* ===== Page header (h1 + button) ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.page-header h1 { margin-bottom: 0; }

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}
.filter-bar select {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}
.muted { color: var(--muted); font-size: 0.875rem; }

/* ===== Data tables ===== */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th, .data-table td {
  padding: 0.625rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: #faf7f2;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
}
.data-table tbody tr:hover {
  background: #fff3eb;
}
.th-actions, .cell-actions {
  text-align: right;
  white-space: nowrap;
}
.cell-actions button {
  margin-left: 0.25rem;
}
.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
}
.btn-icon:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-icon.btn-danger:hover {
  background: var(--error);
  border-color: var(--error);
}
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}
.empty-row a {
  color: var(--accent);
  text-decoration: underline;
}
.room-row.is-maint {
  opacity: 0.6;
}

/* ===== Status pills ===== */
.status-pill {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-active { background: #d1fae5; color: #065f46; }
.status-maintenance { background: #fee2e2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-checked_in { background: #ede9fe; color: #5b21b6; }
.status-checked_out { background: #e5e7eb; color: #374151; }
.status-cancelled { background: #fee2e2; color: #991b1b; text-decoration: line-through; }

/* ===== Buttons (variants) ===== */
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #faf7f2;
  border-color: var(--accent);
}
.btn-primary {
  width: auto;
  margin-top: 0;
  padding: 0.625rem 1rem;
}
.page-header .btn-primary, .filter-bar .btn-primary { margin-top: 0; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
[x-cloak] { display: none !important; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-lg {
  max-width: 640px;
}
.modal h2 {
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===== Form row (two columns) ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-row .form-group { margin-bottom: 0.75rem; }
.form-group select, .form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ===== Today tab ===== */
.today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.today-col h2 {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.count {
  background: var(--accent);
  color: #fff;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.booking-card {
  background: #faf7f2;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}
.bc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.bc-room {
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 0.125rem;
}
.bc-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.bc-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.bc-actions .btn-primary {
  width: auto;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* ===== Calendar ===== */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cal-nav .btn-secondary {
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
}
.cal-grid {
  overflow-x: auto;
  margin-top: 1rem;
  font-size: 0.75rem;
}
.cal-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-width: max-content;
}
.cal-room-name {
  flex: 0 0 100px;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  background: #faf7f2;
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--border);
}
.cal-cells {
  display: flex;
  flex: 1 0 auto;
}
.cal-cell {
  flex: 0 0 28px;
  height: 28px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.cal-cell-busy { color: #fff; font-weight: 600; }
.cal-day-num { font-size: 0.65rem; }
.cal-legend {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  align-items: center;
}
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.dot-pending { background: #fef3c7; }
.dot-confirmed { background: #dbeafe; }
.dot-checked_in { background: #ede9fe; }
.cal-cell-busy.dot-pending { background: #fbbf24; color: #1f2937; }
.cal-cell-busy.dot-confirmed { background: #60a5fa; color: #fff; }
.cal-cell-busy.dot-checked_in { background: #8b5cf6; color: #fff; }

/* ===== Tab bar (Bookings/Today/Calendar) ===== */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.tab-bar a {
  padding: 0.5rem 0.875rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
}
.tab-bar a:hover { color: var(--accent); }
.tab-bar a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ===== Settings page ===== */
.settings-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.settings-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1rem;
}
.settings-section h2 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.settings-section form .btn-primary {
  width: auto;
}
.success-msg {
  background: #f0fdf4;
  color: #15803d;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid #bbf7d0;
}

/* ===== Wide container for dashboard pages ===== */
.dashboard-page .container {
  max-width: 1100px;
}
.container-wide {
  max-width: 1100px;
}
