:root {
  --azul: #1F4E78;
  --azul-claro: #DDEBF7;
  --verde: #1e7e34;
  --verde-claro: #c6efce;
  --amarillo: #fff2a6;
  --rojo-claro: #ffc7ce;
  --gris-borde: #d9d9d9;
  --gris-texto: #444;
  --fondo: #f5f7fa;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--fondo);
  color: #222;
  margin: 0;
  font-size: 15px;
}

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

.topbar {
  background: var(--azul);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  flex-wrap: wrap;
}
.brand { color: #fff; font-weight: bold; font-size: 1.1em; }
.mainnav { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.mainnav a { color: #cfe0f0; padding: 6px 4px; }
.mainnav a.active, .mainnav a:hover { color: #fff; border-bottom: 2px solid #fff; text-decoration: none; }
.topbar-user { display: flex; align-items: center; gap: 10px; color: #cfe0f0; font-size: 0.9em; }
.btn-link { color: #fff; text-decoration: underline; }
.notif-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #d9364a;
  color: #fff;
  border-radius: 10px;
  font-size: 0.65em;
  padding: 1px 5px;
  font-weight: bold;
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 60px;
}

h1 { font-size: 1.4em; margin: 0 0 14px; color: var(--azul); }
h2 { font-size: 1.15em; color: var(--azul); }

.card {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.grid-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-box {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-left: 5px solid var(--azul);
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 140px;
  flex: 1;
}
.stat-box .num { font-size: 1.8em; font-weight: bold; color: var(--azul); }
.stat-box .label { font-size: 0.85em; color: #666; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--gris-borde); text-align: left; font-size: 0.93em; }
th { background: var(--azul-claro); color: var(--azul); }
tr:hover td { background: #fafcff; }
.table-wrap { overflow-x: auto; border: 1px solid var(--gris-borde); border-radius: 8px; }
.table-wrap table { border: none; }

.btn {
  display: inline-block;
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.95em;
}
.btn:hover { background: #163a5c; text-decoration: none; color: #fff; }
.btn-secondary { background: #fff; color: var(--azul); border: 1px solid var(--azul); }
.btn-danger { background: #b02a37; }
.btn-sm { padding: 5px 10px; font-size: 0.85em; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 4px; font-size: 0.9em; color: #333; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  font-size: 0.95em;
  font-family: inherit;
}
.form-row textarea { min-height: 80px; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

.search-bar { margin-bottom: 16px; }
.search-bar input { width: 100%; max-width: 420px; padding: 10px 12px; border: 1px solid var(--gris-borde); border-radius: 6px; font-size: 1em; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.badge-vida { background: var(--azul-claro); color: var(--azul); }
.badge-gmm { background: #e6d9f7; color: #5b2c8e; }
.badge-activo { background: var(--verde-claro); color: #1e6b2e; }
.badge-cancelado { background: var(--rojo-claro); color: #900; }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: #eef1f5; border-radius: 8px; min-width: 240px; flex: 1; padding: 10px; }
.kanban-col h3 { font-size: 0.85em; text-transform: uppercase; color: #555; margin: 0 0 8px; }
.kanban-card {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  display: block;
  font-size: 0.9em;
}
.kanban-card:hover { border-color: var(--azul); text-decoration: none; }
.kanban-card .tel { color: #666; font-size: 0.85em; }

.estatus-Cliente, .estatus-Pagado, .estatus-Contrato_aceptado { background: var(--verde-claro) !important; }
.estatus-No_quiere_contratar { background: var(--rojo-claro) !important; }
.estatus-Pendiente, .estatus-Contratará_después { background: var(--amarillo) !important; }

.login-wrap { max-width: 380px; margin: 60px auto; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.9em; }
.alert-error { background: #ffe0e0; color: #900; border: 1px solid #f5b5b5; }
.alert-ok { background: #dff5e1; color: #1e6b2e; border: 1px solid #b7e2bd; }

.notas-log { border-top: 1px solid var(--gris-borde); margin-top: 16px; padding-top: 10px; }
.nota-item { padding: 8px 0; border-bottom: 1px dashed var(--gris-borde); font-size: 0.92em; }
.nota-fecha { color: #888; font-size: 0.82em; }

.muted { color: #888; font-size: 0.85em; }

@media (max-width: 600px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
}
