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

/* ─────────────────────────────────────────
   DESIGN TOKENS — Apple-style minimal
───────────────────────────────────────── */
:root {
  /* Backgrounds — light (default) */
  --bg:          #F5F5F7;
  --bg-sidebar:  #FFFFFF;
  --bg-card:     #FFFFFF;
  --bg-card-2:   #F5F5F7;
  --bg-input:    rgba(0,0,0,0.04);

  /* Borders */
  --border:       rgba(0,0,0,0.08);
  --border-md:    rgba(0,0,0,0.14);
  --border-acc:   rgba(0,122,255,0.22);

  /* Brand / Accent — Apple System Blue */
  --omega:        #0049B7;
  --accent:       #007AFF;
  --accent-2:     #007AFF;
  --glow:         rgba(0,122,255,0.06);

  /* Text — Apple hierarchy */
  --t1: #1D1D1F;
  --t2: #6E6E73;
  --t3: #AEAEB2;

  /* Status — Apple system colors */
  --s-act:   #34C759;
  --s-act-b: rgba(52,199,89,.10);
  --s-bld:   #FF9500;
  --s-bld-b: rgba(255,149,0,.10);
  --s-pnd:   #8E8E93;
  --s-pnd-b: rgba(142,142,147,.12);

  /* Geometry */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --sw:    252px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 0 0 0.5px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 0 0 0.5px rgba(0,0,0,.05);

  font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'SF Pro Display', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Dark mode ─── */
:root[data-theme="dark"] {
  --bg:          #000000;
  --bg-sidebar:  #1C1C1E;
  --bg-card:     #1C1C1E;
  --bg-card-2:   #2C2C2E;
  --bg-input:    rgba(255,255,255,0.06);

  --border:       rgba(255,255,255,0.10);
  --border-md:    rgba(255,255,255,0.16);
  --border-acc:   rgba(10,132,255,0.30);

  --accent:       #0A84FF;
  --accent-2:     #0A84FF;
  --glow:         rgba(10,132,255,0.10);

  --t1: #FFFFFF;
  --t2: #AEAEB2;
  --t3: #636366;

  --s-act:   #30D158;
  --s-act-b: rgba(48,209,88,.12);
  --s-bld:   #FF9F0A;
  --s-bld-b: rgba(255,159,10,.12);
  --s-pnd:   #636366;
  --s-pnd-b: rgba(99,99,102,.18);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.40);
  --shadow-md: 0 4px 20px rgba(0,0,0,.40);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--t1);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; cursor: pointer; }

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
  width: var(--sw);
  flex-shrink: 0;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
}

/* ─── Brand ─── */
.sidebar-brand {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-logo-mark {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.sidebar-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--t1);
}

.theme-toggle {
  width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--t2);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  transition: background 150ms, border-color 150ms;
}

.theme-toggle:hover {
  color: var(--t1);
  border-color: var(--border-md);
  background: var(--bg-card-2);
}

.theme-toggle-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--t3);
  background: linear-gradient(90deg, var(--t2) 50%, transparent 50%);
  flex-shrink: 0;
}

/* ─── Nav ─── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-md);
  border-radius: 99px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  text-align: left;
  transition: background 120ms;
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover { background: var(--bg-input); }

.nav-item.active {
  background: rgba(0,122,255,.08);
  border-color: rgba(0,122,255,.12);
}

:root[data-theme="dark"] .nav-item.active {
  background: rgba(10,132,255,.12);
  border-color: rgba(10,132,255,.18);
}

/* left accent */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
  flex-shrink: 0;
  transition: background 120ms, border-color 120ms, color 120ms;
}

.nav-item.active .nav-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nav-text { min-width: 0; }

.nav-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  line-height: 1.25;
  transition: color 120ms;
}

.nav-label {
  font-size: 11px;
  color: var(--t3);
  margin-top: 1px;
}

.nav-item.active .nav-name { color: var(--accent); font-weight: 700; }
.nav-item.active .nav-label { color: var(--t2); }

/* ─── Footer ─── */
.sidebar-footer {
  padding: 8px 8px 12px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  transition: background 120ms, color 120ms;
}

.sidebar-footer a:hover {
  background: var(--bg-input);
  color: var(--t2);
}

