/* ===============================
   🎨  ESTILOS GLOBALES MAXBOX
   =============================== */

:root {
  --azul: #004aad;
  --naranja: #ff7b00;
  --card-bg: #fff;
  --muted: #6b7280;
}

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

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Inter, system-ui, Poppins, Arial, sans-serif;
  background: #f3f6fa;
  color: #111;
}

/* =====================================
   🧱 ESTRUCTURA Y CONTENEDORES
   ===================================== */
.wrap, .container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 15px;
}

/* =====================================
   🟦 CABECERA (HEADER) - CORREGIDO
   ===================================== */
header, 
.site-header {
  background: linear-gradient(90deg, var(--azul), var(--naranja));
  color: #fff;
  width: 100%;
  max-width: 100vw;
  position: relative;
  overflow: hidden;
  padding: 16px 12px;
  display: flex;               /* ✅ Flexbox para centrado perfecto */
  justify-content: center;     /* ✅ Centra el título */
  align-items: center;         /* ✅ Centra verticalmente */
  box-sizing: border-box;
  min-height: 64px;            /* ✅ Altura fija para consistencia visual */
}

header h2, 
.site-header h1, 
.site-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  text-align: center;
  flex-grow: 1;                /* ✅ El texto ocupa el espacio central disponible */
  padding: 0;                  /* ✅ Sin padding que genere bloques blancos */
}

/* Botón de cerrar sesión (admin y cliente) */
.logout-btn, 
.logout, 
.btn-ghost {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--naranja);
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);  /* ✅ Sombra sutil para destacar */
}

.logout-btn:hover, 
.logout:hover, 
.btn-ghost:hover {
  opacity: 0.9;
  transform: translateY(-50%) scale(1.02);  /* ✅ Efecto hover suave */
  transition: all 0.2s ease;
}

/* =====================================
   📦 TARJETAS, TABLAS Y BOTONES
   ===================================== */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(2,6,23,0.06);
  margin-bottom: 18px;
}

.table, table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-size: 14px;
}

th {
  background: var(--azul);
  color: #fff;
  font-weight: 600;
}

tr:hover {
  background: #f1f7ff;
}

img {
  border-radius: 8px;
}

button.primary, 
.btn-primary {
  background: linear-gradient(90deg, var(--azul), var(--naranja));
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}

button.primary:hover, 
.btn-primary:hover {
  opacity: 0.9;
}

/* =====================================
   🌐 FORMULARIOS BÁSICOS
   ===================================== */
form {
  background: #fff;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 18px;
}

input, select, textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
}

/* =====================================
   📱 RESPONSIVE MÓVILES
   ===================================== */
@media (max-width: 768px) {
  header, .site-header {
    padding: 12px 10px;
    min-height: 56px;          /* ✅ Altura menor en móvil */
  }

  header h2, .site-header h2 {
    font-size: 16px;
  }

  .logout, .logout-btn, .btn-ghost {
    font-size: 12px;
    padding: 6px 10px;
    right: 10px;
  }

  .wrap, .container {
    padding: 12px 10px;
  }

  th, td {
    font-size: 12px;
  }

  img {
    width: 60px;
  }
}

/* =====================================
   🚫 BLOQUE PREVENCIÓN DE DESBORDES
   ===================================== */
header, 
.site-header, 
header *, 
.site-header *, 
.wrap, 
.container, 
table, 
.card {
  max-width: 100%;
  overflow-x: hidden;
}