/* ============================================================
   ARGOS Portal · tema Databricks
   Paleta y tipografía inspiradas en Databricks aplicadas
   al producto propio (marca timestamp · contenido ARGOS).
   Blanco limpio · gris frío · rojo-lava #FF3621 · azul · DM Sans
   ============================================================ */
:root {
  --f-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --f-mono: "DM Mono", ui-monospace, monospace;

  /* Brand (lava) */
  --brand: #FF3621;
  --brand-700: #E12D1A;
  --brand-tint: #FFEBE7;

  /* Interactive blue */
  --blue: #2272B4;
  --blue-700: #1B5C95;
  --blue-tint: #E7F0F8;

  /* Surfaces */
  --bg: #FFFFFF;
  --side-bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --border: #E5E8EB;
  --border-2: #D4D9DE;

  /* Ink */
  --ink: #11171C;
  --muted: #5A6671;
  --faint: #8B95A1;

  /* Functional status */
  --ok: #1A8F4C;     --ok-tint: #E7F4EC;
  --warn: #B8740F;   --warn-tint: #FBF0DC;
  --info: #2272B4;   --info-tint: #E7F0F8;
  --slate: #5A6671;  --slate-tint: #EEF0F2;
  --violet: #7B61FF; --violet-tint: #EFEBFF;

  /* category accents (solid tiles) */
  --c-datos: #2C5CC5;
  --c-ingesta: #7B61FF;
  --c-analitica: #1A8F4C;
  --c-gobierno: #FF3621;
  --c-operacion: #5A6671;

  --shadow-sm: 0 1px 2px rgba(17,23,28,0.05);
  --shadow-md: 0 4px 16px -6px rgba(17,23,28,0.14);
  --radius: 10px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --side-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--bg); color: var(--ink);
  font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--blue); color: #fff; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal; font-style: normal; line-height: 1; white-space: nowrap;
  direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased; font-variation-settings: "wght" 300, "opsz" 24;
  user-select: none; display: inline-block;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0 1rem; background: var(--bg); border-bottom: 1px solid var(--border);
}
.top__left { display: flex; align-items: center; gap: 0.7rem; width: calc(var(--side-w) - 1rem); flex: 0 0 auto; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background 0.15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .ms { font-size: 22px; }
.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand__mark { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.brand__mark .ms { color: #fff; font-size: 18px; font-variation-settings: "wght" 500, "opsz" 24, "FILL" 1; }
.brand__name { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
.brand__tag { font-family: var(--f-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border-2); border-radius: 4px; padding: 0.05rem 0.3rem; }

.top__search {
  flex: 1; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 0.6rem;
  height: 38px; padding: 0 0.9rem; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 9px; color: var(--faint); font-size: 0.92rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.top__search:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.top__search .ms { font-size: 20px; }
.top__search span { flex: 1; text-align: left; }
.top__search kbd { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); }

.top__right { display: flex; align-items: center; gap: 0.7rem; flex: 0 0 auto; }
.ws-pill { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 500; font-size: 0.88rem; color: var(--muted); padding: 0.4rem 0.6rem; border-radius: 8px; }
.ws-pill:hover { background: var(--surface-2); }
.ws-pill .ms { font-size: 18px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 0.82rem; flex: 0 0 auto; }
.btn-salir { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.86rem; color: var(--muted); border: 1px solid var(--border-2); border-radius: 8px; padding: 0.42rem 0.85rem; transition: background 0.15s, border-color 0.15s; }
.btn-salir:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-salir .ms { font-size: 17px; }
.btn-mejoras { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.84rem; color: var(--blue); border: 1px solid var(--blue); border-radius: 8px; padding: 0.42rem 0.8rem; transition: background 0.15s; white-space: nowrap; }
.btn-mejoras:hover { background: var(--blue-tint); }
.btn-mejoras.on { background: var(--blue); color: #fff; }
.btn-mejoras .ms { font-size: 17px; }

/* ============================================================
   SHELL · sidebar + main
   ============================================================ */
.shell { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: flex-start;
  width: var(--side-w); flex: 0 0 auto; height: calc(100vh - var(--topbar-h));
  overflow-y: auto; background: var(--side-bg); border-right: 1px solid var(--border);
  padding: 0.8rem 0.7rem 2rem;
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.15s ease;
}
.side__group { margin-bottom: 0.4rem; }
.side__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0.9rem 0.7rem 0.3rem; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 0.92rem;
  transition: background 0.13s, color 0.13s;
}
.side__link .ms { font-size: 20px; color: var(--faint); transition: color 0.13s; flex: 0 0 auto; }
.side__link .ext { margin-left: auto; font-size: 15px; opacity: 0; transition: opacity 0.13s; }
.side__link:hover { background: #EFF1F3; color: var(--ink); }
.side__link:hover .ms { color: var(--muted); }
.side__link:hover .ext { opacity: 0.6; }
.side__link.active { background: #ECEEF0; color: var(--ink); font-weight: 600; }
.side__link.active::before { content: ""; position: absolute; left: -0.7rem; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: var(--brand); border-radius: 0 3px 3px 0; }
.side__link.active .ms { color: var(--ink); }
.side__beta { font-size: 0.6rem; font-weight: 600; color: var(--blue); background: var(--blue-tint); border-radius: 4px; padding: 0.05rem 0.3rem; margin-left: auto; }

.main { flex: 1; min-width: 0; padding: clamp(1.4rem, 3vw, 2.4rem) clamp(1.1rem, 3.5vw, 3rem) 6rem; max-width: 1320px; }

.view { display: none; }
.view.active { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.7rem; }
.page-head__icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.page-head__icon .ms { font-size: 24px; }
.page-head__kicker { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.page-head h1 { font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.025em; line-height: 1.05; margin-top: 0.1rem; }
.page-head p { color: var(--muted); margin-top: 0.3rem; max-width: 64ch; }
.page-head__back { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 0.88rem; color: var(--blue); padding: 0.4rem 0.6rem; border-radius: 8px; }
.page-head__back:hover { background: var(--blue-tint); }

/* ============================================================
   TOOLBAR / search / chips
   ============================================================ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1.3rem; }
.search { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 240px; max-width: 340px; padding: 0.5rem 0.8rem; background: var(--surface); border: 1px solid var(--border-2); border-radius: 9px; transition: border-color 0.15s, box-shadow 0.15s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.search .ms { font-size: 19px; color: var(--faint); }
.search input { border: 0; outline: 0; background: none; flex: 1; font: inherit; font-size: 0.9rem; color: var(--ink); }
.search input::placeholder { color: var(--faint); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chips__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-right: 0.2rem; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.84rem; font-weight: 500; color: var(--muted); padding: 0.4rem 0.75rem; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); transition: all 0.13s; }
.chip:hover { border-color: var(--faint); color: var(--ink); }
.chip.on { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; }
.chip__count { font-family: var(--f-mono); font-size: 0.72rem; color: var(--faint); }
.chip.on .chip__count { color: var(--blue); }

/* ============================================================
   DASHBOARD · services
   ============================================================ */
.svc-section { margin-bottom: 1.9rem; }
.svc-section__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.85rem; }
.svc-section__bar { width: 4px; height: 16px; border-radius: 2px; }
.svc-section__head h2 { font-weight: 700; font-size: 1.06rem; letter-spacing: -0.01em; }
.svc-section__count { font-family: var(--f-mono); font-size: 0.74rem; color: var(--faint); }
.svc-section__line { flex: 1; height: 1px; background: var(--border); }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.8rem; }
.svc { position: relative; display: flex; gap: 0.85rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.05rem; transition: border-color 0.13s, box-shadow 0.15s, transform 0.15s; }
.svc:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.svc__icon { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; }
.svc__icon .ms { font-size: 21px; font-variation-settings: "wght" 400, "opsz" 24; }
.svc__body { flex: 1; min-width: 0; }
.svc__top { display: flex; align-items: center; gap: 0.5rem; }
.svc__name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.svc__star { margin-left: auto; color: var(--faint); opacity: 0; transition: opacity 0.13s, color 0.13s; }
.svc:hover .svc__star { opacity: 1; }
.svc__star:hover { color: var(--warn); }
.svc__star.on { opacity: 1; color: var(--warn); }
.svc__star .ms { font-size: 19px; }
.svc__star.on .ms { font-variation-settings: "FILL" 1, "wght" 400; }
.svc__desc { color: var(--muted); font-size: 0.88rem; margin-top: 0.1rem; }
.svc__foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.65rem; }
.svc__url { font-family: var(--f-mono); font-size: 0.72rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc__health { display: inline-flex; align-items: center; gap: 0.32rem; font-size: 0.7rem; font-weight: 600; padding: 0.14rem 0.5rem 0.14rem 0.42rem; border-radius: 6px; white-space: nowrap; }
.svc__health .d { width: 7px; height: 7px; border-radius: 50%; }
.svc__open { color: var(--faint); transition: color 0.13s, transform 0.13s; }
.svc:hover .svc__open { color: var(--blue); transform: translate(1px,-1px); }
.svc__open .ms { font-size: 17px; }

.health-ok { background: var(--ok-tint); color: var(--ok); }
.health-ok .d { background: var(--ok); }
.health-warn { background: var(--warn-tint); color: var(--warn); }
.health-warn .d { background: var(--warn); }
.health-maint { background: var(--slate-tint); color: var(--slate); }
.health-maint .d { background: var(--slate); }

.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-left: auto; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ============================================================
   FUENTES · summary + table
   ============================================================ */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-bottom: 1.4rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.95rem 1.05rem; }
.stat-card__n { font-weight: 700; font-size: 1.85rem; letter-spacing: -0.02em; line-height: 1; }
.stat-card__l { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
.stat-card__bar { display: flex; height: 6px; border-radius: 4px; overflow: hidden; margin-top: 0.6rem; gap: 1px; }
.stat-card__bar span { display: block; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.src { width: 100%; border-collapse: collapse; }
table.src thead th {
  position: sticky; top: var(--topbar-h); z-index: 5; background: var(--surface-2);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 0.8rem 1.05rem; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
table.src thead th:hover { color: var(--blue); }
table.src th.num, table.src td.num { text-align: right; }
table.src th .ms { font-size: 14px; vertical-align: middle; opacity: 0.5; }
table.src tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; cursor: pointer; }
table.src tbody tr:last-child { border-bottom: 0; }
table.src tbody tr:hover { background: var(--surface-2); }
table.src td { padding: 0.8rem 1.05rem; vertical-align: middle; }
.src-name { font-weight: 600; font-size: 0.94rem; }
.src-slug { font-family: var(--f-mono); font-size: 0.74rem; color: var(--faint); margin-top: 0.08rem; }
.src-org { color: var(--muted); font-size: 0.9rem; }
.spec-chip { font-family: var(--f-mono); font-size: 0.72rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 0.12rem 0.5rem; }
.spec-empty { color: var(--faint); }
.ds-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; min-width: 96px; }
.ds-num { font-family: var(--f-mono); font-weight: 500; font-size: 0.92rem; }
.ds-num.zero { color: var(--faint); }
.ds-bar { width: 84px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ds-bar span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }

.badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; font-weight: 600; padding: 0.22rem 0.6rem 0.22rem 0.48rem; border-radius: 6px; white-space: nowrap; line-height: 1.2; }
.badge .d { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.st-propuesta { background: var(--slate-tint); color: var(--slate); }
.st-propuesta .d { background: var(--slate); }
.st-pruebas { background: var(--warn-tint); color: var(--warn); }
.st-pruebas .d { background: var(--warn); }
.st-productiva { background: var(--ok-tint); color: var(--ok); }
.st-productiva .d { background: var(--ok); }
.st-pausada { background: var(--info-tint); color: var(--info); }
.st-pausada .d { background: var(--info); }
.st-retirada { background: var(--surface-2); color: var(--faint); }
.st-retirada .d { background: var(--faint); }

.proj-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.proj-pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 500; color: var(--muted); border: 1px solid var(--border-2); border-radius: 6px; padding: 0.14rem 0.52rem; }
.proj-pill .d { width: 7px; height: 7px; border-radius: 50%; }
.proj-empty { color: var(--faint); }
.src-chev { color: var(--faint); }
table.src tbody tr:hover .src-chev { color: var(--blue); }
.no-rows { padding: 3rem; text-align: center; color: var(--faint); }

/* ============================================================
   PROYECTOS
   ============================================================ */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.proj-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.35rem; overflow: hidden; transition: border-color 0.13s, box-shadow 0.15s, transform 0.15s; cursor: pointer; }
.proj-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-2); }
.proj-card__stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.proj-card__top { display: flex; align-items: center; gap: 0.55rem; }
.proj-card__dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.proj-card h3 { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.proj-card__desc { color: var(--muted); font-size: 0.9rem; margin-top: 0.55rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.proj-metrics { display: flex; gap: 1.5rem; margin-top: 1rem; }
.proj-metric__n { font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; line-height: 1; }
.proj-metric__l { font-size: 0.72rem; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.3rem; }
.proj-dist { margin-top: 1rem; }
.proj-dist__bar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; gap: 1.5px; }
.proj-dist__bar span { display: block; }
.proj-dist__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-top: 0.55rem; font-size: 0.76rem; color: var(--muted); }
.proj-dist__legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.proj-dist__legend i { width: 7px; height: 7px; border-radius: 50%; }
.proj-card__cta { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.1rem; font-weight: 600; font-size: 0.9rem; color: var(--blue); }
.proj-card__cta .ms { font-size: 18px; transition: transform 0.15s; }
.proj-card:hover .proj-card__cta .ms { transform: translateX(3px); }

.proj-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem; text-align: center; border: 1.5px dashed var(--border-2); border-radius: var(--radius); padding: 1.3rem; min-height: 200px; color: var(--muted); transition: border-color 0.13s, color 0.13s, background 0.13s; cursor: pointer; }
.proj-new:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.proj-new__icon { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.proj-new__icon .ms { font-size: 25px; }
.proj-new strong { font-weight: 700; font-size: 1.02rem; }
.proj-new span { font-size: 0.82rem; }

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.cmdk { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding-top: 11vh; background: rgba(17,23,28,0.4); backdrop-filter: blur(3px); }
.cmdk.open { display: flex; animation: fade 0.16s ease; }
.cmdk__box { width: min(620px, 92vw); background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: 0 24px 70px -18px rgba(17,23,28,0.5); overflow: hidden; }
.cmdk__input { display: flex; align-items: center; gap: 0.7rem; padding: 0.95rem 1.05rem; border-bottom: 1px solid var(--border); }
.cmdk__input .ms { font-size: 22px; color: var(--blue); }
.cmdk__input input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 1.02rem; color: var(--ink); }
.cmdk__input kbd { font-family: var(--f-mono); font-size: 0.68rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 5px; padding: 0.1rem 0.4rem; }
.cmdk__list { max-height: 52vh; overflow-y: auto; padding: 0.5rem; }
.cmdk__group { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 0.6rem 0.7rem 0.3rem; }
.cmdk__item { display: flex; align-items: center; gap: 0.7rem; padding: 0.58rem 0.7rem; border-radius: 8px; cursor: pointer; }
.cmdk__item.sel, .cmdk__item:hover { background: var(--blue-tint); }
.cmdk__item .ms { font-size: 20px; color: var(--muted); }
.cmdk__item.sel .ms { color: var(--blue); }
.cmdk__txt { flex: 1; min-width: 0; }
.cmdk__txt b { font-weight: 600; font-size: 0.94rem; }
.cmdk__txt small { display: block; color: var(--faint); font-size: 0.78rem; font-family: var(--f-mono); }
.cmdk__kind { font-size: 0.72rem; color: var(--faint); }
.cmdk__empty { padding: 2rem; text-align: center; color: var(--faint); }