/* ─────────────────────────────────────────
   MAIN CONTENT
───────────────────────────────────────── */
.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ─── Sticky header ─── */
.content-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245,245,247,.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
}

:root[data-theme="dark"] .content-header {
  background: rgba(0,0,0,.82);
}

.area-breadcrumb {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}

.area-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.1;
}

.drive-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  white-space: nowrap;
  transition: border-color 120ms, color 120ms, background 120ms;
}

.drive-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glow);
}

/* ─── Body ─── */
.content-body {
  padding: 24px 28px 52px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.area-purpose-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--t2);
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-width: 720px;
  box-shadow: var(--shadow-sm);
}

.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* ─────────────────────────────────────────
   PANEL CARDS
───────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms, box-shadow 150ms;
}

.panel:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
}

.panel-header {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t3);
}

.panel-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  background: var(--bg-input);
  padding: 2px 8px;
  border-radius: 99px;
}

.item-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item {
  padding: 11px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms;
}

.item:hover {
  background: var(--bg-input);
  border-color: var(--border);
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.3;
}

.item-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--t2);
}

.item-link {
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.item-link:hover {
  background: var(--glow);
  border-color: var(--border-acc);
}

.item-link:hover .item-name { color: var(--accent); }

.item-arrow {
  display: inline-block;
  vertical-align: middle;
  margin-left: 4px;
  opacity: .4;
  flex-shrink: 0;
}

.item-link:hover .item-arrow { opacity: .9; }

/* ─────────────────────────────────────────
   STATUS BADGES
───────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .03em;
}

.status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status.active {
  color: var(--s-act);
  background: var(--s-act-b);
}
.status.active::before { background: var(--s-act); }

.status.build {
  color: var(--s-bld);
  background: var(--s-bld-b);
}
.status.build::before { background: var(--s-bld); }

.status.pending {
  color: var(--s-pnd);
  background: var(--s-pnd-b);
}
.status.pending::before { background: var(--s-pnd); }

/* ─────────────────────────────────────────
   LIVE DATA
───────────────────────────────────────── */
.live-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.live-section:empty { margin-top: 0; }
.panel-wide { grid-column: 1 / -1; }
.panel-meta { font-size: .72rem; opacity: .40; margin-left: auto; }

.briefing-text {
  font-size: .875rem;
  line-height: 1.65;
  margin: 0;
  padding: .25rem 1rem 1.25rem;
  opacity: .80;
  white-space: pre-wrap;
  color: var(--t2);
}

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .5rem;
  padding: .25rem 1rem 1.25rem;
}

.kpi-card {
  background: var(--bg-card-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: .75rem .875rem;
  box-shadow: var(--shadow-sm);
}

.kpi-nombre {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--t3);
  margin-bottom: .3rem;
  font-weight: 700;
}

