/* ============================================================
   Gestión — Sistema de diseño
   ============================================================ */

[hidden] { display: none !important; }

:root {
  --bg: #05080f;
  --bg-2: #080e1a;
  --panel: #0c1523;
  --panel-2: #101c2e;
  --panel-3: #16243a;
  --line: #1c2b42;
  --line-2: #29405f;
  --text: #eaf2ff;
  --text-2: #8ea3c0;
  --text-3: #5e7695;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --pink: #e879f9;
  --glass: rgba(6, 11, 20, 0.72);
  --grid-line: rgba(120, 165, 225, 0.08);
  --dot: rgba(130, 170, 230, 0.16);
  --shadow: 0 14px 40px rgba(0, 4, 12, 0.55);
  --shadow-sm: 0 4px 16px rgba(0, 4, 12, 0.4);
  --radius: 16px;
  --ring: 0 0 0 3px rgba(34, 211, 238, 0.18);
  --sb: 252px;
  color-scheme: dark;
}

html.light {
  --bg: #eef2f9;
  --bg-2: #f7f9fd;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --panel-3: #eaf0f9;
  --line: #dce5f1;
  --line-2: #c4d3e6;
  --text: #0b1728;
  --text-2: #566c8a;
  --text-3: #8698b1;
  --accent: #0891b2;
  --accent-2: #4f46e5;
  --accent-soft: rgba(8, 145, 178, 0.1);
  --glass: rgba(247, 249, 253, 0.78);
  --grid-line: rgba(40, 80, 140, 0.09);
  --dot: rgba(60, 100, 160, 0.2);
  --shadow: 0 16px 40px rgba(30, 60, 110, 0.12);
  --shadow-sm: 0 4px 14px rgba(30, 60, 110, 0.1);
  --ring: 0 0 0 3px rgba(8, 145, 178, 0.15);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  overflow-x: hidden;
}

/* Fondos decorativos */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(34, 211, 238, 0.14), transparent 62%),
    radial-gradient(820px 480px at 96% -6%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(680px 560px at 62% 112%, rgba(232, 121, 249, 0.09), transparent 62%);
}