/* ============================================================
   ASK AI floating
   ============================================================ */
.askai { position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 30; display: inline-flex; align-items: center; gap: 0.5rem; background: var(--ink); color: #fff; padding: 0.65rem 1.05rem 0.65rem 0.7rem; border-radius: 999px; box-shadow: var(--shadow-md); font-weight: 600; font-size: 0.88rem; transition: transform 0.15s; }
.askai:hover { transform: translateY(-2px); }
.askai__badge { width: 25px; height: 25px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 0.68rem; font-weight: 700; }
.askai small { font-size: 0.62rem; letter-spacing: 0.1em; opacity: 0.55; text-transform: uppercase; }

/* ============================================================
   Responsive
   ============================================================ */
.scrim { display: none; }
@media (max-width: 820px) {
  .top__left { width: auto; }
  .top__search { max-width: none; }
  .brand__tag, .ws-pill span, .nav__user { display: none; }
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); z-index: 45; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-md); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(17,23,28,0.35); z-index: 44; }
  .main { max-width: none; }
}
@media (min-width: 821px) {
  /* Sidebar retráctil en escritorio: el botón ☰ pliega/despliega y persiste */
  body.sidebar-collapsed .sidebar {
    width: 0; padding-left: 0; padding-right: 0; border-right: 0; opacity: 0; pointer-events: none;
  }
  body.sidebar-collapsed .sidebar > * { white-space: nowrap; }
}
@media (max-width: 720px) {
  .btn-mejoras span:not(.ms), .btn-salir span:not(.ms) { display: none; }
  table.src thead { display: none; }
  table.src, table.src tbody, table.src tr, table.src td { display: block; width: 100%; }
  table.src tbody tr { padding: 0.7rem 0.9rem; }
  table.src td { padding: 0.22rem 0; }
  .ds-cell { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } html { scroll-behavior: auto; } }

