/* ==========================================================
   AIRWIZ Ventas — CSS principal
   Identidad de marca oficial:
     Verde principal: #68BD44 (PANTONE 360 C)
     Azul oscuro:     #253343
     Gris:            #B3B3B4
     Tipografía:      Raleway (cuerpo) / Eastman Alternate (logo)
   ========================================================== */

:root {
  --verde: #68BD44;
  --verde-oscuro: #58a538;
  --verde-claro: #a8e080;
  --verde-bg: #e8f5e0;
  --azul: #253343;
  --azul-claro: #3e5062;
  --gris: #B3B3B4;
  --gris-bg: #f5f7fa;
  --gris-medio: #e6eaee;
  --gris-texto: #6b7580;
  --blanco: #ffffff;
  --rojo: #e53935;
  --rojo-bg: #fdecea;
  --ambar: #e8a500;
  --ambar-bg: #fff4d6;
  --sombra: 0 2px 12px rgba(37, 51, 67, 0.08);
  --sombra-hover: 0 4px 20px rgba(37, 51, 67, 0.15);
  --radio: 10px;
  --radio-sm: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--azul);
  background: var(--gris-bg);
  line-height: 1.5;
  font-size: 14px;
}

a { color: var(--verde); text-decoration: none; }
a:hover { color: var(--verde-oscuro); text-decoration: underline; }

/* ==========================================================
   LAYOUT
   ========================================================== */

.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--azul);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .brand img {
  width: 160px;
  filter: brightness(1.1);
}

.sidebar .brand .subtle {
  font-size: 11px;
  color: var(--verde);
  letter-spacing: 2px;
  margin-top: 2px;
}

.sidebar nav { padding: 16px 12px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radio-sm);
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--verde);
  color: white;
}
.sidebar nav .group-title {
  padding: 14px 14px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
}

.sidebar nav .icon {
  display: inline-block;
  width: 20px;
  text-align: center;
  font-weight: 700;
}

.sidebar .userbox {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px;
  font-size: 12.5px;
}
.sidebar .userbox .name { font-weight: 600; color: white; }
.sidebar .userbox .email { color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.sidebar .userbox a { color: var(--verde); }

.main {
  padding: 24px 32px 48px;
  max-width: 100%;
  overflow-x: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gris-medio);
}
.topbar h1 { font-size: 22px; margin: 0; font-weight: 700; color: var(--azul); }
.topbar .crumbs { font-size: 12px; color: var(--gris-texto); margin-top: 4px; }
.topbar .crumbs a { color: var(--gris-texto); }

/* ==========================================================
   AUTH layout (login)
   ========================================================== */

.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--azul) 0%, #1a2632 100%);
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}
.auth-card .logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-card .logo img { width: 180px; }
.auth-card h2 {
  text-align: center;
  margin: 0 0 6px;
  color: var(--azul);
}
.auth-card p.sub {
  text-align: center;
  color: var(--gris-texto);
  margin: 0 0 28px;
  font-size: 13px;
}

/* ==========================================================
   CARDS, PANELES
   ========================================================== */

.card {
  background: white;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 20px;
}
.card .card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--azul);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-left: 4px solid var(--verde);
  padding-left: 10px;
}
.card .card-subtitle { color: var(--gris-texto); font-size: 12.5px; margin: -12px 0 16px; }

/* Grid de stats del dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: white;
  border-radius: var(--radio);
  padding: 20px;
  box-shadow: var(--sombra);
  border-left: 4px solid var(--verde);
}
.stat .label { font-size: 12px; color: var(--gris-texto); text-transform: uppercase; letter-spacing: 1px; }
.stat .value { font-size: 32px; font-weight: 700; color: var(--azul); margin-top: 6px; }

/* ==========================================================
   FORMS
   ========================================================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
}
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-field.full { grid-column: 1 / -1; }

.form-field { display: flex; flex-direction: column; }
.form-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--azul);
  margin-bottom: 6px;
}
.form-field label .req { color: var(--verde); margin-left: 3px; }
.form-field .hint { font-size: 11.5px; color: var(--gris-texto); margin-top: 4px; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=tel], input[type=url], input[type=date], input[type=datetime-local],
input[type=file], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gris-medio);
  border-radius: var(--radio-sm);
  background: white;
  font-family: inherit;
  font-size: 14px;
  color: var(--azul);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(104, 189, 68, 0.15);
}
textarea { resize: vertical; min-height: 80px; }

input[type=checkbox], input[type=radio] {
  width: 18px; height: 18px; accent-color: var(--verde);
  vertical-align: middle; margin-right: 6px;
}

/* ==========================================================
   BOTONES
   ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--verde);
  color: white;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--radio-sm);
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  text-decoration: none;
}
.btn:hover { background: var(--verde-oscuro); color: white; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn.btn-block { width: 100%; }

.btn.btn-secondary {
  background: white;
  color: var(--azul);
  border: 1px solid var(--gris-medio);
}
.btn.btn-secondary:hover { background: var(--gris-bg); color: var(--azul); }
.btn.btn-danger { background: var(--rojo); }
.btn.btn-danger:hover { background: #c62828; }
.btn.btn-azul { background: var(--azul); }
.btn.btn-azul:hover { background: var(--azul-claro); }
.btn.btn-ghost { background: transparent; color: var(--gris-texto); border: 1px dashed var(--gris-medio); }
.btn.btn-ghost:hover { background: var(--gris-bg); color: var(--azul); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.actions.right { justify-content: flex-end; }

/* ==========================================================
   ALERTS, TAGS, BADGES
   ========================================================== */

