:root {
  color-scheme: light;
  --nc-blue: #0082c9;
  --nc-blue-hover: #006aa3;
  --nc-blue-dark: #005e91;
  --bg: #fff;
  --bg-app: #f6f6f6;
  --ink: #222;
  --muted: #6b6b6b;
  --rail: #f6f6f6;
  --rail-ink: #222;
  --accent: #0082c9;
  --accent-2: #1cafff;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --danger: #e9322d;
  --danger-bg: #fdecea;
  --card: #fff;
  --line: #ededed;
  --hover: #f5f5f5;
  --shadow: 0 1px 10px rgba(0, 0, 0, 0.08);
  --table-head: #fafafa;
  --input-bg: #fff;
  --input-border: #ddd;
  --badge-bg: #eef1f4;
  --badge-ink: #334;
  --code-bg: #f7f7f7;
  --nav-active: #e6f3fb;
  --bar-track: #e6e6e6;
  --dialog-backdrop: rgba(0, 0, 0, 0.45);
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --header-h: 50px;
  --nav-w: 300px;
  --nav-w-narrow: 60px;
  --radius: 3px;
  --radius-l: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171717;
    --bg-app: #121212;
    --ink: #e8e8e8;
    --muted: #9a9a9a;
    --rail: #202020;
    --rail-ink: #e8e8e8;
    --ok: #81c784;
    --ok-bg: #1c3324;
    --danger: #ef9a9a;
    --danger-bg: #3a1e1c;
    --card: #232323;
    --line: #333;
    --hover: #2c2c2c;
    --shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
    --table-head: #1c1c1c;
    --input-bg: #1a1a1a;
    --input-border: #444;
    --badge-bg: #2c2c2c;
    --badge-ink: #ddd;
    --code-bg: #1a1a1a;
    --nav-active: #163445;
    --bar-track: #3a3a3a;
    --dialog-backdrop: rgba(0, 0, 0, 0.65);
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171717;
  --bg-app: #121212;
  --ink: #e8e8e8;
  --muted: #9a9a9a;
  --rail: #202020;
  --rail-ink: #e8e8e8;
  --ok: #81c784;
  --ok-bg: #1c3324;
  --danger: #ef9a9a;
  --danger-bg: #3a1e1c;
  --card: #232323;
  --line: #333;
  --hover: #2c2c2c;
  --shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  --table-head: #1c1c1c;
  --input-bg: #1a1a1a;
  --input-border: #444;
  --badge-bg: #2c2c2c;
  --badge-ink: #ddd;
  --code-bg: #1a1a1a;
  --nav-active: #163445;
  --bar-track: #3a3a3a;
  --dialog-backdrop: rgba(0, 0, 0, 0.65);
}
html[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--accent); }
a:hover { color: var(--nc-blue-hover); }

.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.header {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 0.75rem 0 0.5rem;
  background: var(--nc-blue);
  color: #fff;
  z-index: 30;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.18);
}
.header a { color: #fff; }
.header a:hover { color: #fff; opacity: 0.92; }
.header-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: min(var(--nav-w), 40vw);
  flex: 0 0 auto;
}
.header-burger.ibtn {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #fff;
  border-radius: 50%;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.header-burger:hover { background: rgba(255, 255, 255, 0.12); }
.header .brand {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  text-decoration: none;
  color: #fff;
  padding: 0.15rem 0.4rem;
}
.header .brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.header .brand .tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.02em;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f3;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mark img { width: 36px; height: 36px; display: block; object-fit: contain; }
.header-company {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 280px;
  max-width: 40rem;
  padding: 0;
}
.header-company .rail-co {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-company > .hint { display: none; }
.header-company .hint { color: rgba(255, 255, 255, 0.9); }
.rail-switch { margin: 0; min-width: 10rem; flex: 0 1 16rem; }
.rail-switch label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
  gap: 0;
}
.rail-switch label span { display: none; }
.rail-switch select {
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  padding: 0.32rem 0.5rem;
}
.rail-switch select option { color: var(--ink); background: var(--card); }
.rail-quota {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  flex: 1 1 10rem;
  min-width: 8rem;
}
.rail-quota .bar {
  background: rgba(255, 255, 255, 0.22);
  min-width: 0;
  height: 6px;
}
.rail-quota .bar span { background: #fff; }
.header .rail-quota .hint + .bar + .hint {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.user-menu { position: relative; }
.user-menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  border-radius: 99px;
  color: #fff;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(255, 255, 255, 0.12); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--nc-blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.avatar svg { width: 18px; height: 18px; }
.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(280px, calc(100vw - 1.5rem));
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-l);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  padding: 0.7rem 0.2rem 0.35rem;
  z-index: 30;
}
.user-pop-head {
  padding: 0.2rem 0.9rem 0.75rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.1rem;
}
.user-pop-head strong { font-size: 0.95rem; }
.user-pop-head .hint { margin: 0; }
.user-pop form { margin: 0.35rem 0 0; }
.user-pop button {
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 0;
  padding: 0.65rem 0.9rem;
}
.user-pop button:hover { background: var(--hover); color: var(--accent); }

.rail {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--rail);
  color: var(--rail-ink);
  border-right: 1px solid var(--line);
  padding: 0.6rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.rail nav {
  display: flex;
  flex-direction: column;
  padding: 0.2rem 0.6rem;
  gap: 0.1rem;
}
.rail nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-l);
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 4px solid transparent;
  margin-left: 2px;
}
.rail nav a svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.rail nav a:hover {
  background: var(--hover);
  color: var(--ink);
}
.rail nav a.active {
  background: var(--nav-active);
  color: var(--nc-blue);
  border-left-color: var(--nc-blue);
  font-weight: 650;
}
.rail nav a.active svg { opacity: 1; }

