/* Fuentes: stack del sistema (sin descarga externa). El panel se ve igual de bien
   con Segoe UI / SF Pro / Cascadia / Consolas que con Inter / JetBrains Mono. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: local('Inter'), local('-apple-system'), local('Segoe UI'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: local('JetBrains Mono'), local('Cascadia Mono'), local('Consolas'), local('Menlo'); }

[hidden] { display: none !important; }

:root {
  /* ============================================================
     SEHL · IDENTIDAD CANÓNICA
     ============================================================ */

  --brand-gold:            #b0894f;
  --brand-gold-rgb:        176 137 79;
  --brand-gold-deep:       #97713a;
  --brand-gold-soft:       #f3ebdc;
  --brand-gold-on-dark:    #d8b676;

  --brand-navy:            #1f2a3c;
  --brand-navy-rgb:        31 42 60;
  --brand-navy-soft:       #e7ebf1;

  --brand-ink:             #1b1f2a;
  --brand-ink-rgb:         27 31 42;

  --brand-ivory:           #faf8f4;
  --brand-ivory-rgb:       250 248 244;

  --brand-surface:         #ffffff;
  --brand-surface-2:       #fbfaf7;
  --brand-bg-2:            #f3efe8;

  --brand-line:            #e8e3da;
  --brand-line-soft:       #f0ece4;

  --brand-ink-soft:        #555c6b;
  --brand-ink-faint:       #8a909c;

  /* Estados semánticos */
  --semantic-ok-rgb:       47 143 91;
  --semantic-warn-rgb:     201 138 37;
  --semantic-danger-rgb:   192 73 47;
  --neutral-rgb:           138 144 156;

  --semantic-ok:           #2f8f5b;
  --semantic-ok-soft:      #e7f3ec;

  --semantic-warn:         #c98a25;
  --semantic-warn-soft:    #faf0db;

  --semantic-danger:       #c0492f;
  --semantic-danger-soft:  #f8e8e3;

  --semantic-info:         #2f6f9f;
  --semantic-info-soft:    #e6eef5;

  /* ============================================================
     DARK · SEHL Navy + Gold
     ============================================================ */

  --bg:                    #111827;
  --bg-rgb:                17 24 39;

  --bg-2:                  #182337;
  --bg-3:                  #202d43;
  --bg-4:                  #29374d;
  --bg-hover:              #304159;

  --surface-rgb:           24 35 55;
  --surface-2-rgb:         32 45 67;

  --fg:                    var(--brand-ivory);
  --fg-rgb:                250 248 244;
  --fg-muted:              #c7ced9;
  --fg-muted-rgb:          199 206 217;
  --fg-dim:                #929dad;

  --border:                #34465f;
  --border-2:              #465a74;

  --accent:                var(--brand-gold);
  --accent-2:              var(--brand-gold-deep);
  --accent-contrast:       #d8b676;

  --accent-soft:           rgb(var(--brand-gold-rgb) / .12);
  --accent-soft-strong:    rgb(var(--brand-gold-rgb) / .20);
  --accent-glow:           rgb(var(--brand-gold-rgb) / .22);

  --success:               var(--semantic-ok);
  --success-soft:          rgb(47 143 91 / .16);

  --warn:                  var(--semantic-warn);
  --warn-soft:             rgb(201 138 37 / .16);

  --danger:                var(--semantic-danger);
  --danger-soft:           rgb(192 73 47 / .16);

  --info:                  var(--semantic-info);
  --info-soft:             rgb(47 111 159 / .16);

  --neutral-soft:          rgb(138 144 156 / .16);

  --on-accent:             #ffffff;
  --overlay-bg:            rgb(var(--brand-ink-rgb) / .82);
  --terminal-bg:           var(--terminal-bg);

  --radius:                10px;
  --radius-lg:             14px;
  --radius-sm:             6px;
  --sidebar-w:             188px;

  --shadow-sm:             0 1px 2px rgb(11 16 24 / .20);
  --shadow-md:             0 8px 24px rgb(11 16 24 / .27);
  --shadow-lg:             0 18px 48px rgb(11 16 24 / .34);

  --tr:                    cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* ============================================================
     LIGHT · SEHL Ivory + Ink + Gold
     ============================================================ */

  --bg:                    #f5f1ea;
  --bg-rgb:                245 241 234;

  --bg-2:                  #fffdfa;
  --bg-3:                  #faf7f1;
  --bg-4:                  #eee7dc;
  --bg-hover:              #f0e9dd;

  --surface-rgb:           255 253 250;
  --surface-2-rgb:         250 247 241;

  --fg:                    var(--brand-ink);
  --fg-rgb:                27 31 42;
  --fg-muted:              #596271;
  --fg-muted-rgb:          89 98 113;
  --fg-dim:                #858d99;

  --border:                #d9d1c5;
  --border-2:              #c9c0b2;

  --accent:                var(--brand-gold);
  --accent-2:              var(--brand-gold-deep);
  --accent-contrast:       #8c6735;

  --accent-soft:           rgb(var(--brand-gold-rgb) / .11);
  --accent-soft-strong:    rgb(var(--brand-gold-rgb) / .18);
  --accent-glow:           rgb(var(--brand-gold-rgb) / .14);

  --success:               var(--semantic-ok);
  --success-soft:          var(--semantic-ok-soft);

  --warn:                  var(--semantic-warn);
  --warn-soft:             var(--semantic-warn-soft);

  --danger:                var(--semantic-danger);
  --danger-soft:           var(--semantic-danger-soft);

  --info:                  var(--semantic-info);
  --info-soft:             var(--semantic-info-soft);

  --neutral-soft:          rgb(138 144 156 / .14);

  --on-accent:             #ffffff;
  --overlay-bg:            rgb(var(--brand-ink-rgb) / .55);

  --shadow-sm:             0 1px 2px rgb(27 31 42 / .05);
  --shadow-md:             0 8px 24px rgb(27 31 42 / .09);
  --shadow-lg:             0 16px 42px rgb(27 31 42 / .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; overflow: hidden; }

