:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #0f172a;
  --light: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-700: #334155;
  --card-bg: #ffffff;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: #f1f5f9;
  color: var(--dark);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navbar */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.navbar-menu a {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.navbar-menu a:hover, .navbar-menu a.active {
  color: var(--primary);
  background: #eff6ff;
  text-decoration: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Layout Container */
.container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
}

.page-subtitle {
  color: var(--secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Cards & Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 0.75rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius);
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow);
}

.stat-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--secondary);
  font-weight: 600;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--dark);
  margin-top: 0.5rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--gray-200);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #f8fafc;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #e2e8f0; color: #334155; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.9); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--gray-200); color: var(--dark); }
.btn-outline:hover { background: var(--gray-100); text-decoration: none; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  color: var(--gray-700);
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.show { display: flex; }

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Telão TV / Projector Mode */
.telao-body {
  background-color: #090d16;
  color: #f8fafc;
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  padding: 1.5rem;
  min-height: 100vh;
}

.telao-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111827;
  padding: 1.25rem 2rem;
  border-radius: 16px;
  border: 1px solid #1f2937;
  margin-bottom: 1.5rem;
}

.telao-title {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.telao-badge-live {
  background: #ef4444;
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 800;
  letter-spacing: 1px;
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.telao-grid {
  display: grid;
  grid-template-columns: 4.5fr 7.5fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .telao-grid { grid-template-columns: 1fr; }
}

.telao-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.calling-box {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.calling-label {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #93c5fd;
  font-weight: 800;
}

.calling-pos {
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  margin: 0.5rem 0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.calling-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fbbf24;
}

.calling-score {
  font-size: 1.25rem;
  color: #e0f2fe;
  font-weight: 600;
  margin-top: 0.5rem;
}

.next-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.next-item {
  background: #1f2937;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #3b82f6;
}

.next-pos {
  font-size: 1.25rem;
  font-weight: 800;
  color: #60a5fa;
}

.next-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3f4f6;
}

.telao-table-container {
  max-height: 70vh;
  overflow-y: auto;
}

.telao-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.telao-table th {
  background: #1f2937;
  color: #9ca3af;
  padding: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.telao-table td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid #1f2937;
  font-size: 1.1rem;
}

.telao-table tr:hover {
  background: #1e293b;
}

/* Printable Document / Ata / Comunicado */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .navbar, .btn, .no-print {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .printable-document {
    border: 2px solid #000 !important;
    padding: 2.5rem !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
  }
}

/* ---------- LOGIN LAYOUT (Estilo Transporte) ---------- */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(37, 99, 235, 0.18), transparent 60%),
              linear-gradient(135deg, var(--primary), var(--dark));
}

.login-wrap {
  display: flex;
  width: 100%;
  max-width: 920px;
  min-height: 560px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
}

.login-brand {
  flex: 1 1 45%;
  padding: 48px 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(150deg, var(--primary), #1e40af);
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  font-size: 30px;
  margin-bottom: 18px;
  backdrop-filter: blur(4px);
}

.login-brand h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.brand-tag {
  opacity: 0.9;
  margin: 6px 0 28px;
  font-size: 14px;
}

.brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.brand-features i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.login-card {
  flex: 1 1 55%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.login-mobile-logo {
  display: none;
}

.login-card h2 {
  font-size: 22px;
  color: var(--dark);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.login-sub {
  color: var(--secondary);
  font-size: 13px;
  margin: 6px 0 24px;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gray-700);
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: var(--dark);
}

.login-card input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  outline: none;
}

.senha-wrap {
  position: relative;
  display: block;
}

.senha-wrap input {
  padding-right: 42px;
}

.senha-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.senha-toggle:hover {
  color: var(--primary);
  background: var(--gray-100);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 18px;
  font-size: 13px;
}

.lembrar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
  color: var(--secondary);
  cursor: pointer;
}

.lembrar input {
  width: auto;
  margin: 0;
}

.link-esqueci {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.link-esqueci:hover {
  text-decoration: underline;
}

.login-hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--secondary);
  text-align: center;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .login-wrap {
    flex-direction: column;
    min-height: 0;
    max-width: 420px;
  }
  .login-brand {
    display: none;
  }
  .login-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin: 0 auto 14px;
    background: var(--primary);
    color: #ffffff;
    font-size: 26px;
  }
  .login-card {
    padding: 28px 22px;
  }
}

/* ==========================================================================
   SIDEBAR NAVIGATION LAYOUT (ESTILO TRANSPORTE)
   ========================================================================== */
body.has-sidebar {
  display: block;
  min-height: 100vh;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
}

/* Sidebar Fixa na Esquerda */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 250px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  padding: 1.35rem 1.25rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand i {
  color: #3b82f6;
  font-size: 1.35rem;
}

.sidebar-user {
  padding: 0.9rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #f8fafc;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Menu de Navegação */
.sidebar-nav {
  flex: 1;
  padding: 0.85rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-group {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 1px;
  padding: 12px 10px 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-nav a i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-nav a:hover i {
  color: #60a5fa;
}

.sidebar-nav a.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-nav a.active i {
  color: #ffffff;
}

.sidebar-foot {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-foot a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f87171;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-foot a:hover {
  color: #ef4444;
}

/* Área Principal de Conteúdo (Layout com Sidebar) */
.main-wrapper {
  margin-left: 250px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.has-sidebar .container {
  width: 100%;
  max-width: 1350px;
  margin: 1.75rem auto 3rem auto;
  padding: 0 2rem;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: #334155;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.topbar-toggle:hover {
  background: #f1f5f9;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1040;
}

/* Responsividade Mobile */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .has-sidebar .container {
    padding: 0 1rem;
    margin: 1.25rem auto;
  }

  .topbar-toggle {
    display: inline-flex;
  }
}

/* Estilos Globais de Impressão */
@media print {
  .no-print { display: none !important; }
  .only-print { display: block !important; }
}





