/* =========================================================
   Bilheteria Pay Backoffice - Light UI (Premium / Clean)
   Ajustado para o último index.html enviado
   ========================================================= */

/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #0f172a;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(59,130,246,.10), transparent 55%),
    radial-gradient(900px 600px at 85% 25%, rgba(34,211,238,.10), transparent 55%),
    #f6f8fc;
}

/* Tokens */
:root {
  --bg: #f6f8fc;
  --panel: rgba(255,255,255,.72);
  --card: rgba(255,255,255,.92);
  --card-strong: #ffffff;

  --text: #0f172a;
  --muted: #64748b;

  --line: rgba(15,23,42,.10);
  --line-strong: rgba(15,23,42,.14);

  --shadow: 0 18px 60px rgba(2,6,23,.08);
  --shadow-soft: 0 10px 30px rgba(2,6,23,.08);

  --accent: #2563eb;
  --accent2: #06b6d4;

  --good: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;

  --radius: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --pad: 14px;
  --pad-lg: 18px;
}

/* Layout */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 290px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.55));
  backdrop-filter: blur(12px);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 14px 35px rgba(37,99,235,.18);
}

.brand-title {
  font-weight: 900;
  letter-spacing: .2px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;

  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  user-select: none;

  background: transparent;
  font-weight: 800;
}

.nav-item i {
  width: 18px;
  height: 18px;
  opacity: .9;
}

.nav-item:hover {
  border-color: var(--line);
  background: rgba(15,23,42,.03);
}

.nav-item.active {
  border-color: rgba(37,99,235,.22);
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(6,182,212,.07));
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.topbar-left .title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .2px;
}

.topbar-left .subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);

  background: rgba(255,255,255,.75);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

/* Content */
.content {
  padding: 18px 20px;
  overflow: auto;
}

/* Views */
.view.hidden { display: none; }

/* Cards */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  font-weight: 950;
  letter-spacing: .2px;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 14px;
}

/* Grid helpers */
.grid { display: grid; gap: 12px; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-title { font-size: 12px; color: var(--muted); font-weight: 800; }
.kpi-value { font-size: 24px; font-weight: 950; letter-spacing: .2px; }

/* Forms */
.form { display: grid; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 800; }

.input, .select, select, input {
  height: 40px;
  padding: 10px 12px;

  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.90);
  color: var(--text);

  outline: none;
}

.input:focus, .select:focus, select:focus, input:focus {
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.hint { font-size: 12px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 40px;
  padding: 0 12px;

  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);

  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.btn i { width: 18px; height: 18px; }

.btn:hover {
  background: rgba(15,23,42,.03);
  border-color: var(--line-strong);
}

.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
}

.btn.icon {
  width: 40px;
  justify-content: center;
  padding: 0;
}

.btn.small {
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  font-weight: 900;
}

.btn.primary {
  border-color: rgba(37,99,235,.25);
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(6,182,212,.10));
}

/* Tables */
.table-wrap { width: 100%; overflow: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}
.table tbody td {
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody tr:hover {
  background: rgba(37,99,235,.04);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}

.tab {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
}

.tab:hover {
  border-color: var(--line-strong);
}

.tab.active {
  border-color: rgba(37,99,235,.25);
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(6,182,212,.09));
}

.tabpanes { padding: 14px; }
.tabpane.hidden { display: none; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 12px;
  font-weight: 900;

  padding: 6px 10px;
  border-radius: 999px;

  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.75);
}

.badge.ok {
  border-color: rgba(22,163,74,.25);
  color: #15803d;
  background: rgba(22,163,74,.08);
}

.badge.danger {
  border-color: rgba(239,68,68,.25);
  color: #b91c1c;
  background: rgba(239,68,68,.08);
}

/* Simple helpers */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hr {
  height: 1px;
  width: 100%;
  background: var(--line);
}
.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

/* Modal */
.modal.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(780px, 96vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.70);
}

.modal-title {
  font-weight: 950;
  letter-spacing: .2px;
}

.modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-body {
  padding: 14px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;

  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.70);
}

/* Toast */
.toast.hidden { display: none; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;

  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  color: var(--text);
  box-shadow: var(--shadow-soft);

  font-weight: 900;
}

/* Responsive */
@media (max-width: 1100px) {
  .sidebar { width: 240px; }
}

@media (max-width: 920px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .card-actions { flex-wrap: wrap; justify-content: flex-end; }
  .kv { grid-template-columns: 1fr; }
}
