/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f4f4f0;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: #c8102e; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Courier New', monospace; font-size: .875em; background: #f0f0ea; padding: 2px 5px; border-radius: 3px; }

/* ===== Navbar ===== */
.navbar { background: #1a1a2e; color: #fff; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { color: #fff; font-size: 1.05rem; font-weight: 600; letter-spacing: .3px; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; }
.nav-link { color: rgba(255,255,255,.7); font-size: .875rem; transition: color .15s; }
.nav-link:hover, .nav-link.active { color: #fff; text-decoration: none; }

/* ===== Main ===== */
.main-content { flex: 1; max-width: 1100px; margin: 0 auto; padding: 32px 24px; width: 100%; }

/* ===== Footer ===== */
.footer { background: #1a1a2e; color: rgba(255,255,255,.5); font-size: .8rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 16px 24px; text-align: center; }

/* ===== Page Header ===== */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.subhead { margin-top: 4px; font-size: .9rem; color: #666; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.last-scan { font-size: .8rem; color: #888; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 5px; font-size: .875rem; font-weight: 500;
  border: 1.5px solid transparent; cursor: pointer; transition: all .15s;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #c8102e; color: #fff; border-color: #c8102e; }
.btn-primary:hover { background: #a50d25; border-color: #a50d25; color: #fff; }
.btn-outline { background: transparent; color: #1a1a2e; border-color: #ccc; }
.btn-outline:hover { border-color: #1a1a2e; }
.btn-danger { background: transparent; color: #c8102e; border-color: #c8102e; }
.btn-danger:hover { background: #c8102e; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== Spinner ===== */
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Date Pills ===== */
.date-pills { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.date-pill { background: #fff; border: 1px solid #e0e0d8; border-radius: 8px; padding: 10px 18px; text-align: center; min-width: 70px; }
.date-pill-day { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #c8102e; }
.date-pill-date { display: block; font-size: .95rem; font-weight: 600; margin-top: 2px; }

/* ===== Restaurant Cards ===== */
.restaurant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.restaurant-card { background: #fff; border: 1px solid #e0e0d8; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid #f0f0ea; }
.card-title { font-size: 1.1rem; font-weight: 700; }
.card-meta { font-size: .8rem; color: #888; margin-top: 2px; }
.card-footer { padding: 12px 20px; border-top: 1px solid #f0f0ea; }
.link-subtle { font-size: .8rem; color: #888; }

/* Platform badges */
.platform-badge { font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.platform-resy { background: #fef0e6; color: #c45f00; }
.platform-opentable { background: #e6f4ea; color: #1e7e34; }
.platform-resos { background: #e8eaf6; color: #3949ab; }

/* ===== Slots ===== */
.slots-grid { padding: 14px 20px; flex: 1; }
.date-group { margin-bottom: 12px; }
.date-group-header { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #888; margin-bottom: 8px; }
.time-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-btn {
  display: inline-block; padding: 6px 12px; background: #f0faf2; color: #1e7e34;
  border: 1px solid #b8e0c0; border-radius: 5px; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.slot-btn:hover { background: #1e7e34; color: #fff; text-decoration: none; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: #666; margin-bottom: 24px; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e0e0d8; border-radius: 8px; overflow: hidden; }
.table th { background: #f9f9f6; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #666; padding: 12px 16px; text-align: left; border-bottom: 1px solid #e0e0d8; }
.table td { padding: 14px 16px; font-size: .9rem; border-bottom: 1px solid #f0f0ea; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.row-inactive td { opacity: .5; }
.rank-col { width: 40px; color: #aaa; }
.id-col { font-size: .8rem; max-width: 160px; }
.actions-col { white-space: nowrap; display: flex; gap: 6px; align-items: center; padding: 10px 16px; }
.empty-row { text-align: center; color: #888; padding: 32px; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 12px; }
.badge-green { background: #e6f4ea; color: #1e7e34; }
.badge-gray { background: #f0f0ea; color: #666; }
.badge-red { background: #fce8ec; color: #c8102e; cursor: help; }

.warn { color: #c45f00; font-size: .8rem; }
.muted { color: #888; }

/* ===== Forms ===== */
.form-card { background: #fff; border: 1px solid #e0e0d8; border-radius: 10px; padding: 28px; max-width: 760px; }
.form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid #f0f0ea; }
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: #444; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 0; }
.form-group-sm { max-width: 220px; }
.form-group label { font-size: .8rem; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-input { padding: 9px 12px; border: 1.5px solid #d0d0c8; border-radius: 5px; font-size: .9rem; font-family: inherit; transition: border-color .15s; }
.form-input:focus { outline: none; border-color: #c8102e; }
.form-textarea { resize: vertical; min-height: 80px; }
select.form-input { appearance: auto; }
.hint { font-size: .75rem; color: #888; margin-top: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 500; cursor: pointer; padding-top: 20px; }
.platform-fields { margin-top: 16px; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; }

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .875rem; }
.alert-error { background: #fce8ec; color: #a0001a; border: 1px solid #f0b8c0; }
.alert-warn { background: #fff8e6; color: #7a5c00; border: 1px solid #f0dcb8; }
.alert-info { background: #e8f0fe; color: #1a56b0; border: 1px solid #b8d0f0; }

/* ===== Confirm / Booking ===== */
.confirm-wrap { display: flex; justify-content: center; padding: 16px 0; }
.confirm-card { background: #fff; border: 1px solid #e0e0d8; border-radius: 12px; padding: 36px; width: 100%; max-width: 480px; }
.confirm-card h1 { font-size: 1.5rem; margin-bottom: 20px; }
.confirm-details { border: 1px solid #f0f0ea; border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.confirm-row { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #f7f7f4; font-size: .9rem; }
.confirm-row:last-child { border-bottom: none; }
.confirm-label { color: #666; }
.confirm-value { font-weight: 500; text-align: right; }
.result-icon { font-size: 3rem; margin-bottom: 12px; }
.result-success { color: #1e7e34; }
.result-error { color: #c8102e; }
.result-sub { color: #555; margin-bottom: 24px; font-size: 1rem; }

/* ===== Login ===== */
.login-page { background: #f4f4f0; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border: 1px solid #e0e0d8; border-radius: 12px; padding: 40px; width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: #888; font-size: .875rem; margin-bottom: 28px; }
.login-card .form-group { text-align: left; margin-bottom: 20px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .restaurant-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { gap: 14px; }
  .actions-col { flex-wrap: wrap; }
}
