@font-face {
  font-family: "Updater Sans";
  src: url("/assets/roboto-latin-400-normal-BqEyEoaF.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Updater Sans";
  src: url("/assets/roboto-latin-500-normal-7RbcRiD8.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Updater Sans";
  src: url("/assets/roboto-latin-700-normal-BZpUvMxY.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #f1f5f9;
  --text: #111827;
  --heading: #0b1220;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;
  --primary: #0f8f8c;
  --primary-strong: #08736f;
  --primary-soft: #e7f7f6;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #0f9f6e;
  --green-soft: #e9f8f1;
  --amber: #b77905;
  --amber-soft: #fff7df;
  --red: #c93737;
  --red-soft: #fff0f0;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 8px 18px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --topbar-offset: 0px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b;
  --surface: #151b24;
  --surface-2: #111820;
  --surface-3: #1c2530;
  --text: #e7edf5;
  --heading: #f8fafc;
  --muted: #9aa7ba;
  --muted-2: #778498;
  --border: #273244;
  --border-strong: #364458;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --primary-soft: rgba(45, 212, 191, 0.13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.13);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.13);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 10px 22px rgba(0, 0, 0, 0.24);
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html[data-ensure-auth="1"]:not([data-auth-ready="1"]) body {
  visibility: hidden;
}

html,
body {
  overflow: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Updater Sans", "Segoe UI", "Trebuchet MS", sans-serif;
  font-size: 13px;
  line-height: 1.42;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  color: var(--heading);
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.05rem);
  font-weight: 700;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

h3 {
  font-size: 0.96rem;
  font-weight: 700;
}

code,
.mono {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 9px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--heading);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.brand-logo svg {
  width: 21px;
  height: 21px;
  display: block;
}

.app-brand {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.app-brand strong {
  color: var(--heading);
  font-size: 0.95rem;
  line-height: 1.05;
}

.app-brand span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.page-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  padding: 7px 10px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.nav a:hover,
.nav a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.spacer {
  flex: 1;
}

.user {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

#userName {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
}

.container {
  max-width: 1260px;
  margin: calc(16px + var(--topbar-offset)) auto 22px;
  padding: 0 18px;
}

.container.wide {
  max-width: 1600px;
}

.container.with-sidebar {
  max-width: none;
  height: calc(100vh - var(--topbar-offset) - 24px);
  margin: calc(12px + var(--topbar-offset)) 18px 12px calc(var(--sidebar-w) + 18px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 14px;
}

.sidebar {
  position: fixed;
  top: var(--topbar-offset);
  left: 0;
  bottom: 0;
  z-index: 20;
  width: var(--sidebar-w);
  padding: 14px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  color: var(--heading);
  font-size: 0.92rem;
  font-weight: 700;
}

.sidebar-title::after {
  content: "Panel de gestion";
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
}

.menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu a:hover {
  background: var(--surface-2);
  color: var(--heading);
}

.menu a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.menu a .icon {
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 21px;
}

.menu a .icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
}

.menu a .label {
  white-space: nowrap;
}

.menu-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.menu-parent {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  text-align: left;
}

.menu-parent:hover,
.menu-group.active .menu-parent {
  background: var(--surface-2);
  color: var(--heading);
}

.menu-parent .icon {
  width: 21px;
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 21px;
}

.menu-parent .icon svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
}

.menu-parent .chev {
  margin-left: auto;
  color: var(--muted-2);
  transition: transform 0.15s ease;
}

.menu-group.open .menu-parent .chev {
  transform: rotate(90deg);
}

.submenu {
  display: none;
  padding-left: 28px;
}

.menu-group.open .submenu {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.submenu a {
  gap: 9px;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.82rem;
}

.submenu a .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.submenu a .icon svg {
  width: 14px;
  height: 14px;
}

.submenu a.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

:root[data-sidebar="collapsed"] .sidebar {
  width: var(--sidebar-w-collapsed);
}

:root[data-sidebar="collapsed"] .sidebar-title,
:root[data-sidebar="collapsed"] .sidebar-title::after,
:root[data-sidebar="collapsed"] .menu a .label,
:root[data-sidebar="collapsed"] .menu-parent .label,
:root[data-sidebar="collapsed"] .menu-parent .chev,
:root[data-sidebar="collapsed"] .submenu {
  display: none;
}

:root[data-sidebar="collapsed"] .sidebar-header {
  justify-content: center;
}

:root[data-sidebar="collapsed"] .menu a {
  justify-content: center;
  padding-inline: 8px;
}

:root[data-sidebar="collapsed"] .menu-parent {
  justify-content: center;
  padding-inline: 8px;
}

:root[data-sidebar="collapsed"] .container.with-sidebar {
  margin-left: calc(var(--sidebar-w-collapsed) + 18px);
}

.workspace-hero,
.page-hero {
  padding: 0 0 14px;
  margin-bottom: 14px;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.workspace-hero h1,
.workspace-hero h2,
.page-hero h1,
.page-hero h2 {
  margin-bottom: 4px;
  font-size: 1.4rem;
}

.workspace-hero .muted,
.page-hero .muted {
  max-width: 820px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-actions,
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.desktop-frame::before {
  content: none;
}

.card {
  position: relative;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.card > h2,
.card > h3 {
  margin-bottom: 10px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.row,
.controls,
.pair-header,
.pair-sub,
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: var(--primary-strong);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--heading);
}

.btn.warn {
  background: var(--amber);
  color: #ffffff;
}

.btn.error {
  background: var(--red);
  color: #ffffff;
}

.btn.success {
  background: var(--green);
  color: #ffffff;
}

.btn.icon-sm,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.btn.icon-sm:hover,
.icon-btn:hover {
  background: var(--surface-2);
}

.btn.icon-sm svg,
.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
}

.theme-icon.sun {
  display: none;
}

:root[data-theme="light"] .theme-icon.sun {
  display: inline;
}

:root[data-theme="light"] .theme-icon.moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon.moon {
  display: inline;
}

label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: auto;
  max-width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: none;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: var(--surface-2);
}

td.col-right,
th.col-right {
  text-align: right;
}

pre,
.log {
  margin: 0;
  padding: 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #0f172a;
  color: #dbeafe;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 500;
}

.badge.ok,
.chip.success,
.chip.succeeded {
  color: var(--green);
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 20%, var(--border));
}

.badge.warn,
.chip.running {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 20%, var(--border));
}

.badge.error,
.chip.failed {
  color: var(--red);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 20%, var(--border));
}

.badge.muted,
.chip.pending {
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 8px;
  background: var(--muted-2);
}

.dot.on {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.dot.off {
  background: var(--muted-2);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

table.responsive {
  min-width: 1120px;
}

.tenant-refresh-btn {
  width: auto !important;
  min-width: 68px;
  padding: 0 9px !important;
  font-size: 0.72rem;
}

table.pkgs {
  min-width: 920px;
  table-layout: fixed;
}

.pkgs td:not(.actions) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkgs td.actions {
  white-space: nowrap;
  overflow: visible;
}

.pkgs td.actions .btn {
  margin-right: 4px;
}

.pkgs td.actions .btn:last-child {
  margin-right: 0;
}

.pkgs td.actions .btn.icon-sm[title="Detalle"] {
  width: auto;
  min-width: 58px;
  padding: 0 9px;
}

.pkg-detail-cell {
  color: var(--text);
}

.pkg-card-detail {
  margin-top: 9px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.upload-result {
  max-height: 180px;
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.table-toolbar .search,
.table-toolbar .controls-right,
.table-toolbar .pager,
.table-toolbar .view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.table-footer .pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.packages-footer {
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.packages-footer::before {
  content: "Navegacion de paquetes";
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

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

.backup-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.backup-selector {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.backup-selector label {
  display: grid;
  gap: 6px;
}

.inline-check {
  display: flex !important;
  align-items: center;
  gap: 7px;
  min-height: 32px;
}

.backup-simple-status,
.backup-manager-grid,
.backup-final-grid {
  display: grid;
  gap: 14px;
}

.backup-simple-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.backup-simple-status > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.backup-simple-status strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
  font-size: 1rem;
}

.backup-manager-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.backup-choice-card {
  position: relative;
  padding-top: 48px;
}

.choice-number {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--heading);
  color: var(--surface);
  font-weight: 700;
}

.backup-choice-card h3 {
  margin-bottom: 6px;
}

.backup-advanced {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.backup-advanced summary {
  padding: 10px 12px;
  color: var(--heading);
  font-weight: 600;
  cursor: pointer;
}

.backup-advanced label {
  padding: 0 12px 12px;
}

.backup-final-grid {
  grid-template-columns: 1fr;
}

.backup-final-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.backup-final-row .path-box {
  margin-top: 6px;
}

.backup-help-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--muted);
}

.backup-help-line strong {
  color: var(--primary-strong);
}

.backup-overview,
.backup-effective-grid,
.backup-policy-grid,
.backup-flow {
  display: grid;
  gap: 14px;
}

.backup-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.backup-summary-card,
.backup-step,
.backup-destination {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.backup-summary-card {
  padding: 14px;
}

.backup-summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
  font-size: 1rem;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.backup-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.backup-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 13px;
}

.backup-step span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.backup-step strong {
  color: var(--heading);
}

.backup-step small {
  color: var(--muted);
  line-height: 1.35;
}

.backup-effective-grid,
.backup-policy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.backup-destination {
  padding: 15px;
}

.destination-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.destination-head h3 {
  margin-top: 2px;
}

.path-box {
  min-height: 46px;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--heading);
  overflow: auto;
  word-break: break-all;
}

.source-pill {
  white-space: nowrap;
}

.source-pill[data-source*="tenant"] {
  color: var(--green);
  background: var(--green-soft);
}

.source-pill[data-source*="global"] {
  color: var(--blue);
  background: var(--blue-soft);
}

.source-pill[data-source*="appsettings"],
.source-pill[data-source*="built"] {
  color: var(--amber);
  background: var(--amber-soft);
}

.backup-priority,
.backup-roots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.backup-priority {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}

.backup-priority strong {
  color: var(--heading);
}

.backup-policy-card .card-header {
  align-items: flex-start;
}

.backup-card label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.backup-card input[type="text"] {
  width: 100%;
}

.backup-card small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.backup-history {
  min-width: 980px;
}

.update-hero > h2,
.update-hero > p {
  display: none;
}

.update-hero-copy h2 {
  margin-bottom: 4px;
}

.update-hero .hero-actions a[href="/online.html"] {
  display: none;
}

.update-flow,
.update-status-grid,
.update-review-grid,
.update-main-grid {
  display: grid;
  gap: 14px;
}

.update-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.update-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.update-step span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 700;
}

.update-step strong {
  color: var(--heading);
}

.update-step small {
  color: var(--muted);
  line-height: 1.35;
}

.update-launch-card > h2,
.update-review-card > h2,
.update-launch-card > .card {
  display: none;
}

.update-card-title {
  margin-bottom: 12px;
}

.update-card-title h2 {
  margin-bottom: 4px;
}

.update-launch-card label {
  display: grid;
  gap: 6px;
}

.update-launch-card select {
  min-width: min(100%, 260px);
}

.preserve-check {
  margin-top: 22px;
}

.update-help-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--muted);
}

.update-help-line strong {
  color: var(--primary-strong);
}

.update-result {
  margin-top: 12px;
  max-height: 180px;
  background: var(--surface-2);
  color: var(--text);
}

.update-review-card .row {
  padding: 6px 0;
}

.review-item {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.review-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-item strong {
  display: block;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-message {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.update-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
}

.update-job-panel {
  margin-top: 16px;
}

.update-job-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.update-technical,
.update-technical-panel {
  margin-top: 16px;
}

.update-technical summary,
.update-technical-panel summary {
  color: var(--heading);
  font-weight: 700;
  cursor: pointer;
}

.update-technical .log,
.update-technical-panel .log {
  margin-top: 10px;
  max-height: 360px;
}

.admin-status-grid,
.admin-main-grid,
.admin-review-grid,
.admin-shortcuts-grid {
  display: grid;
  gap: 14px;
}

.admin-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.admin-status-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.admin-status-card strong {
  display: block;
  margin-top: 4px;
  color: var(--heading);
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-status-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.admin-main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.admin-choice-card {
  position: relative;
  padding-top: 48px;
}

.admin-choice-card h3 {
  margin-bottom: 6px;
}

.admin-choice-card label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.admin-choice-card select,
.admin-choice-card input[type="text"] {
  width: 100%;
}

.admin-choice-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-review-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-shortcuts-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.admin-shortcut {
  display: block;
  margin: 0;
  color: var(--text);
}

.admin-shortcut strong {
  display: block;
  color: var(--heading);
  margin-bottom: 5px;
}

.admin-shortcut span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-technical summary {
  color: var(--heading);
  font-weight: 700;
  cursor: pointer;
}

.admin-technical .log {
  max-height: 360px;
}

.users-toolbar {
  align-items: center;
  justify-content: space-between;
}

.users-toolbar input {
  min-width: 260px;
}

.users-table {
  min-width: 1120px;
}

.users-table small.block {
  display: block;
  margin-top: 3px;
}

.users-menu-cell {
  max-width: 360px;
  color: var(--muted);
  white-space: normal;
}

.audit-table {
  min-width: 1240px;
}

.audit-table small.block {
  display: block;
  margin-top: 3px;
}

.audit-details {
  max-width: 320px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(900px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.users-modal form {
  margin: 0;
}

.users-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}

.users-form-grid label,
.users-form-grid input {
  width: 100%;
}

.users-switches,
.access-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.access-card-title {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.access-option {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.access-option input {
  width: auto !important;
  margin-top: 3px;
}

.access-option strong,
.access-option small {
  display: block;
}

.access-option strong {
  color: var(--heading);
  font-size: 0.88rem;
}

.access-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.permissions-section {
  padding: 0 18px 18px;
}

.permissions-section h3 {
  margin-bottom: 4px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.checkbox-select {
  position: relative;
  margin-top: 12px;
}

.checkbox-select-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-xs);
}

.checkbox-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.checkbox-select-button:hover:not(:disabled),
.checkbox-select.open .checkbox-select-button {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.checkbox-select-button > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-select-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.checkbox-select-chev {
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.checkbox-select.open .checkbox-select-chev {
  transform: rotate(-90deg);
}

.checkbox-select-panel {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  z-index: 5;
  display: none;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.checkbox-select.open .checkbox-select-panel {
  display: block;
}

.checkbox-select-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.checkbox-select-tools .btn {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.checkbox-select-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-select-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
}

.checkbox-select-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.checkbox-select-option input {
  width: auto;
  margin-top: 3px;
}

.checkbox-select-option input:disabled {
  cursor: not-allowed;
}

.checkbox-select-option strong,
.checkbox-select-option small {
  display: block;
}

.checkbox-select-option strong {
  color: var(--heading);
  margin-bottom: 3px;
  font-size: 0.84rem;
}

.checkbox-select-option small {
  color: var(--muted);
  font-size: 0.75rem;
}

.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.permission-card input {
  margin-top: 3px;
}

.permission-card strong,
.permission-card small {
  display: block;
}

.permission-card strong {
  color: var(--heading);
  margin-bottom: 3px;
}

.permission-card small {
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

.btn.danger {
  background: var(--red);
  color: #ffffff;
}

.btn.danger:hover {
  filter: brightness(0.96);
}

.sql-console-tab {
  position: fixed;
  left: auto;
  right: 18px;
  bottom: 0;
  z-index: 64;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 44px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: #050505;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 180ms ease, opacity 180ms ease, background 150ms ease;
}

:root[data-sidebar="collapsed"] .sql-console-tab {
  left: auto;
}

.sql-console-tab:hover {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.sql-console-tab svg {
  width: 22px;
  height: 22px;
  display: block;
  color: #050505;
}

body.sql-console-open .sql-console-tab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

.sql-console {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 580px);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px 0 0 0;
  background: #050814;
  box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 180ms ease, opacity 180ms ease;
}

:root[data-sidebar="collapsed"] .sql-console {
  left: var(--sidebar-w-collapsed);
}

.sql-console.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.sql-console-open .container.with-sidebar {
  padding-bottom: 430px;
}

body.sql-console-enabled:not(.sql-console-open) .container.with-sidebar {
  padding-bottom: 52px;
}

.sql-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, #0b1020, #070b16);
}

.sql-console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sql-console-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 11px;
  background: rgba(45, 212, 191, 0.1);
  color: #7dd3fc;
}

.sql-console-head-icon svg {
  width: 20px;
  height: 20px;
}

.sql-console-head strong {
  display: block;
  color: #f8fafc;
  font-size: 0.98rem;
}

.sql-console-head span {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.8rem;
}

.sql-console-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #050814;
}

.sql-console-window {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  margin: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: #050814;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 50px rgba(0, 0, 0, 0.28);
}

.sql-console-windowbar {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, #111827, #0b1020);
  color: #cbd5e1;
}

.sql-console-windowbar strong {
  margin-left: 6px;
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.win-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #64748b;
}

.win-dot.close {
  background: #ef4444;
}

.win-dot.min {
  background: #f59e0b;
}

.win-dot.max {
  background: #22c55e;
}

.sql-console-terminal {
  flex: 1;
  min-height: 300px;
  max-height: none;
  overflow: auto;
  padding: 8px 16px;
  color: #dbeafe;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 50%, rgba(0, 0, 0, 0.02) 50%),
    #050814;
  background-size: 100% 28px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sql-console-terminal::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sql-console-screen {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #050814;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -28px 70px rgba(45, 212, 191, 0.04);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sql-console-screen::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sql-console-screen:focus,
.sql-console-screen:focus-visible {
  outline: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -28px 70px rgba(45, 212, 191, 0.04);
}

.sql-console-banner {
  padding: 14px 16px 0;
  color: #cbd5e1;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sql-console-line {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.sql-console-line.cmd {
  color: #f8fafc;
}

.sql-console-line.system,
.sql-console-line .dim {
  color: #94a3b8;
}

.sql-console-line.ok,
.sql-console-line .ok {
  color: #34d399;
}

.sql-console-line.error,
.sql-console-line .err {
  color: #fb7185;
}

.sql-console-line code {
  padding: 1px 5px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #bfdbfe;
}

.sql-console-line .prompt {
  color: #5eead4;
  font-weight: 700;
}

.sql-console-command {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
  border-top: 0;
  background: transparent;
}

.sql-console-prompt {
  flex: 0 0 auto;
  color: #5eead4;
  font-family: "Cascadia Code", Consolas, monospace;
  font-weight: 700;
}

.sql-console-input {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #dbeafe;
  outline: none !important;
  padding: 0;
  caret-color: #5eead4;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.sql-console-input:focus,
.sql-console-input:focus-visible {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sql-console-input:empty::before {
  content: "escribe un comando y presiona Enter";
  color: rgba(148, 163, 184, 0.5);
  pointer-events: none;
}

.sql-console-caret {
  width: 8px;
  height: 17px;
  margin-left: -3px;
  background: #5eead4;
  opacity: 0.9;
  animation: terminalBlink 1s steps(1) infinite;
}

@keyframes terminalBlink {
  50% {
    opacity: 0;
  }
}

.sql-console-statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: #080d19;
}

.sql-console-statusbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sql-console-statusbar span {
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sql-console-active {
  color: #5eead4 !important;
}

.sql-console-statusbar input[type="number"] {
  width: 82px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: #030712;
  color: #f8fafc;
  padding: 0 8px;
}

.sql-console-left,
.sql-console-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
}

.sql-console-field {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--heading);
  font-weight: 700;
}

.sql-console-field span,
.sql-console-options span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sql-console textarea,
.sql-console input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  font: inherit;
}

.sql-console textarea {
  min-height: 112px;
  padding: 11px;
  resize: vertical;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.48;
}

#sqlConsoleSql {
  min-height: 170px;
}

.sql-console textarea:focus,
.sql-console input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.sql-console-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
}

.sql-console-options label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sql-console input[type="number"] {
  height: 38px;
  padding: 0 10px;
}

.sql-console-check {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.sql-console-check input {
  margin: 0;
}

.sql-console-toolbar .sql-console-check {
  grid-column: auto;
  flex-direction: row !important;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: #030712;
}

.sql-console-toolbar input[type="number"] {
  width: 82px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: #030712;
  color: #f8fafc;
  padding: 0 8px;
}

.sql-console-toolbar .btn.secondary {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
}

.sql-console-statusbar .sql-console-check {
  grid-column: auto;
  flex-direction: row !important;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: #030712;
}

.sql-console-statusbar input[type="number"] {
  width: 76px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #030712;
  color: #f8fafc;
  padding: 0 8px;
}

.sql-console-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sql-console-actions span {
  flex: 1;
  min-width: 160px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sql-console-result {
  min-height: 68px;
  max-height: 214px;
  overflow: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.sql-console-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  color: var(--muted);
}

.sql-console-meta strong {
  color: var(--heading);
}

.sql-console-meta .warn,
.sql-console-error {
  color: var(--red);
}

.sql-console-ok {
  color: var(--green);
}

.sql-console-ok span {
  margin-left: 8px;
  color: var(--muted);
}

.sql-console-table-wrap {
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sql-console-table-wrap::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sql-console-table-wrap table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.sql-console-table-wrap th,
.sql-console-table-wrap td {
  max-width: 280px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sql-console-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-3);
  color: var(--heading);
  font-weight: 700;
}

.sql-console-terminal .sql-console-table-wrap {
  max-height: 220px;
  border-color: rgba(148, 163, 184, 0.22);
  background: #030712;
}

.sql-console-terminal .sql-console-table-wrap table {
  color: #dbeafe;
}

.sql-console-terminal .sql-console-table-wrap th,
.sql-console-terminal .sql-console-table-wrap td {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.sql-console-terminal .sql-console-table-wrap th {
  background: #111827;
  color: #f8fafc;
}

.pkg-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.pkg-card .title {
  margin-bottom: 6px;
  color: var(--heading);
  font-weight: 700;
}

.pkg-card .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.pkg-card .hash {
  margin-top: 10px;
  color: var(--muted);
  word-break: break-word;
}

.pkg-card .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress .bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload .upload-box {
  flex: 1;
  min-width: 280px;
  padding: 15px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.upload .upload-box:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upload .upload-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.upload .upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
  gap: 12px;
}

.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.kpi .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi .icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
}

.kpi .val {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1;
  color: var(--heading);
  letter-spacing: -0.025em;
}

.kpi .lbl {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.kpi.green .icon {
  color: var(--green);
  background: var(--green-soft);
}

.kpi.amber .icon,
.kpi.warn .icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.kpi.red .icon,
.kpi.error .icon {
  color: var(--red);
  background: var(--red-soft);
}

.kpi.blue .icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.kpi.slate .icon {
  color: var(--muted);
  background: var(--surface-3);
}

.charts-grid,
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.seg {
  display: inline-flex;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
}

.seg button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.two-pane {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.navs {
  min-height: 440px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: auto;
}

.navs-header {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.navs-schema {
  margin-top: 14px;
  margin-bottom: 8px;
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 700;
}

.navs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
}

.navs-item.active,
.navs-item:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.navs-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot-add {
  background: var(--green);
}

.dot-del {
  background: var(--red);
}

.dot-mod {
  background: var(--amber);
}

.dot-same {
  background: var(--muted-2);
}

.panel,
.side,
.rows {
  min-width: 0;
}

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

.side {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.side h5 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--heading);
}

.rows .row {
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.rows .row:last-child {
  border-bottom: 0;
}

.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.flag.add {
  color: var(--green);
  background: var(--green-soft);
}

.flag.del {
  color: var(--red);
  background: var(--red-soft);
}

.flag.mod {
  color: var(--amber);
  background: var(--amber-soft);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  overflow: auto;
  background: var(--surface);
}

.login-page::after {
  content: "";
  display: block;
  background:
    linear-gradient(135deg, rgba(15, 143, 140, 0.92), rgba(37, 99, 235, 0.9)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='rgba(255,255,255,.18)' stroke-width='1'%3E%3Cpath d='M0 80h160M80 0v160M20 20h120v120H20zM40 40h80v80H40z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover, 180px 180px;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(350px, calc(100% - 42px));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-card::before {
  content: "Updater";
  display: block;
  margin-bottom: 22px;
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 14px;
  color: #ffffff;
  background: var(--heading);
}

.login-brand svg {
  width: 30px;
  height: 30px;
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: inline-block;
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding-left: 40px;
  padding-right: 44px;
}

.input-wrap .icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
}

.input-wrap .toggle {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.error {
  margin-top: 10px;
  color: var(--red);
}

.app-toast-stack {
  position: fixed;
  top: calc(var(--topbar-offset) + 14px);
  right: 16px;
  z-index: 2000;
  display: flex;
  width: min(430px, calc(100vw - 28px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  pointer-events: auto;
}

.app-toast.error {
  border-left-color: var(--red);
}

.app-toast.success {
  border-left-color: var(--green);
}

.app-toast button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}

td.actions {
  white-space: nowrap;
  text-align: right;
}

td.actions .btn {
  margin-right: 6px;
}

td.actions .btn:last-child {
  margin-right: 0;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .charts-grid,
  .grid-two,
  .diff-grid,
  .form-grid,
  .two-pane,
  .backup-flow,
  .backup-overview,
  .backup-effective-grid,
  .backup-policy-grid,
  .backup-simple-status,
  .backup-manager-grid,
  .update-flow,
  .update-status-grid,
  .update-review-grid,
  .update-main-grid,
  .admin-status-grid,
  .admin-main-grid,
  .admin-review-grid,
  .admin-shortcuts-grid,
  .users-form-grid,
  .permission-grid,
  .sql-console-body {
    grid-template-columns: 1fr;
  }

  .backup-final-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .backup-hero {
    flex-direction: column;
  }

  .backup-selector {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    padding-inline: 14px;
  }

  .app-brand,
  .page-context {
    display: none;
  }

  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  .menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .menu a {
    flex: 0 0 auto;
  }

  .container.with-sidebar {
    height: auto;
    margin: 14px 12px 24px;
  }

  :root[data-sidebar="collapsed"] .container.with-sidebar {
    margin-left: 12px;
  }

  .sql-console-tab,
  :root[data-sidebar="collapsed"] .sql-console-tab {
    left: auto;
    right: 14px;
  }

  .sql-console {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82vh;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  :root[data-sidebar="collapsed"] .sql-console {
    left: 0;
  }

  body.sql-console-open .container.with-sidebar {
    padding-bottom: 560px;
  }

  body.sql-console-open .sql-console-tab {
    opacity: 0;
    pointer-events: none;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .backup-selector label,
  .backup-selector select {
    width: 100%;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-page::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .user {
    width: 100%;
    justify-content: flex-end;
  }

  .container {
    padding: 0 12px;
  }

  .card {
    padding: 13px;
  }

  .sql-console-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sql-console-actions span {
    min-width: 0;
  }

  .sql-console-options {
    grid-template-columns: 1fr;
  }

}
