/* ============================================================
   Kappino — Tables / Floor Plan (V2.0). Tokens from styles.css.
   ============================================================ */
.view[data-view="tables"] { padding: 0 !important; height: 100%; overflow: hidden; }
.ktbl { display: flex; height: 100%; min-height: 600px; background: var(--paper); }
.ktbl-fallback, .ktbl-empty { padding: 60px 24px; text-align: center; color: var(--ink-2); font-weight: 600; }
.ktbl-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* main column */
.ktbl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.ktbl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 24px 12px; }
.ktbl-head-r { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.ktbl-head-r .btn { white-space: nowrap; }
.ktbl-title-row { display: flex; align-items: center; gap: 10px; }
.ktbl-title-row .page-title { margin: 0; }
.ktbl-floor-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: #fff;
  font-size: 13px; font-weight: 800; color: var(--ink); cursor: pointer; transition: all var(--fast);
}
.ktbl-floor-btn:hover { border-color: var(--blue); color: var(--blue); }
.ktbl-sub { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }

/* zone tabs */
.ktbl-zones { display: flex; gap: 9px; padding: 4px 24px 14px; overflow-x: auto; flex: 0 0 auto; }
.ktbl-zone {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; flex: 0 0 auto;
  border: 1.5px solid var(--line-strong); border-radius: 13px; background: #fff;
  font-size: 14px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all var(--fast);
}
.ktbl-zone:hover { border-color: var(--blue); }
.ktbl-zone.active { border-color: var(--blue); background: var(--tint-blue); color: var(--blue); }
.ktbl-zone-add { color: var(--blue); border-style: dashed; }
.ktbl-zc { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 800; background: var(--fill); color: var(--ink-3); }
.ktbl-zone.active .ktbl-zc { background: rgba(45,111,214,.16); color: var(--blue); }