#topbar { display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--bg-2); border-bottom: 1px solid var(--border); height: 56px; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 15px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-contrast) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; white-space: nowrap; letter-spacing: -0.01em; }
.brand .version { color: var(--fg-muted); -webkit-text-fill-color: var(--fg-muted); font-size: 11px; font-weight: 500; margin-left: 4px; }
.host-selector { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-muted); }
.host-selector select { background: var(--bg-3); color: var(--fg); border: 1px solid var(--border); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color .2s var(--tr); }
.host-selector select:hover { border-color: var(--accent); background: var(--bg-hover); }
.spacer { flex: 1; }
.user-info { display: flex; align-items: center; gap: 6px; font-size: 12px; }
#user-label { color: var(--fg); background: var(--bg-3); padding: 5px 12px; border-radius: 100px; font-weight: 500; font-size: 11.5px; margin-right: 4px; border: 1px solid var(--border); }
.icon-btn { background: var(--bg-3); color: var(--fg); border: 1px solid var(--border); padding: 6px 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 500; transition: all .2s var(--tr); font-family: inherit; }
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
.user-info .btn { background: var(--bg-3); color: var(--fg); border: 1px solid var(--border); padding: 6px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .2s var(--tr); }
.user-info .btn:hover { background: var(--danger); border-color: var(--danger); color: white; transform: translateY(-1px); }

#body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; overflow: hidden; }
#body.collapsed { grid-template-columns: 60px 1fr; }
#body.collapsed #sidebar .lbl, #body.collapsed #sidebar .nav-sep { display: none; }
#body.collapsed #sidebar button { justify-content: center; padding: 10px 0; }

#sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 14px 10px; overflow-y: auto; overflow-x: hidden; }
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
#sidebar nav { display: flex; flex-direction: column; gap: 1px; }
#sidebar button { display: flex; align-items: center; gap: 11px; background: transparent; color: var(--fg-muted); border: none; border-radius: var(--radius-sm); padding: 8px 11px; cursor: pointer; font-size: 13px; font-weight: 500; text-align: left; width: 100%; font-family: inherit; transition: background .15s var(--tr), color .15s var(--tr); white-space: nowrap; position: relative; }
#sidebar button .ico { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; filter: grayscale(0.4); transition: filter .2s var(--tr); }
#sidebar button .lbl { flex: 1; }
#sidebar button:hover { background: var(--bg-hover); color: var(--fg); }
#sidebar button:hover .ico { filter: grayscale(0); }
#sidebar button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#sidebar button.active::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: var(--accent); border-radius: 0 3px 3px 0; box-shadow: 0 0 8px var(--accent-glow); }
#sidebar button.active .ico { filter: grayscale(0); }
.nav-sep { font-size: 10px; font-weight: 600; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .1em; padding: 14px 12px 6px; }

#content { overflow: auto; position: relative; padding: 24px 28px; background: radial-gradient(circle at 0% 0%, rgb(var(--brand-gold-rgb) / 0.04) 0%, transparent 50%), var(--bg); }
#content::-webkit-scrollbar { width: 10px; }
#content::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
.pane { display: none; animation: fadeIn .25s var(--tr); }
.pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

#statusbar { display: flex; gap: 20px; padding: 6px 20px; background: var(--bg-2); border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-muted); font-family: 'JetBrains Mono', 'Consolas', monospace; height: 30px; flex-shrink: 0; align-items: center; }
#statusbar .sb-item { display: inline-flex; align-items: center; gap: 4px; }
.sb-item.right { margin-left: auto; }

.overlay { position: fixed; inset: 0; background: rgba(8, 9, 12, 0.75); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(12px); }
.login-card { background: var(--bg-2); border: 1px solid var(--border); padding: 40px 36px; border-radius: var(--radius-lg); width: 380px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg), 0 0 80px rgb(var(--brand-gold-rgb) / 0.1); position: relative; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.login-card h1 { font-size: 22px; font-weight: 700; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-contrast) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: -0.02em; }
.login-card .muted { color: var(--fg-muted); font-size: 12.5px; }
.login-card input { background: var(--bg); color: var(--fg); border: 1px solid var(--border-2); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; transition: border-color .2s var(--tr), box-shadow .2s var(--tr); }
.login-card input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card button { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: white; border: none; padding: 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; font-family: inherit; transition: transform .15s var(--tr), box-shadow .2s var(--tr); }
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }
.login-card .error { color: var(--danger); font-size: 12px; min-height: 16px; }

.panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; transition: border-color .2s var(--tr); }
.panel:hover { border-color: var(--border-2); }
.panel h2 { font-size: 14.5px; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.01em; }
.panel h3 { font-size: 10.5px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }

button.btn, .btn { background: var(--bg-3); color: var(--fg); border: 1px solid var(--border-2); padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; font-weight: 500; font-family: inherit; transition: all .15s var(--tr); line-height: 1.4; }
button.btn:hover { background: var(--bg-hover); border-color: var(--border-2); color: var(--fg); transform: translateY(-1px); }
button.btn.primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: white; border-color: transparent; font-weight: 600; }
button.btn.primary:hover { box-shadow: 0 6px 20px var(--accent-glow); transform: translateY(-1px); }
button.btn.danger { background: var(--danger); color: white; border-color: var(--danger); font-weight: 600; }
button.btn.danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.35); }
button.btn.success { background: var(--success); color: white; border-color: var(--success); font-weight: 600; }
button.btn.success:hover { box-shadow: 0 6px 20px rgba(34,197,94,0.35); }
button.btn.small { padding: 4px 10px; font-size: 11.5px; }

input, select, textarea { background: var(--bg); color: var(--fg); border: 1px solid var(--border-2); padding: 7px 11px; border-radius: var(--radius-sm); font-size: 12.5px; font-family: inherit; transition: border-color .15s var(--tr), box-shadow .15s var(--tr); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
table.data thead th { background: var(--bg-3); color: var(--fg-muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .07em; }
table.data tbody tr { transition: background .12s var(--tr); }
table.data tr:hover td { background: var(--bg-3); }
table.data tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge.active { background: var(--success-soft); color: var(--success); }
.badge.inactive { background: var(--danger-soft); color: var(--danger); }
.badge.partial { background: var(--warn-soft); color: var(--warn); }
.badge.unknown { background: var(--bg-3); color: var(--fg-muted); }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; transition: transform .2s var(--tr), border-color .2s var(--tr), box-shadow .2s var(--tr); position: relative; overflow: hidden; }
.metric-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); opacity: 0; transition: opacity .2s var(--tr); }
.metric-card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow-md); }
.metric-card:hover::before { opacity: 1; }
.metric-card .label { color: var(--fg-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.metric-card .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.metric-card .sub { color: var(--fg-muted); font-size: 11px; margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

.term-container { background: #000; border-radius: var(--radius); height: calc(100vh - 180px); padding: 8px; border: 1px solid var(--border); }
.term-tabs { display: flex; gap: 3px; margin-bottom: 8px; }
.term-tabs .tab { background: var(--bg-3); padding: 6px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-size: 11.5px; cursor: pointer; color: var(--fg-muted); border: 1px solid var(--border); border-bottom: none; }
.term-tabs .tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.term-tabs .add { background: var(--bg-3); padding: 6px 12px; cursor: pointer; border-radius: var(--radius-sm); }

.fm-split { display: grid; grid-template-columns: 1fr 8px 1fr; height: calc(100vh - 240px); }
.fm-pane { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.fm-pane .header { padding: 10px; background: var(--bg-3); border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.fm-pane .list { flex: 1; overflow: auto; }
.fm-pane .list .item { padding: 6px 12px; border-bottom: 1px solid rgba(255,255,255,.02); display: grid; grid-template-columns: 22px 1fr 100px 90px 140px; gap: 10px; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 12px; transition: background .12s var(--tr); }
.fm-pane .list .item:hover { background: var(--bg-3); }
.fm-pane .list .item.selected { background: var(--accent-soft); color: var(--accent); }
.fm-pane.dnd-over { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft); }
.fm-pane.dnd-over .list::before { content: 'Soltá aquí para subir →'; position: sticky; top: 0; padding: 12px; text-align: center; color: var(--accent); font-weight: 700; display: block; background: var(--bg-2); border-bottom: 1px solid var(--accent); }
.fm-queue { margin-top: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.fm-queue h3 { margin: 0 0 8px 0; font-size: 13px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.fm-ctx-menu div:active { background: var(--accent-soft); }
.notes-md-preview { padding: 14px; line-height: 1.55; }
.notes-md-preview h1, .notes-md-preview h2, .notes-md-preview h3 { margin-top: 0.8em; }
.notes-md-preview code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.notes-md-preview pre { background: var(--bg-3); padding: 10px; border-radius: 6px; overflow-x: auto; }
.notes-md-preview blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--fg-muted); margin: 0.6em 0; }
.notes-md-preview a { color: var(--accent); }

.sql-area { display: grid; grid-template-rows: 1fr 1fr; height: calc(100vh - 240px); gap: 10px; }
.CodeMirror { height: 100% !important; font-size: 12.5px; border-radius: var(--radius); font-family: 'JetBrains Mono', monospace; }

#toasts { position: fixed; bottom: 40px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-2); color: var(--fg); border: 1px solid var(--border-2); padding: 12px 18px; border-radius: var(--radius); min-width: 260px; box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 500; animation: slideIn .25s var(--tr); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.warn { border-left: 3px solid var(--warn); }

#cmd-palette .palette { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 14px; width: 600px; max-height: 70vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg), 0 0 80px rgb(var(--brand-gold-rgb) / 0.1); }
#cmd-palette input { background: var(--bg); color: var(--fg); border: 1px solid var(--border-2); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14.5px; font-family: inherit; }
#cmd-palette input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#cmd-palette ul { list-style: none; margin-top: 10px; overflow: auto; }
#cmd-palette li { padding: 10px 14px; cursor: pointer; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; transition: background .12s var(--tr); }
#cmd-palette li.active, #cmd-palette li:hover { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: white; }

.alert-banner { background: linear-gradient(135deg, var(--danger), #b91c1c); color: white; padding: 10px 18px; font-size: 12.5px; font-weight: 600; text-align: center; }
.alert-banner.warn { background: linear-gradient(135deg, var(--warn), #b45309); color: white; }

.mono { font-family: 'JetBrains Mono', 'Consolas', monospace; }
.muted { color: var(--fg-muted); }
.right { text-align: right; }
.center { text-align: center; }
.flex-row { display: flex; gap: 10px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.mb-sm { margin-bottom: 10px; }
.mt-sm { margin-top: 10px; }

/* ── DB module ── */
.db-app { display: grid; grid-template-columns: 240px 1fr; gap: 14px; height: calc(100vh - 140px); }
.db-aside { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.db-aside-header { display: flex; gap: 4px; margin-bottom: 8px; }
.db-aside-header select { flex: 1; padding: 5px 8px; }
.db-section { font-size: 10px; font-weight: 600; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; padding: 10px 4px 4px; }
.db-list { display: flex; flex-direction: column; gap: 1px; }
.db-item { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; transition: background .12s var(--tr); color: var(--fg-muted); }
.db-item:hover { background: var(--bg-hover); color: var(--fg); }
.db-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.db-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.db-quick button { font-size: 11px; padding: 4px 8px; }
.db-main { display: flex; flex-direction: column; gap: 12px; overflow: auto; min-width: 0; }
.db-main > .panel { margin: 0; }
.db-main textarea { width: 100%; min-height: 160px; font-family: 'JetBrains Mono', monospace; resize: vertical; }
.db-error { color: var(--danger); padding: 10px; background: var(--danger-soft); border-radius: var(--radius-sm); }
.db-hist-item { padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s var(--tr); }
.db-hist-item:hover { background: var(--bg-hover); }
.muted.small { font-size: 11px; padding: 4px 8px; }

/* ─────────── Terminal — Windows Terminal style ─────────── */
/* Reemplazo el grid del pane terminal para que ocupe todo el alto */
.pane[data-pane="terminal"].active {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 8px;
  height: calc(100vh - 100px);
}

/* Toolbar superior */
.term-toolbar {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  flex-wrap: wrap;
}
.term-tool {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--border-2);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  transition: all .15s var(--tr);
  display: inline-flex; align-items: center; gap: 6px;
}
.term-tool:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.term-tool.small { padding: 4px 8px; font-size: 11px; }
.term-tool-sep   { width: 1px; height: 22px; background: var(--border-2); margin: 0 4px; }
.term-tool-lbl   { color: var(--fg-muted); font-size: 11px; font-weight: 600; padding: 0 4px; }
.term-tool-sel {
  background: var(--bg-3);
  color: var(--fg);
  border: 1px solid var(--border-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  cursor: pointer;
}

/* Search bar */
.term-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.term-search input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
}

/* Tabs estilo Windows Terminal */
.term-tabs {
  display: flex; align-items: flex-end; gap: 3px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
}
.term-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 7px 14px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  margin-bottom: -1px;
  transition: background .15s var(--tr), color .15s var(--tr);
  position: relative;
}
.term-tab:hover { background: var(--bg-hover); color: var(--fg); }
.term-tab.active {
  background: #000;
  color: var(--accent);
  border-color: var(--border-2);
  border-bottom: 1px solid #000;
}
.term-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: var(--radius) var(--radius) 0 0;
}
.term-tab-icon { font-size: 9px; color: var(--success); }
.term-tab.active .term-tab-icon { color: var(--accent); }
.term-tab-label { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; }
.term-tab-close {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  color: var(--fg-muted);
  opacity: 0.6;
  transition: all .12s var(--tr);
}
.term-tab-close:hover {
  background: var(--danger);
  color: white;
  opacity: 1;
}

.term-tab-add {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  margin-bottom: -1px;
  transition: all .12s var(--tr);
}
.term-tab-add:hover { background: var(--bg-hover); color: var(--accent); }

/* Host de terminales (fondo negro como Windows Terminal) */
.term-host {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.term-pane { height: 100%; }
.term-pane .xterm-viewport { background: transparent !important; }

/* Pane de terminal: flex column para que term-host llene todo el espacio
   disponible y la status bar quede pegada abajo sin hueco. */
.pane.active[data-pane="terminal"] {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
}
.pane[data-pane="terminal"] > .term-toolbar,
.pane[data-pane="terminal"] > .term-search,
.pane[data-pane="terminal"] > .term-tabs,
.pane[data-pane="terminal"] > .term-statusbar {
  flex-shrink: 0;
}

/* Status bar inferior */
.term-statusbar {
  display: flex; align-items: center; gap: 14px;
  padding: 5px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--fg-muted);
}
.term-statusbar .spacer { flex: 1; }

/* ── Scrollbar de xterm.js (terminal) ── */
.xterm-viewport::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}
.xterm-viewport::-webkit-scrollbar-track {
  background: var(--bg-2);
  border-radius: 5px;
}
.xterm-viewport::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 5px;
  border: 2px solid var(--bg-2);
}
.xterm-viewport::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
.xterm-viewport {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) var(--bg-2);
}

/* Scrollbars globales para Firefox y cualquier elemento con overflow */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

/* Default scrollbar para todo lo que no esté ya estilizado */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── Notes module ── */
.notes-app { display: grid; grid-template-columns: 260px 1fr; gap: 14px; height: calc(100vh - 140px); }
.notes-aside { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.notes-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.notes-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s var(--tr); }
.notes-item:hover { background: var(--bg-hover); }
.notes-item.active { background: var(--accent-soft); }
.notes-item-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.notes-item-meta { font-size: 10.5px; color: var(--fg-muted); }
.notes-main { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.notes-title-input { font-size: 18px; font-weight: 600; border: none; background: transparent; padding: 4px 0; }
.notes-title-input:focus { box-shadow: none; }
.notes-tags-input { font-size: 12px; border: 1px solid var(--border); padding: 5px 10px; }
.notes-textarea { flex: 1; min-height: 300px; font-family: 'JetBrains Mono', monospace; font-size: 13px; resize: none; }

/* ─── Cheat sheet de atajos (Ctrl+?) ─── */
.sc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.sc-overlay[hidden] { display: none !important; }
.sc-modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px 26px; width: 560px; max-width: 95vw; max-height: 85vh; overflow: auto; }
.sc-modal h2 { margin: 0 0 4px; font-size: 18px; }
.sc-sub { font-size: 12px; color: var(--fg-muted); margin: 0 0 14px; }
.sc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.sc-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sc-keys { display: flex; align-items: center; gap: 4px; min-width: 140px; }
.sc-keys kbd { background: var(--bg-3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-family: 'JetBrains Mono', Consolas, monospace; font-size: 11px; font-weight: 600; }
.sc-plus { color: var(--fg-muted); font-size: 10px; }
.sc-desc { font-size: 12.5px; color: var(--fg); }
.sc-footer { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ─── Global search (Ctrl+/) ─── */
.gs-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.gs-overlay[hidden] { display: none !important; }
.gs-modal { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; width: 640px; max-width: 95vw; max-height: 70vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.gs-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.gs-icon { font-size: 18px; }
.gs-input { flex: 1; background: transparent; border: none; outline: none; color: var(--fg); font-size: 15px; }
.gs-close { background: none; border: none; color: var(--fg-muted); font-size: 16px; cursor: pointer; padding: 2px 8px; border-radius: 4px; }
.gs-close:hover { background: var(--bg-3); color: var(--fg); }
.gs-results { flex: 1; overflow-y: auto; padding: 8px; }
.gs-section { margin-bottom: 12px; }
.gs-section-title { font-size: 10px; font-weight: 700; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: background .12s; }
.gs-item:hover { background: var(--bg-3); }
.gs-item-ico { font-size: 16px; min-width: 22px; }
.gs-item-body { flex: 1; min-width: 0; }
.gs-item-title { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item-sub { font-size: 11px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item-tag { font-size: 9.5px; padding: 2px 7px; border-radius: 10px; background: var(--bg-3); color: var(--fg-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
.gs-empty { padding: 30px 20px; text-align: center; color: var(--fg-muted); font-size: 12px; }
.gs-empty.error { color: var(--danger); }
.gs-foot { padding: 10px 18px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--fg-muted); text-align: center; }

/* ─── Onboarding tour ─── */
.ob-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1900; display: flex; align-items: center; justify-content: center; }
.ob-overlay[hidden] { display: none !important; }
.ob-modal { background: var(--bg-2); border: 1px solid var(--accent); border-radius: 12px; padding: 30px; max-width: 520px; box-shadow: 0 0 30px rgb(var(--brand-gold-rgb) / .3); }
.ob-modal h2 { margin: 0 0 12px; color: var(--accent); }
.ob-modal p { line-height: 1.6; color: var(--fg); margin: 0 0 16px; }
.ob-progress { font-size: 11px; color: var(--fg-muted); text-align: center; padding: 8px 0; }
.ob-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* ─── Favorites star ─── */
.fav-star { font-size: 11px; transition: opacity .15s; }
.fav-star:hover { opacity: 1 !important; color: gold; }

/* ─── Themes: cyberpunk ─── */
:root[data-theme="cyberpunk"] {
  --bg: #0a0014; --bg-2: #14001f; --bg-3: #1f0033;
  --fg: #e0d4ff; --fg-muted: #9a7fc4;
  --accent: #ff00ff; --accent-2: #00ffff; --accent-soft: rgba(255,0,255,.12);
  --border: #3d1a5f; --border-2: #5a2980;
  --success: #00ff9f; --warn: #ffa500; --danger: #ff0066;
}
:root[data-theme="cyberpunk"] body { background: linear-gradient(135deg, #0a0014 0%, #1a0033 100%); }

/* ─── Empty states ─── */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 20px; color: var(--fg-muted); }
.empty-state .ico { font-size: 48px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; margin: 0; color: var(--fg); }
.empty-state p { font-size: 12.5px; margin: 0; max-width: 320px; text-align: center; }

/* ─── Statusbar hover ─── */
#statusbar .sb-item:hover { background: var(--bg-3); border-radius: 4px; }

/* ─── Disk warn badge animado ─── */
#sidebar-disk-warn { animation: sehl-pulse 2s infinite; }
@keyframes sehl-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
/* ─── Mobile responsive (< 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  #body { flex-direction: column; }
  #sidebar {
    width: 100% !important;
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 240px;
    overflow-y: auto;
  }
  #sidebar.collapsed, #body.collapsed #sidebar { display: none; }
  #main-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  #main-tabs button { flex: 1 1 auto; min-width: 90px; font-size: 11px; }
  .nav-sep { width: 100%; }
  #content { padding: 8px; }
  /* Tablas con scroll horizontal */
  table.data, .dom-table, .pane table {
    display: block; overflow-x: auto; max-width: 100%; white-space: nowrap;
  }
  /* Palette y modals adaptados */
  #cmd-palette .palette {
    width: 95vw !important; max-width: none;
  }
  /* DB Explorer y NGINX manager: stack vertical */
  .db-app { flex-direction: column; }
  .db-aside { width: 100% !important; max-height: 240px; overflow-y: auto; }
}
.cmd-palette-list li.active {
  background: var(--accent-soft, rgba(79, 110, 247, 0.1));
}
#cmd-list li.active {
  background: var(--accent-soft, rgba(79, 110, 247, 0.15));
}

/* ============================================================
   SEHL-CONSOLE — Official Tokenized SEHL Theme
   Visual-only patch. Does not touch backend logic.
   ============================================================ */



/* Light theme is governed by canonical SEHL tokens */


/* Global background */
html,
body {
  background:
    radial-gradient(circle at 0% 0%, rgb(var(--brand-gold-rgb) / .075), transparent 34%),
    radial-gradient(circle at 100% 10%, rgb(var(--brand-gold-rgb) / .045), transparent 28%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-2) 48%, var(--bg-3) 100%) !important;
  color: var(--fg) !important;
}

/* Main app surfaces */
#topbar,
#sidebar,
#statusbar,
.panel,
.metric-card,
.login-card,
.fm-pane,
.db-aside,
table.data,
#cmd-palette .palette,
.toast {
  background: rgb(var(--surface-rgb) / 0.78) !important;
  border-color: rgb(var(--brand-gold-rgb) / 0.16) !important;
  backdrop-filter: blur(16px) saturate(1.08) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  box-shadow:
    inset 0 1px 0 rgb(var(--fg-rgb) / .045),
    0 12px 32px rgba(0,0,0,.24) !important;
}

/* Topbar */
#topbar {
  height: 62px !important;
  border-bottom: 1px solid rgb(var(--brand-gold-rgb) / .22) !important;
  background:
    linear-gradient(180deg, rgb(var(--surface-rgb) / .94), rgb(var(--surface-rgb) / .90)) !important;
}

#topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--brand-gold-rgb) / .62), transparent);
  pointer-events: none;
}

/* Brand */
.brand {
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: .10em !important;
  background: linear-gradient(135deg, var(--accent-contrast) 0%, var(--accent) 46%, var(--accent-2) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-transform: uppercase !important;
  text-shadow: 0 0 18px rgb(var(--brand-gold-rgb) / .14) !important;
}

.brand::before {
  content: "◆";
  display: inline-block;
  margin-right: 9px;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  filter: drop-shadow(0 0 8px rgb(var(--brand-gold-rgb) / .30));
}

.brand .version {
  color: rgb(var(--fg-muted-rgb) / .62) !important;
  -webkit-text-fill-color: rgb(var(--fg-muted-rgb) / .62) !important;
  font-size: 10px !important;
  letter-spacing: .12em !important;
  margin-left: 8px !important;
}

/* Content background */
#content {
  background:
    radial-gradient(circle at 0% 0%, rgb(var(--brand-gold-rgb) / .06), transparent 36%),
    linear-gradient(145deg, rgb(var(--bg-rgb) / .98), rgb(var(--surface-rgb) / .98)) !important;
}

/* Sidebar */
#sidebar {
  border-right: 1px solid rgb(var(--brand-gold-rgb) / .16) !important;
}

#sidebar button {
  color: rgb(var(--fg-muted-rgb) / .68) !important;
  border: 1px solid transparent !important;
}

#sidebar button:hover {
  background: rgb(var(--brand-gold-rgb) / .075) !important;
  color: var(--fg) !important;
  border-color: rgb(var(--brand-gold-rgb) / .16) !important;
}

#sidebar button.active {
  background: rgb(var(--brand-gold-rgb) / .14) !important;
  color: var(--accent-contrast) !important;
  border-color: rgb(var(--brand-gold-rgb) / .30) !important;
}

#sidebar button.active::before {
  background: var(--accent) !important;
  box-shadow: 0 0 10px rgb(var(--brand-gold-rgb) / .45) !important;
}