.alert {
  padding: 12px 16px;
  border-radius: var(--radio-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border-left: 4px solid;
}
.alert-ok    { background: var(--verde-bg); border-color: var(--verde); color: #2e6e1b; }
.alert-error { background: var(--rojo-bg);  border-color: var(--rojo);  color: #922; }
.alert-warn  { background: var(--ambar-bg); border-color: var(--ambar); color: #8a5c00; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge.ok    { background: var(--verde-bg); color: var(--verde-oscuro); }
.badge.azul  { background: #e0e8f0;  color: var(--azul); }
.badge.warn  { background: var(--ambar-bg); color: var(--ambar); }
.badge.err   { background: var(--rojo-bg);  color: var(--rojo); }
.badge.gris  { background: var(--gris-medio); color: var(--gris-texto); }

/* Estados de venta */
.estado-borrador, .estado-docs_pendientes { background: var(--gris-medio); color: var(--gris-texto); }
.estado-equipo_pendiente, .estado-lista_instalar { background: var(--ambar-bg); color: var(--ambar); }
.estado-enviada_mikrowisp { background: #e0e8f0; color: var(--azul); }
.estado-instalada { background: var(--verde-bg); color: var(--verde-oscuro); }
.estado-anulada { background: var(--rojo-bg); color: var(--rojo); }

/* ==========================================================
   TABLAS
   ========================================================== */

.table-wrap {
  background: white;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data thead th {
  background: var(--gris-bg);
  color: var(--azul);
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gris-medio);
}
table.data tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gris-medio);
}
table.data tbody tr:hover { background: #fafbfc; }
table.data .num { font-family: 'SF Mono', Menlo, monospace; color: var(--azul); font-weight: 600; }

/* ==========================================================
   STEPPER (flujo de venta)
   ========================================================== */
.stepper {
  display: flex;
  margin-bottom: 24px;
  background: white;
  border-radius: var(--radio);
  overflow: hidden;
  box-shadow: var(--sombra);
}
.stepper .step {
  flex: 1;
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid var(--gris-medio);
  color: var(--gris-texto);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
}
.stepper .step:last-child { border-right: none; }
.stepper .step .n {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gris-medio); color: white; line-height: 24px; margin-right: 6px;
  font-weight: 700;
}
.stepper .step.active { color: var(--azul); background: #fafbfc; }
.stepper .step.active .n { background: var(--verde); }
.stepper .step.done { color: var(--verde-oscuro); }
.stepper .step.done .n { background: var(--verde); }
.stepper .step:hover { background: #f0f4f8; text-decoration: none; }

/* ==========================================================
   UPLOADER DE DOCUMENTOS
   ========================================================== */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.doc-card {
  border: 2px dashed var(--gris-medio);
  border-radius: var(--radio);
  padding: 18px;
  text-align: center;
  background: #fdfefe;
  transition: border-color 0.15s, background 0.15s;
}
.doc-card.ok { border-color: var(--verde); border-style: solid; background: var(--verde-bg); }
.doc-card .label { font-weight: 700; color: var(--azul); margin-bottom: 4px; font-size: 13px; }
.doc-card .status { font-size: 11px; color: var(--gris-texto); margin-bottom: 10px; }
.doc-card .status.ok { color: var(--verde-oscuro); font-weight: 600; }
.doc-card img.preview { width: 100%; max-height: 120px; object-fit: cover; border-radius: var(--radio-sm); margin-bottom: 10px; }
.doc-card .file-name { font-size: 11px; color: var(--gris-texto); word-break: break-all; margin-bottom: 8px; }

/* ==========================================================
   EQUIPOS
   ========================================================== */
.equipo-ocr-box {
  background: var(--gris-bg);
  border-radius: var(--radio);
  padding: 20px;
  margin-bottom: 16px;
}
.equipo-candidatos {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.equipo-candidatos .c {
  background: white; border: 1px solid var(--gris-medio); border-radius: 20px;
  padding: 4px 10px; font-size: 11.5px; cursor: pointer; font-family: 'SF Mono', monospace;
}
.equipo-candidatos .c:hover { background: var(--verde-bg); border-color: var(--verde); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 16px; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .stepper { flex-direction: column; }
  .stepper .step { border-right: 0; border-bottom: 1px solid var(--gris-medio); }
}

/* Utilidades */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--gris-texto); }
.text-verde { color: var(--verde); }
.text-azul { color: var(--azul); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }
hr.sep { border: none; border-top: 1px solid var(--gris-medio); margin: 20px 0; }
