/* ============================================================
   CONCEPTO SMART — Design System
   Inspiración: iOS 26 (Liquid Glass), superficie clara
   Paleta de marca: azul #35B6E8 · verde #8CC63F
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Marca */
  --brand-blue:      #35B6E8;
  --brand-blue-600:  #22A3D6;
  --brand-blue-50:   #E9F7FD;
  --brand-green:     #8CC63F;
  --brand-green-600: #77B02E;
  --brand-green-50:  #F1F8E7;

  /* Superficies (light) */
  --bg:        #EEF3F8;
  --bg-2:      #E4EBF3;
  --surface:   rgba(255,255,255,0.72);
  --surface-solid: #FFFFFF;
  --card-border: rgba(255,255,255,0.9);
  --hairline:  rgba(15,40,70,0.08);

  /* Texto */
  --ink:       #0F1B2D;
  --ink-2:     #46586E;
  --ink-3:     #8496AB;

  /* Estados */
  --ok:        #34C759;
  --warn:      #FF9F0A;
  --danger:    #FF3B30;
  --ok-50:     #E7F9EC;
  --warn-50:   #FFF4E2;
  --danger-50: #FFE9E7;

  /* Radios estilo iOS */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Sombras suaves */
  --shadow-sm: 0 1px 2px rgba(16,40,70,.06), 0 2px 8px rgba(16,40,70,.05);
  --shadow-md: 0 8px 24px rgba(16,40,70,.10), 0 2px 6px rgba(16,40,70,.06);
  --shadow-lg: 0 20px 50px rgba(16,40,70,.16);

  --blur: saturate(180%) blur(20px);
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--brand-blue-50), transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, var(--brand-green-50), transparent 55%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ---------- Tipografía utilitaria ---------- */
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.h-xl { font-size: 28px; font-weight: 800; }
.h-lg { font-size: 22px; font-weight: 700; }
.h-md { font-size: 17px; font-weight: 700; }
.muted { color: var(--ink-2); }
.muted-3 { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.card {
  background: var(--surface-solid);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.card-pad-lg { padding: 28px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-blue-600));
  color: #fff; box-shadow: 0 6px 16px rgba(53,182,232,.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(53,182,232,.45); }
.btn-green {
  background: linear-gradient(180deg, var(--brand-green), var(--brand-green-600));
  color: #fff; box-shadow: 0 6px 16px rgba(140,198,63,.35);
}
.btn-ghost {
  background: rgba(255,255,255,.6); color: var(--ink);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-wa {
  background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,.3);
}

/* ---------- Inputs ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 13px 15px;
  transition: border .15s, box-shadow .15s; outline: none;
}
.input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--brand-blue-50);
}
textarea.input { resize: vertical; min-height: 90px; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 11px;
  border-radius: var(--r-pill); line-height: 1;
}
.badge-blue  { background: var(--brand-blue-50); color: var(--brand-blue-600); }
.badge-green { background: var(--brand-green-50); color: var(--brand-green-600); }
.badge-ok    { background: var(--ok-50); color: #1e9e42; }
.badge-warn  { background: var(--warn-50); color: #c47700; }
.badge-danger{ background: var(--danger-50); color: #d0241b; }
.badge-gray  { background: #EEF2F7; color: var(--ink-2); }

/* ---------- Layout app ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; padding: 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 20px; }
.sidebar .brand img { height: 34px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-md);
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.nav-item.active {
  background: #fff; color: var(--brand-blue-600);
  box-shadow: var(--shadow-sm);
}
.nav-sep { height: 1px; background: var(--hairline); margin: 10px 6px; }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px; gap: 16px; flex-wrap: wrap;
}
.topbar .title-wrap { min-width: 0; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Stat card ---------- */
.stat {
  padding: 20px 22px; border-radius: var(--r-lg);
  background: var(--surface-solid); border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; word-break: break-word; overflow-wrap: break-word; }
.stat .v small { font-size: 16px; font-weight: 700; color: var(--ink-3); }
.stat.accent-blue  { background: linear-gradient(160deg,#fff, var(--brand-blue-50)); }
.stat.accent-green { background: linear-gradient(160deg,#fff, var(--brand-green-50)); }

/* ---------- Progreso de meta ---------- */
.progress { height: 12px; border-radius: 999px; background: #E1E9F1; overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
  transition: width .5s ease;
}

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--hairline); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-3); padding: 14px 16px;
  border-bottom: 1px solid var(--hairline); background: #F8FAFC;
}
table.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--hairline); color: var(--ink); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #FAFCFE; }

/* ---------- Auth / install centrado ---------- */
.center-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 440px; padding: 34px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { height: 52px; }

/* ---------- Banner publicitario (1:1, se auto-ajusta al dispositivo) ---------- */
.ad-banner {
  display: block; width: 100%; max-width: 360px; max-height: 360px;
  aspect-ratio: 1 / 1; margin: 0 auto 22px;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid var(--card-border);
  transition: transform .15s ease; box-sizing: border-box;
}
.ad-banner:active { transform: scale(0.98); }
.ad-banner img { width: 100%; height: 100%; max-width: 360px; max-height: 360px; object-fit: cover; display: block; }

/* ---------- Alertas ---------- */
.alert { padding: 13px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 16px; font-weight: 500; }
.alert-ok     { background: var(--ok-50); color: #1e7e37; }
.alert-danger { background: var(--danger-50); color: #b3241b; }
.alert-info   { background: var(--brand-blue-50); color: var(--brand-blue-600); }

/* ---------- Steps instalador ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 26px; }
.step { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.step .dot {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 7px;
  display: flex; align-items: center; justify-content: center;
  background: #E1E9F1; color: var(--ink-3); font-weight: 700;
}
.step.active .dot { background: var(--brand-blue); color: #fff; }
.step.done .dot { background: var(--brand-green); color: #fff; }

/* ---------- Utilidades ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.gap-2{gap:16px}.gap-3{gap:24px}
.text-right{text-align:right}.text-center{text-align:center}
.flex-1{flex:1}
.hidden{display:none}
.copy-box {
  display:flex; gap:8px; align-items:center; background:#F4F8FB;
  border:1px solid var(--hairline); border-radius:var(--r-md); padding:10px 12px;
  font-size:13px; word-break:break-all;
}

/* ---------- Mobile ---------- */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat .v { font-size: 24px; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    background: rgba(238,243,248,.92); backdrop-filter: var(--blur);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 18px 16px 60px; }
  .menu-toggle { display: inline-flex; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stat .v { font-size: 21px; }
  .stat { padding: 16px 16px; }
}
