/* ═══════════════════════════════════════════════════════════════════════════
   Kepler Tickets — Reception Module
   Palette: #DDDCDB · #FD7B41 · #EDBF9B · #3C4044
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --gray:    #DDDCDB;
  --orange:  #FD7B41;
  --peach:   #EDBF9B;
  --dark:    #3C4044;
  --white:   #FFFFFF;

  --orange-dark:  #e06030;
  --orange-light: #fff0e8;
  --dark-muted:   #5a6068;
  --border:       #e8e5e3;
  --bg:           #f7f5f3;
  --danger:       #e53e3e;
  --success:      #38a169;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 2px 12px rgba(60,64,68,.10);
  --shadow-lg: 0 8px 32px rgba(60,64,68,.16);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(60,64,68,.08);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--dark);
  font-size: 15px; font-weight: 500;
}
.brand strong { color: var(--orange); }

.topbar-nav { flex: 1; display: flex; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--dark-muted);
  font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
  background: var(--orange-light); color: var(--orange);
}

.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 20px;
  padding: 4px 12px 4px 6px;
}
.user-role {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  padding: 2px 8px; border-radius: 12px; letter-spacing: .5px;
}
.user-role.receptionist { background: var(--orange-light); color: var(--orange); }
.user-role.admin         { background: #e8eaf6; color: #3949ab; }
.user-name { font-size: 13px; font-weight: 500; }

.btn-logout {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--dark-muted);
  font-size: 13px; transition: color .15s;
}
.btn-logout:hover { color: var(--danger); }

.main-content {
  max-width: 1280px; margin: 0 auto;
  padding: 28px 24px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary.btn-full { width: 100%; justify-content: center; }
.btn-primary.btn-lg { padding: 13px 24px; font-size: 15px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--dark);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 9px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--orange); background: var(--orange-light); }

.btn-disabled {
  background: var(--gray); color: var(--dark-muted);
  border: none; border-radius: var(--radius);
  padding: 10px 20px; font-size: 14px; cursor: not-allowed;
}
.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--dark-muted); padding: 4px;
  display: flex; align-items: center;
  border-radius: 6px; transition: color .15s, background .15s;
}
.btn-icon:hover { color: var(--danger); background: #fee; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--dark); }
.optional { font-weight: 400; color: var(--dark-muted); }

.field-input {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; font-size: 14px; font-family: var(--font);
  color: var(--dark); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.field-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(253,123,65,.12);
}
.field-error { font-size: 12px; color: var(--danger); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert-error {
  display: flex; align-items: center; gap: 8px;
  background: #fff5f5; color: var(--danger);
  border: 1px solid #fed7d7; border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px;
}
.alert-success {
  background: #f0fff4; color: var(--success);
  border: 1px solid #c6f6d5; border-radius: var(--radius);
  padding: 10px 14px; font-size: 13px;
}
.hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, var(--dark) 0%, #2a2e31 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 24px; position: relative; z-index: 1;
}
.login-panel {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 44px 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 16px; margin-bottom: 32px;
}
.login-brand { font-size: 22px; font-weight: 700; line-height: 1.1; }
.login-subtitle { font-size: 13px; color: var(--dark-muted); margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-footer { margin-top: 20px; text-align: center; font-size: 12px; color: var(--dark-muted); }

.input-with-toggle { position: relative; }
.input-with-toggle .field-input { padding-right: 44px; width: 100%; }
.toggle-pwd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--dark-muted);
}

/* Decorative circles */
.deco-circle {
  position: absolute; border-radius: 50%;
  background: rgba(253,123,65,.15);
  pointer-events: none;
}
.deco-1 { width: 300px; height: 300px; top: -80px; right: -60px; }
.deco-2 { width: 200px; height: 200px; bottom: -40px; left: -40px; }
.deco-3 { width: 150px; height: 150px; top: 50%; left: 30%; background: rgba(237,191,155,.1); }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--dark-muted); margin-top: 2px; }

.filter-bar { display: flex; gap: 8px; }
.filter-select {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 8px 14px; font-size: 13px; font-family: var(--font);
  color: var(--dark); background: var(--white); cursor: pointer;
}

/* ── Showtime Grid ───────────────────────────────────────────────────────── */
.showtime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.showtime-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 12px;
}
.showtime-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--orange); }
.showtime-card.urgent { border-color: #fed7d7; }
.showtime-card.low    { border-color: #fefcbf; }

.card-top { display: flex; justify-content: space-between; align-items: center; }
.event-tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; padding: 3px 10px; border-radius: 12px;
  background: var(--orange-light); color: var(--orange);
}
.event-price { font-size: 16px; font-weight: 700; color: var(--orange); }

.card-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.card-time {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--dark-muted);
}

.seat-progress { display: flex; flex-direction: column; gap: 6px; }
.progress-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 500;
}
.progress-labels .urgent { color: var(--danger); }
.progress-labels .low    { color: #d69e2e; }
.progress-bar { height: 6px; background: var(--gray); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); border-radius: 3px; transition: width .3s; }

.btn-card { width: 100%; justify-content: space-between; margin-top: 4px; }

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--dark-muted);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

/* ── Sale Layout ─────────────────────────────────────────────────────────── */
.sale-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 24px;
  min-height: calc(100vh - 56px - 56px);
}