/* ============================================================
   EXTENSIONES · componentes para el resto del portal
   (login, admin, detalle de fuente/proyecto, formularios)
   Mantienen los mismos tokens del tema Databricks.
   ============================================================ */

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; font-size: 0.88rem;
  padding: 0.5rem 0.95rem; border-radius: 8px; border: 1px solid transparent; white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, color 0.13s, box-shadow 0.13s; line-height: 1.1;
}
.btn .ms { font-size: 18px; }
.btn--sm { padding: 0.34rem 0.7rem; font-size: 0.8rem; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-700); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--surface); color: var(--muted); border-color: var(--border-2); }
.btn--ghost:hover { color: var(--ink); border-color: var(--faint); background: var(--surface-2); }
.btn--danger { background: var(--surface); color: var(--brand); border-color: var(--border-2); }
.btn--danger:hover { background: var(--brand-tint); border-color: var(--brand); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: default; }

/* ---- Formularios ---- */
.field { display: block; }
.field > .lbl, .lbl {
  display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.3rem;
}
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: 8px; padding: 0.5rem 0.7rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; align-items: end; }
.field-grid .col-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; cursor: pointer; color: var(--muted); }
.check input { accent-color: var(--blue); width: 15px; height: 15px; }
.check .d { width: 8px; height: 8px; border-radius: 50%; }