.nav-sep {
  color: rgb(var(--fg-muted-rgb) / .72) !important;
}

/* Buttons */
.icon-btn,
.user-info .btn,
button.btn,
.btn,
.term-tool,
.term-tab,
.term-tab-add {
  background: rgb(var(--fg-rgb) / .035) !important;
  color: var(--fg) !important;
  border-color: rgb(var(--fg-rgb) / .10) !important;
  box-shadow: none !important;
}

.icon-btn:hover,
.user-info .btn:hover,
button.btn:hover,
.term-tool:hover,
.term-tab:hover,
.term-tab-add:hover {
  background: rgb(var(--brand-gold-rgb) / .12) !important;
  color: var(--accent-contrast) !important;
  border-color: rgb(var(--brand-gold-rgb) / .34) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 22px rgb(var(--brand-gold-rgb) / .10) !important;
}

button.btn.primary,
.login-card button,
.term-tabs .tab.active,
#cmd-palette li.active,
#cmd-palette li:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%) !important;
  color: var(--on-accent) !important;
  border-color: rgb(var(--brand-gold-rgb) / .38) !important;
  box-shadow: 0 10px 28px rgb(var(--brand-gold-rgb) / .18) !important;
}

/* Login */
.overlay {
  background:
    radial-gradient(circle at 50% 15%, rgb(var(--brand-gold-rgb) / .12), transparent 34%),
    rgb(var(--bg-rgb) / .82) !important;
}

