/* =====================================================
   Mobile-first стили (базовая ширина 320-480px)
   ===================================================== */

:root {
  --bg:         #1a1a2e;
  --surface:    #16213e;
  --primary:    #e94560;
  --primary-dk: #c73652;
  --text:       #f5f5f5;
  --text-dim:   #a0a0b0;
  --border:     #2a2a4a;
  --success:    #4caf50;
  --warning:    #ff9800;
  --radius:     12px;
  --bot-nav-h:  64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100dvh;
  padding-bottom: var(--bot-nav-h);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-title { font-size: 1.2rem; font-weight: 700; color: var(--primary); }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bot-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-item.active, .nav-item:active { color: var(--primary); }
.nav-icon { font-size: 1.4rem; }

/* Main content */
main { padding: 16px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):active { background: var(--primary-dk); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-danger  { background: #c0392b; color: #fff; }
.btn-full    { width: 100%; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 6px; }
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 1rem;
}
.form-input:focus { outline: none; border-color: var(--primary); }

/* Status badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
}
.badge-pending   { background: #ffb30022; color: var(--warning); }
.badge-confirmed { background: #4caf5022; color: var(--success); }
.badge-completed { background: #8aa6ff22; color: #8aa6ff; }
.badge-cancelled { background: #c0392b22; color: #e74c3c; }

/* Floor plan */
.floorplan-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  touch-action: pan-x pan-y;
}
.floorplan-wrap svg { width: 100%; height: auto; display: block; }

/* SVG table states */
.table-shape            { cursor: pointer; transition: opacity 0.15s; }
.table-shape.available  { fill: #2ecc71; opacity: 0.7; }
.table-shape.occupied   { fill: #e74c3c; opacity: 0.7; }
.table-shape.selected   { fill: #f39c12; opacity: 0.9; stroke: #fff; stroke-width: 2; }
.table-shape:active     { opacity: 1; }

/* Loading / empty state */
.loading { text-align: center; padding: 48px 0; color: var(--text-dim); }
.empty   { text-align: center; padding: 48px 0; color: var(--text-dim); font-size: 0.95rem; }

/* Telegram login widget container */
.tg-login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
}

/* First-login modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
}

/* Date/time row */
.time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Duration radio */
.duration-radio {
  display: flex;
  gap: 10px;
}
.duration-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.duration-option input[type="radio"] { display: none; }
.duration-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(233,69,96,.12);
}
