/* ===========================================================================
   AZ Control Tower — tema visual
   Derivado del mockup AZ_Control_Tower_AI. Identificadores en inglés,
   textos de la app en español. Las clases del shell se anclan bajo .az-app
   para no chocar con Bootstrap (que usan las páginas de Identity).
   =========================================================================== */
:root{
  /* Marca / verdes */
  --green:  #053b25;
  --green2: #075c37;
  --green3: #109657;
  --mint:   #eaf7ef;
  /* Superficies */
  --bg:     #f5f8f6;
  --card:   #fff;
  --line:   #dbe8e0;
  /* Acento + estado */
  --orange: #ff7a1a;
  --orange2:#ff9c3d;
  --red:    #e3342f;
  --yellow: #f7b500;
  --blue:   #2085d0;
  /* Texto */
  --ink:    #0e1f19;
  --muted:  #63746b;
  /* Elevación */
  --shadow: 0 18px 40px rgba(8,41,25,.08);
  /* Radios */
  --r-sm:10px; --r-md:14px; --r-lg:18px; --r-xl:20px; --r-pill:999px;
}

/* ---------- Base ---------- */
body{
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
  margin:0;
}

/* ===========================================================================
   Shell autenticado
   =========================================================================== */
.az-app{
  display:grid;
  grid-template-columns:280px 1fr;
  min-height:100vh;
}

