:root {
  --mint: #38bdf8;
  --ink: #071827;
  --panel: #0d2234;
  --line: rgba(56, 189, 248, 0.24);
  --muted: #8fb5c9;
  --gold: #22d3ee;
  color: #e9f7ff;
  background: #071827;
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 300;
}

body {
  background:
    radial-gradient(circle at 75% 6%, rgba(14, 165, 233, 0.22), transparent 31rem),
    radial-gradient(circle at 18% 90%, rgba(34, 211, 238, 0.14), transparent 36rem),
    linear-gradient(145deg, #071827, #06121f);
  color: #e9f7ff;
  font-weight: 300;
}

button {
  background: linear-gradient(110deg, #2563eb, #0ea5e9 52%, #22d3ee);
  color: #f7fdff;
  font-weight: 400;
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.16);
}

button:hover { filter: brightness(1.08); }
strong { font-weight: 400; }
h1, h2, h3 { font-weight: 250; }
.login-card h1 { font-weight: 250; }
.eyebrow { color: #67e8f9; font-weight: 400; }
label { color: #b8d6e5; font-weight: 300; }

.brand-mark,
.logo {
  background: linear-gradient(135deg, #2563eb, #38bdf8 58%, #2dd4bf);
  color: white;
  font-weight: 450;
  box-shadow: 0 10px 32px rgba(14, 165, 233, 0.24);
}

.login-card,
.card,
.panel,
.project-card,
dialog {
  background: linear-gradient(145deg, rgba(17, 45, 67, 0.9), rgba(8, 26, 42, 0.96));
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 1px 0 rgba(186, 230, 253, 0.06), 0 18px 48px rgba(1, 8, 18, 0.22);
}

.login-card { border-color: rgba(34, 211, 238, 0.28); }
aside { background: linear-gradient(180deg, #061522, #071b2b); border-color: rgba(56, 189, 248, 0.15); }
nav { gap: 0; border-top: 1px solid rgba(56, 189, 248, 0.13); }
nav::before { content: "NAVEGACIÓN"; padding: 1rem .45rem .55rem; color: #527d94; font-size: .68rem; font-weight: 400; letter-spacing: .14em; }
.nav { position: relative; color: #87b7cf; font-weight: 300; border-radius: 0; border-bottom: 1px solid rgba(56, 189, 248, 0.1); padding: .85rem .45rem .85rem 1.15rem; box-shadow: none; }
.nav.active,
.nav:hover { background: transparent; color: #d9f4ff; filter: none; }
.nav.active { background: transparent; color: #67e8f9; box-shadow: none; }
.nav.active::before { content: ""; position: absolute; left: .25rem; top: 50%; width: .32rem; height: .32rem; border-radius: 50%; background: #38bdf8; transform: translateY(-50%); box-shadow: 0 0 12px rgba(56, 189, 248, .75); }

input,
select,
textarea {
  background: rgba(4, 18, 31, 0.86);
  color: #eefaff;
  border-color: rgba(56, 189, 248, 0.28);
  font-weight: 300;
}

.ghost { background: transparent; color: #b9def0; border-color: rgba(56, 189, 248, 0.28); box-shadow: none; }
.connection.ok,
.card.positive strong { color: #67e8f9; }
.bar { background: linear-gradient(#38bdf8, #0ea5e9); }
.bar.actual { background: linear-gradient(#2dd4bf, #14b8a6); }
.table-wrap { border-color: rgba(56, 189, 248, 0.2); }
th { background: #071827; color: #8fc7df; font-weight: 400; }
th, td { border-bottom-color: rgba(56, 189, 248, 0.13); }
.tag { background: rgba(14, 165, 233, 0.12); color: #bae6fd; font-weight: 300; }
.tag.pending { background: rgba(56, 189, 248, 0.12); color: #bae6fd; }
.tag.cancelled,
.tag.ineffective { background: rgba(129, 140, 248, 0.13); color: #c7d2fe; }
.tag.effective,
.tag.confirmed { background: rgba(20, 184, 166, 0.17); color: #99f6e4; }
.concept-line { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.tag.compact { padding: .12rem .42rem; font-size: .68rem; line-height: 1.25; }
.running-balance { color: #bae6fd; font-weight: 350; }
.running-balance.combined { color: #5eead4; }
.danger { background: transparent; color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.24); box-shadow: none; font-weight: 300; }
.danger:hover { background: rgba(56, 189, 248, 0.1); color: #e0f7ff; }
.dialog-head h3 { font-weight: 300; }
.bulk-check { display: flex; align-items: flex-start; gap: .65rem; font-weight: 300; }
.bulk-check input { width: auto; margin-top: .2rem; }

@media (max-width: 980px) {
  nav { border-top: 0; border-left: 1px solid rgba(56, 189, 248, 0.13); }
  nav::before { display: none; }
  .nav { border-bottom: 0; border-right: 1px solid rgba(56, 189, 248, 0.1); padding: .65rem .85rem; }
  .nav.active::before { left: 50%; top: auto; bottom: .15rem; transform: translateX(-50%); }
}

.app-shell { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: auto;
  padding: .65rem clamp(1rem, 4vw, 4rem);
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  border-right: 0;
  border-bottom: 1px solid rgba(56, 189, 248, .16);
  background: rgba(5, 20, 33, .9);
  backdrop-filter: blur(18px);
}
.topbar-brand { display: flex; align-items: center; gap: .75rem; min-width: max-content; }
.topbar-brand strong { display: block; font-size: .9rem; font-weight: 400; }
.topbar-brand small { display: block; margin-top: .05rem; font-size: .72rem; font-weight: 300; }
.topbar nav { display: flex; gap: .35rem; margin: 0 0 0 auto; border: 0; }
.topbar nav::before { display: none; }
.topbar .nav {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: .8rem;
  background: transparent;
}
.topbar .nav svg,
.topbar-action svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.topbar .nav:hover { background: rgba(56, 189, 248, .08); border-color: rgba(56, 189, 248, .13); }
.topbar .nav.active { background: rgba(14, 165, 233, .13); border-color: rgba(56, 189, 248, .25); color: #67e8f9; }
.topbar .nav.active::before { display: none; }
.topbar-action { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; padding: 0; margin: 0; border-radius: .8rem; }
.app-shell main { padding: 2rem clamp(1rem, 4vw, 4rem); }

@media (max-width: 620px) {
  .topbar { gap: .55rem; padding: .55rem .75rem; }
  .topbar-brand > div:last-child { display: none; }
  .topbar nav { gap: .15rem; }
  .topbar .nav,
  .topbar-action { width: 2.45rem; height: 2.45rem; }
}

.brand-mark,
.logo {
  color: transparent;
  background-color: transparent;
  background-image: url("proyecto2027-logo-v2.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: none;
}
.brand-mark { width: 5rem; height: 4.6rem; margin-bottom: 1.4rem; }

tr[data-entry-id] { cursor: default; }
tr[data-entry-id]:hover td { background: rgba(56, 189, 248, .035); }
tr[data-entry-id]:focus { outline: 1px solid rgba(56, 189, 248, .35); outline-offset: -1px; }

.context-menu {
  position: fixed;
  z-index: 200;
  width: 12.5rem;
  padding: .38rem;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: .85rem;
  background: #071d2e;
  box-shadow: 0 18px 55px rgba(0, 5, 14, .48);
}
.context-menu button {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: #c9eaff;
  text-align: left;
  font-weight: 300;
  box-shadow: none;
}
.context-menu button:hover { background: rgba(56, 189, 248, .11); }
.context-menu .context-danger { color: #a5b4fc; }

.status-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: .7rem;
}
.status-summary > div {
  min-width: 0;
  padding: .55rem .75rem;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: .65rem;
  background: rgba(8, 32, 51, .72);
}
.status-summary small { display: block; color: #8fb5c9; font-size: .67rem; }
.status-summary strong { display: block; margin-top: .15rem; color: #e9f7ff; font-size: .9rem; }
.status-summary .positive strong { color: #5eead4; }
.status-summary .negative strong { color: #a5b4fc; }

.projection-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(2, minmax(10rem, 1fr)) auto;
  align-items: end;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: .9rem;
  background: rgba(8, 32, 51, .55);
}
.projection-filters label { display: grid; gap: .35rem; }
.projection-filters label span { color: #8fb5c9; font-size: .78rem; }
.projection-filters input,
.projection-filters select { min-height: 2.65rem; }
.projection-filters button { min-height: 2.65rem; white-space: nowrap; }
.table-tools > div { flex: 1; }
.table-tools > div input { width: 100%; }
.filter-count { display: block; margin-top: .35rem; color: #8fb5c9; font-size: .75rem; }

@media (max-width: 900px) {
  .status-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projection-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .projection-filters { grid-template-columns: 1fr; }
}

#editor {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(35rem, 100vw);
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid rgba(56, 189, 248, .28);
  border-radius: 1.25rem 0 0 1.25rem;
  background: #082033;
  box-shadow: -24px 0 70px rgba(0, 6, 16, .55);
}
#editor::backdrop { background: rgba(1, 8, 17, .62); backdrop-filter: blur(2px); }
#editor form { display: flex; flex-direction: column; height: 100%; background: #082033; }
#editor .dialog-head,
#editor .dialog-actions { flex: none; background: #0b2940; }
#editorFields {
  flex: 1;
  overflow: auto;
  padding: .25rem 1.35rem 1.5rem;
  background: #082033;
}

@media (max-width: 620px) {
  #editor { width: 100vw; border-radius: 0; }
}