html.light body::before {
  background:
    radial-gradient(900px 520px at 8% -12%, rgba(8, 145, 178, 0.12), transparent 62%),
    radial-gradient(820px 480px at 96% -6%, rgba(79, 70, 229, 0.12), transparent 60%),
    radial-gradient(680px 560px at 62% 112%, rgba(192, 38, 211, 0.07), transparent 62%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

::selection { background: rgba(34, 211, 238, 0.3); }

/* Scrollbars */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

.muted { color: var(--text-2); }
.tiny { font-size: 11px; }

/* ============================================================
   Estructura
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sb) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 18, 32, 0.9), rgba(6, 11, 20, 0.92));
  backdrop-filter: blur(18px);
  z-index: 40;
  overflow-y: auto;
}
html.light .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 247, 253, 0.94));
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.28);
  color: #04121c;
  flex: none;
}
html.light .brand-mark { color: #fff; }
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; padding: 8px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; background: none;
  width: 100%; text-align: left; transition: 0.16s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: 0.9; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-color: rgba(34, 211, 238, 0.22);
}
.nav-item.active svg { color: var(--accent); opacity: 1; }
.nav-item .badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}

.nav-label-row { display: flex; align-items: center; justify-content: space-between; }
.nav-add {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--text-3); display: grid; place-items: center;
}
.nav-add:hover { color: var(--accent); border-color: rgba(34,211,238,.35); background: var(--accent-soft); }
.nav-add svg { width: 12px; height: 12px; }

.dash-list { display: flex; flex-direction: column; gap: 2px; }
.dash-group-label {
  padding: 10px 10px 4px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
}
.dash-group-label:first-child { padding-top: 2px; }
.dash-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 9px; font-size: 12.5px;
  color: var(--text-2); background: none; border: none; width: 100%; text-align: left;
  transition: 0.15s ease; position: relative; cursor: pointer;
}
.dash-item:hover { background: var(--panel-2); color: var(--text); }
.dash-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.dash-item.active { color: var(--text); background: var(--panel-2); }
.dash-item.active .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dash-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-item .count { color: var(--text-3); font-size: 10.5px; flex: none; }
.dash-item .dash-del {
  width: 20px; height: 20px; border-radius: 5px; border: 0; background: transparent;
  color: var(--text-3); display: none; place-items: center; flex: none; margin-left: 2px;
}
.dash-item:hover .dash-del { display: grid; }
.dash-item .dash-del:hover { color: var(--bad); background: rgba(251,113,133,.12); }
.dash-item .dash-del svg { width: 12px; height: 12px; }
.dash-limit { padding: 6px 10px; font-size: 10px; color: var(--text-3); line-height: 1.4; }

/* Base de datos del panel */
.db-notice {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid rgba(34,211,238,.28); border-radius: 10px;
  background: rgba(34,211,238,.08); color: var(--text-2); font-size: 11px; line-height: 1.5;
}
.db-notice span:first-child { color: var(--accent); display: flex; flex: none; margin-top: 1px; }
.db-notice svg { width: 15px; height: 15px; }
.db-cols { display: flex; flex-wrap: wrap; gap: 6px; max-height: 110px; overflow-y: auto; }
.db-col {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2);
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.db-col input { accent-color: var(--accent); }
.db-preview {
  max-height: 130px; overflow: auto; border: 1px solid var(--line); border-radius: 9px;
  font-size: 10.5px; color: var(--text-2); padding: 8px; background: var(--panel-2);
}
.db-preview table { border-collapse: collapse; width: 100%; }
.db-preview th, .db-preview td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.db-preview th { color: var(--text); font-weight: 600; }

.side-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.18), transparent 60%),
    var(--panel);
}
.side-card h4 { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.side-card p { font-size: 11px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }

.user-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 8px;
  width: 100%; border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: inherit; text-align: left; cursor: pointer;
}
.user-row:hover { background: var(--panel-2); border-color: var(--line); }
.sidebar > .user-row {
  margin-top: -8px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.sidebar > .user-row:hover { border-color: var(--line-2); }
.sidebar > #registerBtn {
  width: 100%; margin-top: -10px; border-style: dashed; color: var(--text-2);
  font-size: 11.5px; justify-content: center;
}
.sidebar > #registerBtn:hover { color: var(--accent); border-color: var(--accent); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #03111a;
}
html.light .avatar { color: #fff; }
.user-meta { line-height: 1.25; min-width: 0; flex: 1; }
.user-meta strong { font-size: 12px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10.5px; color: var(--text-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-caret { color: var(--text-3); display: grid; place-items: center; }
.user-caret svg { width: 14px; height: 14px; }

/* ---------- Main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 22px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); min-width: 0; }
.crumb b { color: var(--text-2); font-weight: 500; }
.crumb .sep { opacity: 0.5; }
.crumb .current { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search {
  position: relative; display: flex; align-items: center;
  width: 200px; height: 34px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel);
  transition: 0.15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search svg { width: 15px; height: 15px; margin-left: 10px; color: var(--text-3); flex: none; }
.search input {
  background: none; border: none; outline: none;
  padding: 0 8px; width: 100%; font-size: 12.5px; color: var(--text);
}
.search input::placeholder { color: var(--text-3); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); font-size: 12.5px; font-weight: 500;
  transition: 0.16s ease; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.btn-primary {
  border: none; color: #04121c; font-weight: 650;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.26);
}
html.light .btn-primary { color: #fff; }
.btn-primary:hover { color: #04121c; transform: translateY(-1px); filter: brightness(1.06); }
html.light .btn-primary:hover { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-danger { color: var(--bad); border-color: rgba(251, 113, 133, 0.3); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.1); border-color: var(--bad); color: var(--bad); }

.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2); transition: 0.16s ease;
  flex: none;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.icon-btn.active { color: var(--accent); border-color: rgba(34, 211, 238, 0.4); background: var(--accent-soft); }

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.6); }
.icon-btn.active .live-dot, .btn.live-on .live-dot {
  background: var(--ok);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; padding: 22px 22px 16px; flex-wrap: wrap;
}
.title-input {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  padding: 2px 6px; margin-left: -6px; max-width: 520px; width: 100%;
  transition: 0.15s ease;
}
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: var(--ring); }
.toolbar-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--text-2); }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.12); color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.status-pill svg { width: 10px; height: 10px; }

.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.segmented button {
  height: 27px; padding: 0 11px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-3); font-size: 11.5px; font-weight: 600;
  transition: 0.15s ease;
}
.segmented button:hover { color: var(--text-2); }
.segmented button.on {
  color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.24);
}

/* ---------- Canvas / Grid ---------- */
.canvas-wrap { flex: 1; padding: 4px 22px 40px; }
.grid-stack {
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.4px);
  background-size: 24px 24px;
  background-position: -6px -6px;
  border-radius: 18px;
  min-height: 60vh;
  padding: 2px;
  transition: background-color 0.2s ease;
}
body.editing .grid-stack { background-color: rgba(34, 211, 238, 0.025); }

.grid-stack-item-content {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.grid-stack-item-content:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
body.editing .grid-stack-item-content {
  outline: 1px dashed rgba(34, 211, 238, 0.32);
  outline-offset: -1px;
}

.grid-stack-placeholder > .placeholder-content {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius) !important;
}

/* handles de resize */
.grid-stack > .grid-stack-item > .ui-resizable-handle::after {
  content: ""; position: absolute; right: 6px; bottom: 6px;
  width: 7px; height: 7px; border-radius: 2px;
  border-right: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2);
}
body.editing .grid-stack > .grid-stack-item > .ui-resizable-handle::after { border-color: var(--accent); }

.widget { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---------- Cabecera de widget ---------- */
.w-head {
  display: flex; align-items: center; flex-wrap: wrap; column-gap: 8px;
  padding: 11px 12px 8px; flex: none;
  user-select: none;
}
.w-drag { cursor: grab; }
.w-drag:active { cursor: grabbing; }
.w-dot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--accent); box-shadow: 0 0 8px currentColor;
}
.w-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.w-sub {
  order: 3; flex: 1 1 100%; min-width: 0; font-size: 9.5px; font-weight: 400; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.w-actions { margin-left: auto; display: flex; gap: 1px; opacity: 0; transition: opacity 0.16s ease; flex: none; }
.grid-stack-item:hover .w-actions,
body.editing .w-actions { opacity: 1; }
.w-btn {
  display: grid; place-items: center; width: 24px; height: 24px;
  border: none; border-radius: 6px; background: transparent; color: var(--text-3);
  transition: 0.14s ease;
}
.w-btn svg { width: 13px; height: 13px; }
.w-btn:hover { background: var(--panel-3); color: var(--text); }
.w-btn.danger:hover { background: rgba(251, 113, 133, 0.14); color: var(--bad); }
.examples-locked .w-actions { opacity: 1; }
.w-btn[hidden] { display: none !important; }
.examples-locked [data-act="tpl"] { color: var(--accent); border: 1px solid var(--accent); }
.examples-locked [data-act="tpl"]:hover { background: rgba(34, 211, 238, 0.14); }

.w-body {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 0 14px 13px; position: relative;
}

.chart-box { position: relative; flex: 1; min-height: 0; width: 100%; overflow: hidden; }
.chart-box canvas { display: block; width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; }

/* ---------- KPI ---------- */
.kpi .w-head { padding-bottom: 2px; }
.kpi-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2px 14px 10px; }
.kpi-value {
  font-size: clamp(22px, 2.6vw, 31px);
  font-weight: 720; letter-spacing: -0.03em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 650; padding: 2px 6px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.12); color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.22);
}
.delta.down { background: rgba(251, 113, 133, 0.12); color: var(--bad); border-color: rgba(251, 113, 133, 0.22); }
.delta svg { width: 9px; height: 9px; }
.kpi-note { font-size: 10px; color: var(--text-3); }
.kpi-spark { flex: 1; min-height: 34px; margin-top: 8px; }