/* ---------- Sidebar ---------- */
.az-sidebar{
  height:100vh;
  position:sticky; top:0;
  padding:18px;
  color:#fff;
  overflow:auto;
  background:radial-gradient(circle at 40% -10%, #147247 0%, #063b25 42%, #042417 100%);
}
.az-sideLogo{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.az-sideLogo .az-logoChip{
  background:#fff; border-radius:14px; padding:8px;
  display:grid; place-items:center; flex:0 0 auto;
}
.az-sideLogo .az-logoChip img{ width:76px; height:50px; display:block; object-fit:contain; }
.az-sideLogo h2{ margin:0; font-size:17px; font-weight:900; line-height:1.1; }
.az-sideLogo p{ margin:3px 0 0; font-size:11px; color:#c9efd8; }

.az-userCard{
  padding:14px; border-radius:18px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  margin-bottom:8px;
}
.az-userCard b{ display:block; font-size:14px; }
.az-userCard small{ display:block; color:#c9efd8; margin:2px 0 10px; font-size:12px; }

.az-navGroup{
  margin:16px 0 7px; font-size:11px; text-transform:uppercase;
  color:#8fd9a9; font-weight:900; letter-spacing:.04em;
}
.az-nav a, .az-nav button{
  width:100%; display:flex; align-items:center; gap:9px;
  background:transparent; border:1px solid transparent; border-radius:13px;
  color:#eaf7ef; text-align:left; padding:11px 12px; font-weight:800;
  font-size:14px; cursor:pointer; margin-bottom:4px; text-decoration:none;
  font-family:inherit;
}
.az-nav a:hover, .az-nav button:hover,
.az-nav a.active{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.16);
}
.az-nav a .az-soon{
  margin-left:auto; font-size:9px; font-weight:900; letter-spacing:.04em;
  background:rgba(255,255,255,.14); color:#cdeed9; padding:2px 7px; border-radius:999px;
}

.az-offlineBox{
  margin-top:16px; padding:14px; border-radius:16px;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
}
.az-offlineBox b{ font-size:13px; }
.az-offlineBox small{ display:block; color:#c9efd8; margin:6px 0 10px; font-size:11px; }

/* ---------- Main ---------- */
.az-main{ padding:18px 24px 40px; overflow:hidden; max-width:calc(100vw - 280px); }
.az-toolbar{
  display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-bottom:14px;
}
.az-pagehead{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  flex-wrap:wrap; margin-bottom:18px;
}
.az-pagehead h1{ margin:0; font-size:28px; letter-spacing:-.02em; }
.az-pagehead p{ margin:6px 0 0; color:var(--muted); }
.az-pagehead .az-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- Botones ---------- */
.az-app .btn, .az-login .btn{
  border:0; border-radius:14px; padding:12px 15px; font-weight:900; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  transition:.18s; font-size:14px; font-family:inherit; text-decoration:none; line-height:1.1;
}
.az-app .btn:hover, .az-login .btn:hover{ transform:translateY(-1px); }
.az-app .btn.primary, .az-login .btn.primary{
  background:linear-gradient(135deg,var(--green2),var(--green3)); color:#fff;
  box-shadow:0 12px 24px rgba(8,90,52,.18);
}
.az-app .btn.az, .az-login .btn.az{
  background:linear-gradient(135deg,var(--orange),var(--orange2)); color:#fff;
}
.az-app .btn.ghost, .az-login .btn.ghost{
  background:#eff7f2; color:var(--green2); border:1px solid var(--line);
}
.az-app .btn.danger{ background:#fff1f0; color:#b42318; border:1px solid #ffd0cc; }
.az-app .btn.small{ padding:8px 10px; border-radius:10px; font-size:12px; }
.az-app .btn.block{ width:100%; }
.az-nav .btn-logout{ /* logout sits in sidebar; inherits .az-nav button look */ }

/* ---------- Tarjetas ---------- */
.az-app .card{
  background:#fff; border:1px solid var(--line); border-radius:20px;
  box-shadow:var(--shadow); padding:16px;
}
.az-app .card h3{ margin:0 0 12px; font-size:16px; }
.az-app .cardHead{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.az-app .cardHead h3{ margin:0; }

/* ---------- KPIs ---------- */
.az-kpiGrid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:14px; }
.az-kpi{ min-height:112px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.az-kpi small{ font-weight:900; color:#34493e; font-size:13px; }
.az-kpi strong{ display:block; font-size:27px; color:var(--green); margin:8px 0 4px; }
.az-kpi .trend{ font-size:12px; color:var(--green3); font-weight:900; }
.az-kpiIcon{ width:50px; height:50px; border-radius:18px; background:var(--mint); display:grid; place-items:center; font-size:25px; flex:0 0 auto; }
.az-kpiIcon.orange{ background:#fff0e3; }
.az-kpiIcon.blue{ background:#e7f2ff; }

.az-dashGrid{ display:grid; grid-template-columns:2fr 1fr; gap:14px; margin-bottom:14px; }
.az-dashGrid.thirds{ grid-template-columns:1fr 1fr 1fr; }

/* ---------- Badges ---------- */
.az-app .badge, .az-login .badge{
  display:inline-flex; align-items:center; gap:6px; border-radius:999px;
  padding:5px 9px; font-size:12px; font-weight:900;
}
.badge.ok    { background:#e6f8ee; color:#087443; }
.badge.warn  { background:#fff3d6; color:#b66a00; }
.badge.danger{ background:#ffe8e6; color:#c1271e; }
.badge.blue  { background:#e7f2ff; color:#1466b0; }
.badge.gray  { background:#eef2ef; color:#596a61; }

/* ---------- Tablas ---------- */
.az-tableWrap{ overflow:auto; background:#fff; border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); }
.az-tableWrap table{ width:100%; border-collapse:collapse; }
.az-tableWrap th, .az-tableWrap td{ padding:12px; border-bottom:1px solid var(--line); font-size:13px; text-align:left; }
.az-tableWrap th{ background:#f0f6f2; text-transform:uppercase; font-size:11px; letter-spacing:.04em; color:#315343; }
.az-tableWrap tbody tr:hover td{ background:#fbfdfb; }
.az-tableWrap td.actions{ white-space:nowrap; text-align:right; }
.az-empty{ padding:34px; text-align:center; color:var(--muted); }

/* ---------- Formularios ---------- */
.az-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.az-field label{ font-size:12px; font-weight:900; color:#32483d; }
.az-field input, .az-field select, .az-field textarea{
  border:1px solid var(--line); border-radius:15px; background:#fff; padding:12px 13px;
  font-size:14px; outline:none; font-family:inherit; color:var(--ink);
}
.az-field input:focus, .az-field select:focus, .az-field textarea:focus{ border-color:var(--green3); }
.az-field textarea{ min-height:80px; resize:vertical; }
.az-formGrid{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.az-validation{ color:#c1271e; font-size:12px; font-weight:700; }
.az-checkbox{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:14px; }
.az-checkbox input{ width:18px; height:18px; }

.az-select{
  border:1px solid var(--line); background:#fff; border-radius:14px; padding:11px 14px;
  font-weight:900; color:#173d2d; min-width:210px; font-family:inherit; font-size:14px;
}

/* ---------- Modal ---------- */
.az-modalBack{ position:fixed; inset:0; background:rgba(8,30,20,.45); display:grid; place-items:center; z-index:50; padding:20px; }
.az-modal{ background:#fff; border-radius:22px; box-shadow:0 32px 80px rgba(7,34,20,.28); width:min(560px,100%); max-height:90vh; overflow:auto; }
.az-modalHead{ display:flex; justify-content:space-between; align-items:center; padding:18px 20px; border-bottom:1px solid var(--line); }
.az-modalHead h2{ margin:0; font-size:20px; }
.az-modalBody{ padding:20px; }
.az-modalFoot{ display:flex; justify-content:flex-end; gap:10px; padding:16px 20px; border-top:1px solid var(--line); }

/* ---------- Pills de progreso / barras ---------- */
.az-progress{ height:10px; background:#edf3ef; border-radius:999px; overflow:hidden; }
.az-progress > span{ display:block; height:100%; background:linear-gradient(90deg,var(--green2),#7fc85b); }

/* ---------- Panel oscuro de actividad ---------- */
.az-activity{ background:linear-gradient(180deg,var(--green),#07301f); color:#fff; border-radius:20px; padding:16px; box-shadow:var(--shadow); }
.az-activity h3{ margin:0 0 12px; font-size:16px; }
.az-activity .item{ border-left:2px solid rgba(255,255,255,.2); padding:0 0 12px 12px; margin-left:4px; }
.az-activity .item small{ color:#bfe8ce; }

/* ---------- Chart box ---------- */
.az-chartBox{ position:relative; height:240px; }
.az-chartBox.sm{ height:180px; }

/* ===========================================================================
   Login
   =========================================================================== */
.az-login{ min-height:100vh; display:grid; grid-template-columns:1.05fr .95fr; }
.az-login .hero{
  color:#fff; padding:56px 60px; display:flex; flex-direction:column; justify-content:center;
  background:radial-gradient(circle at 30% 0%, #147247 0%, #063b25 45%, #042417 100%);
}
.az-login .hero .logoLine{ display:flex; align-items:center; gap:16px; margin-bottom:34px; }
.az-login .hero .logoChip{ background:#fff; border-radius:22px; padding:12px; display:grid; place-items:center; }
.az-login .hero .logoChip img{ width:150px; height:82px; object-fit:contain; display:block; }
.az-login .hero h1{ font-size:54px; line-height:1.02; letter-spacing:-.03em; margin:0 0 16px; }
.az-login .hero h1 .accent{ color:#8edc62; display:block; }
.az-login .hero p.lead{ font-size:17px; color:#d6f1e0; max-width:460px; }
.az-login .hero .feats{ margin-top:28px; display:flex; flex-direction:column; gap:10px; color:#cdeed9; font-weight:700; }

.az-login .panel{ display:flex; align-items:center; justify-content:center; padding:40px; }
.az-login .panelCard{ width:min(420px,100%); }
.az-login .panelCard h2{ font-size:30px; margin:0 0 4px; }
.az-login .panelCard .sub{ color:var(--muted); margin:0 0 22px; }
.az-login .demoBox{ background:var(--mint); border:1px solid #cce9d6; border-radius:14px; padding:12px 14px; font-size:12.5px; color:#1f5236; margin-bottom:18px; }
.az-login .demoBox b{ color:var(--green2); }
.az-login .demoBox code{ background:#fff; padding:1px 6px; border-radius:6px; font-weight:700; }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width:980px){
  .az-app{ grid-template-columns:1fr; }
  .az-sidebar{ position:static; height:auto; }
  .az-main{ max-width:100vw; }
  .az-dashGrid, .az-dashGrid.thirds{ grid-template-columns:1fr; }
  .az-login{ grid-template-columns:1fr; }
  .az-login .hero{ display:none; }
  .az-formGrid{ grid-template-columns:1fr; }
}
