/* ============================================================
   Restaurant Booking Manager Pro – Admin CSS
   ============================================================ */

:root {
  --rbm-bg:        #0f1117;
  --rbm-surface:   #1a1d27;
  --rbm-surface2:  #242736;
  --rbm-border:    #2e3347;
  --rbm-accent:    #e8a84c;
  --rbm-accent2:   #5b7fff;
  --rbm-green:     #2dce89;
  --rbm-red:       #f75676;
  --rbm-yellow:    #f6c343;
  --rbm-text:      #e8eaf0;
  --rbm-muted:     #8892a4;
  --rbm-radius:    8px;
  --rbm-shadow:    0 4px 24px rgba(0,0,0,.4);
  --font-main:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
}

/* ── Layout ──────────────────────────────────────────────── */
#rbm-app {
  font-family: var(--font-main);
  background: var(--rbm-bg);
  color: var(--rbm-text);
  min-height: 100vh;
  margin: -20px -20px 0;
  padding: 0;
}

.rbm-header {
  background: var(--rbm-surface);
  border-bottom: 1px solid var(--rbm-border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 32px;
  z-index: 100;
}

.rbm-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--rbm-accent);
  letter-spacing: .5px;
  white-space: nowrap;
}

.rbm-nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.rbm-nav-tab {
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--rbm-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.rbm-nav-tab:hover  { color: var(--rbm-text); background: var(--rbm-surface2); }
.rbm-nav-tab.active { color: var(--rbm-accent); background: rgba(232,168,76,.12); }

.rbm-page-body { padding: 28px; }

/* ── Cards ───────────────────────────────────────────────── */
.rbm-card {
  background: var(--rbm-surface);
  border: 1px solid var(--rbm-border);
  border-radius: var(--rbm-radius);
  padding: 24px;
  margin-bottom: 20px;
}
.rbm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.rbm-card-title { font-size: 15px; font-weight: 600; color: var(--rbm-text); }

/* ── Stat Tiles ──────────────────────────────────────────── */
.rbm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.rbm-stat {
  background: var(--rbm-surface);
  border: 1px solid var(--rbm-border);
  border-radius: var(--rbm-radius);
  padding: 20px;
  text-align: center;
}
.rbm-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--rbm-accent);
  line-height: 1;
}
.rbm-stat-label { font-size: 12px; color: var(--rbm-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; }
.rbm-stat.green .rbm-stat-value { color: var(--rbm-green); }
.rbm-stat.red   .rbm-stat-value { color: var(--rbm-red); }
.rbm-stat.blue  .rbm-stat-value { color: var(--rbm-accent2); }

/* ── Table ───────────────────────────────────────────────── */
.rbm-table-wrap { overflow-x: auto; }
.rbm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rbm-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--rbm-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--rbm-border);
  background: var(--rbm-surface2);
}
.rbm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rbm-border);
  vertical-align: middle;
}
.rbm-table tr:hover td { background: rgba(255,255,255,.03); }

/* ── Badges ──────────────────────────────────────────────── */
.rbm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.rbm-badge.confirmed  { background: rgba(45,206,137,.15); color: var(--rbm-green); }
.rbm-badge.pending    { background: rgba(246,195,67,.15);  color: var(--rbm-yellow); }
.rbm-badge.seated     { background: rgba(91,127,255,.15);  color: var(--rbm-accent2); }
.rbm-badge.completed  { background: rgba(136,146,164,.15); color: var(--rbm-muted); }
.rbm-badge.cancelled  { background: rgba(247,86,118,.15);  color: var(--rbm-red); }
.rbm-badge.no_show    { background: rgba(247,86,118,.1);   color: var(--rbm-red); opacity:.7; }