/* canvas */
.ktbl-canvas {
  position: relative; flex: 1; margin: 0 24px 24px; border-radius: var(--r-card);
  background: #fff; border: 1px solid var(--line);
  background-image: radial-gradient(var(--line) 1.2px, transparent 1.2px);
  background-size: 26px 26px; background-position: 13px 13px;
  overflow: auto; min-height: 360px;
}
.ktbl-canvas.editing { background-color: #FBFCFE; outline: 2px dashed var(--blue-100); outline-offset: -8px; }

/* a table on the canvas — also carries the legacy .tb-card class (so the
   global-search "edit table" flow can still find it); reset the inherited
   card-grid styles so the inline shape size + status colour win. */
.ktbl-table {
  position: absolute; transform: translate(-50%, -50%);
  background: #fff; border: 2px solid var(--olive); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; padding: 0; gap: 0; min-height: 0; text-align: center;
  box-shadow: 0 1px 2px rgba(20,24,31,.05), 0 6px 16px rgba(20,24,31,.07);
  transition: box-shadow .12s, border-color .12s;
}
.ktbl-table::before { display: none !important; }
.ktbl-table.kst-available, .ktbl-table.kst-occupied, .ktbl-table.kst-reserved, .ktbl-table.kst-bill { background: #fff; }
.ktbl-table:hover { transform: translate(-50%, -50%); }
.ktbl-canvas.editing .ktbl-table { cursor: grab; }
.ktbl-canvas.editing .ktbl-table:active { cursor: grabbing; }
.ktbl-dot { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; }
.ktbl-num { font-size: 17px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: #1B1F27; }
.ktbl-top { font-size: 9.5px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
.ktbl-tag { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; background: #fff; padding: 1px 7px; border-radius: var(--r-pill); box-shadow: 0 1px 4px rgba(20,24,31,.1); }
.ktbl-srv { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.ktbl-table.kst-bill { animation: ktbl-pulse 1.5s ease-in-out infinite; }
@keyframes ktbl-pulse { 0%,100% { box-shadow: 0 1px 2px rgba(20,24,31,.05), 0 6px 16px rgba(20,24,31,.07); } 50% { box-shadow: 0 0 0 4px rgba(229,147,59,.22), 0 6px 16px rgba(20,24,31,.07); } }

/* right panel */
.ktbl-panel { width: 392px; flex: 0 0 392px; background: #fff; border-left: 1px solid var(--line); height: 100%; overflow-y: auto; box-shadow: -10px 0 30px rgba(20,24,31,.04); z-index: 2; animation: kslide .2s ease; }
.ktbl-panel-pad { padding: 22px 20px; }
.ktbl-panel-h { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.ktbl-eyebrow { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 11px; }

.ktbl-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 22px; }
.ktbl-stat { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 15px 16px; }
.ktbl-stat-v { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ktbl-stat-dot { width: 9px; height: 9px; border-radius: 50%; }
.ktbl-stat-l { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-top: 5px; }

.ktbl-resv { display: flex; flex-direction: column; gap: 9px; }
.ktbl-resv-row { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ktbl-resv-time { width: 46px; height: 46px; border-radius: 12px; background: var(--tint-blue); color: var(--blue); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; }
.ktbl-resv-time span { font-size: 13px; font-weight: 800; line-height: 1; }
.ktbl-resv-time .ampm { font-size: 9px; font-weight: 700; opacity: .7; }
.ktbl-resv-info .nm { font-size: 14.5px; font-weight: 700; }
.ktbl-resv-info .mt { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ktbl-resv-empty { padding: 22px; text-align: center; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.ktbl-hint { margin-top: 22px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-soft); font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }

/* detail */
.ktbl-detail { display: flex; flex-direction: column; height: 100%; }
.ktbl-detail-h { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.ktbl-detail-h > div:first-child { display: flex; }
.ktbl-detail-id { display: flex; align-items: center; gap: 13px; }
.ktbl-detail-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ktbl-badge { width: 48px; height: 48px; border-radius: 14px; border: 2px solid; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ktbl-detail-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; text-transform: capitalize; }
.ktbl-detail-meta { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ktbl-x { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; border: none; background: var(--fill); color: var(--ink-2); cursor: pointer; font-size: 16px; }
.ktbl-x:hover { background: var(--fill-2); }
.ktbl-detail-pill { padding: 0 20px; margin: -6px 0 0; }
.ktbl-detail .ktbl-detail-pill { padding: 14px 20px 0; }
.ktbl-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12px; font-weight: 800; }
.ktbl-detail-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

.ktbl-info { margin-bottom: 4px; }
.ktbl-info-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid var(--surface-soft); }
.ktbl-info-row span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.ktbl-info-row strong { font-size: 14.5px; font-weight: 700; }
.ktbl-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.ktbl-act { width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer; transition: all var(--fast); color: var(--ink); }
.ktbl-act:hover { border-color: var(--ink-3); }
.ktbl-act.primary { border: none; color: #fff; background: var(--grad-primary); box-shadow: var(--shadow-primary); }
.ktbl-act.primary:hover { filter: brightness(1.04); }
.ktbl-act.ok { border-color: var(--olive); color: var(--olive); }
.ktbl-act.ok:hover { background: var(--tint-green); }
.ktbl-act.warn { border-color: var(--gold); color: var(--gold-700); }
.ktbl-act.warn:hover { background: var(--tint-amber); }
.ktbl-act.danger { border-color: #F4C7C9; color: var(--wine); }
.ktbl-act.danger:hover { background: var(--tint-red); }
.ktbl-act.ghost { border: none; background: transparent; color: var(--ink-2); }

/* steppers + chips (seat + edit) */
.ktbl-stepper { display: flex; align-items: center; justify-content: space-between; background: var(--surface-soft); border-radius: var(--r-lg); padding: 13px 18px; }
.ktbl-stepper > span { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.ktbl-stepper-ctl { display: flex; align-items: center; gap: 14px; }
.ktbl-stepper-ctl button { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--blue); font-size: 22px; font-weight: 700; cursor: pointer; }
.ktbl-stepper-ctl button:hover { border-color: var(--blue); }
.ktbl-stepper-ctl b { min-width: 40px; text-align: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ktbl-num-input { width: 100%; height: 50px; border-radius: 13px; border: 1.5px solid var(--line-strong); background: #fff; padding: 0 16px; font-size: 16px; font-weight: 800; color: var(--ink); outline: none; font-variant-numeric: tabular-nums; }
.ktbl-num-input:focus { border-color: var(--blue); }
.ktbl-server-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ktbl-server { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; transition: all var(--fast); }
.ktbl-server:hover { border-color: var(--blue); }
.ktbl-server.active { border-color: var(--blue); background: var(--tint-blue); }
.ktbl-server-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ktbl-chip-grid { display: grid; gap: 9px; }
.ktbl-chip-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.ktbl-chip-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.ktbl-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 46px; padding: 8px 6px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; text-transform: capitalize; transition: all var(--fast); }
.ktbl-chip:hover { border-color: var(--blue); }
.ktbl-chip.active { border-color: var(--blue); background: var(--tint-blue); color: var(--blue); }
.ktbl-shape-glyph { width: 18px; height: 18px; background: currentColor; opacity: .65; }
.ktbl-shape-glyph.s-round, .ktbl-shape-glyph.s-stool, .ktbl-shape-glyph.s-hightop, .ktbl-shape-glyph.s-oval { border-radius: 50%; }
.ktbl-shape-glyph.s-oval { width: 22px; height: 14px; }
.ktbl-shape-glyph.s-square { border-radius: 4px; }
.ktbl-shape-glyph.s-rect, .ktbl-shape-glyph.s-communal { width: 22px; height: 13px; border-radius: 3px; }
.ktbl-shape-glyph.s-booth { width: 20px; height: 14px; border-radius: 7px 7px 3px 3px; }

/* edit summary */
.ktbl-edit-note { font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.5; margin-bottom: 20px; }
.ktbl-add-table { width: 100%; height: 56px; border-radius: 15px; border: none; background: var(--grad-primary); color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-primary); display: flex; align-items: center; justify-content: center; gap: 9px; }
.ktbl-add-table:hover { filter: brightness(1.04); }
.ktbl-edit-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 18px; }
.ktbl-edit-stat { background: var(--surface-soft); border-radius: var(--r-lg); padding: 15px 16px; }
.ktbl-edit-stat b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ktbl-edit-stat span { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.ktbl-add-floor { width: 100%; height: 46px; margin-top: 18px; border-radius: 13px; border: 1.5px dashed var(--line-strong); background: #fff; color: var(--blue); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.ktbl-add-floor:hover { border-color: var(--blue); }

/* floor dropdown menu */
.ktbl-floor-menu { position: fixed; z-index: 80; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--sh-lg); padding: 6px; }
.ktbl-floor-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 11px 12px; border-radius: 11px; border: none; background: #fff; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.ktbl-floor-item:hover { background: var(--tint-blue); }
.ktbl-floor-item.active { background: var(--tint-blue); color: var(--blue); }
.ktbl-floor-item.add { color: var(--blue); }
.ktbl-floor-c { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--r-pill); font-size: 11px; font-weight: 800; background: var(--fill); color: var(--ink-3); }
.ktbl-floor-sep { height: 1px; background: var(--line); margin: 4px 8px; }

@media (max-width: 1000px) {
  .ktbl-panel { width: 320px; flex-basis: 320px; }
}