.login-card {
  border-color: rgb(var(--brand-gold-rgb) / .26) !important;
  box-shadow:
    0 30px 90px rgba(0,0,0,.62),
    0 0 46px rgb(var(--brand-gold-rgb) / .10) !important;
}

.login-card::before {
  background: linear-gradient(90deg, transparent, rgb(var(--brand-gold-rgb) / .80), transparent) !important;
}

.login-card h1 {
  background: linear-gradient(135deg, var(--accent-contrast) 0%, var(--accent) 52%, var(--accent-2) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  letter-spacing: .04em !important;
}

/* Inputs */
input,
select,
textarea,
#cmd-palette input,
.host-selector select {
  background: rgb(var(--bg-rgb) / .68) !important;
  color: var(--fg) !important;
  border-color: rgb(var(--fg-rgb) / .12) !important;
}

input:focus,
select:focus,
textarea:focus,
#cmd-palette input:focus {
  border-color: rgb(var(--brand-gold-rgb) / .46) !important;
  box-shadow: 0 0 0 3px rgb(var(--brand-gold-rgb) / .13) !important;
}

/* Cards */
.metric-card:hover,
.panel:hover,
.dom-card:hover {
  border-color: rgb(var(--brand-gold-rgb) / .28) !important;
  box-shadow:
    0 16px 34px rgba(0,0,0,.34),
    0 0 22px rgb(var(--brand-gold-rgb) / .08) !important;
}

