:root{
  --bg:#090d1a;
  --panel:#0f172a;
  --card:#1e293b;
  --text:#f8fafc;
  --muted:#94a3b8;
  --amber:#f59e0b;
  --amber-light:#fbbf24;
  --emerald:#10b981;
  --emerald-dark:#059669;
  --indigo:#6366f1;
  --danger:#ef4444;
  --ok:#22c55e;
  --border:rgba(255,255,255,.12);
  --shadow: 0 16px 36px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 500px at 10% -10%, rgba(245,158,11,.15), transparent 60%),
              radial-gradient(800px 500px at 90% 0%, rgba(16,185,129,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

.container{
  width:min(1200px, calc(100% - 32px));
  margin:0 auto;
}

.topbar{
  position: sticky;
  top:0;
  z-index:100;
  background: rgba(9, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 0;
  gap:16px;
  flex-wrap: wrap;
}

.brand-group{
  display: flex;
  flex-direction: column;
}
.brand{
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand-badge{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--amber-light);
}
.free-badge{
  background: rgba(16,185,129,0.2);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.brand-sub{
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pin{ color: var(--amber); }

.nav{ display:flex; gap:8px; flex-wrap:wrap; align-items: center; }
.nav__link{
  color:var(--muted);
  text-decoration:none;
  padding:8px 12px;
  border-radius:10px;
  font-size: 13px;
  font-weight: 600;
  border:1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.nav__link:hover{
  color:var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,.06);
}
.nav__link.active{
  background: var(--amber);
  color: #020617;
  font-weight: 700;
}
.nav__link--danger:hover{
  color: #fca5a5;
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.1);
}

/* Botão Menu Hambúrguer (Mobile) */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 42px;
  height: 42px;
  padding: 10px 9px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  z-index: 101;
  transition: all 0.2s ease;
}
.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--amber);
}
.hamburger-bar {
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Estado ativo do hambúrguer (vira um 'X') */
.mobile-menu-toggle.active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background-color: var(--amber-light);
}
.mobile-menu-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-toggle.active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background-color: var(--amber-light);
}

.btn--emerald{
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark)) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn--emerald:hover{
  filter: brightness(1.1);
}

.footer{
  margin-top:60px;
  border-top:1px solid var(--border);
  padding:24px 0;
  color:var(--muted);
  font-size: 14px;
}
.footer__inner{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.hero{
  padding:36px 0 20px;
}
.hero-banner{
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-banner::after{
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-tag{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber-light);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero-title{
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
  color: #ffffff;
}
.hero-subtitle{
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 0 28px;
}
.hero-pills{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-pill{
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.muted{ color:var(--muted); }

.card{
  background: rgba(30, 41, 59, 0.7);
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  box-shadow: var(--shadow);
}

.page-head{ padding:26px 0 16px; }
.page-head h1{ margin:0 0 8px; font-size: 28px; font-weight: 800; }

.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(245,158,11,.1));
  color:var(--text);
  text-decoration:none;
  font-weight:700;
  cursor:pointer;
  font-size: 14px;
  gap: 6px;
  transition: all 0.2s;
}
.btn:hover{ border-color: rgba(255,255,255,.3); filter: brightness(1.1); }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.btn--ghost{
  background: rgba(255,255,255,.04);
}

.form{
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:16px;
}
@media (max-width: 700px){
  .grid{ grid-template-columns: 1fr; }
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.field--full{ grid-column: 1 / -1; }
.field > span{ color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(15,23,42,.8);
  color: var(--text);
  outline:none;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus{ border-color: var(--amber); }

/* Slots da agenda */
.slots-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.slot-btn{
  padding: 12px 8px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.slot-btn--free{
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.slot-btn--free:hover{
  background: rgba(34, 197, 94, 0.3);
  transform: translateY(-2px);
}
.slot-btn--occupied{
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  cursor: not-allowed;
}

/* TV Display Styles & Fluid Responsiveness */
.tv-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 20px 0;
  width: 100%;
}

.tv-main-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--amber);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 40px);
  text-align: center;
  box-shadow: 0 0 50px rgba(245,158,11,0.15);
  max-width: 100%;
  overflow: hidden;
}

.tv-ticket {
  font-size: clamp(32px, 8vw, 90px);
  font-weight: 900;
  color: var(--amber-light);
  line-height: 1.1;
  margin: 10px 0;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(245,158,11,0.4);
  overflow-wrap: break-word;
  word-break: break-all;
}

.tv-client-name {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 20px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Regras de Prevenção de Transbordo Lateral Global */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

img, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}

svg {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  max-height: 100%;
  flex-shrink: 0;
}

/* Regras estritas de fallback para ícones SVG */
svg.w-3\.5 { width: 0.875rem !important; }
svg.h-3\.5 { height: 0.875rem !important; }
svg.w-4 { width: 1rem !important; }
svg.h-4 { height: 1rem !important; }
svg.w-5 { width: 1.25rem !important; }
svg.h-5 { height: 1.25rem !important; }
svg.w-6 { width: 1.5rem !important; }
svg.h-6 { height: 1.5rem !important; }
svg.w-8 { width: 2rem !important; }
svg.h-8 { height: 2rem !important; }
svg.w-12 { width: 3rem !important; }
svg.h-12 { height: 3rem !important; }

h1, h2, h3, h4, h5, h6, p, span, strong, div {
  overflow-wrap: break-word;
}

.prof-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
}

.booking-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

/* Responsividade Global e Dispositivos Móveis */
@media (max-width: 900px) {
  .tv-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .booking-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

@media (max-width: 868px) {
  .topbar__inner {
    padding: 10px 0;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-top: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    gap: 10px;
  }

  .nav.active {
    display: flex;
    animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav__link, .nav .btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .user-info-badge {
    margin-left: 0 !important;
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .prof-add-form {
    grid-template-columns: 1fr !important;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 20px);
    padding: 0 4px;
  }

  .card, .form, .hero-banner {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .hero {
    padding: 16px 0 10px;
  }

  .hero-title {
    font-size: 22px !important;
  }

  .hero-subtitle {
    font-size: 13px !important;
  }

  .hero-pills {
    flex-direction: column;
    gap: 8px;
  }

  .hero-pill {
    width: 100%;
  }

  .page-head h1 {
    font-size: 20px !important;
  }

  input, select, textarea {
    font-size: 16px !important; /* Previne auto-zoom no iOS Safari */
    padding: 12px;
    max-width: 100%;
  }

  .btn {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 13px;
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .slot-btn {
    padding: 10px 4px;
    font-size: 12px;
  }

  /* Tabelas responsivas com rolagem suave horizontal sem estourar o layout da tela */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }

  .tv-main-card {
    padding: 20px 14px !important;
  }

  #login-modal > div {
    max-width: min(480px, calc(100vw - 24px)) !important;
    padding: 16px !important;
  }
}