/* ── Buttons ─────────────────────────────────────────────── */
.rbm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.rbm-btn-primary   { background: var(--rbm-accent);  color: #1a1a1a; }
.rbm-btn-secondary { background: var(--rbm-surface2); color: var(--rbm-text); border: 1px solid var(--rbm-border); }
.rbm-btn-danger    { background: rgba(247,86,118,.15); color: var(--rbm-red); }
.rbm-btn-green     { background: rgba(45,206,137,.15); color: var(--rbm-green); }
.rbm-btn-icon      { padding: 6px 8px; }
.rbm-btn:hover     { filter: brightness(1.1); }
.rbm-btn:active    { filter: brightness(.9); }

/* ── Form Controls ───────────────────────────────────────── */
.rbm-field { margin-bottom: 18px; }
.rbm-field label { display: block; font-size: 12px; font-weight: 600; color: var(--rbm-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.rbm-input, .rbm-select, .rbm-textarea {
  width: 100%;
  background: var(--rbm-surface2);
  border: 1px solid var(--rbm-border);
  border-radius: 6px;
  color: var(--rbm-text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-main);
  transition: border-color .15s;
  box-sizing: border-box;
}
.rbm-input:focus, .rbm-select:focus, .rbm-textarea:focus {
  outline: none;
  border-color: var(--rbm-accent);
  box-shadow: 0 0 0 3px rgba(232,168,76,.15);
}
.rbm-textarea { resize: vertical; min-height: 90px; }
.rbm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Date Picker Strip ───────────────────────────────────── */
.rbm-date-nav {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.rbm-date-nav .rbm-date-label {
  font-size: 20px; font-weight: 700; color: var(--rbm-text);
  min-width: 200px; text-align: center;
}
.rbm-date-nav input[type="date"] {
  background: var(--rbm-surface2);
  border: 1px solid var(--rbm-border);
  border-radius: 6px;
  color: var(--rbm-text);
  padding: 7px 10px;
  font-size: 13px;
}

/* ── Floor Plan Canvas ───────────────────────────────────── */
#rbm-floor-canvas {
  background: var(--rbm-surface2);
  border: 1px solid var(--rbm-border);
  border-radius: var(--rbm-radius);
  position: relative;
  min-height: 500px;
  overflow: hidden;
}
.rbm-table-obj {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  user-select: none;
  font-size: 11px;
  font-weight: 700;
}
.rbm-table-obj.available  { background: rgba(45,206,137,.15); border-color: var(--rbm-green); }
.rbm-table-obj.occupied   { background: rgba(91,127,255,.2);  border-color: var(--rbm-accent2); }
.rbm-table-obj.reserved   { background: rgba(232,168,76,.15); border-color: var(--rbm-accent); }
.rbm-table-obj.overdue    { background: rgba(247,86,118,.2);  border-color: var(--rbm-red); }
.rbm-table-obj:hover      { filter: brightness(1.2); transform: scale(1.04); z-index: 10; }
.rbm-table-obj.round      { border-radius: 50%; }
.rbm-table-obj.square     { border-radius: 4px; }
.rbm-table-obj .tbl-name  { font-size: 13px; color: var(--rbm-text); }
.rbm-table-obj .tbl-info  { font-size: 10px; color: var(--rbm-muted); }

/* ── Timeline ────────────────────────────────────────────── */
.rbm-timeline {
  overflow-x: auto;
  position: relative;
}
.rbm-timeline-header {
  display: flex;
  position: sticky;
  top: 0;
  background: var(--rbm-surface);
  z-index: 5;
  border-bottom: 1px solid var(--rbm-border);
}
.rbm-tl-time {
  min-width: 60px;
  padding: 8px 4px;
  font-size: 11px;
  color: var(--rbm-muted);
  text-align: center;
  border-right: 1px solid var(--rbm-border);
}
.rbm-tl-row { display: flex; border-bottom: 1px solid var(--rbm-border); align-items: center; }
.rbm-tl-label { min-width: 80px; padding: 8px 12px; font-size: 12px; font-weight: 600; background: var(--rbm-surface2); border-right: 1px solid var(--rbm-border); }
.rbm-tl-slot {
  min-width: 60px; height: 44px;
  border-right: 1px solid rgba(46,51,71,.5);
  cursor: pointer;
  transition: background .1s;
}
.rbm-tl-slot:hover { background: rgba(255,255,255,.04); }
.rbm-tl-block {
  position: absolute;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  z-index: 3;
}
.rbm-tl-block.confirmed { background: rgba(45,206,137,.25); color: var(--rbm-green); border: 1px solid rgba(45,206,137,.4); }
.rbm-tl-block.seated    { background: rgba(91,127,255,.3);  color: var(--rbm-accent2); border: 1px solid rgba(91,127,255,.5); }
.rbm-tl-block.pending   { background: rgba(246,195,67,.2);  color: var(--rbm-yellow); border: 1px solid rgba(246,195,67,.4); }

/* ── Modal ───────────────────────────────────────────────── */
.rbm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.rbm-modal-overlay.open { display: flex; }
.rbm-modal {
  background: var(--rbm-surface);
  border: 1px solid var(--rbm-border);
  border-radius: 12px;
  padding: 28px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--rbm-shadow);
  animation: rbmSlideIn .2s ease;
}
.rbm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.rbm-modal-title { font-size: 18px; font-weight: 700; }
.rbm-modal-close { background: none; border: none; color: var(--rbm-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.rbm-modal-close:hover { color: var(--rbm-text); background: var(--rbm-surface2); }

@keyframes rbmSlideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Toolbar ─────────────────────────────────────────────── */
.rbm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.rbm-search-wrap { position: relative; flex: 1; min-width: 200px; }
.rbm-search-wrap input { padding-left: 36px; }
.rbm-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--rbm-muted); font-size: 14px; pointer-events: none;
}

/* ── Toast Notifications ─────────────────────────────────── */
#rbm-toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px;
}
.rbm-toast {
  background: var(--rbm-surface);
  border: 1px solid var(--rbm-border);
  border-left: 3px solid var(--rbm-green);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  box-shadow: var(--rbm-shadow);
  animation: toastIn .2s ease;
  max-width: 320px;
}
.rbm-toast.error { border-left-color: var(--rbm-red); }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Pagination ──────────────────────────────────────────── */
.rbm-pagination {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; justify-content: flex-end; font-size: 13px;
}
.rbm-page-btn {
  width: 32px; height: 32px;
  background: var(--rbm-surface2);
  border: 1px solid var(--rbm-border);
  border-radius: 6px;
  color: var(--rbm-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.rbm-page-btn:hover  { border-color: var(--rbm-accent); color: var(--rbm-accent); }
.rbm-page-btn.active { background: var(--rbm-accent); color: #1a1a1a; border-color: var(--rbm-accent); }

/* ── Shift / Calendar Grid ───────────────────────────────── */
.rbm-calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 1px;
  background: var(--rbm-border);
  border: 1px solid var(--rbm-border);
  border-radius: var(--rbm-radius);
  overflow: hidden;
}
.rbm-cal-cell {
  background: var(--rbm-surface2);
  padding: 10px 8px;
  font-size: 12px;
  text-align: center;
}
.rbm-cal-cell.header { background: var(--rbm-surface); font-weight: 700; color: var(--rbm-muted); text-transform: uppercase; font-size: 11px; }
.rbm-cal-cell.slot-on  { background: rgba(45,206,137,.1); color: var(--rbm-green); cursor: pointer; }
.rbm-cal-cell.slot-off { background: rgba(247,86,118,.08); color: rgba(136,146,164,.4); cursor: pointer; }
.rbm-cal-cell.blocked  { background: repeating-linear-gradient(-45deg, rgba(247,86,118,.05), rgba(247,86,118,.05) 4px, transparent 4px, transparent 8px); }

/* ── Reports Charts ──────────────────────────────────────── */
.rbm-chart-wrap { height: 260px; position: relative; }

/* ── Scrollbars ──────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--rbm-border) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rbm-border); border-radius: 3px; }

/* ── Misc Utilities ──────────────────────────────────────── */
.rbm-flex    { display: flex; }
.rbm-gap-12  { gap: 12px; }
.rbm-mt-16   { margin-top: 16px; }
.rbm-text-muted { color: var(--rbm-muted); }
.rbm-text-sm    { font-size: 12px; }
.rbm-empty      { text-align: center; padding: 48px; color: var(--rbm-muted); font-size: 14px; }
.rbm-loading    { text-align: center; padding: 32px; color: var(--rbm-muted); }
.rbm-divider    { border: none; border-top: 1px solid var(--rbm-border); margin: 20px 0; }
.rbm-grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rbm-grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Drag handle for table editor */
.rbm-drag-handle { cursor: grab; color: var(--rbm-muted); }
.rbm-drag-handle:active { cursor: grabbing; }
