/* Pomeboard - tema oscuro "tinta nocturna". Acentos: celeste (interfaz), menta/azafran/rosa (estados). */
:root {
  --bg: #0a0c12;
  --bar: #0d1018;
  --panel: #131724;
  --panel-2: #1a1f30;
  --line: #262c42;
  --line-soft: #1e2336;
  --text: #eef0f8;
  --text-2: #b6bcd2;
  --muted: #8189a6;
  --sky: #6cc3ff;
  --mint: #46d6a0;
  --saffron: #ffbe3d;
  --rose: #ff6b81;
  --lilac: #b8a1ff;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --r-panel: 22px;
  --r-inner: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login::before, .login::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(110px); opacity: .28; pointer-events: none; }
.login::before { background: #2fbf86; left: -160px; top: -160px; }
.login::after { background: #ffb020; right: -180px; bottom: -200px; opacity: .2; }
.login-card { position: relative; width: 100%; max-width: 380px; background: rgba(19, 23, 36, .86); border: 1px solid var(--line); border-radius: 26px; padding: 34px 30px 30px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(10px); }
.login-card h1 { font-size: 34px; margin-top: 14px; }
.login-card .lead { margin: 0 0 14px; color: var(--text-2); }
.login-card label { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.field { background: #0d1019; border: 1px solid var(--line); color: var(--text); padding: 12px 14px; border-radius: var(--r-inner); font: inherit; width: 100%; }
.field:focus-visible { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(108, 195, 255, .2); }
.err { color: var(--rose); min-height: 20px; font-size: 13px; }
.mark { display: inline-grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #1c2540, #121829); border: 1px solid var(--line); color: var(--sky); }
.mark.lg { width: 56px; height: 56px; border-radius: 17px; }
.mark.sm { width: 34px; height: 34px; }

/* ---------- barra superior ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; padding: 10px 28px; background: rgba(10, 12, 18, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--panel); }
.top-right { display: flex; align-items: center; gap: 14px; }

/* ---------- botones ---------- */
.btn { cursor: pointer; border-radius: 10px; padding: 9px 16px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; transition: border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: #3a4366; background: #1f2539; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--sky); border-color: var(--sky); color: #06121c; }
.btn.primary:hover:not(:disabled) { background: #8bd0ff; border-color: #8bd0ff; }
.btn.warn { background: rgba(255, 190, 61, .1); border-color: rgba(255, 190, 61, .45); color: var(--saffron); }
.btn.warn:hover:not(:disabled) { background: rgba(255, 190, 61, .18); border-color: var(--saffron); }
.btn.danger { background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .45); color: var(--rose); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 107, 129, .18); border-color: var(--rose); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; margin-top: 10px; padding: 12px; }

/* ---------- estructura ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 0 28px 48px; display: flex; flex-direction: column; gap: 56px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-head h2 { font-size: 26px; }
.sec-head p { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button { font-size: 13px; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- estado general ---------- */
.hero { padding-top: 44px; display: flex; flex-direction: column; gap: 26px; }
.hero-main { display: flex; align-items: flex-start; gap: 20px; }
.beacon { flex: none; position: relative; width: 18px; height: 18px; margin-top: 18px; border-radius: 50%; background: var(--muted); }
.beacon.ok { background: var(--mint); }
.beacon.warn { background: var(--saffron); }
.beacon.bad { background: var(--rose); }
.beacon.ok::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--mint); opacity: 0; animation: ping 3.2s ease-out 1; }
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -0.022em; font-weight: 700; }
.hero p { margin: 10px 0 0; color: var(--text-2); font-size: 17px; max-width: 62ch; }
.lights { display: flex; flex-wrap: wrap; gap: 10px; }
.light { display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px 8px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.light:hover { border-color: #3a4366; }
.light small { color: var(--muted); font-weight: 500; font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--mint); }
.dot.warn { background: var(--saffron); }
.dot.bad { background: var(--rose); }
#alerts { display: flex; flex-direction: column; gap: 8px; }
#alerts:empty { display: none; }
.alert { padding: 11px 16px; border-radius: var(--r-inner); border: 1px solid; font-size: 14px; }
.alert.warn { background: rgba(255, 190, 61, .08); border-color: rgba(255, 190, 61, .35); color: #ffd98a; }
.alert.bad { background: rgba(255, 107, 129, .08); border-color: rgba(255, 107, 129, .4); color: #ffb3bf; }

/* ---------- instrumentos del servidor ---------- */
.vitals { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.vital { background: var(--panel); padding: 18px 18px 16px; min-width: 0; }
.vital .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.vital .value { font-family: var(--display); font-size: 31px; font-weight: 650; letter-spacing: -0.02em; margin: 2px 0 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.vital .sub { color: var(--text-2); font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.vital .sub + .sub { color: var(--muted); }
.meter { height: 5px; background: #0b0e17; border-radius: 3px; overflow: hidden; margin: 0 0 9px; }
.meter > i { display: block; height: 100%; background: var(--sky); border-radius: 3px; transition: width .5s; }
.meter.warn > i { background: var(--saffron); }
.meter.bad > i { background: var(--rose); }

/* ---------- paneles de proyecto ---------- */
.projects { display: flex; flex-direction: column; gap: 22px; }
.proj { --accent: var(--sky); display: grid; grid-template-columns: 290px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.proj-media { position: relative; display: flex; justify-content: center; align-items: flex-start; padding: 36px 0;
  background: radial-gradient(120% 60% at 50% 100%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 72%), var(--panel-2);
  border-right: 1px solid var(--line); }
.phone { position: sticky; top: 92px; width: 224px; border: 6px solid #05070c; border-radius: 34px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #2a3048, 0 24px 44px rgba(0, 0, 0, .55); }
.phone img { display: block; width: 100%; height: auto; }
.phone.noimg { display: grid; place-items: center; color: var(--muted); background: var(--panel); font-size: 13px; padding: 10px; text-align: center; }
.proj-body { padding: 26px 28px 24px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.proj-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.proj-head h3 { font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; }
.proj-head .domain { color: var(--muted); font-size: 14px; }
.proj-head .domain:hover { color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 11px; border-radius: 999px; font-weight: 650; font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.chip.ok { color: var(--mint); background: rgba(70, 214, 160, .09); border-color: rgba(70, 214, 160, .35); }
.chip.warn { color: var(--saffron); background: rgba(255, 190, 61, .09); border-color: rgba(255, 190, 61, .35); }
.chip.bad { color: var(--rose); background: rgba(255, 107, 129, .09); border-color: rgba(255, 107, 129, .4); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { font-size: 13px; padding: 4px 11px; border-radius: 8px; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.fact.ok { color: var(--mint); }
.fact.warn { color: var(--saffron); }
.fact.bad { color: var(--rose); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 18px 22px; padding: 18px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stat b { display: block; font-family: var(--display); font-size: 29px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.vis-title { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vis-title h4 { font-size: 16px; }
.vis-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.paths h5 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.paths div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.paths div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.note { margin-top: 16px; padding: 14px 18px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r-inner); color: var(--text-2); font-size: 14px; }

/* ---------- SQL ---------- */
.sqlpanel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 26px 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px 26px; }
.sqlicon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(108, 195, 255, .1); border: 1px solid rgba(108, 195, 255, .3); color: var(--sky); }
.sqlicon.bad { background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .4); color: var(--rose); }
.sqlbody { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- graficos ---------- */
.chartgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.chartcell { background: var(--panel); padding: 20px 22px 16px; min-width: 0; }
.chartcell h3 { font-size: 17px; margin-bottom: 2px; }
.chartcell .muted { margin-bottom: 8px; display: block; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.chart .tip { position: absolute; pointer-events: none; background: #0c0f19; border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; font-size: 13px; white-space: nowrap; transform: translateX(-50%); top: 4px; z-index: 3; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; font-size: 14px; }

/* ---------- tablas ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 22px; min-width: 0; }
.panel h3 { font-size: 17px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 6px 10px 8px; }
td { padding: 9px 10px; border-top: 1px solid var(--line-soft); white-space: nowrap; }
td.wrap { white-space: normal; word-break: break-word; }
td.r, th.r { text-align: right; }
td .dot { margin-right: 8px; }

/* ---------- control ---------- */
.control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.actioncard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 8px; display: flex; flex-direction: column; }
.action { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 18px; border-radius: 16px; }
.action + .action { border-top: 1px solid var(--line-soft); border-radius: 0 0 16px 16px; }
.action h3 { font-size: 17px; }
.action p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 38ch; }
#action-status { padding: 0 10px 10px; }
#action-status:empty { display: none; }

/* ---------- modal y aviso ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4, 6, 12, .72); backdrop-filter: blur(3px); padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; width: 100%; max-width: 460px; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-card.wide { max-width: 880px; }
.modal-card h3 { font-size: 22px; }
.modal-card p { color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.logbox { background: #070910; border: 1px solid var(--line-soft); border-radius: var(--r-inner); padding: 12px; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; color: var(--text); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--sky); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #0c0f19; border: 1px solid var(--line); padding: 11px 18px; border-radius: 12px; z-index: 60; max-width: 90vw; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); }
footer { color: var(--muted); font-size: 13px; max-width: 80ch; }

/* ---------- pastillas de estado ---------- */
.pill { padding: 5px 13px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--mint); border-color: rgba(70, 214, 160, .35); background: rgba(70, 214, 160, .08); }
.pill.warn { color: var(--saffron); border-color: rgba(255, 190, 61, .4); background: rgba(255, 190, 61, .08); }
.pill.bad { color: var(--rose); border-color: rgba(255, 107, 129, .45); background: rgba(255, 107, 129, .08); }

/* ---------- adaptativo ---------- */
@media (max-width: 1100px) {
  .vitals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vis-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .top { padding: 10px 16px; }
  main { padding: 0 16px 40px; gap: 44px; }
  .hero { padding-top: 28px; }
  .proj { grid-template-columns: minmax(0, 1fr); }
  .proj-media { height: 250px; overflow: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 26px 0 0; }
  .phone { position: static; width: 190px; }
  .proj-body { padding: 20px 18px; }
  .chartgrid, .grid2, .control { grid-template-columns: minmax(0, 1fr); }
  .sqlpanel { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; }
  .action { flex-direction: column; align-items: stretch; }
  #updated { display: none; }
}
@media (max-width: 560px) {
  .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vital .value { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .beacon.ok::after { animation: none; }
}