.scc-platforms-embed {
  margin-top: auto;
  flex: 0 0 auto;
  width: 100%;
  min-height: 40px;
  overflow: visible;
  position: relative;
  padding: 0.35rem 0.6rem 0;
}
.scc-platforms-embed iframe {
  display: block;
  border: 0;
  width: 100%;
  height: 40px;
  background: transparent;
}
.rail-mini .scc-platforms-embed {
  width: 40px;
  min-height: 40px;
  align-self: center;
  padding: 0.35rem 0 0;
}
.rail-mini .scc-platforms-embed iframe {
  width: 40px;
  height: 40px;
}
.rail-mini .rail:has(.scc-platforms-embed.is-rail-open) {
  overflow: visible;
  z-index: 30;
}

.nav-backdrop {
  display: none;
}

.content {
  grid-column: 2;
  grid-row: 2;
  padding: 1.75rem 2rem 3.5rem;
  width: 100%;
  min-width: 0;
  background: var(--bg);
}
.topbar { display: none; }
.rail-toggle {
  display: none;
}
.bar span { transition: width 0.6s ease; }
h1 { font-size: 1.6rem; margin: 0 0 0.35rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 0.5rem; font-weight: 650; }
.lede { color: var(--muted); margin: 0 0 1.35rem; max-width: 62rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); box-shadow: 0 2px 14px rgba(0, 130, 201, 0.12); }
.card .n { font-size: 1.7rem; font-weight: 700; color: var(--nc-blue); letter-spacing: -0.03em; }
.card .k { color: var(--muted); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; }
.home-quota {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.9fr);
  gap: 1.4rem;
  align-items: center;
  margin-bottom: 1.4rem;
}
.home-quota h2 { margin: 0 0 0.35rem; }
.home-quota-pct {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--nc-blue);
  letter-spacing: -0.04em;
  margin: 0.15rem 0 0.7rem;
  line-height: 1;
}
.home-quota-pct .n { font-size: inherit; font-weight: inherit; color: inherit; }
.home-quota-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
.home-quota-stats .card { box-shadow: none; }
.home-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.home-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.home-row:last-child { border-bottom: 0; }
a.home-row:hover { color: var(--accent); }
.home-row .meta { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.home-empty { color: var(--muted); padding: 0.4rem 0 0.2rem; }
.dot-on {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 0.4rem;
  vertical-align: middle;
}
.row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }

.file-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  /* Scroll instead of clipping: a wide table must never hide its last column. */
  overflow-x: auto;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.85rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--table-head);
}
.file-list tbody tr { background: var(--card); }
.file-list tbody tr:hover { background: var(--hover); }
.file-list tbody tr:last-child td { border-bottom: 0; }
.file-list td:first-child { font-weight: 600; }
.actions { display: flex; gap: 0.2rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.btn, form.stack button[type=submit], form.stack input[type=submit], .login-card button[type=submit], .confirm-box button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1.3;
  gap: 0.35rem;
}
.btn:hover, form.stack button[type=submit]:hover, .login-card button[type=submit]:hover { background: var(--nc-blue-hover); color: #fff; }
.btn.sec, .ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
}
.btn.sec:hover, .ghost:hover { background: var(--hover); color: var(--ink); border-color: var(--input-border); }
.btn.danger, .confirm-box button.danger { background: var(--danger); color: #fff; }
.btn.danger:hover, .confirm-box button.danger:hover { background: #c62828; color: #fff; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover { background: #256628; color: #fff; }

.ibtn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  line-height: 0;
  flex: 0 0 auto;
}
.ibtn svg { width: 18px; height: 18px; display: block; }
.ibtn:hover, .ibtn:focus-visible {
  background: var(--hover);
  color: var(--ink);
  outline: none;
}
.ibtn.primary { background: var(--accent); color: #fff; }
.ibtn.primary:hover, .ibtn.primary:focus-visible { background: var(--nc-blue-hover); color: #fff; }
.ibtn.danger { color: var(--danger); background: transparent; }
.ibtn.danger:hover, .ibtn.danger:focus-visible { background: var(--danger-bg); color: var(--danger); }
.ibtn.ok { color: var(--ok); background: transparent; }
.ibtn.ok:hover, .ibtn.ok:focus-visible { background: var(--ok-bg); color: var(--ok); }
.ibtn[disabled], .ibtn.is-queued { opacity: 0.45; cursor: default; }
.header .ibtn { color: #fff; background: transparent; }
.header .ibtn:hover, .header .ibtn:focus-visible { background: rgba(255, 255, 255, 0.14); color: #fff; }
.header-scc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  text-decoration: none;
  flex: 0 0 auto;
}
.header-scc img { width: 28px; height: 28px; display: block; border-radius: 6px; }
.header-scc:hover, .header-scc:focus-visible { background: rgba(255, 255, 255, 0.14); outline: none; }
.theme-toggle svg { display: none; }
html:not([data-theme]) .theme-toggle .i-sys { display: block; }
html[data-theme="light"] .theme-toggle .i-sun { display: block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.login-theme {
  position: fixed;
  top: 7px;
  right: 12px;
  z-index: 5;
}
.login-theme .ibtn { color: #fff; }
.login-theme .ibtn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.theme-choices { padding: 0.45rem 0.35rem 0.2rem; border-bottom: 1px solid var(--line); }
.theme-choices .hint { margin: 0 0.55rem 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.7rem; font-weight: 650; }
.theme-choices button {
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.theme-choices button:hover { background: var(--hover); color: var(--accent); }
.theme-choices button.active { color: var(--accent); font-weight: 650; }

/* Toast: aviso fijo, fuera del flujo — no empuja el contenido ni obliga a scrollear arriba. */
#sbs-toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(28rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin: 0;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.ok { background: var(--ok-bg); color: var(--ok); }
.toast.err { background: var(--danger-bg); color: var(--danger); }
.toast.is-leaving {
  opacity: 0;
  transform: translateY(-0.4rem);
}
/* Panel de clave emitida (no es toast ni banner flash). */
.panel.issued-key {
  border: 1px solid var(--ok);
  background: var(--ok-bg);
}

.empty {
  padding: 2.4rem 1.4rem;
  text-align: center;
  color: var(--muted);
  background: var(--card);
}
.empty::before {
  content: "";
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--nc-blue);
  opacity: 0.28;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm0 2.5L19.5 10H14z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zm0 2.5L19.5 10H14z'/%3E%3C/svg%3E") center / contain no-repeat;
}

form.stack { display: grid; gap: 0.85rem; max-width: 640px; }
.stack { display: grid; gap: 1rem; }

.config-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 52rem;
}
.config-section.panel {
  padding: 1.55rem 1.6rem 1.7rem;
  margin: 0;
}
.config-section h2 { margin: 0 0 0.4rem; }
.config-section h3 { font-size: 1rem; margin: 0.35rem 0 0.55rem; font-weight: 650; }
.config-section .lede { margin-bottom: 1.15rem; }
.config-section form.stack,
.config-section .stack { max-width: none; gap: 1.05rem; }
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.config-mirror-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.config-mirrors { display: grid; gap: 1.15rem; margin-top: 0.75rem; }
.config-mirror {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 1.1rem 1.15rem;
  display: grid;
  gap: 0.85rem;
  background: var(--hover);
}
.config-follow { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .config-grid { grid-template-columns: 1fr; }
}
label { display: grid; gap: 0.3rem; font-size: 0.88rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(0, 130, 201, 0.35);
  border-color: var(--accent);
}
.checks { display: grid; gap: 0.4rem; }
.checks label { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; }
.when { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.days { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.days label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--input-border);
  border-radius: 99px;
  background: var(--input-bg);
}
.plan-cadence-block[hidden] { display: none; }
@media (max-width: 720px) {
  .when { grid-template-columns: 1fr; }
}
/* anywhere, not break-all: a squeezed column must not wrap one char per line. */
.hash { font-family: var(--mono); font-size: 0.75rem; overflow-wrap: anywhere; color: var(--muted); font-weight: 400; }
.badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-weight: 650;
  display: inline-block;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.status i { width: 0.72rem; height: 0.72rem; border-radius: 50%; background: #9c9286; flex: 0 0 auto; }
.status.ok i { background: #2f6f4e; }
.status.fail i { background: var(--danger); }
.status.unknown i { background: #9c9286; }
.bar { height: 8px; background: var(--bar-track); border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .35s ease; }
.bar.big { height: 12px; margin: 0.4rem 0; }
td[data-label="Respaldo"] { min-width: 140px; }
td[data-label="Respaldo"] .hint { margin-top: 0.25rem; }
td[data-label="Origen"] { min-width: 11rem; }
.err-note {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius);
  padding: 0.3rem 0.45rem;
  max-width: 22rem;
  overflow-wrap: anywhere;
}
.err-note .err-when { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.72rem; }
.plan-group { margin-bottom: 1.6rem; }
.plan-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; margin: 0 0 0.55rem; }
.plan-head h2 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.plan-group .panel, .plan-group .file-list { margin: 0; }
code { font-family: var(--mono); font-size: 0.85em; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg-app);
}
.login-wrap::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: var(--nc-blue);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  padding: 1.8rem 1.7rem 1.6rem;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: relative;
}
.login-card .brand { color: var(--ink); margin-bottom: 1.1rem; display: flex; gap: 0.75rem; align-items: center; text-decoration: none; }
.login-card .mark { background: #f3f4f3; }
.login-card .brand strong { display: block; font-size: 1.1rem; color: var(--ink); }
.login-card .brand .tag, .login-card .brand span span { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.login-card h1 { margin-bottom: 0.25rem; }
.login-card button[type=submit], .login-card .btn { width: 100%; padding: 0.7rem 1rem; }
.login-or { text-align: center; margin: 0.9rem 0 0.4rem; }
.hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin: 0.8rem 0 1rem; }
.dl-card { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 0.95rem 1rem; display: grid; gap: 0.35rem; align-content: start; background: var(--card); }
.dl-card .hint { margin: 0; }
.dl-card .actions { margin-top: 0.25rem; }
pre.hint {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  overflow: auto;
  white-space: pre-wrap;
}

.confirm-box {
  border: 0;
  border-radius: var(--radius-l);
  padding: 1.35rem 1.4rem;
  background: var(--card);
  color: var(--ink);
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}
.confirm-box::backdrop { background: var(--dialog-backdrop); }
.confirm-box h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.confirm-box p { margin: 0 0 0.8rem; }
.confirm-box .actions { margin-top: 1rem; justify-content: flex-end; }
.confirm-box .ghost { color: var(--ink); }

.header-burger, .header-burger:hover, .header .header-burger, .header .header-burger:hover {
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.header .header-burger:hover { background: rgba(255, 255, 255, 0.12); }
.nav-backdrop, .nav-backdrop:hover {
  background: rgba(0, 0, 0, 0.35);
  color: inherit;
  border-radius: 0;
  font-weight: 400;
  box-shadow: none;
}
.user-pop button:hover { background: var(--hover); color: var(--accent); }
.busy .btn, .busy button, .busy input[type=submit] { opacity: 0.65; pointer-events: none; }
form.destroy.busy::after { content: none; }
.busy::after { content: " Enviando…"; color: var(--muted); font-size: 0.85rem; }

.error-guest { max-width: 32rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 0.75rem;
}
.crumbs a { color: var(--accent); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: 0.55; }
.browser-toolbar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin: 0 0 0.85rem; }
.browser-filter { display: block; min-width: min(100%, 280px); }
.browser-filter input { width: 100%; }
.browser-name {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
a.browser-name:hover { color: var(--accent); }
.folder-ico, .file-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  color: #e6b422;
}
.folder-ico svg, .file-ico svg { width: 28px; height: 28px; display: block; }
.file-ico { color: var(--muted); width: 24px; height: 24px; }
.file-ico svg { width: 22px; height: 22px; }
td.muted { color: var(--muted); font-weight: 400; }
.share-panel { margin-top: 1.6rem; }
.share-panel h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.share-url { font-size: 0.78rem; word-break: break-all; }
.share-box {
  border: 0;
  border-radius: var(--radius-l);
  padding: 1.35rem 1.4rem;
  background: var(--card);
  color: var(--ink);
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
}
.share-box::backdrop { background: var(--dialog-backdrop); }
.share-box h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.share-box form.stack { max-width: none; width: 100%; }
.share-box .actions { margin-top: 0.4rem; justify-content: flex-end; }
.share-body { margin: 0; background: var(--bg-app); }
.share-header { position: sticky; top: 0; }
.share-content { max-width: 1100px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.browser-row.is-hidden { display: none; }

.rail-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 0.35rem 0.4rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.rail-toggle:hover,
.rail-toggle:focus-visible { background: rgba(255, 255, 255, 0.14); color: #fff; }
.rail-toggle svg { width: 19px; height: 19px; transition: transform 0.2s ease; }
.rail-mini .rail-toggle svg { transform: rotate(180deg); }

.rail-mini .app { grid-template-columns: var(--nav-w-narrow) minmax(0, 1fr); }
.rail-mini .rail nav { padding: 0.2rem 0.45rem; }
.rail-mini .rail nav a { justify-content: center; gap: 0; padding: 0.6rem 0; margin-left: 0; }
.rail-mini .rail nav a span { display: none; }

.dot-on { animation: sbs-pulse 2.2s ease-in-out infinite; }
@keyframes sbs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.35); }
  55% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
}

@media (max-width: 1024px) {
  .app { grid-template-columns: var(--nav-w-narrow) minmax(0, 1fr); }
  .header-left { min-width: 0; }
  .user-name { display: none; }
  .rail nav a span { display: none; }
  .rail nav a { justify-content: center; gap: 0; padding: 0.6rem 0; margin-left: 0; }
  .rail nav { padding: 0.2rem 0.45rem; }
  .content { padding: 1.2rem 1.1rem 2.5rem; }
}
@media (max-width: 900px) {
  /* With the rail always visible, wide tables (Planes has ten columns) cannot
     fit a single-column layout without crushing: stack them as cards. */
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  .file-list { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    margin-bottom: 0.7rem;
    padding: 0.45rem 0.7rem;
    box-shadow: var(--shadow);
  }
  td { border: 0; display: flex; justify-content: space-between; gap: 0.8rem; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 650; }
  td[data-label="Origen"], td[data-label="Respaldo"] { min-width: 0; }
  .err-note { max-width: none; }
}
@media (max-width: 480px) {
  .rail-toggle { display: none; }
  .app,
  .rail-mini .app { grid-template-columns: 1fr; }
  .header-burger.ibtn { display: inline-flex; }
  .rail {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(var(--nav-w), 86vw);
    height: auto;
    z-index: 25;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
  }
  .rail nav a span { display: inline; }
  .rail nav a { justify-content: flex-start; gap: 0.75rem; padding: 0.55rem 0.75rem; margin-left: 2px; }
  .rail nav { padding: 0.2rem 0.6rem; }
  body.nav-open .rail,
  .rail.open { display: flex; }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 24;
    border: 0;
    padding: 0;
  }
  body.nav-open .nav-backdrop { display: block; }
  .content { padding: 1.1rem 0.85rem 2.5rem; }
}
@media (max-width: 860px) {
  .home-quota, .home-split { grid-template-columns: 1fr; }
  .header .brand .tag { display: none; }
  .header-company { max-width: none; }
}