/* ── Seat Panel ──────────────────────────────────────────────────────────── */
.seat-panel {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.panel-header { display: flex; align-items: flex-start; gap: 16px; }
.back-link {
  display: flex; align-items: center; gap: 4px;
  color: var(--dark-muted); text-decoration: none; font-size: 13px;
  padding: 6px 0; white-space: nowrap; margin-top: 2px;
}
.back-link:hover { color: var(--orange); }
.showtime-info h2 { font-size: 20px; font-weight: 700; }
.showtime-info span { font-size: 13px; color: var(--dark-muted); }

/* Stage */
.stage-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; margin-bottom: 4px;
}
.stage-arc {
  width: 70%; height: 20px;
  border-top: 3px solid var(--orange);
  border-radius: 100% 100% 0 0;
}
.stage-label {
  font-size: 10px; letter-spacing: 3px; font-weight: 700;
  color: var(--orange); text-transform: uppercase;
}

/* Legend */
.seat-legend {
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dark-muted); }
.legend-dot {
  width: 16px; height: 16px; border-radius: 4px;
}
.legend-dot.available { background: #a8c8f0; }
.legend-dot.selected  { background: var(--orange); }
.legend-dot.reserved  { background: var(--gray); }
.legend-dot.occupied  { background: #e53e3e; }

/* Seat Map */
.seat-map-wrapper {
  overflow-x: auto; padding: 8px 0;
}
.seat-map {
  display: flex; flex-direction: column; gap: 6px;
  min-width: fit-content; margin: 0 auto;
  width: fit-content;
}
.seat-row {
  display: flex; align-items: center; gap: 8px;
}
.row-label {
  width: 22px; text-align: right;
  font-size: 12px; font-weight: 600; color: var(--dark-muted);
  flex-shrink: 0;
}
.seats-in-row { display: flex; gap: 5px; }

.seat-btn {
  width: 36px; height: 36px;
  border: none; border-radius: 6px;
  cursor: pointer; position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: transform .1s, opacity .15s;
  padding: 0;
}
.seat-btn:hover:not(:disabled) { transform: scale(1.15); z-index: 2; }
.seat-btn:disabled { cursor: default; }

.seat-available { background: #a8c8f0; color: #2b6cb0; }
.seat-selected  { background: var(--orange); color: var(--white); }
.seat-reserved  { background: var(--gray); color: #888; }
.seat-occupied  { background: #fed7d7; color: var(--danger); }

.seat-num {
  font-size: 9px; font-weight: 700;
  position: absolute; bottom: 2px;
  line-height: 1;
}

/* ── Sale Sidebar ────────────────────────────────────────────────────────── */
.sale-sidebar {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 72px; height: fit-content;
}
.sale-step {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
}
.step-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--orange); color: var(--white);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  float: left; margin-right: 10px; margin-bottom: 4px;
}
.step-title {
  font-size: 14px; font-weight: 700; margin-bottom: 14px;
  line-height: 28px;
}

/* Customer */
.search-row { display: flex; gap: 8px; }
.search-row .field-input { flex: 1; min-width: 0; }
.search-row .btn-secondary { flex-shrink: 0; white-space: nowrap; }

.lookup-msg { font-size: 12px; margin-top: 6px; }
.msg-warning { color: #d69e2e; }
.msg-error   { color: var(--danger); }

.customer-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--orange-light); border-radius: var(--radius);
  padding: 10px 12px;
}
.customer-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--orange); color: var(--white);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customer-info {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.customer-info strong { font-size: 14px; font-weight: 600; }
.customer-info span   { font-size: 12px; color: var(--dark-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-phone { margin-top: 1px; }

/* Selection */
.selected-list { display: flex; flex-direction: column; gap: 6px; }
.empty-hint { font-size: 13px; color: var(--dark-muted); text-align: center; padding: 8px 0; }
.sel-seat-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
}
.sel-label { flex: 1; font-size: 13px; font-weight: 600; }
.sel-price { font-size: 13px; color: var(--orange); font-weight: 600; }
.btn-remove {
  background: none; border: none; cursor: pointer;
  color: var(--dark-muted); font-size: 12px; padding: 2px 4px;
  border-radius: 4px; transition: color .15s;
}
.btn-remove:hover { color: var(--danger); }

.seat-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding: 10px 12px;
  background: var(--dark); border-radius: var(--radius);
  color: var(--white);
}
.seat-total span { font-size: 13px; }
.seat-total strong { font-size: 18px; color: var(--peach); }

/* Payment */
.payment-options { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.payment-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border-radius: var(--radius);
  border: 2px solid var(--border); cursor: pointer;
  font-size: 12px; font-weight: 500; text-align: center;
  transition: border-color .15s, background .15s;
}
.payment-opt:hover  { border-color: var(--orange); background: var(--orange-light); }
.payment-opt.selected { border-color: var(--orange); background: var(--orange-light); color: var(--orange); }

/* Loader */
.loader {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; font-size: 13px; color: var(--dark-muted);
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--gray);
  border-top-color: var(--orange);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(60,64,68,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-hint { font-size: 13px; color: var(--dark-muted); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}
.modal-footer-center { justify-content: center; }

/* Success modal */
.modal-success { text-align: center; padding: 32px 24px 0; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--success); margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.modal-success h3 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.success-details { text-align: left; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.success-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.success-row span { color: var(--dark-muted); }
.ticket-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.ticket-item {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; font-weight: 600;
}
.qr-thumb { width: 40px; height: 40px; border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sale-layout { grid-template-columns: 1fr; }
  .sale-sidebar { position: static; }
  .topbar-inner { padding: 0 16px; }
  .main-content { padding: 16px; }
  .login-panel  { padding: 32px 24px; }
}
@media (max-width: 480px) {
  .showtime-grid { grid-template-columns: 1fr; }
  .payment-options { grid-template-columns: 1fr; }
}