.kpi-valor { font-size: 1.25rem; font-weight: 700; line-height: 1; color: var(--t1); }
.kpi-unit  { font-size: .7rem; font-weight: 400; color: var(--t3); margin-left: .15em; }
.kpi-up    { font-size: .68rem; color: var(--s-act); margin-top: .25rem; }
.kpi-down  { font-size: .68rem; color: #FF3B30; margin-top: .25rem; }

/* Alertas */
.alerta-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: .22em .6em;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.alerta-critica     { background: rgba(255,59,48,.12);   color: #FF3B30; }
.alerta-warning,
.alerta-advertencia { background: rgba(255,149,0,.12);   color: #FF9500; }
.alerta-info        { background: rgba(0,122,255,.10);   color: var(--accent); }

/* Tareas */
.item-vence { opacity: .45; font-size: .72rem; margin-top: .1rem; }

/* Spinner */
.live-loading {
  padding: .75rem 1rem;
  color: var(--t3);
  font-size: .8rem;
  grid-column: 1 / -1;
}

/* ─────────────────────────────────────────
   HERRAMIENTAS PAGE
───────────────────────────────────────── */
.page-intro {
  padding: 22px 28px 0;
}

.page-intro-desc {
  font-size: 14px;
  color: var(--t2);
}

.tools-catalog {
  padding: 20px 28px 52px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tools-section { display: flex; flex-direction: column; gap: 10px; }

.tools-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tools-section-icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--glow);
  border: 1px solid var(--border-acc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.tools-section-name { font-size: 13px; font-weight: 700; color: var(--t1); }
.tools-section-label { font-size: 12px; color: var(--t3); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  box-shadow: var(--shadow-sm);
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}

.tool-card:hover {
  border-color: var(--border-md);
  box-shadow: var(--shadow-md);
}

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tool-card-name { font-size: 13px; font-weight: 600; color: var(--t1); line-height: 1.3; }
.tool-card-desc { font-size: 12px; color: var(--t2); line-height: 1.5; }

.tool-card-link { cursor: pointer; text-decoration: none; display: block; }
.tool-card-link:hover { background: var(--glow); border-color: var(--border-acc); }
.tool-card-link:hover .tool-card-name { color: var(--accent); }

/* ─────────────────────────────────────────
   TOOL PAGES & FORMS
───────────────────────────────────────── */
.tool-workspace {
  padding: 24px 28px 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.form-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--t2);
  font-size: 12px;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 38px;
  color: var(--t1);
  background: var(--bg-input);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 0 11px;
  font: inherit;
  transition: border-color 150ms;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.quote-box { padding: 16px; }

.quote-label {
  display: block;
  color: var(--t3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.quote-box strong {
  display: block;
  color: var(--t1);
  font-size: 32px;
  line-height: 1;
  margin-bottom: 12px;
}

.quote-box p { color: var(--t2); font-size: 13px; line-height: 1.5; }

.quote-actions {
  border-top: 1px solid var(--border);
  padding: 13px 15px;
}

.app-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
  border-radius: var(--r-sm);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 150ms;
}

.app-button:hover { opacity: .85; }

.standalone-tool {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.redirect-card {
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  text-align: center;
}

.redirect-mark { width: 60px; height: 60px; object-fit: contain; margin-bottom: 14px; }
.redirect-card h1 { margin-bottom: 8px; }
.redirect-card p { color: var(--t2); margin-bottom: 18px; }
.muted-link { display: block; color: var(--t3); font-size: 12px; margin-top: 14px; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 960px) {
  .panels-grid       { grid-template-columns: 1fr; }
  .tools-grid        { grid-template-columns: repeat(2, 1fr); }
  .tool-workspace    { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { flex-direction: column; overflow: auto; height: auto; }
  .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 4px; }
  .nav-item { flex: 1; min-width: 120px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; }
  .nav-item.active::before { display: none; }
  .main-content { height: auto; overflow-y: visible; }
  .content-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .content-body, .tools-catalog { padding: 16px 16px 32px; }
  .page-intro { padding: 16px 16px 0; }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-workspace { padding: 16px 16px 32px; }
  .form-grid { grid-template-columns: 1fr; }
}


/* === Tip / hint en cards externas (ej. Cobranzas) === */
.item-hint, .tool-card-hint {
  margin-top: 10px;
  padding: 7px 10px;
  background: rgba(245, 158, 11, .08);
  border-left: 2px solid #f59e0b;
  border-radius: 4px;
  font-size: .76rem;
  line-height: 1.45;
  color: #92400e;
  font-weight: 600;
  letter-spacing: .005em;
}
[data-theme="dark"] .item-hint,
[data-theme="dark"] .tool-card-hint {
  background: rgba(245, 158, 11, .12);
  color: #fbbf24;
}

/* ============================================================
   Tarjetas armónicas de herramientas (con icono 3D a color)
   ============================================================ */
.htool-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(238px,1fr));gap:12px;padding:12px}
.htool{display:flex;flex-direction:column;gap:9px;padding:16px;border-radius:var(--r-lg);border:1px solid var(--border);
  background:var(--bg-card);box-shadow:var(--shadow-sm);text-decoration:none;transition:transform .14s,box-shadow .14s,border-color .14s}
.htool.link{cursor:pointer}
.htool.link:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);border-color:var(--border-acc)}
.htool-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.htool-name{font-size:14px;font-weight:700;color:var(--t1);line-height:1.3;display:flex;align-items:center;gap:5px}
.htool.link:hover .htool-name{color:var(--accent)}
.htool-desc{font-size:12px;line-height:1.55;color:var(--t2);flex:1}
.htool-hint{font-size:11px;line-height:1.5;color:var(--t3);margin-top:1px}
.htool-arrow{opacity:.4;flex-shrink:0}
.htool.link:hover .htool-arrow{opacity:.95}
@media(max-width:600px){.htool-grid{grid-template-columns:1fr}}

/* ─────────────────────────────────────────
   HERRAMIENTAS AGRUPADAS POR SUB-FUNCIÓN
   ─────────────────────────────────────────
   Un área con 14 herramientas en una grilla plana obliga a leer las 14 para
   encontrar una. Agrupadas por sub-función (Tesorería, Cobranzas…), el ojo
   descarta grupos enteros de un vistazo. Los títulos aparecen sólo si hay
   más de un grupo: rotular un grupo único no separa nada. */
.htool-secciones { padding: 12px; }
.htool-secciones > .htool-grid { padding: 0; }

.htool-grupo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--t2);
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.htool-grupo:first-child { margin-top: 4px; }
/* Filete al costado del título: separa sin agregar una caja más. */
.htool-grupo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* "Próximamente": ideas todavía sin construir. Colapsado por defecto para que
   no ocupen el mismo peso visual que lo que sí funciona, pero visibles: son
   el pipeline del área y alguien las quiere ver. */
.htool-prox { margin-top: 22px; }
.htool-prox > summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--t3);
  cursor: pointer;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  list-style: none;
  transition: color .15s, border-color .15s;
}
.htool-prox > summary::-webkit-details-marker { display: none; }
.htool-prox > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .18s;
}
.htool-prox[open] > summary::before { transform: rotate(90deg); }
.htool-prox > summary:hover { color: var(--t2); border-color: var(--border-md); }
.htool-prox > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.htool-prox[open] > summary { margin-bottom: 10px; }
/* Sin URL: la tarjeta no promete un clic que no existe. */
.htool-prox .htool { opacity: .72; }