/* ---------- Tabla ---------- */
.table-body { overflow: auto; padding-top: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600; padding: 7px 8px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--panel-2);
}
.data-table td { padding: 8px; border-bottom: 1px solid rgba(120, 150, 190, 0.08); color: var(--text-2); }
.data-table td:first-child { color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--panel-3); }
.data-table th:not(:first-child), .data-table td:not(:first-child) { text-align: right; }

/* ---------- Progreso ---------- */
.progress-body { gap: 11px; overflow: auto; padding-top: 4px; }
.prog-row { display: flex; flex-direction: column; gap: 5px; }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 11.5px; }
.prog-top span:first-child { color: var(--text-2); font-weight: 500; }
.prog-top strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.prog-track { height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ---------- Gauge ---------- */
.gauge-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.gauge-center {
  position: absolute; left: 0; right: 0; bottom: 16%;
  text-align: center; pointer-events: none;
}
.gauge-center strong { display: block; font-size: 25px; font-weight: 720; letter-spacing: -0.02em; }
.gauge-center span { display: block; font-size: 10px; color: var(--text-3); margin-top: 1px; }
.gauge-legend { display: flex; justify-content: center; gap: 14px; font-size: 10.5px; color: var(--text-2); padding-bottom: 2px; }
.gauge-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* ============================================================
   Modales, drawer, toasts
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(2, 5, 12, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(2, 5, 12, 0.58);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  visibility: hidden;
}
.modal.open { opacity: 1; pointer-events: auto; visibility: visible; }
.modal-card {
  width: min(760px, 100%); max-height: min(82vh, 720px);
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.modal.open .modal-card { transform: none; }
.modal-card.sm { width: min(560px, 100%); }

/* Confirmación */
.confirm-card { width: min(420px, 100%); padding: 24px; text-align: center; gap: 10px; align-items: center; }
.confirm-icon {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px;
  color: var(--bad); background: rgba(251, 113, 133, 0.12); border: 1px solid rgba(251, 113, 133, 0.25);
}
.confirm-icon svg { width: 21px; height: 21px; }
.confirm-card h3 { font-size: 15px; font-weight: 650; color: var(--text); margin: 4px 0 0; }
.confirm-card p { font-size: 12px; line-height: 1.55; color: var(--text-2); margin: 0; }
.confirm-actions { display: flex; gap: 10px; width: 100%; margin-top: 12px; }
.confirm-actions .btn { flex: 1; justify-content: center; }
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; font-weight: 650; }
.modal-head p { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px 20px; overflow-y: auto; }

.upload-zone {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 22px 16px; margin-bottom: 14px;
  border: 1.5px dashed var(--line-strong, var(--line));
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  transition: 0.16s ease;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 2px; }
.upload-zone b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.upload-zone > span:last-of-type { font-size: 10.5px; color: var(--text-3); }
.upload-zone input { display: none; }

.csv-file {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 8px 11px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 11.5px; color: var(--text-2);
}
.csv-file svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.csv-file > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.field-row .field { margin: 0; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* Bienvenida */
.welcome-card { width: min(560px, 100%); }
.welcome-hero {
  position: relative;
  display: flex; align-items: flex-start; gap: 13px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(34, 211, 238, 0.16), transparent 55%),
    var(--panel);
}
.welcome-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent);
}
.welcome-mark svg { width: 22px; height: 22px; }
.welcome-hero-text { flex: 1; min-width: 0; }
.welcome-kicker {
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.welcome-hero h3 { font-size: 17px; font-weight: 650; margin: 2px 0 3px; }
.welcome-hero p { font-size: 11.5px; color: var(--text-2); line-height: 1.5; }
.welcome-hero .icon-btn { flex: none; }
.welcome-body { display: flex; flex-direction: column; gap: 14px; }
.welcome-step { display: flex; gap: 11px; align-items: flex-start; }
.ws-num {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center;
  border-radius: 50%; font-size: 10.5px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.22);
}
.welcome-step b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.welcome-step p { font-size: 11px; color: var(--text-2); line-height: 1.55; }
.welcome-hint {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 11px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 10.5px; color: var(--text-3); line-height: 1.4;
}
.welcome-hint svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.welcome-hint b { color: var(--text); }
.welcome-foot {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: var(--panel);
}
@media (max-width: 520px) {
  .welcome-foot { flex-direction: column-reverse; }
  .welcome-foot .btn { width: 100%; justify-content: center; }
}

