:root {
  --azul: #182F71;
  --azul-2: #192E72;
  --naranja: #F87614;
  --fondo: #f4f6fb;
  --texto: #333333;
  --muted: #7a7a7a;
  --blanco: #fff;
  --ok: #1b7a3d;
  --error: #b42318;
  --radio: 10px;
  --sidebar: 260px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
}
a { color: var(--azul); text-decoration: none; }
img { max-width: 100%; }
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: var(--azul);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand img { height: 36px; background: #fff; border-radius: 6px; padding: 4px; }
.brand span { font-weight: 700; letter-spacing: .04em; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 4px; overflow: auto; flex: 1; }
.sidebar nav a {
  color: #fff; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; opacity: .9;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.12); opacity: 1; }
.sidebar nav a.active { box-shadow: inset 3px 0 0 var(--naranja); }
.sidebar-user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.sidebar-user small { display: block; opacity: .75; margin: 2px 0 8px; text-transform: uppercase; }
.sidebar-user a { color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  background: #fff; display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid #e6e8ef;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.25rem; margin: 0; color: var(--azul); }
.menu-btn { display: none; background: none; border: 0; font-size: 1.2rem; color: var(--azul); }
.content { padding: 20px; }
.toolbar { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.thumb-cell { width: 96px; }
.thumb-cell img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; display: block; background: #111; }
.card {
  background: #fff; border-radius: var(--radio); padding: 18px;
  box-shadow: 0 1px 3px rgba(24,47,113,.06);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #eee; vertical-align: middle; }
th { color: var(--azul); font-size: .9rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-weight: 600; font-size: .95rem;
}
.btn-primary { background: var(--azul); color: #fff; }
.btn-orange { background: var(--naranja); color: #fff; }
.btn-ghost { background: #eef1f8; color: var(--azul); }
.btn-danger { background: #b42318; color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--azul); cursor: pointer; font-size: 1.05rem; padding: 6px; }
.icon-btn.danger { color: #b42318; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.ok { background: #e8f6ee; color: #14532d; }
.alert.error { background: #fdecec; color: #7a1b16; }
.alert.info { background: #eaf0ff; color: var(--azul); }
label { display: block; font-weight: 600; margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfd5e4; border-radius: 8px;
  font: inherit; background: #fff;
}
textarea { min-height: 180px; font-family: ui-monospace, monospace; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid #d5dbe8; background: #fff; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-weight: 700; color: var(--azul);
}
.chip.active { background: var(--azul); color: #fff; border-color: var(--azul); }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.step-dot {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #dfe3ee; color: var(--azul); font-weight: 700;
}
.step-dot.on { background: var(--azul); color: #fff; }
.wizard-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; }
.thumb-preview { width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; background: #111; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: .85rem; font-weight: 700; }
.badge.green { background: #e8f6ee; color: var(--ok); }
.badge.gray { background: #eee; color: #555; }
.modal {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55);
  z-index: 80; padding: 16px; overflow: auto;
}
.modal.open { display: grid; place-items: center; }
.modal-box {
  background: #fff; width: min(980px, 100%); border-radius: 12px; padding: 20px;
  max-height: 92vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.thumbs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumbs-grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #182F71, #0d1b45);
}
.login-card {
  width: min(420px, 92vw); background: #fff; border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; gap: 6px;
}
.login-card img { height: 48px; align-self: flex-start; }
.login-card h1 { color: var(--azul); font-size: 1.3rem; margin: 8px 0 12px; }
code, .cron-box {
  background: #0f1b3d; color: #e8eeff; padding: 12px; border-radius: 8px;
  display: block; overflow-x: auto; font-size: .85rem; white-space: pre-wrap;
}
.summary { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .row, .grid-2, .summary { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; transform: translateX(-105%); transition: .2s ease;
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .sidebar.open + .main ~ .sidebar-backdrop,
  body:has(.sidebar.open) .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20;
  }
}