@media (prefers-reduced-motion: reduce) {
  .htool-prox > summary::before { transition: none; }
}

/* Con un solo panel en el home (Proyectos), la grilla de dos columnas dejaba
   media pantalla vacía a la derecha. Una columna, con ancho de lectura. */
.panels-grid.panels-una { grid-template-columns: minmax(0, 720px); }

/* ─────────────────────────────────────────
   BANDA SUPERIOR ÚNICA
   ─────────────────────────────────────────
   Una sola barra con la marca, a todo el ancho, y el menú alineado debajo.
   Reemplaza a las tres que había apiladas (franja del tagline + banda con
   logo + cabecera del menú), que no compartían alineación entre sí.
   Azul institucional plano, Pantone 661 C: el degradado de antes metía dos
   azules que no están en el manual. */
.sc-topbar {
  flex-shrink: 0;
  background: #003595;
  color: #fff;
  position: relative;
  overflow: hidden;
  z-index: 40;                       /* por encima del rail del menú */
}
.sc-topbar-in {
  display: flex;
  align-items: center;
  gap: 20px;
  /* El padding izquierdo iguala el ancho del menú para que la marca y las
     áreas caigan en la misma vertical. */
  padding: 0 24px 0 20px;
  min-height: 64px;
  position: relative;
  z-index: 2;
}
.sc-topbar-marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sc-topbar-o {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center;
}
.sc-topbar-o img {
  width: 24px; height: 24px; object-fit: contain;
  filter: brightness(0) invert(1);   /* aplicación negativa, manual pág. 10 */
}
.sc-topbar-txt { display: flex; flex-direction: column; min-width: 0; }
.sc-topbar-name {
  font-family: 'Cairo', 'Plus Jakarta Sans', sans-serif;
  font-size: 19px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1;
}
.sc-topbar-sub { font-size: 11.5px; color: #C6D3EC; margin-top: 1px; }
.sc-topbar-acts { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.sc-topbar-acts button,
.sc-topbar-acts a {
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(255,255,255,.10);
  color: #fff;
  border-radius: 22px;
  padding: 8px 15px;
  font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px;
}
.sc-topbar-acts button:hover,
.sc-topbar-acts a:hover { background: rgba(255,255,255,.20); }
.sc-topbar-acts :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* La O gigante de fondo: guiño de marca, no decoración genérica. */
.sc-topbar-ghost {
  position: absolute; right: -46px; top: -78px;
  width: 210px; height: 210px; object-fit: contain;
  opacity: .07; filter: brightness(0) invert(1);
  z-index: 1; pointer-events: none;
}
@media (max-width: 760px) {
  .sc-topbar-in { padding: 0 14px; min-height: 56px; gap: 12px; }
  .sc-topbar-sub { display: none; }
  .sc-topbar-name { font-size: 16px; }
  .sc-topbar-ghost { display: none; }
}

/* ─────────────────────────────────────────
   MARCO DE HERRAMIENTA EMBEBIDA
   ─────────────────────────────────────────
   La herramienta se abre acá adentro, sin sacar a nadie del panel. El menú
   queda a la izquierda y el contexto no se pierde. */
.sc-marco { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sc-marco[hidden] { display: none; }

.sc-marco-barra {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.sc-marco-volver {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--t2);
  padding: 7px 12px; border-radius: 99px;
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  min-height: 36px;
  transition: color .15s, border-color .15s, background .15s;
}
.sc-marco-volver:hover { color: var(--omega); border-color: var(--border-acc); background: var(--bg-input); }
.sc-marco-volver:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sc-marco-titulo {
  font-size: 13.5px; font-weight: 800; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.sc-marco-externo {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--t3);
  text-decoration: none; padding: 7px 11px; border-radius: 99px;
  min-height: 36px;
}
.sc-marco-externo:hover { color: var(--omega); background: var(--bg-input); }
.sc-marco-externo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sc-marco-cuerpo { position: relative; flex: 1; min-height: 0; background: var(--bg); }
.sc-marco-cuerpo iframe {
  width: 100%; height: 100%;
  border: 0; display: block;
  background: var(--bg);
}
/* Mientras carga, un aviso sobrio en vez de un rectángulo blanco mudo. */
.sc-marco-cargando {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--t3);
  background: var(--bg);
  z-index: 2;
}
.sc-marco-cargando[hidden] { display: none; }

/* Con la herramienta abierta, el main deja de scrollear: scrollea la
   herramienta adentro de su marco. */
.main-content.sc-con-marco { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.main-content.sc-con-marco .content-header { flex-shrink: 0; }

/* El marco ocupa todo el alto que queda: la herramienta adentro scrollea
   sola. Sin esto el iframe se queda con el alto por defecto (150px) y la
   herramienta aparece espiando por una ranura. */
.main-content.sc-con-marco { height: 100%; }
.sc-marco { min-height: 420px; }
.sc-marco-cuerpo { min-height: 380px; }

/* La cadena flex necesita min-height:0 en cada eslabón, si no el marco no
   puede crecer: un item flex tiene min-height auto por defecto y se planta en
   el alto de su contenido. Sin esto el iframe queda en 380px y la herramienta
   se ve por una ranura. */
.ob-body { min-height: 0; }
.main-content.sc-con-marco { min-height: 0; flex: 1; }
.main-content.sc-con-marco .sc-marco { flex: 1; min-height: 0; }
.main-content.sc-con-marco .sc-marco-cuerpo { flex: 1; min-height: 0; }

/* `hidden` es un atributo, no una prioridad: cualquier regla con display lo
   pisa. Estos dos bloques se alternan —tablero o herramienta— así que el
   ocultamiento tiene que ganar siempre. */
#scTablero[hidden], .sc-marco[hidden] { display: none !important; }

/* ── La banda va de borde a borde ────────────────────────────
   El menú corre el contenido con un padding-left sobre el <body>, y eso
   empujaba también a la banda: quedaba un rectángulo blanco arriba a la
   izquierda, del ancho del menú.
   La solución no es sacar la banda del flujo —eso desarma el layout— sino
   correr sólo lo que va debajo de ella. */
/* Doble clase a propósito: sc-shell.css carga después y su regla también
   lleva !important, así que hace falta más especificidad para ganarle. */
html.scs-on.scs-en-panel body { padding-left: 0 !important; }
html.scs-en-panel .ob-body { padding-left: var(--scs-w, 264px); }
@media (max-width: 1220px) {
  html.scs-en-panel .ob-body { padding-left: 0; }
}
