/* =====================================================================
   VoucherHub — tema Azul Marinho + Amarelo Dourado
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --navy-900: #071630;
  --navy-800: #0b2447;
  --navy-700: #123563;
  --navy-600: #1b4b8a;
  --navy-100: #e7edf6;

  --gold-600: #b8860b;
  --gold-500: #d4a017;
  --gold-400: #e8b923;
  --gold-100: #fbf0d2;

  --gray-50: #f6f7f9;
  --gray-100: #edeff3;
  --gray-200: #dde1e8;
  --gray-400: #9aa3af;
  --gray-500: #6b7280;
  --gray-700: #374151;

  --white: #ffffff;
  --danger: #c0392b;
  --danger-bg: #fbeae8;
  --success: #1e8e5a;
  --success-bg: #e7f6ee;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(7, 22, 48, 0.08), 0 1px 2px rgba(7, 22, 48, 0.06);
  --shadow-lg: 0 12px 32px rgba(7, 22, 48, 0.16);

  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --sidebar-width: 240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gray-50);
  color: var(--navy-900);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy-900);
  margin: 0 0 .4rem;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 .8rem; color: var(--gray-700); }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Layout autenticado: barra lateral navy + conteúdo
   --------------------------------------------------------------------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 0;
  z-index: 40;
  transform: translateX(0);
  transition: transform .25s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1.4rem 1.4rem;
  margin-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar__mark {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-family: var(--font-display);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar__brand strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sidebar__brand span {
  display: block;
  font-size: .72rem;
  color: rgba(255,255,255,0.55);
}

.sidebar nav { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .8rem; flex: 1; }

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: rgba(255,255,255,0.75);
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }

.sidebar nav a.active {
  background: rgba(212,160,23,0.12);
  color: var(--white);
  border-left-color: var(--gold-500);
}

.sidebar__icon { width: 18px; text-align: center; opacity: .9; }

.sidebar__footer {
  padding: .8rem 1.4rem 0;
  margin-top: .6rem;
}

.sidebar__logout {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.8);
  padding: .55rem .8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  font-family: var(--font-body);
}

.sidebar__logout:hover { border-color: var(--gold-500); color: var(--white); }

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1.6rem;
  background: rgba(246,247,249,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--gray-200);
}

.topbar__menu-btn {
  display: none;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.topbar__title { flex: 1; }
.topbar__title h1 { font-size: 1.15rem; }

.topbar__user {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--gray-700);
}

.topbar__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy-100);
  color: var(--navy-800);
  font-weight: 700;
  font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}

.content { padding: 1.6rem; max-width: 1180px; width: 100%; margin: 0 auto; }

.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(7,22,48,0.45);
  z-index: 35;
}

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1.2rem;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold-500);
}

.stat-card__label {
  font-size: .78rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .3rem;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--navy-900);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem 1.1rem;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}

.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--gold-500); color: var(--navy-900); }
.btn-secondary { background: var(--navy-800); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--navy-800); }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .7rem; font-size: .8rem; }

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: .35rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-control {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .92rem;
  background: var(--white);
  color: var(--navy-900);
}

.form-control:focus {
  border-color: var(--gold-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212,160,23,0.18);
}

.form-hint { font-size: .78rem; color: var(--gray-500); margin-top: .3rem; }

.checkbox-row { display: flex; align-items: center; gap: .5rem; }
.checkbox-row input { width: 16px; height: 16px; }
.checkbox-row label { margin: 0; font-weight: 500; }

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 1rem;
}

.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(192,57,43,0.25); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(30,142,90,0.25); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.badge-available { background: var(--gold-100); color: var(--gold-600); }
.badge-redeemed { background: var(--success-bg); color: var(--success); }
.badge-expired, .badge-cancelled { background: var(--gray-100); color: var(--gray-500); }
.badge-reserved { background: var(--navy-100); color: var(--navy-700); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-draft, .badge-paused { background: var(--gray-100); color: var(--gray-500); }
.badge-ended { background: var(--danger-bg); color: var(--danger); }

/* Elemento de assinatura: código de voucher como "canhoto de cupom" */
.voucher-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .86rem;
  letter-spacing: .03em;
  background: var(--gold-100);
  border: 1.5px dashed var(--gold-600);
  border-radius: var(--radius-sm);
  padding: .3rem .7rem;
  color: var(--navy-900);
  position: relative;
}

.voucher-chip::before,
.voucher-chip::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 9px; height: 9px;
  background: var(--gray-50);
  border: 1.5px solid var(--gold-600);
  border-radius: 50%;
  transform: translateY(-50%);
}

.voucher-chip::before { left: -6px; }
.voucher-chip::after { right: -6px; }

.card .voucher-chip::before,
.card .voucher-chip::after { background: var(--white); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.data-table th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
  padding: .6rem .7rem;
  border-bottom: 2px solid var(--gray-200);
}

.data-table td {
  padding: .7rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--navy-900);
}

.data-table tr:last-child td { border-bottom: none; }
.table-responsive { overflow-x: auto; }

.empty-state {
  text-align: center;
  padding: 2.4rem 1rem;
  color: var(--gray-500);
}

.empty-state strong { display: block; color: var(--navy-800); margin-bottom: .3rem; }

.generated-codes {
  background: var(--navy-900);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  color: var(--white);
}

.generated-codes__list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}

.generated-codes .voucher-chip { background: var(--gold-500); border-style: solid; }
.generated-codes .voucher-chip::before,
.generated-codes .voucher-chip::after { background: var(--navy-900); border-color: var(--gold-600); }

/* ---------------------------------------------------------------------
   Tela de login
   --------------------------------------------------------------------- */

.guest-shell {
  min-height: 100vh;
  display: flex;
}

.guest-brand {
  flex: 1;
  background: radial-gradient(circle at 20% 20%, var(--navy-700), var(--navy-900) 60%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.guest-brand__decor {
  position: absolute;
  border: 2px dashed rgba(212,160,23,0.35);
  border-radius: var(--radius);
  width: 180px; height: 64px;
}

.guest-brand__decor--a { top: 12%; right: 8%; transform: rotate(-12deg); }
.guest-brand__decor--b { bottom: 16%; right: 22%; transform: rotate(8deg); width: 140px; height: 50px; }
.guest-brand__decor--c { top: 46%; right: -30px; transform: rotate(-4deg); width: 120px; height: 46px; opacity: .6; }

.guest-brand__mark {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.4rem;
}

.guest-brand h1 { color: var(--white); font-size: 2rem; max-width: 360px; }
.guest-brand p { color: rgba(255,255,255,0.65); max-width: 340px; }

.guest-form {
  width: 440px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--white);
}

.guest-form__inner { width: 100%; max-width: 320px; }
.guest-form h2 { margin-bottom: .3rem; }
.guest-form > .guest-form__inner > p { margin-bottom: 1.6rem; }

.guest-form__hint {
  margin-top: 1.2rem;
  font-size: .78rem;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
}

/* ---------------------------------------------------------------------
   Responsivo
   --------------------------------------------------------------------- */

@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .guest-brand { display: none; }
  .guest-form { width: 100%; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar__menu-btn { display: inline-flex; }
  .overlay.is-open { display: block; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 1.1rem; }
  .topbar { padding: .8rem 1rem; }
  .card { padding: 1.1rem; }
}