/* Formularios */
.forms-card, .projects-card {
  width: min(960px, 100%);
  height: min(86vh, 760px);
  max-height: min(92vh, 820px);
}
.forms-layout { display: grid; grid-template-columns: 226px minmax(0, 1fr); flex: 1; min-height: 0; }
.forms-side {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-right: 1px solid var(--line);
  background: var(--panel-2); overflow-y: auto;
}
.forms-side .hint { margin-top: auto; }
.forms-list { display: flex; flex-direction: column; gap: 5px; }
.form-list-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); text-align: left; transition: 0.15s;
}
.form-list-item:hover { background: var(--panel-3); color: var(--text); }
.form-list-item.active { background: var(--accent-soft); border-color: rgba(34, 211, 238, 0.25); color: var(--text); }
.fl-icon {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: 7px; background: var(--panel-3); color: var(--accent);
}
.form-list-item.active .fl-icon { background: var(--accent); color: #041018; }
.fl-icon svg { width: 14px; height: 14px; }
.fl-meta { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fl-meta b { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-meta span { font-size: 10px; color: var(--text-3); }

.forms-main { padding: 18px 20px; overflow-y: auto; min-width: 0; }
.forms-empty {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 30px 10px;
}
.fe-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 15px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px;
}
.fe-icon svg { width: 26px; height: 26px; }
.forms-empty b { font-size: 14px; }
.forms-empty p { font-size: 11.5px; color: var(--text-2); max-width: 320px; line-height: 1.55; }
.fe-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }

.form-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.form-head h4 { font-size: 15px; font-weight: 650; }
.form-head p { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.form-head-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.form-cols { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; margin-top: 16px; align-items: start; }
.form-panel {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); padding: 14px; min-width: 0;
}
.form-panel h5 {
  font-size: 11.5px; font-weight: 650; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.form-panel h5 .count {
  font-size: 9.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 1px 6px; border-radius: 20px;
}
.record-form { display: flex; flex-direction: column; gap: 10px; }
.record-form .field { gap: 4px; }
.record-form label { font-size: 10.5px; }
.record-form .req { color: var(--bad); }
.record-actions { display: flex; gap: 6px; margin-top: 2px; }
.records-scroll { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.records-scroll .data-table { font-size: 11px; }
.records-scroll .data-table th, .records-scroll .data-table td { padding: 6px 8px; white-space: nowrap; }
.records-scroll .data-table th:last-child, .records-scroll .data-table td:last-child { text-align: right; width: 1%; }
.records-empty { padding: 18px 10px; text-align: center; font-size: 11px; color: var(--text-3); }
.row-act { display: inline-flex; gap: 2px; }
.row-act button {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  color: var(--text-3); border: 1px solid transparent; background: transparent;
}
.row-act button:hover { color: var(--text); background: var(--panel-3); border-color: var(--line); }
.row-act button.danger:hover { color: var(--bad); }
.row-act svg { width: 12px; height: 12px; }

.structure-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.struct-fields { display: flex; flex-direction: column; gap: 8px; }
.struct-row {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); padding: 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.struct-row-top { display: flex; gap: 6px; }
.struct-row-top .input { flex: 1; }
.struct-row-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.struct-row-bottom .select { width: 130px; height: 30px; font-size: 11px; }
.struct-row .options-input { display: none; }
.struct-row.has-options .options-input { display: block; }
.struct-row .icon-btn { width: 30px; height: 30px; flex: none; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); }
.structure-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

@media (max-width: 760px) {
  .forms-card, .projects-card { height: min(90vh, 760px); }
  .forms-layout { grid-template-columns: 1fr; }
  .forms-side {
    border-right: 0; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center;
  }
  .forms-side .hint { display: none; }
  .forms-list { flex-direction: row; overflow-x: auto; width: 100%; }
  .form-list-item { flex: none; width: auto; }
  .form-cols { grid-template-columns: 1fr; }
}

/* Plantillas de formularios */
.tpl-toolbar { margin-top: 14px; margin-bottom: 16px; }
.tpl-blank {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; text-align: left;
  border: 1px dashed var(--line-2); background: transparent; color: var(--text);
  transition: 0.16s ease;
}
.tpl-blank:hover { border-color: var(--accent); background: var(--accent-soft); }
.tpl-blank-icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--panel-3); color: var(--accent);
}
.tpl-blank-icon svg { width: 18px; height: 18px; }
.tpl-blank b { display: block; font-size: 12.5px; font-weight: 600; }
.tpl-blank small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; line-height: 1.4; }