/* ---- Tarjetas / superficies genéricas ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card--pad { padding: 1.5rem; }
.section-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); margin-bottom: 0.8rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--f-mono); }
.lead { color: var(--muted); max-width: 70ch; margin-top: 0.35rem; }

/* ---- Avisos ---- */
.alert { display: flex; align-items: flex-start; gap: 0.55rem; border-radius: 9px; padding: 0.7rem 0.95rem; font-size: 0.88rem; margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert .ms { font-size: 19px; flex: 0 0 auto; }
.alert--ok { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert--err { background: var(--brand-tint); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.alert--info { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* ---- Disclosure (details/summary) ---- */
.disclosure { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 1.2rem; margin-top: 1rem; }
.disclosure > summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--ink); padding: 1rem 0; display: flex; align-items: center; gap: 0.5rem; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "add"; font-family: "Material Symbols Outlined"; font-size: 20px; color: var(--blue); transition: transform 0.15s; }
.disclosure[open] > summary::before { content: "remove"; }
.disclosure > summary + * { margin-bottom: 1.2rem; }

/* ---- Tabla de datos genérica ---- */
.dtable-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table.dtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.dtable thead th { background: var(--surface-2); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.dtable th.num, table.dtable td.num { text-align: right; }
table.dtable tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
table.dtable tbody tr:last-child { border-bottom: 0; }
table.dtable tbody tr:hover { background: var(--surface-2); }
table.dtable td { padding: 0.7rem 1rem; vertical-align: middle; }
.link { color: var(--blue); font-weight: 600; }
.link:hover { color: var(--blue-700); text-decoration: underline; }

/* ---- Badges de mecanismo ---- */
.mbadge { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 600; padding: 0.16rem 0.55rem; border-radius: 6px; white-space: nowrap; }
.mb-airbyte_http { background: #FDE8D8; color: #9A4B00; }
.mb-fichero_pull { background: var(--violet-tint); color: #5B43C9; }
.mb-upload_manual { background: var(--info-tint); color: var(--info); }
.mb-sparql { background: #DCF3EF; color: #0C7A6B; }
.mb-airbyte_db { background: #E6E8FB; color: #3B3FAE; }
.mb-pg_directo { background: var(--slate-tint); color: var(--slate); }

/* ---- Detalle: cabecera + tiles ---- */
.detail-back { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; font-size: 0.86rem; color: var(--blue); margin-bottom: 0.9rem; }
.detail-back:hover { text-decoration: underline; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.detail-head h1 { font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -0.025em; line-height: 1.08; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin-bottom: 1.6rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.05rem; }
.tile__l { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.tile__v { font-weight: 600; font-size: 1rem; color: var(--ink); margin-top: 0.3rem; word-break: break-word; }

/* ---- Pipeline (proyecto · el dato a través del stack) ---- */
.pipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.7rem; margin-bottom: 0.8rem; }
.pipe-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.95rem 1rem; transition: border-color 0.13s, box-shadow 0.15s, transform 0.15s; }
.pipe-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pipe-card__top { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.5rem; }
.pipe-card__top .ms { font-size: 20px; color: var(--blue); }
.pipe-card__top h3 { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.pipe-card__v { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }
.pipe-card__sub { font-size: 0.76rem; color: var(--muted); margin-top: 0.1rem; }
.pipe-card__tags { margin-top: auto; padding-top: 0.55rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tag { font-size: 0.66rem; font-weight: 500; padding: 0.12rem 0.42rem; border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---- Pestañas ---- */
.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 0.6rem 0.9rem; font-weight: 600; font-size: 0.9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.13s, border-color 0.13s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---- Dropzone (subida de ficheros) ---- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem; text-align: center; border: 1.5px dashed var(--border-2); border-radius: var(--radius); padding: 2rem; color: var(--muted); cursor: pointer; transition: border-color 0.13s, background 0.13s, color 0.13s; }
.dropzone:hover { border-color: var(--blue); background: var(--blue-tint); color: var(--blue); }
.dropzone .ms { font-size: 30px; color: var(--blue); }
.file-tiny { font-size: 0.78rem; color: var(--secondary, var(--muted)); }

/* ---- Hero gradiente (proyectos & documentación) ---- */
.hero { position: relative; overflow: hidden; border-radius: 16px; padding: 2rem 2.2rem; color: #fff; display: block; transition: box-shadow 0.2s, transform 0.15s; }
a.hero:hover { box-shadow: 0 24px 60px -24px rgba(17,23,28,0.5); transform: translateY(-2px); }
.hero__bgicon { position: absolute; right: 1.3rem; top: 1.1rem; opacity: 0.18; }
.hero__bgicon .ms { font-size: 110px; }
.hero__kicker { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.85; }
.hero h2 { font-weight: 800; font-size: 1.9rem; letter-spacing: -0.02em; margin-top: 0.4rem; }
.hero p { margin-top: 0.7rem; max-width: 60ch; opacity: 0.92; font-size: 0.94rem; }
.hero__cta { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.2rem; font-weight: 700; font-size: 0.88rem; background: rgba(255,255,255,0.16); padding: 0.5rem 0.95rem; border-radius: 999px; transition: background 0.15s; }
.hero:hover .hero__cta { background: rgba(255,255,255,0.26); }
.hero__row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.2rem; }
.login__card { width: min(380px, 100%); }
.login__brand { text-align: center; margin-bottom: 1.6rem; }
.login__mark { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); display: inline-grid; place-items: center; margin-bottom: 0.6rem; }
.login__mark .ms { color: #fff; font-size: 26px; font-variation-settings: "wght" 500, "FILL" 1; }
.login__title { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.02em; }
.login__sub { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem; }

/* ---- Admin: tarjeta de usuario ---- */
.user-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.user-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill { font-size: 0.68rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; }
.pill--admin { background: var(--brand-tint); color: var(--brand-700); }
.pill--off { background: var(--brand-tint); color: var(--brand-700); }

/* ---- Ask AI · panel deslizante (restyle del existente) ---- */
.aip { position: fixed; top: 0; right: 0; z-index: 62; height: 100%; width: min(420px, 100%); background: var(--surface); box-shadow: -12px 0 50px -20px rgba(17,23,28,0.45); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.28s ease; }
.aip.open { transform: none; }
.aip__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); }
.aip__kicker { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.aip__title { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.1; margin-top: 0.15rem; }
.aip__sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.aip__close { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border-2); }
.aip__close:hover { color: var(--ink); background: var(--surface-2); }
.aip__thread { flex: 1; overflow-y: auto; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.aip__foot { padding: 1rem 1.2rem; border-top: 1px solid var(--border); }
.aip-sug { display: block; width: 100%; text-align: left; font-size: 0.86rem; font-weight: 600; color: var(--blue); background: var(--blue-tint); border-radius: 9px; padding: 0.55rem 0.75rem; }
.aip-sug:hover { background: #DCEAF6; }
.aip-bubble { max-width: 88%; padding: 0.6rem 0.85rem; font-size: 0.88rem; border-radius: 13px; white-space: pre-wrap; }
.aip-bubble--user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.aip-bubble--ai { align-self: flex-start; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.aip-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.aip-chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 0.12rem 0.5rem; }
.aip-chip:hover { color: var(--blue); border-color: var(--blue); }
.aip-overlay { position: fixed; inset: 0; z-index: 61; background: rgba(17,23,28,0.35); display: none; }
.aip-overlay.open { display: block; }