.metric-card::before {
  background: linear-gradient(90deg, var(--accent), transparent) !important;
}

/* Tables */
table.data thead th {
  background: rgb(var(--surface-2-rgb) / .82) !important;
  color: rgb(var(--fg-muted-rgb) / .72) !important;
}

table.data tr:hover td {
  background: rgb(var(--brand-gold-rgb) / .055) !important;
}

/* Links and small accents */
.notes-md-preview a,
.db-item.active,
.dom-chip:hover,
.dom-chip.active,
.dom-view-btn.active,
.dom-view-btn:hover {
  color: var(--accent-contrast) !important;
}

.badge.active {
  background: rgb(var(--semantic-ok-rgb) / .14) !important;
  color: var(--success) !important;
}

.badge.partial {
  background: var(--warn-soft) !important;
  color: var(--warn) !important;
}

.badge.unknown {
  background: var(--neutral-soft) !important;
  color: var(--fg-muted) !important;
}

/* Terminal should stay readable */
.term-container,
.term-body,
.xterm,
.xterm-screen {
  background: var(--terminal-bg) !important;
}

.term-tab.active {
  background: rgb(var(--brand-gold-rgb) / .12) !important;
  color: var(--accent-contrast) !important;
  border-color: rgb(var(--brand-gold-rgb) / .32) !important;
}