.tpl-groups { display: flex; flex-direction: column; gap: 18px; padding-bottom: 6px; }
.tpl-group-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 9px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.tpl-group-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl-card {
  display: flex; align-items: flex-start; gap: 11px; width: 100%;
  padding: 13px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  transition: 0.16s ease; cursor: pointer;
}
.tpl-card:hover { border-color: rgba(34, 211, 238, 0.4); background: var(--panel-3); transform: translateY(-1px); }
.tpl-icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.tpl-icon svg { width: 18px; height: 18px; }
.tpl-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tpl-meta b { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.tpl-meta small { font-size: 10.5px; color: var(--text-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-count {
  flex: none; align-self: center;
  font-size: 9.5px; font-weight: 600; color: var(--text-3);
  background: var(--panel-3); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.tpl-card:hover .tpl-count { color: var(--accent); border-color: rgba(34, 211, 238, 0.25); background: var(--accent-soft); }

@media (max-width: 560px) {
  .tpl-grid { grid-template-columns: 1fr; }
}

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lib-item {
  display: flex; flex-direction: column; gap: 7px; align-items: flex-start;
  padding: 13px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--panel-2);
  transition: 0.16s ease;
}
.lib-item:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-3); }
.lib-icon {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.lib-icon svg { width: 16px; height: 16px; }
.lib-item b { font-size: 12.5px; font-weight: 600; }
.lib-item span { font-size: 10.5px; color: var(--text-3); line-height: 1.35; }
.lib-item .lib-ex {
  margin-top: 3px; padding-top: 7px; width: 100%;
  border-top: 1px dashed var(--line);
  font-size: 10px; font-style: italic; color: var(--text-3);
}
.lib-group { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 4px 0 9px; }

/* Drawer */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 62;
  width: min(392px, 94vw);
  display: flex; flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.4);
  transform: translateX(103%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.drawer-head h3 { font-size: 14px; font-weight: 650; }
.drawer-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.drawer-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  outline: none; transition: 0.15s ease; font-size: 12.5px;
}
.textarea { height: auto; min-height: 150px; padding: 10px 11px; resize: vertical; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 11.5px; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint { font-size: 10.5px; color: var(--text-3); line-height: 1.45; }

.tip {
  font-size: 11px; line-height: 1.55; color: var(--text-2);
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 10px;
  padding: 10px 11px;
}
.tip b { color: var(--text); font-weight: 600; }

.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent;
  outline: 1px solid var(--line); transition: 0.15s ease; position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--bg); outline: 2px solid currentColor; }

