:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #0f151c;
  --surface-2: #141c25;
  --text: #f7f9fc;
  --muted: #9ba8b7;
  --line: rgba(255, 255, 255, 0.11);
  --cyan: #4bd3ff;
  --green: #68e0a6;
  --ink: #071016;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.topbar, .appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 22px; width: 100%; padding: 15px max(20px, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid var(--line); background: rgba(8, 11, 16, 0.9); backdrop-filter: blur(18px); }
.brand, .nav { display: flex; align-items: center; }
.brand { gap: 10px; font-weight: 800; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(75, 211, 255, 0.55); border-radius: 8px; background: #0a2230; color: var(--cyan); }
.nav { gap: 22px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; cursor: pointer; }
.button.primary { border-color: rgba(75, 211, 255, 0.5); background: var(--cyan); color: #061018; }
.button.secondary { background: rgba(255,255,255,0.045); color: #eaf0f7; }

.hero { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr); gap: 38px; align-items: center; width: min(var(--max), calc(100vw - 40px)); min-height: calc(100vh - 65px); margin: 0 auto; padding: 54px 0 32px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 20px; font-size: clamp(48px, 7vw, 88px); line-height: 0.95; letter-spacing: 0; }
h2 { margin-bottom: 0; font-size: clamp(30px, 4.8vw, 52px); line-height: 1.04; letter-spacing: 0; }
h3 { margin-bottom: 10px; font-size: 18px; }
.lead { max-width: 680px; margin-bottom: 28px; color: #c8d2de; font-size: clamp(18px, 2vw, 22px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.product-shot { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; background: var(--surface); box-shadow: 0 34px 120px rgba(0,0,0,0.5); }
.product-shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.shot-caption { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid rgba(255,255,255,0.14); border-radius: 8px; background: rgba(7, 12, 18, 0.78); backdrop-filter: blur(12px); }
.shot-caption span { color: var(--muted); }

.capability-band, .section, .footer, .workspace { width: min(var(--max), calc(100vw - 40px)); margin: 0 auto; }
.capability-band { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #0c1218; }
.capability-band span { padding: 8px 12px; border: 1px solid rgba(75,211,255,0.18); border-radius: 8px; color: #dcf7ff; background: rgba(75,211,255,0.06); font-weight: 800; font-size: 13px; }
.section { padding: 88px 0 0; }
.compact-heading { max-width: 780px; margin-bottom: 28px; }
.compact-heading p:not(.eyebrow), .final-cta p, .workspace-hero p { color: var(--muted); }

.playground { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #101821, #080c12); }
.code-tabs { display: none; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.035); }
.tab { min-height: 38px; min-width: 72px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.045); color: var(--text); font-weight: 800; cursor: pointer; }
.tab.is-active { border-color: rgba(104,224,166,0.6); background: rgba(104,224,166,0.12); }
.editor-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.editor-panel { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; }
.editor-panel.code-field { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; align-items: center; }
.editor-panel.code-field textarea { grid-column: 1 / -1; }
.editor-panel span, .preview-card span, .login-card span { color: #dce7f2; font-size: 13px; font-weight: 800; }
textarea { width: 100%; min-height: 380px; max-height: 560px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: #05080c; color: #eef5ff; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 14px; outline: none; }
textarea:focus, input:focus { border-color: rgba(75,211,255,0.72); box-shadow: 0 0 0 3px rgba(75,211,255,0.12); }
.preview-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid rgba(75,211,255,0.22); border-radius: 8px; background: rgba(75,211,255,0.06); }
.preview-card p { margin: 0; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature, .panel-block { padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #0c1218; }
.panel-block { overflow-x: auto; }
.feature p, .panel-block p { margin-bottom: 0; color: var(--muted); }
.final-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 86px 0; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 36px 0 28px; color: var(--muted); font-size: 14px; }

.modal { position: fixed; inset: 0; z-index: 80; display: none; padding: 20px; }
.modal.is-open { display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(10px); }
.modal-dialog, .auth-dialog { position: relative; z-index: 1; display: grid; overflow: hidden; width: min(1120px, 100%); max-height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; box-shadow: 0 34px 120px rgba(0,0,0,0.56); }
.modal-dialog { grid-template-rows: auto auto auto 1fr; height: min(760px, calc(100vh - 40px)); }
.auth-dialog { grid-template-rows: auto 1fr; width: min(860px, 100%); }
.modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding: 12px 14px 12px 18px; border-bottom: 1px solid #dce3ec; background: #fff; }
.modal-bar .eyebrow { margin-bottom: 2px; color: #007a70; }
.modal-bar h3 { margin: 0; color: #121923; }
.icon-button { min-height: 40px; padding: 0 12px; border: 1px solid #cfd8e3; border-radius: 8px; background: #f4f7fb; color: #1c2734; font-weight: 900; cursor: pointer; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid rgba(16,24,32,0.12); background: #f8fafc; }
.preview-size-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-size-button, .preview-open-button { min-height: 34px; padding: 0 10px; border: 1px solid #cfd8e3; border-radius: 8px; background: white; color: #1c2734; font-size: 12px; font-weight: 900; cursor: pointer; }
.preview-size-button.is-active { border-color: rgba(0,122,112,0.45); background: #e7f7f4; color: #006c63; }
.preview-open-button { margin-left: auto; background: #101820; color: white; }
.preview-surface { display: grid; min-height: 0; overflow: auto; place-items: stretch center; padding: 0; background: #dce3ec; }
.preview-surface iframe { width: 100%; height: 100%; min-height: 0; border: 0; background: white; }
.preview-surface[data-preview-size="desktop"] iframe { width: min(100%, 1280px); }
.preview-surface[data-preview-size="tablet"] iframe { width: min(100%, 820px); }
.preview-surface[data-preview-size="mobile"] iframe { width: min(100%, 390px); }
.preview-surface[data-preview-size="tall"] iframe { width: min(100%, 1280px); min-height: 1400px; }
.preview-diagnostics { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(16,24,32,0.12); background: #eef4f7; color: #203040; font-size: 13px; }
.preview-diagnostics:empty { display: none; }
.preview-diagnostics p { margin: 0; padding: 6px 8px; border: 1px solid rgba(32,48,64,0.12); border-radius: 6px; background: white; font-weight: 700; }
.preview-diagnostics .ok { color: #087443; border-color: rgba(8,116,67,0.24); background: #e8f7ef; }
.preview-diagnostics .info { color: #31516f; border-color: rgba(49,81,111,0.22); background: #edf5fb; }
.preview-diagnostics .warn { color: #8a5b00; border-color: rgba(138,91,0,0.24); background: #fff6d9; }
.preview-diagnostics .error { color: #a31d1d; border-color: rgba(163,29,29,0.24); background: #ffe8e8; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; background: #eef3f8; }
.login-card { display: grid; gap: 14px; padding: 22px; border: 1px solid #d9e1ea; border-radius: 8px; background: white; color: #121923; }
.login-card label { display: grid; gap: 8px; }
.login-card input { width: 100%; min-height: 44px; border: 1px solid #ccd6e1; border-radius: 8px; background: white; color: #121923; padding: 0 12px; outline: none; }
.login-card .button { width: 100%; }
.notice { padding: 12px; border: 1px solid rgba(75,211,255,0.35); border-radius: 8px; background: rgba(75,211,255,0.08); color: #dff7ff; }
.error-notice { border-color: rgba(255, 193, 7, 0.45); background: rgba(255, 193, 7, 0.12); color: #fff1bd; font-weight: 800; }

.workspace { padding: 56px 0 80px; }
.workspace-hero { margin-bottom: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.metric-grid div { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #0c1218; }
.metric-grid strong, .metric-grid span { display: block; }
.metric-grid strong { font-size: 28px; }
.metric-grid span { color: var(--muted); }
.panel-table { width: 100%; border-collapse: collapse; color: var(--text); }
.panel-table th, .panel-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.panel-table th { color: #dbe7f5; font-size: 13px; }
.admin-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: 34px; align-items: start; width: min(980px, calc(100vw - 40px)); min-height: 100vh; margin: 0 auto; padding: 92px 0; }
.admin-entry p { color: var(--muted); }

@media (max-width: 980px) {
  .hero, .admin-entry { grid-template-columns: 1fr; }
  .product-shot { order: -1; }
  .feature-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-panels { grid-template-columns: 1fr; }
  .code-tabs { display: flex; }
  .editor-panel { display: none; }
  .editor-panel.is-active { display: grid; }
  .auth-grid { grid-template-columns: 1fr; }
  .final-cta { align-items: stretch; flex-direction: column; }
}

@media (max-width: 620px) {
  .nav { display: none; }
  h1 { font-size: 42px; }
  .topbar, .appbar { position: static; }
  .feature-grid, .metric-grid { grid-template-columns: 1fr; }
  .preview-card, .shot-caption, .footer { flex-direction: column; align-items: stretch; }
  .modal { padding: 10px; }
  .modal-dialog { height: calc(100vh - 20px); max-height: none; }
  .preview-toolbar { align-items: stretch; flex-direction: column; }
  .preview-open-button { width: 100%; margin-left: 0; }
  .preview-size-button { flex: 1 1 auto; }
  .preview-surface[data-preview-size="tall"] iframe { min-height: 1100px; }
  textarea { min-height: 300px; }
}

/* Planes, tema claro y menu de panel */
.top-actions, .appbar-left { display: flex; align-items: center; gap: 10px; }
.theme-toggle { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.045); color: var(--text); font-weight: 800; cursor: pointer; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price-card { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: #0c1218; }
.price-card.featured { border-color: rgba(75,211,255,0.55); background: rgba(75,211,255,0.08); }
.price-card h3 { margin: 0; font-size: 42px; line-height: 1; }
.price-card > span { color: var(--muted); }
.price-card ul { display: grid; gap: 8px; min-height: 132px; margin: 0; padding-left: 18px; color: #cdd7e3; }

.hamburger { display: grid; gap: 4px; width: 42px; height: 42px; place-content: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.045); cursor: pointer; }
.hamburger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); }
.app-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: min(1420px, calc(100vw - 32px)); margin: 0 auto; }
.side-menu { position: sticky; top: 73px; align-self: start; height: calc(100vh - 73px); overflow: auto; padding: 22px 14px 22px 0; border-right: 1px solid var(--line); }
.side-head { padding: 0 10px 14px; }
.side-menu nav { display: grid; gap: 6px; }
.side-menu a { display: grid; gap: 2px; padding: 11px 10px; border: 1px solid transparent; border-radius: 8px; }
.side-menu a:hover { border-color: var(--line); background: rgba(255,255,255,0.04); }
.side-menu a span { color: var(--muted); font-size: 12px; }
.app-layout .workspace { width: 100%; padding-left: 28px; }

html[data-theme="light"] { color-scheme: light; --bg: #f5f7fb; --surface: #ffffff; --surface-2: #eef3f8; --text: #111821; --muted: #5d6a78; --line: rgba(15, 23, 42, 0.14); --ink: #ffffff; }
html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] .topbar, html[data-theme="light"] .appbar { background: rgba(245,247,251,0.9); }
html[data-theme="light"] .product-shot, html[data-theme="light"] .feature, html[data-theme="light"] .panel-block, html[data-theme="light"] .price-card, html[data-theme="light"] .capability-band, html[data-theme="light"] .playground, html[data-theme="light"] .metric-grid div { background: #ffffff; }
html[data-theme="light"] .lead, html[data-theme="light"] .compact-heading p:not(.eyebrow), html[data-theme="light"] .final-cta p, html[data-theme="light"] .feature p, html[data-theme="light"] .panel-block p, html[data-theme="light"] .price-card > span, html[data-theme="light"] .price-card ul { color: var(--muted); }
html[data-theme="light"] textarea { background: #f8fafc; color: #111821; }
html[data-theme="light"] .theme-toggle, html[data-theme="light"] .button.secondary, html[data-theme="light"] .hamburger { background: #ffffff; color: var(--text); }
html[data-theme="light"] .hamburger span { background: var(--text); }
html[data-theme="light"] .price-card.featured { background: #e9f7ff; }
html[data-theme="light"] .capability-band span { color: #075168; background: #e9f7ff; }
html[data-theme="light"] .panel-table { color: var(--text); }

@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .app-layout { grid-template-columns: 1fr; }
  .side-menu { position: fixed; top: 0; left: 0; z-index: 70; width: min(320px, 88vw); height: 100vh; padding: 18px; background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-105%); transition: transform 0.18s ease; }
  body.menu-open .side-menu { transform: translateX(0); }
  .app-layout .workspace { padding-left: 0; }
}

@media (max-width: 620px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .top-actions { margin-left: auto; }
  .theme-toggle { display: none; }
}

/* Funciones reales de paneles */
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form input { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.045); color: var(--text); padding: 0 12px; outline: none; }
.project-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-editor label { display: grid; gap: 8px; min-width: 0; }
.project-editor .code-field { grid-template-columns: 1fr auto; align-items: center; }
.project-editor .code-field textarea { grid-column: 1 / -1; }
.project-editor label span { color: #dce7f2; font-size: 13px; font-weight: 800; }
.clear-code-button { min-height: 30px; padding: 0 10px; border: 1px solid rgba(75,211,255,0.26); border-radius: 8px; background: rgba(75,211,255,0.08); color: #dff7ff; font-size: 12px; font-weight: 900; cursor: pointer; }
.clear-code-button:hover { border-color: rgba(75,211,255,0.52); background: rgba(75,211,255,0.14); }
.project-editor textarea { min-height: 340px; }
.editor-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.panel-table a { color: var(--cyan); font-weight: 800; }
.panel-block + .panel-block { margin-top: 22px; }
html[data-theme="light"] .inline-form input { background: #fff; color: var(--text); }
html[data-theme="light"] .project-editor label span { color: var(--text); }
html[data-theme="light"] .clear-code-button { background: #eef8ff; color: #075168; }

@media (max-width: 980px) {
  .panel-head { align-items: stretch; flex-direction: column; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form input, .inline-form .button { width: 100%; }
  .project-editor { grid-template-columns: 1fr; }
}


.quota-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.quota-card strong,
.quota-card span {
  display: block;
}

.quota-card strong {
  color: var(--text);
  font-size: 20px;
}

.quota-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quota-card i {
  display: block;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.quota-card b {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

html[data-theme="light"] .quota-card {
  background: #ffffff;
}

html[data-theme="light"] .quota-card i {
  background: #e9eef5;
}

/* Admin nodos */
.inline-code { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: rgba(104,224,166,0.08); font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.node-help { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.035); }
.node-help p { margin-bottom: 10px; }
.node-help pre { overflow: auto; margin: 0; padding: 12px; border-radius: 8px; background: #05080c; color: #e8f2ff; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
html[data-theme="light"] .node-help { background: #fff; }
html[data-theme="light"] .node-help pre { background: #f8fafc; color: #111821; }

.row-actions,
.table-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-form input,
.table-form select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  color: var(--text);
}

.table-form label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
  color: var(--muted);
  font-size: 13px;
}

.button.danger {
  border-color: rgba(234, 84, 85, .42);
  color: #ffb4b4;
  background: rgba(234, 84, 85, .1);
}

[data-theme="light"] .button.danger {
  color: #9f2222;
  background: #fff1f1;
}

.panel-table td span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .table-form,
  .row-actions {
    align-items: stretch;
  }
  .table-form input,
  .table-form select,
  .table-form button,
  .row-actions button {
    width: 100%;
  }
}

/* Navegacion por secciones y scroll discreto */
* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html[data-ready="true"] .app-layout .workspace > section:not(.is-active),
html[data-ready="true"] .app-layout .workspace > .panel-ad:not(.is-active) {
  display: none;
}

html[data-ready="true"] .app-layout .workspace > section.is-active.metric-grid {
  display: grid;
}

.side-menu a.is-active {
  border-color: rgba(75,211,255,0.42);
  background: rgba(75,211,255,0.09);
}

.landing-ad,
.panel-ad {
  width: min(var(--max), calc(100vw - 40px));
  margin: 14px auto 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.panel-ad {
  width: 100%;
  margin: 0 0 22px;
}

.landing-ad a,
.panel-ad a {
  color: inherit;
}

.settings-form,
.create-plan-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.settings-form label,
.create-plan-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.settings-form input,
.create-plan-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
}

.settings-form .button,
.create-plan-form .button {
  align-self: end;
}

html[data-theme="light"] .landing-ad,
html[data-theme="light"] .panel-ad,
html[data-theme="light"] .settings-form input,
html[data-theme="light"] .create-plan-form input {
  background: #ffffff;
  color: var(--text);
}

@media (max-width: 980px) {
  .settings-form,
  .create-plan-form {
    grid-template-columns: 1fr;
  }
}

/* Indicadores de nodos */
.node-table {
  min-width: 920px;
}

.node-table th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.node-table th[data-sort]::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.node-table th.is-sorted-asc::after { content: "^"; color: var(--cyan); }
.node-table th.is-sorted-desc::after { content: "v"; color: var(--cyan); }

.metric-number {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.metric-number.warn {
  color: #ffc457;
}

.metric-number.net {
  color: #cde8ff;
  font-size: 12px;
}

html[data-theme="light"] .metric-number.net {
  color: #185d8c;
}



.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.table-pagination button {
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 640px) {
  .table-pagination {
    justify-content: space-between;
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ok {
  color: #9cf4c7;
  background: rgba(104,224,166,.1);
  border-color: rgba(104,224,166,.35);
}

.status-pill.bad {
  color: #ffb4b4;
  background: rgba(234,84,85,.1);
  border-color: rgba(234,84,85,.35);
}

html[data-theme="light"] .status-pill.ok {
  color: #106d43;
  background: #ecfff4;
}

html[data-theme="light"] .status-pill.bad {
  color: #9f2222;
  background: #fff1f1;
}



.resource-cell {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 620px;
  overflow-x: auto;
  padding: 2px 0;
}

.resource-meter {
  display: grid;
  grid-template-rows: auto auto 6px auto;
  gap: 4px;
  flex: 0 0 92px;
  min-width: 92px;
  min-height: 66px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.resource-meter span,
.resource-meter em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meter strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meter i {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}

.resource-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.resource-meter.ok b { background: #68e0a6; }
.resource-meter.warn b { background: #ffc457; }
.resource-meter.critical b { background: #ff6b6b; }

.resource-meter.ok { border-color: rgba(104,224,166,.42); background: rgba(104,224,166,.07); }
.resource-meter.warn { border-color: rgba(255,196,87,.58); background: rgba(255,196,87,.08); }
.resource-meter.critical { border-color: rgba(255,107,107,.62); background: rgba(255,107,107,.09); }

html[data-theme="light"] .resource-meter {
  background: #ffffff;
}

html[data-theme="light"] .resource-meter.ok { background: #ecfff4; }
html[data-theme="light"] .resource-meter.warn { background: #fff8e7; }
html[data-theme="light"] .resource-meter.critical { background: #fff1f1; }

html[data-theme="light"] .resource-meter i {
  background: #e9eef5;
}

@media (max-width: 760px) {
  .resource-cell {
    min-width: 560px;
  }

  .resource-meter {
    flex-basis: 84px;
    min-width: 84px;
  }
}


.settings-sections {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.settings-section {
  display: grid;
  grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.settings-section h3 {
  margin-bottom: 6px;
}

.settings-section p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.settings-form.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.endpoint-list code {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 12px;
}

html[data-theme="light"] .endpoint-list code {
  background: #ffffff;
}

@media (max-width: 900px) {
  .settings-section {
    grid-template-columns: 1fr;
  }

  .settings-form.compact {
    grid-template-columns: 1fr;
  }
}


/* Admin publicidad */
.ad-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.ad-settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.ad-settings-form .wide {
  grid-column: 1 / -1;
}


.ad-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ad-form-actions .button {
  min-width: 160px;
}

.ad-preview-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.ad-preview-box .landing-ad.preview {
  width: 100%;
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.ad-preview-box p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.promo-section {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.promo-section h3 {
  margin-bottom: 6px;
}

.promo-section p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.promo-channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.promo-channel {
  display: grid;
  gap: 6px;
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.promo-channel strong,
.promo-channel span,
.promo-channel p {
  margin: 0;
}

.promo-channel strong {
  color: var(--text);
}

.promo-channel span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.promo-channel p {
  color: var(--muted);
  font-size: 13px;
}

html[data-theme="light"] .ad-preview-box,
html[data-theme="light"] .promo-channel {
  background: #ffffff;
}

@media (max-width: 1080px) {
  .promo-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ad-admin-grid,
  .ad-settings-form,
  .promo-channel-grid {
    grid-template-columns: 1fr;
  }
}


/* Marca configurable */
.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.brand-preview {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.brand-preview img {
  max-width: 160px;
  max-height: 54px;
  object-fit: contain;
}

.brand-preview.small img {
  width: 32px;
  height: 32px;
}

.brand-preview span:not(.brand-mark) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.brand-form input[type="file"] {
  min-height: 44px;
  padding: 9px 10px;
}

/* Simulacion de anuncio */
.ad-mock {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(75,211,255,0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(75,211,255,0.12), rgba(104,224,166,0.08));
}

.ad-mock-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-mock h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.ad-mock p {
  margin: 0;
  color: var(--muted);
}

.ad-mock .button {
  width: max-content;
}

html[data-theme="light"] .brand-preview,
html[data-theme="light"] .ad-mock {
  background: #ffffff;
}


/* Workspace web de proyectos */
.workspace-shell {
  padding: 0;
  overflow: hidden;
  background: #080d13;
}

.workspace-form {
  display: grid;
  min-height: 720px;
}

.workspace-source {
  display: none;
}

.workspace-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #0c1218;
}

.workspace-top h2 {
  font-size: 30px;
}

.workspace-top p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

.workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.web-ide {
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) minmax(340px, 0.8fr);
  min-height: 640px;
}

.file-rail {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #090f15;
}

.rail-title,
.rail-note {
  display: grid;
  gap: 2px;
  padding: 10px;
}

.rail-title span,
.rail-note span {
  color: var(--muted);
  font-size: 12px;
}

.file-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.file-item span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.file-item strong {
  font-size: 14px;
}

.file-item:hover,
.file-item.is-active {
  border-color: rgba(75,211,255,0.28);
  background: rgba(75,211,255,0.08);
}

.rail-note {
  margin-top: 10px;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.editor-stage {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
  background: #05080c;
}

.editor-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #0b1118;
}

.workspace-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.workspace-tab.is-active {
  background: #05080c;
  color: var(--text);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #070b10;
}

.editor-toolbar span {
  color: #dce7f2;
  font-size: 13px;
  font-weight: 900;
}

.workspace-code {
  min-height: 100%;
  max-height: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #05080c;
  font-size: 14px;
  line-height: 1.55;
}

.workspace-code:focus {
  box-shadow: none;
}

.preview-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #dce3ec;
}

.preview-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 1px solid #cbd5df;
  background: #f8fafc;
  color: #111821;
}

.preview-pane-head strong,
.preview-pane-head span {
  display: block;
}

.preview-pane-head span {
  color: #5d6a78;
  font-size: 12px;
  font-weight: 800;
}

.preview-pane iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: white;
}

html[data-theme="light"] .workspace-shell,
html[data-theme="light"] .workspace-top,
html[data-theme="light"] .file-rail,
html[data-theme="light"] .editor-stage,
html[data-theme="light"] .editor-tabs,
html[data-theme="light"] .editor-toolbar {
  background: #ffffff;
}

html[data-theme="light"] .workspace-code {
  background: #f8fafc;
  color: #111821;
}

html[data-theme="light"] .workspace-tab.is-active {
  background: #f8fafc;
}

html[data-theme="light"] .file-item:hover,
html[data-theme="light"] .file-item.is-active {
  background: #eef8ff;
}

@media (max-width: 1180px) {
  .web-ide {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .preview-pane {
    grid-column: 1 / -1;
    min-height: 420px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .workspace-top {
    align-items: stretch;
    flex-direction: column;
  }
  .workspace-actions,
  .workspace-actions .button {
    width: 100%;
  }
  .web-ide {
    grid-template-columns: 1fr;
  }
  .file-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-title,
  .rail-note {
    grid-column: 1 / -1;
  }
  .editor-stage {
    min-height: 520px;
  }
}


.file-tree {
  display: grid;
  gap: 4px;
}

.folder-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,0.025);
}

.folder-item span {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.folder-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item {
  padding-left: calc(10px + (var(--depth, 0) * 12px));
}

.file-item em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.clear-code-button.danger {
  border-color: rgba(234,84,85,.4);
  background: rgba(234,84,85,.09);
  color: #ffb4b4;
}

html[data-theme="light"] .folder-item {
  background: #f3f7fb;
}

html[data-theme="light"] .clear-code-button.danger {
  background: #fff1f1;
  color: #9f2222;
}

@media (max-width: 760px) {
  .editor-toolbar,
  .editor-tool-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .editor-tool-actions .clear-code-button {
    width: 100%;
  }
}


/* Explorador estilo Windows */
.file-rail {
  gap: 10px;
  padding: 10px;
  background: #0b1118;
}

.file-tree {
  display: grid;
  gap: 1px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #071016;
}

.explorer-header {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(90px, .7fr);
  gap: 8px;
  min-height: 28px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.explorer-node {
  display: grid;
  gap: 1px;
}

.explorer-row {
  display: grid;
  grid-template-columns: 16px 22px minmax(80px, 1fr) minmax(70px, .65fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  padding: 3px 8px 3px calc(8px + (var(--depth, 0) * 16px));
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: default;
}

.explorer-row:hover {
  border-color: rgba(75,211,255,0.22);
  background: rgba(75,211,255,0.06);
}

.explorer-row.is-active {
  border-color: rgba(75,211,255,0.5);
  background: rgba(75,211,255,0.18);
}

.tree-twist {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.win-icon {
  position: relative;
  display: inline-grid;
  width: 20px;
  height: 18px;
  place-items: center;
  flex: 0 0 auto;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 3px;
  width: 8px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #f2c94c;
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 6px;
  bottom: 2px;
  border: 1px solid rgba(130, 87, 0, .35);
  border-radius: 2px;
  background: linear-gradient(#ffd96a, #e8b937);
}

.file-icon {
  width: 18px;
  height: 20px;
  border: 1px solid rgba(75,211,255,0.45);
  border-radius: 2px;
  background: #eef8ff;
  color: #075168;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
}

.win-name,
.win-ext {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-name {
  font-size: 13px;
  font-weight: 700;
}

.win-ext {
  color: var(--muted);
  font-size: 11px;
}

.folder-row .win-ext {
  display: none;
}

.editor-tool-actions .clear-code-button {
  min-height: 28px;
}

html[data-theme="light"] .file-rail,
html[data-theme="light"] .file-tree {
  background: #ffffff;
}

html[data-theme="light"] .explorer-row.is-active {
  border-color: #99c8ff;
  background: #dbeeff;
}

html[data-theme="light"] .explorer-row:hover {
  background: #eef6ff;
}

@media (max-width: 760px) {
  .explorer-header,
  .explorer-row {
    grid-template-columns: 16px 22px minmax(0, 1fr);
  }
  .win-ext,
  .explorer-header span:nth-child(2) {
    display: none;
  }
}


.explorer-rename-input {
  width: 100%;
  min-height: 22px;
  border: 1px solid #4a90e2;
  border-radius: 2px;
  padding: 1px 4px;
  background: #ffffff;
  color: #111821;
  font: inherit;
  outline: none;
}


/* Windows Explorer skin v2 */
.workspace-shell {
  background: #f3f3f3;
}

.workspace-top {
  align-items: center;
  border-bottom: 1px solid #d8d8d8;
  background: #f7f7f7;
  color: #1f1f1f;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

.workspace-top h2,
.workspace-top p:not(.eyebrow) {
  color: #1f1f1f;
}

.win-commandbar {
  align-items: center;
  padding: 4px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.win-commandbar .button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: #202020;
  font-size: 13px;
  font-weight: 600;
}

.win-commandbar .button:hover {
  border-color: #d8d8d8;
  background: #f2f6fb;
}

.win-commandbar .button.primary {
  border-color: #0067c0;
  background: #0067c0;
  color: white;
}

.web-ide {
  grid-template-columns: minmax(560px, .95fr) minmax(360px, .78fr) minmax(320px, .62fr);
  background: #ffffff;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

.windows-explorer.file-rail {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border-right: 1px solid #d8d8d8;
  background: #ffffff;
}

.win-left-pane {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 8px;
  border-right: 1px solid #e5e5e5;
  background: #f6f6f6;
  color: #1f1f1f;
}

.win-nav-title {
  padding: 8px 10px 6px;
  color: #5f5f5f;
  font-size: 12px;
  font-weight: 600;
}

.win-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #202020;
  font-size: 13px;
  text-align: left;
}

.win-nav-item.is-active,
.win-nav-item:hover {
  background: #e9f3ff;
}

.win-nav-icon {
  width: 18px;
  color: #0067c0;
  text-align: center;
}

.win-file-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  background: #ffffff;
}

.win-addressbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 8px;
  padding: 0 12px;
  border: 1px solid #d8d8d8;
  border-radius: 7px;
  background: #ffffff;
  color: #202020;
  font-size: 13px;
}

.win-addressbar b {
  color: #777;
  font-weight: 400;
}

.file-tree {
  gap: 0;
  margin: 0 8px 8px;
  padding: 0;
  overflow: auto;
  border: 1px solid #ededed;
  border-radius: 0;
  background: #ffffff;
}

.explorer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) 150px 145px 80px;
  min-height: 30px;
  padding: 0;
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
  color: #555;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
}

.explorer-header span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid #eeeeee;
}

.explorer-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) 150px 145px 80px;
  gap: 0;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  color: #202020;
  font-size: 13px;
}

.explorer-row:hover {
  border-color: transparent;
  background: #f5f9ff;
}

.explorer-row.is-selected {
  border-color: #99d1ff;
  background: #cfe8ff;
}

.name-cell,
.date-cell,
.type-cell,
.size-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
}

.name-cell {
  gap: 7px;
  padding-left: calc(8px + (var(--depth, 0) * 16px));
}

.date-cell,
.type-cell,
.size-cell {
  color: #555;
  font-size: 12px;
}

.size-cell {
  justify-content: flex-end;
}

.tree-twist {
  width: 12px;
  color: #707070;
  font-size: 10px;
}

.win-name {
  color: #202020;
  font-weight: 400;
}

.win-ext {
  display: none;
}

.editor-stage {
  border-left: 1px solid #d8d8d8;
  background: #fbfbfb;
}

.editor-tabs,
.editor-toolbar {
  border-color: #d8d8d8;
  background: #f7f7f7;
  color: #202020;
}

.workspace-tab {
  border-right-color: #d8d8d8;
  color: #555;
}

.workspace-tab.is-active {
  background: #ffffff;
  color: #202020;
}

.editor-toolbar span {
  color: #202020;
}

.workspace-code {
  background: #ffffff;
  color: #111821;
}

@media (max-width: 1180px) {
  .web-ide {
    grid-template-columns: 1fr;
  }
  .windows-explorer.file-rail {
    min-height: 520px;
    border-right: 0;
    border-bottom: 1px solid #d8d8d8;
  }
}

@media (max-width: 760px) {
  .windows-explorer.file-rail {
    grid-template-columns: 1fr;
  }
  .win-left-pane {
    display: none;
  }
  .explorer-header,
  .explorer-row {
    grid-template-columns: minmax(0, 1fr) 88px;
  }
  .date-cell,
  .type-cell,
  .explorer-header span:nth-child(2),
  .explorer-header span:nth-child(3) {
    display: none;
  }
}


/* Workspace context menu and wider two-pane layout */
.project-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.web-ide {
  grid-template-columns: minmax(620px, 1.1fr) minmax(460px, .9fr);
  min-height: 720px;
}

.windows-explorer.file-rail {
  min-width: 0;
}

.win-file-pane {
  position: relative;
}

.explorer-context-menu {
  position: fixed;
  z-index: 50;
  min-width: 190px;
  padding: 4px;
  border: 1px solid #c8c8c8;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  color: #202020;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}

.explorer-context-menu[hidden] {
  display: none;
}

.explorer-context-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 0 28px 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #202020;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.explorer-context-menu button:hover {
  background: #e9f3ff;
}

.explorer-context-menu button.danger:hover {
  background: #fdecec;
  color: #a40000;
}

.explorer-context-menu span {
  display: block;
  height: 1px;
  margin: 4px 6px;
  background: #e5e5e5;
}

@media (max-width: 1180px) {
  .web-ide {
    grid-template-columns: 1fr;
  }
}


/* Functional quick access panel */
.win-nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.win-collapse-button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #202020;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.win-collapse-button:hover {
  border-color: #d8d8d8;
  background: #ffffff;
}

.windows-explorer.is-nav-collapsed {
  grid-template-columns: 46px minmax(0, 1fr);
}

.windows-explorer.is-nav-collapsed .win-left-pane {
  padding: 8px 5px;
}

.windows-explorer.is-nav-collapsed .win-nav-title {
  justify-content: center;
  padding: 4px 0 8px;
}

.windows-explorer.is-nav-collapsed .win-nav-title span,
.windows-explorer.is-nav-collapsed .win-nav-label {
  display: none;
}

.windows-explorer.is-nav-collapsed .win-nav-item {
  justify-content: center;
  min-height: 34px;
  padding: 0;
}

.windows-explorer.is-nav-collapsed .win-nav-icon {
  width: 100%;
}

@media (max-width: 760px) {
  .windows-explorer.is-nav-collapsed {
    grid-template-columns: 1fr;
  }
}


/* Global app side menu collapse */
.side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.side-collapse-button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.side-collapse-button:hover {
  background: rgba(75,211,255,0.09);
}

.side-icon {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cyan);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-layout.is-side-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.app-layout.is-side-collapsed .side-menu {
  padding-right: 8px;
}

.app-layout.is-side-collapsed .side-head {
  justify-content: center;
  padding: 0 0 12px;
}

.app-layout.is-side-collapsed .side-head > div {
  display: none;
}

.app-layout.is-side-collapsed .side-collapse-button {
  width: 38px;
  height: 38px;
}

.app-layout.is-side-collapsed .side-menu nav {
  justify-items: center;
}

.app-layout.is-side-collapsed .side-menu a {
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 4px;
}

.app-layout.is-side-collapsed .side-menu a strong,
.app-layout.is-side-collapsed .side-menu a span {
  display: none;
}

.app-layout.is-side-collapsed .side-icon {
  display: grid;
}

.app-layout.is-side-collapsed .workspace {
  padding-left: 18px;
}

@media (max-width: 1100px) {
  .side-collapse-button {
    display: none;
  }
  .app-layout.is-side-collapsed {
    grid-template-columns: 1fr;
  }
  .app-layout.is-side-collapsed .side-head > div,
  .app-layout.is-side-collapsed .side-menu a strong,
  .app-layout.is-side-collapsed .side-menu a span {
    display: block;
  }
  .app-layout.is-side-collapsed .side-icon {
    display: none;
  }
  .app-layout.is-side-collapsed .side-menu a {
    width: auto;
    height: auto;
    place-items: stretch;
    padding: 11px 10px;
  }
}


/* Resizable two-panel workspace */
.web-ide {
  --explorer-width: min(58vw, 760px);
  grid-template-columns: minmax(320px, var(--explorer-width)) 6px minmax(360px, 1fr);
}

.workspace-resizer {
  width: 6px;
  min-width: 6px;
  background: #e5e5e5;
  cursor: col-resize;
  touch-action: none;
}

.workspace-resizer:hover,
body.is-resizing-workspace .workspace-resizer {
  background: #0078d4;
}

body.is-resizing-workspace {
  cursor: col-resize;
  user-select: none;
}

.windows-explorer.file-rail {
  min-width: 0;
  overflow: hidden;
}

.file-tree {
  overflow: auto;
  scrollbar-width: thin;
}

.file-tree::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.file-tree::-webkit-scrollbar-thumb {
  background: #c7c7c7;
  border-radius: 8px;
}

.explorer-header,
.explorer-row {
  min-width: 620px;
}

.web-ide.is-explorer-collapsed {
  grid-template-columns: 54px 6px minmax(360px, 1fr);
}

.web-ide.is-explorer-collapsed .windows-explorer.file-rail {
  grid-template-columns: 54px;
}

.web-ide.is-explorer-collapsed .win-file-pane {
  display: none;
}

.web-ide.is-explorer-collapsed .workspace-resizer {
  cursor: default;
}

.web-ide.is-explorer-collapsed .win-left-pane {
  padding: 8px 5px;
}

.web-ide.is-explorer-collapsed .win-nav-title {
  justify-content: center;
  padding: 4px 0 8px;
}

.web-ide.is-explorer-collapsed .win-nav-title span,
.web-ide.is-explorer-collapsed .win-nav-label {
  display: none;
}

.web-ide.is-explorer-collapsed .win-nav-item {
  justify-content: center;
  min-height: 34px;
  padding: 0;
}

.web-ide.is-explorer-collapsed .win-nav-icon {
  width: 100%;
}

@media (max-width: 1180px) {
  .web-ide {
    grid-template-columns: 1fr;
  }
  .workspace-resizer {
    display: none;
  }
  .web-ide.is-explorer-collapsed {
    grid-template-columns: 1fr;
  }
  .web-ide.is-explorer-collapsed .windows-explorer.file-rail {
    grid-template-columns: 1fr;
  }
  .web-ide.is-explorer-collapsed .win-file-pane {
    display: grid;
  }
}


.project-row-actions {
  align-items: center;
}

.project-edit-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 6px;
  min-width: min(520px, 100%);
}

.project-edit-form input {
  min-height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,0.045);
  color: var(--text);
  padding: 0 9px;
}

html[data-theme="light"] .project-edit-form input {
  background: #ffffff;
}


/* User app redesign: Workspace as primary navigation */
.app-layout-full {
  grid-template-columns: minmax(0, 1fr);
  width: min(1680px, calc(100vw - 28px));
}

.app-layout-full .workspace {
  padding-left: 0;
}

.app-layout-full .workspace-shell {
  min-height: calc(100vh - 96px);
}

.app-layout-full .web-ide {
  min-height: calc(100vh - 230px);
}

.app-layout-full .win-left-pane {
  overflow-y: auto;
}

.app-layout-full .win-nav-item {
  min-height: 34px;
}

@media (max-width: 1100px) {
  .app-layout-full {
    width: min(100%, calc(100vw - 20px));
  }
}


/* Full-width user workspace and profile menu */
.appbar-user {
  padding: 10px 8px;
}

.appbar-user .brand {
  margin-left: 0;
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.045);
  cursor: pointer;
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--cyan);
  color: #061018;
  font-size: 10px;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1218;
  box-shadow: 0 18px 42px rgba(0,0,0,.32);
}

.profile-popover a,
.profile-popover button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.profile-popover a:hover,
.profile-popover button:hover {
  background: rgba(75,211,255,0.1);
}

html[data-theme="light"] .profile-popover {
  background: #ffffff;
}

.app-layout-full {
  width: calc(100vw - 8px);
}

.app-layout-full .workspace {
  width: 100%;
  padding: 6px 0 24px;
}

.app-layout-full .workspace-shell {
  border-radius: 0;
}

.editor-stage.is-module-mode {
  grid-template-rows: 1fr;
}

.editor-stage.is-module-mode .editor-tabs,
.editor-stage.is-module-mode .editor-toolbar,
.editor-stage.is-module-mode .workspace-code {
  display: none;
}

.workspace-module {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: #ffffff;
  color: #111821;
}

.workspace-module[hidden] {
  display: none;
}

.workspace-module > .panel-block,
.workspace-module > .workspace-hero,
.workspace-module > .metric-grid {
  display: block;
  width: 100%;
  margin: 0;
  border-color: #d8d8d8;
  background: #ffffff;
  color: #111821;
}

.workspace-module > .metric-grid {
  display: grid;
}

.workspace-module .panel-table {
  color: #111821;
}

.workspace-module .panel-block p,
.workspace-module .workspace-hero p {
  color: #5d6a78;
}

.workspace-module .button.secondary,
.workspace-module .project-edit-form input,
.workspace-module input,
.workspace-module select {
  background: #ffffff;
  color: #111821;
}

@media (max-width: 760px) {
  .appbar-user {
    padding: 8px;
  }
  .app-layout-full {
    width: calc(100vw - 4px);
  }
}


/* Workspace module mode hides file detail and uses right pane only */
.web-ide.is-module-mode {
  grid-template-columns: 178px minmax(0, 1fr);
}

.web-ide.is-module-mode .win-file-pane,
.web-ide.is-module-mode .workspace-resizer {
  display: none;
}

.web-ide.is-module-mode .windows-explorer.file-rail {
  grid-template-columns: 178px;
}

.web-ide.is-module-mode .editor-stage {
  grid-column: 2;
  border-left: 1px solid #d8d8d8;
}


.workspace-save-form {
  display: none;
}

.editor-stage.is-module-mode .workspace-module {
  display: block;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 260px);
  position: relative;
  z-index: 2;
}

.web-ide.is-module-mode .editor-stage {
  min-width: 0;
  min-height: calc(100vh - 260px);
  background: #ffffff;
}

.app-layout-full .workspace > section:not(#workspace),
.app-layout-full .workspace > .metric-grid,
.app-layout-full .workspace > .panel-ad {
  display: none !important;
}

/* Perfil usuario, tema y plan */
.profile-popover {
  min-width: 220px;
  gap: 4px;
}

.profile-avatar {
  position: relative;
  background: linear-gradient(180deg, #7ee7ff, #68e0a6);
  font-size: 0;
}

.profile-avatar::before,
.profile-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #061018;
}

.profile-avatar::before {
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.profile-avatar::after {
  bottom: 6px;
  width: 15px;
  height: 9px;
  border-radius: 999px 999px 7px 7px;
}

.profile-group {
  display: grid;
  gap: 6px;
  padding: 6px 6px 8px;
  border-bottom: 1px solid var(--line);
}

.profile-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile-popover .theme-choice-grid button {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  text-align: center;
}

.profile-popover button.is-active {
  border-color: rgba(75,211,255,0.55);
  background: rgba(75,211,255,0.14);
  color: var(--cyan);
}

.plan-dialog {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  overflow: hidden;
  border-radius: 8px;
  background: #eef3f8;
  color: #121923;
  box-shadow: 0 28px 80px rgba(0,0,0,0.34);
}

.plan-modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.current-plan-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 14px;
  align-items: stretch;
}

.current-plan-summary,
.plan-option,
.upgrade-note {
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #ffffff;
}

.current-plan-summary {
  padding: 18px;
}

.current-plan-summary h2,
.current-plan-summary p,
.plan-option h3,
.plan-option p,
.plan-option ul,
.upgrade-note {
  margin: 0;
}

.current-plan-summary p,
.plan-option p,
.plan-option ul,
.upgrade-note {
  color: #5d6a78;
}

.plan-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-option {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
}

.plan-option.is-current {
  border-color: rgba(0,122,112,0.32);
  background: #f2fbf8;
}

.plan-option strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.plan-option ul {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.plan-option .button:disabled {
  cursor: default;
  opacity: 0.72;
}

.upgrade-note {
  padding: 12px 14px;
  font-weight: 800;
}

.workspace-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 74px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(75,211,255,0.18), rgba(104,224,166,0.16));
  color: var(--text);
  text-align: center;
}

.workspace-ad span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(75,211,255,0.38);
  border-radius: 6px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.workspace-ad a {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.ad-format-showcase {
  display: grid;
  gap: 16px;
  align-items: start;
  justify-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ad-format-preview {
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(75,211,255,0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, #082334, #0f4f4a);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.ad-format-preview div {
  min-width: 0;
}

.ad-format-preview strong,
.ad-format-preview p {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
}

.ad-format-preview strong {
  font-size: 16px;
  line-height: 1.1;
}

.ad-format-preview p {
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  line-height: 1.25;
}

.ad-format-preview a {
  justify-self: end;
  min-width: max-content;
  padding: 7px 9px;
  border-radius: 6px;
  background: #68e0a6;
  color: #061018;
  font-size: 12px;
  font-weight: 900;
}

.ad-format-size {
  position: absolute;
  top: 6px;
  left: 8px;
  color: rgba(255,255,255,0.72);
  font-size: 10px;
  font-weight: 900;
}

.ad-format-preview.leaderboard {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: min(728px, 100%);
  min-height: 90px;
  padding: 24px 14px 12px;
}

.ad-format-preview.rectangle {
  width: 300px;
  min-height: 250px;
  align-content: end;
  gap: 12px;
  padding: 34px 18px 18px;
}

.ad-format-preview.rectangle a,
.ad-format-preview.skyscraper a {
  justify-self: start;
}

.ad-format-preview.mobile {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 320px;
  min-height: 50px;
  padding: 16px 8px 7px;
}

.ad-format-preview.mobile p,
.ad-format-preview.mobile .ad-format-size {
  display: none;
}

.ad-format-preview.skyscraper {
  width: 160px;
  min-height: 600px;
  align-content: end;
  gap: 12px;
  padding: 34px 12px 18px;
}

.ad-format-preview.skyscraper strong {
  font-size: 18px;
}

.workspace-module > .metric-grid div {
  background: #ffffff;
  color: #111821;
  border-color: #d8d8d8;
}

.workspace-module > .metric-grid strong {
  color: #111821;
}

.workspace-module > .metric-grid span {
  color: #5d6a78;
}

html[data-theme="light"] .workspace-ad {
  background: linear-gradient(90deg, #e8f7ff, #ebfff5);
}

html[data-theme="light"] .profile-popover .theme-choice-grid button {
  background: #f8fafc;
  color: #111821;
}

html[data-theme="light"] .profile-popover button.is-active {
  background: #e7f7f4;
  color: #006c63;
}

@media (max-width: 900px) {
  .current-plan-summary,
  .plan-options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workspace-ad {
    align-items: stretch;
    flex-direction: column;
  }
  .ad-format-preview.leaderboard,
  .ad-format-preview.rectangle,
  .ad-format-preview.mobile,
  .ad-format-preview.skyscraper {
    width: min(100%, 320px);
    min-height: 120px;
  }
  .ad-format-preview.skyscraper {
    min-height: 360px;
  }
}

/* Ajuste final perfil y panel izquierdo del Workspace */
.theme-choice-grid {
  grid-template-columns: repeat(2, 38px);
  justify-content: start;
}

.profile-popover .theme-icon-button {
  display: grid;
  width: 38px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
  text-align: center;
}

.theme-symbol {
  display: block;
  color: inherit;
  font-size: 18px;
  line-height: 1;
}

html[data-theme="light"] .profile-popover .theme-icon-button {
  background: #f8fafc;
  color: #111821;
}

.profile-popover .theme-icon-button.is-active,
html[data-theme="light"] .profile-popover .theme-icon-button.is-active {
  border-color: rgba(0,122,112,0.38);
  background: #e7f7f4;
  color: #006c63;
}

.app-layout-full .windows-explorer.file-rail {
  --quick-rail-width: 178px;
  align-self: stretch;
  background: linear-gradient(90deg, #f6f6f6 0 var(--quick-rail-width), #ffffff var(--quick-rail-width) 100%);
}

.app-layout-full .win-left-pane {
  align-self: stretch;
  min-height: 100%;
  height: 100%;
  background: #f6f6f6;
}

.app-layout-full .web-ide.is-explorer-collapsed {
  grid-template-columns: 54px minmax(0, 1fr);
}

.app-layout-full .web-ide.is-explorer-collapsed .workspace-resizer {
  display: none;
}

.app-layout-full .web-ide.is-explorer-collapsed .windows-explorer.file-rail {
  --quick-rail-width: 54px;
  grid-template-columns: 54px;
  background: #f6f6f6;
}

.app-layout-full .web-ide.is-explorer-collapsed .editor-stage {
  grid-column: 2;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-left-pane {
  padding: 8px 0;
  border-right: 1px solid #d8d8d8;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-nav-title {
  justify-content: flex-start;
  padding: 4px 0 8px 10px;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-collapse-button {
  width: 34px;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-nav-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 0 0 0 12px;
  border-radius: 0;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-nav-icon {
  width: 24px;
  min-width: 24px;
  text-align: left;
}

.app-layout-full .web-ide.is-explorer-collapsed .win-nav-title span,
.app-layout-full .web-ide.is-explorer-collapsed .win-nav-label {
  display: none;
}

.web-ide.is-module-mode.is-explorer-collapsed {
  grid-template-columns: 54px minmax(0, 1fr);
}

.web-ide.is-module-mode.is-explorer-collapsed .windows-explorer.file-rail {
  grid-template-columns: 54px;
}

.web-ide.is-module-mode.is-explorer-collapsed .editor-stage {
  grid-column: 2;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .app-layout-full .web-ide.is-explorer-collapsed {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .app-layout-full .web-ide.is-explorer-collapsed .windows-explorer.file-rail {
    min-height: auto;
    border-bottom: 0;
    border-right: 1px solid #d8d8d8;
  }
  .app-layout-full .web-ide.is-explorer-collapsed .win-file-pane {
    display: none;
  }
}

/* Vista compacta de archivos estilo IDE */
.win-file-pane {
  grid-template-rows: 1fr;
}

.win-addressbar,
.explorer-header,
.date-cell,
.type-cell,
.size-cell {
  display: none !important;
}

.file-tree {
  margin: 0;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.explorer-header,
.explorer-row {
  min-width: 0;
}

.explorer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.name-cell {
  gap: 5px;
  min-height: 24px;
  padding: 0 8px 0 calc(8px + (var(--depth, 0) * 18px));
}

.tree-twist {
  display: inline-grid;
  width: 14px;
  min-width: 14px;
  place-items: center;
  color: #5f6b7a;
  font-size: 11px;
}

.win-icon.folder-icon {
  width: 16px;
  min-width: 16px;
}

.file-icon {
  width: 16px;
  height: 18px;
  min-width: 16px;
  font-size: 6px;
}

.win-name {
  font-size: 13px;
  line-height: 24px;
}

.explorer-row:hover {
  background: #eef6ff;
}

.explorer-row.is-selected {
  background: #dbeeff;
}

.explorer-node.is-closed > .explorer-node,
.explorer-node.is-closed > .explorer-row + .explorer-row {
  display: none;
}

html[data-theme="light"] .file-tree {
  background: #ffffff;
}

@media (max-width: 760px) {
  .explorer-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Archivos: filas pegadas sin separacion vertical */
.file-tree {
  padding-top: 0;
  padding-bottom: 0;
}

.explorer-node {
  display: block;
  gap: 0;
  margin: 0;
  padding: 0;
}

.explorer-row {
  min-height: 21px;
  height: 21px;
  margin: 0;
}

.name-cell {
  min-height: 21px;
}

.win-name {
  line-height: 21px;
}

.tree-twist {
  height: 21px;
}

.file-icon {
  height: 16px;
}

/* Correccion fuerte: arbol sin gaps entre archivos */
.file-tree {
  display: block !important;
  gap: 0 !important;
  padding: 0 !important;
}

.explorer-node {
  display: block !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.explorer-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: center !important;
  min-height: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 20px !important;
}

.name-cell {
  min-height: 20px !important;
  height: 20px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.win-name,
.tree-twist {
  line-height: 20px !important;
}

/* Estado de cambios sin guardar en Workspace */
.workspace-actions .button.primary:not(.has-unsaved-changes) {
  border-color: #cfd8e3;
  background: #eef3f8;
  color: #5d6a78;
  box-shadow: none;
}

.workspace-actions .button.primary.has-unsaved-changes {
  border-color: rgba(0,122,112,0.45);
  background: #68e0a6;
  color: #061018;
  box-shadow: 0 0 0 3px rgba(104,224,166,0.18);
}

.workspace-tab {
  gap: 6px;
}

.workspace-tab b {
  color: #d97706;
  font-size: 15px;
  line-height: 1;
}

.workspace-tab.is-dirty span::after {
  content: "";
}

html[data-theme="light"] .workspace-actions .button.primary:not(.has-unsaved-changes) {
  background: #eef3f8;
  color: #5d6a78;
}

.workspace-actions .button.primary.is-saving {
  border-color: rgba(217,119,6,0.55);
  background: #facc15;
  color: #241a00;
  box-shadow: 0 0 0 3px rgba(250,204,21,0.2);
}

.workspace-actions .button.primary.has-save-error {
  border-color: rgba(185,28,28,0.55);
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.18);
}

/* Barra del editor sin acciones duplicadas */
.editor-toolbar {
  min-height: 34px;
  padding: 5px 10px;
}

.editor-toolbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editor sin barra redundante de archivo activo */
.editor-stage {
  grid-template-rows: auto 1fr !important;
}

.editor-toolbar {
  display: none !important;
}