/* Statusbar */
#statusbar {
  color: rgb(var(--fg-muted-rgb) / .78) !important;
  border-top-color: rgb(var(--brand-gold-rgb) / .16) !important;
}

/* Scrollbars */
*::-webkit-scrollbar-thumb {
  background: rgb(var(--brand-gold-rgb) / .24) !important;
  border-radius: 8px !important;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--brand-gold-rgb) / .44) !important;
}

/* Domain module blue override */
.dom-aside .nav-item.active,
.dom-chip:hover,
.dom-chip.active,
.dom-avail-link.primary,
.dom-avail-tld.selected {
  background: rgb(var(--brand-gold-rgb) / .14) !important;
  color: var(--accent-contrast) !important;
  border-color: rgb(var(--brand-gold-rgb) / .32) !important;
}

/* Mobile */
@media (max-width: 760px) {
  #topbar {
    height: auto !important;
    min-height: 62px !important;
    flex-wrap: wrap !important;
    padding: 10px 14px !important;
  }

  .brand {
    font-size: 14px !important;
  }
}

/* ============================================================
   SEHL-CONSOLE — Login Logo
   ============================================================ */

.login-card {
  align-items: center !important;
  text-align: center !important;
}

.login-logo {
  display: block !important;
  width: 210px !important;
  max-width: 84% !important;
  height: auto !important;
  margin: -8px auto 2px auto !important;
  object-fit: contain !important;
  filter:
    drop-shadow(0 0 14px rgb(var(--brand-gold-rgb) / .36))
    drop-shadow(0 0 30px rgb(var(--brand-gold-rgb) / .12)) !important;
}