.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--panel-3);
  border: 1px solid var(--line); transition: 0.18s ease;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--text-3); transition: 0.18s ease;
}
.switch input:checked + span { background: var(--accent-soft); border-color: rgba(34, 211, 238, 0.5); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent); }

/* Menú desplegable */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 50;
  width: 208px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(-5px);
  transition: 0.16s ease;
}
.menu.open { opacity: 1; pointer-events: auto; transform: none; }
.menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border: none; border-radius: 7px; background: none;
  color: var(--text-2); font-size: 12px; text-align: left; transition: 0.13s ease;
}
.menu button svg { width: 14px; height: 14px; }
.menu button:hover { background: var(--panel-2); color: var(--text); }
.menu button.danger { color: var(--bad); }
.menu button.danger:hover { background: rgba(251, 113, 133, 0.1); }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 2px; }

/* Toasts */
.toasts {
  position: fixed; bottom: 18px; right: 18px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 12px; color: var(--text);
  animation: toast-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 340px;
}
.toast svg { width: 15px; height: 15px; flex: none; color: var(--accent); }
.toast.ok svg { color: var(--ok); }
.toast.bad svg { color: var(--bad); }
.toast.out { animation: toast-out 0.22s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(0.97); } }

/* Buscador: atenuar widgets no coincidentes */
.grid-stack-item.dimmed { opacity: 0.18; filter: saturate(0.2); pointer-events: none; }