.login-card h1 {
  margin-top: 2px !important;
  text-align: center !important;
}

.login-card .muted {
  text-align: center !important;
}

.login-card input,
.login-card button {
  width: 100% !important;
}

@media (max-width: 520px) {
  .login-logo {
    width: 175px !important;
  }
}

/* ============================================================
   SEHL-CONSOLE — Login logo only
   El logo manda. No texto duplicado.
   ============================================================ */

.login-card {
  align-items: center !important;
  text-align: center !important;
  padding-top: 34px !important;
}

/* Oculta el nombre escrito en el login */
.login-card h1 {
  display: none !important;
}

/* Logo principal más grande */
.login-logo {
  display: block !important;
  width: 310px !important;
  max-width: 96% !important;
  height: auto !important;
  margin: -10px auto 18px auto !important;
  object-fit: contain !important;
  filter:
    drop-shadow(0 0 16px rgb(var(--brand-gold-rgb) / .42))
    drop-shadow(0 0 34px rgb(var(--brand-gold-rgb) / .16)) !important;
}

.login-card .muted {
  margin-top: 4px !important;
  margin-bottom: 4px !important;
  text-align: center !important;
}

.login-card input,
.login-card button {
  width: 100% !important;
}

@media (max-width: 520px) {
  .login-logo {
    width: 250px !important;
  }
}

/* ============================================================
   SEHL-CONSOLE — Compact login card height
   ============================================================ */

.login-card {
  width: 360px !important;
  min-height: auto !important;
  padding: 28px 30px 30px !important;
  gap: 12px !important;
}

.login-logo {
  width: 280px !important;
  max-width: 94% !important;
  margin: -6px auto 10px auto !important;
}

.login-card .muted {
  margin-top: 0 !important;
  margin-bottom: 2px !important;
  font-size: 12px !important;
}

.login-card input {
  padding: 10px 13px !important;
}

.login-card button {
  padding: 10px !important;
}

@media (max-width: 520px) {
  .login-card {
    width: calc(100vw - 42px) !important;
    padding: 24px 24px 26px !important;
  }

  .login-logo {
    width: 240px !important;
  }
}

/* === SEHL PROFESSIONAL SVG ICONS === */
#sidebar .ico {
  width: 20px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#sidebar .sehl-nav-icon {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

#sidebar button.active .sehl-nav-icon {
  stroke-width: 2;
}

/* === SEHL TERMINAL EXPANDED VIEW START === */

body.terminal-focus {
  overflow: hidden !important;
}

.pane[data-pane="terminal"].terminal-expanded {
  position: fixed !important;
  inset: 0 !important;
  z-index: 5000 !important;

  display: flex !important;
  flex-direction: column !important;

  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;

  max-width: none !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 8px !important;

  box-sizing: border-box !important;
  background: var(--bg) !important;
}

.pane[data-pane="terminal"].terminal-expanded
.term-host {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.pane[data-pane="terminal"].terminal-expanded
.term-toolbar,
.pane[data-pane="terminal"].terminal-expanded
.term-search,
.pane[data-pane="terminal"].terminal-expanded
.term-tabs,
.pane[data-pane="terminal"].terminal-expanded
.term-statusbar {
  flex-shrink: 0 !important;
}

.term-expand-toggle {
  min-width: 34px !important;
  justify-content: center !important;
  font-size: 16px !important;
}

.term-expand-toggle.active {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* === SEHL TERMINAL EXPANDED VIEW END === */