@media (hover: none) {
  .w-actions { opacity: 1; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .search { width: 150px; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 70;
    width: 260px;
    transform: translateX(-104%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45);
  }
  .sidebar.open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(2, 5, 12, 0.55); opacity: 0; pointer-events: none; transition: 0.22s; display: block; }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid !important; }
  .search { display: none; }
  .toolbar { padding: 16px 16px 12px; }
  .canvas-wrap { padding: 0 16px 32px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 620px) {
  .toolbar-actions .segmented { order: 3; }
  .title-input { font-size: 19px; }
  .crumb .crumb-parent { display: none; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

.menu-btn { display: none; }

.sidebar-scrim { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Auth */
.auth-card { width: min(480px, 100%); }
.auth-body { display: flex; flex-direction: column; gap: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.auth-tab {
  padding: 8px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer;
}
.auth-tab.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-google {
  width: 100%; justify-content: center; gap: 10px; height: 42px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font-weight: 600;
}
.auth-google:hover { background: var(--panel-2); border-color: var(--text-3); }
.g-logo { width: 18px; height: 18px; flex: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .field { gap: 4px; }
.auth-form label { font-size: 11px; }
.auth-error { min-height: 18px; font-size: 11px; color: var(--bad); }
.auth-error:empty { display: none; }
.google-demo {
  padding: 12px; border-radius: 12px; border: 1px solid rgba(66,133,244,.25);
  background: rgba(66,133,244,.06); display: flex; flex-direction: column; gap: 10px;
}
.google-demo[hidden] { display: none !important; }
.google-demo .field { gap: 4px; }
.google-demo label { font-size: 11px; }
.auth-profile { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.auth-avatar { width: 52px; height: 52px; font-size: 18px; }
.auth-name { font-size: 15px; font-weight: 650; }
.auth-email { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.auth-plan { font-size: 11px; color: var(--accent); margin-top: 4px; font-weight: 500; }
.auth-actions { display: flex; gap: 8px; }
.auth-actions .btn { flex: 1; justify-content: center; }
.auth-view[hidden] { display: none !important; }

/* Projects */
.project-forms { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.project-form-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.pfc-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pfc-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pfc-icon svg { width: 18px; height: 18px; }
.pfc-meta { min-width: 0; }
.pfc-meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfc-meta span { font-size: 11px; color: var(--text-3); }
.pfc-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 700px) { .project-form-card { flex-direction: column; align-items: stretch; } .pfc-actions { justify-content: flex-end; } }

/* ---------- Menú de recursos y páginas informativas ---------- */
.info-nav-wrap {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px;
  position: sticky; top: 0; z-index: 35;
  border-bottom: 1px solid rgba(34, 211, 238, .3);
  background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(99, 102, 241, .1) 55%, transparent);
  box-shadow: 0 6px 22px rgba(34, 211, 238, .09);
}
html.light .info-nav-wrap { background: linear-gradient(90deg, rgba(34, 211, 238, .18), rgba(99, 102, 241, .1) 55%, transparent); }
.info-nav-label {
  flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .16em;
  color: var(--accent); text-shadow: 0 0 12px rgba(34, 211, 238, .5);
}
.info-nav {
  display: flex; align-items: center; gap: 6px; padding: 0;
  overflow-x: auto; flex: 1; border: 0;
}
.info-nav button {
  flex: none; border: 1px solid rgba(34, 211, 238, .28); border-radius: 8px;
  background: rgba(34, 211, 238, .07); color: var(--text);
  font-size: 11.5px; font-weight: 700; padding: 6px 11px; cursor: pointer;
  white-space: nowrap; transition: 0.16s ease;
}
.info-nav button::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  margin-right: 6px; vertical-align: middle;
}
.info-nav button:hover {
  color: #04121c; border-color: transparent; transform: translateY(-1px);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(34, 211, 238, .28);
}

body.info-mode .app { display: none; }
.info-page { min-height: 100vh; background: var(--bg); color: var(--text); }
.info-page[hidden] { display: none; }
.info-head {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 15, 0.94); backdrop-filter: blur(14px); flex-wrap: wrap;
}
html.light .info-head { background: rgba(255,255,255,.94); }
.info-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.info-brand span { color: var(--accent); display: flex; }
.info-brand svg { width: 24px; height: 24px; }
.info-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.info-tabs button {
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  color: var(--text-2); font-size: 11.5px; font-weight: 600; padding: 7px 11px; cursor: pointer;
}
.info-tabs button:hover { color: var(--accent); border-color: var(--accent); }
.info-tabs button.on { color: #04121c; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; }
.info-body { max-width: 1080px; margin: 0 auto; padding: 38px 24px 80px; }
.info-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.info-badge {
  display: inline-block; margin-top: 10px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(34,211,238,.35); background: rgba(34,211,238,.1);
  color: var(--accent); font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase;
}
.info-body h1 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -.02em; margin: 8px 0 10px; }
.info-lead { font-size: 15px; line-height: 1.7; color: var(--text-2); max-width: 760px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-top: 30px; }
.info-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(99,102,241,.12), transparent 60%), var(--panel);
}
.info-card h3 { font-size: 14px; margin-bottom: 8px; }
.info-card p, .info-card li { font-size: 12px; line-height: 1.65; color: var(--text-2); }
.info-card ol, .info-card ul { padding-left: 18px; margin-top: 6px; }
.info-card li { margin-bottom: 6px; }
.info-section { margin-top: 34px; }
.info-section h2 { font-size: 19px; margin-bottom: 12px; }
.info-section p { font-size: 13px; line-height: 1.7; color: var(--text-2); max-width: 800px; }
