/* Panel de administración de ByteFix. Tokens = los de la web de Alex y los de la aplicación. */

:root {
  --bg-gradient-jet: linear-gradient(to bottom right, hsla(240, 1%, 18%, 0.251) 0%, hsla(240, 2%, 11%, 0) 100%), hsl(240, 2%, 13%);
  --border-gradient-onyx: linear-gradient(to bottom right, hsl(0, 0%, 25%) 0%, hsla(0, 0%, 25%, 0) 50%);
  --jet: hsl(0, 0%, 22%); --onyx: hsl(240, 1%, 17%); --eerie-black-1: hsl(240, 2%, 13%); --smoky-black: hsl(0, 0%, 7%);
  --white-1: hsl(0, 0%, 100%); --white-2: hsl(0, 0%, 98%);
  --accent: hsl(203, 88%, 47%); --accent-bold: hsl(203, 84%, 36%);
  --light-gray: hsl(0, 0%, 84%); --light-gray-70: hsla(0, 0%, 84%, 0.7);
  --danger: hsl(0, 43%, 51%); --ok: hsl(152, 62%, 44%); --warn: hsl(38, 90%, 55%);
  --ff: 'Nunito', gotham, 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  --shadow-1: -4px 8px 24px hsla(0, 0%, 0%, 0.125); --shadow-2: 0 16px 30px hsla(0, 0%, 0%, 0.125);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
li { list-style: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; text-align: left; }
::selection { background: var(--accent); color: var(--smoky-black); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html { font-family: var(--ff); }
body { background: var(--smoky-black); color: var(--light-gray); min-height: 100vh; font-size: 15px; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; 
  background: radial-gradient(900px 600px at 15% 10%, hsla(203, 88%, 47%, 0.16), transparent 60%),
              radial-gradient(800px 600px at 90% 95%, hsla(203, 84%, 36%, 0.14), transparent 60%),
              hsl(0, 0%, 7%);
}
body::after { content: ''; position: fixed; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.35); }

.glass { background: rgba(30, 30, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* ---------- estructura ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; max-width: 1500px; margin: 0 auto; padding: 24px; min-height: 100vh; }
.side { padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; height: calc(100vh - 48px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 14px; }
.brand b { color: var(--white-2); font-size: 18px; font-weight: 500; display: block; }
.chip { color: var(--white-1); background: var(--onyx); font-size: 12px; font-weight: 300; padding: 2px 10px; border-radius: 8px; display: inline-block; }
.nav { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; width: 100%;
  color: var(--light-gray); font-weight: 500; transition: color .25s, transform .25s, background .25s; }
.nav:hover { color: var(--accent); transform: translateX(3px); background: rgba(255, 255, 255, 0.03); }
.nav.active { color: var(--accent); font-weight: 600; background: rgba(255, 255, 255, 0.05); }
.nav.active::after { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px; background: var(--accent); }
.nav i { width: 20px; text-align: center; font-size: 16px; }
.grow { flex: 1 1 220px; min-width: 0; }
.sep { height: 1px; background: var(--jet); margin: 14px 0; }
.who { padding: 10px 12px; font-size: 13px; color: var(--light-gray-70); }
.main { min-width: 0; padding: 4px 4px 40px; }
.page { animation: up .45s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
h1 { color: var(--white-2); font-size: 30px; font-weight: 600; }
h2 { color: var(--white-2); font-size: 18px; font-weight: 500; margin-bottom: 14px; }
.sub { color: var(--light-gray); font-weight: 300; line-height: 1.6; margin: 6px 0 22px; max-width: 760px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--light-gray-70); font-size: 13px; font-weight: 300; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .5px; }

/* ---------- tarjetas ---------- */
.panel { padding: 22px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.two { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.stat { position: relative; background: var(--border-gradient-onyx); padding: 20px; border-radius: 14px; box-shadow: var(--shadow-2); z-index: 1; }
.stat::before { content: ''; position: absolute; inset: 1px; background: var(--bg-gradient-jet); border-radius: inherit; z-index: -1; }
.stat .n { color: var(--white-2); font-size: 28px; font-weight: 600; }
.stat .l { color: var(--light-gray-70); font-size: 13px; margin-top: 2px; }
.stat i { float: right; color: var(--accent); font-size: 22px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  font-weight: 500; font-size: 14px; background: rgba(255, 255, 255, 0.05); color: var(--accent); border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all .25s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--accent); color: var(--smoky-black); transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.plain { color: var(--white-2); }
.btn.danger { color: var(--danger); border-color: hsla(0, 43%, 51%, .4); }
.btn.danger:hover:not(:disabled) { background: var(--danger); color: var(--white-1); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }

/* ---------- formularios ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; color: var(--light-gray-70); margin-bottom: 5px; }
input, select, textarea { width: 100%; font: inherit; color: var(--white-2); background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px; padding: 9px 12px; }
select option { background: #1e1e1e; }
textarea { min-height: 220px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.cols { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.hint { color: var(--light-gray-70); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- tablas ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--light-gray-70); padding: 8px 10px; }
.tbl td { padding: 11px 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); vertical-align: middle; }
.tbl tr.click { cursor: pointer; transition: background .2s; }
.tbl tr.click:hover { background: rgba(255, 255, 255, 0.04); }
.tbl .name { color: var(--white-2); font-weight: 500; }
.scroll { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; background: var(--onyx); color: var(--light-gray); }
.badge.ok { color: var(--ok); background: hsla(152, 62%, 44%, .14); }
.badge.warn { color: var(--warn); background: hsla(38, 90%, 55%, .14); }
.badge.bad { color: var(--danger); background: hsla(0, 43%, 51%, .16); }
.badge.free { color: var(--accent); background: hsla(203, 88%, 47%, .14); }

/* ---------- permisos ---------- */
.perm-group { margin-bottom: 16px; }
.perm-group h3 { color: var(--white-2); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.perm { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.perm:hover { background: rgba(255, 255, 255, 0.04); }
.perm input { width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }
.perm.off { opacity: .85; cursor: default; }
.perm small { color: var(--light-gray-70); }

/* ---------- lista de actividad ---------- */
.log { display: flex; flex-direction: column; }
.log li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); font-size: 14px; align-items: baseline; }
.log li:first-child { border-top: none; }
.log time { color: var(--light-gray-70); font-size: 12px; white-space: nowrap; min-width: 112px; }
.log .who2 { color: var(--accent); font-size: 12px; white-space: nowrap; }

/* ---------- modal / avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; background: rgba(28, 28, 30, .96); }
.modal.narrow { width: min(460px, 100%); }
.code { font-size: 26px; text-align: center; color: var(--white-1); background: rgba(0, 0, 0, .4); border: 1px dashed var(--accent); border-radius: 14px; padding: 18px; margin: 16px 0; user-select: all; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; padding: 12px 18px; border-radius: 12px; background: rgba(30, 30, 30, .95); border: 1px solid rgba(255, 255, 255, .15); color: var(--white-2); animation: up .3s both; max-width: 420px; }
.toast.bad { border-color: var(--danger); }

/* ---------- acceso ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login .box { width: min(420px, 100%); padding: 32px; }
.login h1 { font-size: 24px; margin-bottom: 6px; }
.empty { text-align: center; padding: 34px 10px; color: var(--light-gray-70); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 14px; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .brand { width: 100%; }
  .nav { width: auto; }
  .grow { display: none; }
  .two { grid-template-columns: 1fr; }
}

.thread { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; }
.msg { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); max-width: 78%; align-self: flex-start; }
.msg.staff { align-self: flex-end; background: hsla(203, 88%, 47%, .14); }
.msg.system { align-self: center; max-width: 92%; background: transparent; border: 1px dashed rgba(255, 255, 255, 0.18); font-size: 13px; }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.msg time { font-size: 12px; }
button[disabled] { opacity: .45; cursor: not-allowed; }

.screenwrap { background: #000; border-radius: 10px; overflow: hidden; margin: 10px 0; }
canvas.screen { width: 100%; height: auto; display: block; outline: none; cursor: crosshair; }
canvas.screen:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.chat { margin-top: 12px; } .chatlog { max-height: 130px; overflow: auto; margin: 6px 0; font-size: 13px; } .chatlog .me { color: var(--accent); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--onyx); margin: 8px 0; font-size: 14px; }
.notice.warn { background: hsla(38, 90%, 55%, .12); }
.modal .panel { margin: 8px 0; padding: 10px 14px; }

/* ---------- controles con el tema del panel ---------- */
:root { color-scheme: dark; accent-color: var(--accent); }
input, select, textarea { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
input:hover, select:hover, textarea:hover { border-color: hsl(0, 0%, 32%); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px hsla(203, 88%, 47%, 0.18); }
input::placeholder, textarea::placeholder { color: var(--light-gray-70); opacity: 0.75; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white-2); caret-color: var(--white-2);
  -webkit-box-shadow: 0 0 0 1000px hsl(240, 2%, 11%) inset; transition: background-color 9999s ease-out;
}
input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer; background: var(--light-gray); opacity: 0.7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3l10 10M13 3L3 13' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type='checkbox'] {
  -webkit-appearance: none; appearance: none; width: 18px !important; height: 18px; padding: 0; flex: none; cursor: pointer; display: inline-grid; place-content: center;
  background: rgba(0, 0, 0, 0.3); border: 1.5px solid hsl(0, 0%, 36%); border-radius: 5px; transition: background 0.15s ease, border-color 0.15s ease;
}
input[type='checkbox']::after { content: ''; width: 10px; height: 10px; background: var(--smoky-black); transform: scale(0); transition: transform 0.12s ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.5 3.5 7.5-8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type='checkbox']:hover:not(:disabled) { border-color: var(--accent); }
input[type='checkbox']:checked { background: var(--accent); border-color: var(--accent); }
input[type='checkbox']:checked::after { transform: scale(1); }
input[type='checkbox']:disabled { opacity: 0.45; cursor: not-allowed; }
.perm input[type='checkbox'] { width: 18px; height: 18px; }
textarea::-webkit-scrollbar, .tsel-list::-webkit-scrollbar { width: 6px; height: 6px; }
textarea::-webkit-scrollbar-thumb, .tsel-list::-webkit-scrollbar-thumb { background: var(--jet); border-radius: 6px; }
textarea::-webkit-scrollbar-thumb:hover, .tsel-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
html { scrollbar-color: var(--jet) transparent; }

/* desplegable propio (sustituye al <select> nativo; ver themed.js) */
.tsel { position: relative; display: block; width: 100%; }
td .tsel, .filters .tsel, .bar .tsel, .row .tsel, .toolbar .tsel { display: inline-block; width: auto; min-width: 150px; }
.tsel-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.tsel-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; color: var(--white-2); padding: 9px 12px; font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.tsel-btn:hover:not(:disabled) { border-color: hsl(0, 0%, 32%); }
.tsel-btn[aria-expanded='true'], .tsel-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px hsla(203, 88%, 47%, 0.18); outline: none; }
.tsel-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.tsel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsel-btn .fa-chevron-down { font-size: 12px; color: var(--light-gray); transition: transform 0.2s ease; }
.tsel-btn[aria-expanded='true'] .fa-chevron-down { transform: rotate(180deg); }
.tsel-list { position: fixed; z-index: 1000; min-width: 160px; overflow-y: auto; padding: 5px; background: hsl(240, 2%, 14%); border: 1px solid var(--jet); border-radius: 12px; box-shadow: 0 16px 30px hsla(0, 0%, 0%, 0.45); animation: tpop 0.12s ease; }
.tsel-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--light-gray); font-size: 14px; }
.tsel-list li.active { background: hsla(203, 88%, 47%, 0.16); color: var(--white-1); }
.tsel-list li[aria-selected='true'] { color: var(--accent); }
.tsel-list li.dis { opacity: 0.4; cursor: not-allowed; }
.tsel-list li .fa-check { font-size: 12px; }
@keyframes tpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tsel-list { animation: none; } }

/* visor en pantalla completa: la imagen se ajusta sin deformarse y el chat se queda fuera */
.screenwrap:fullscreen { display: flex; align-items: center; justify-content: center; width: 100vw; height: 100vh; margin: 0; border-radius: 0; background: #000; }
.screenwrap:fullscreen canvas.screen { width: 100%; height: 100%; object-fit: contain; }


/* ======================================================================
   Panel de ByteFix Web: mismas piezas que el admin de la aplicación + las propias de la web
   ====================================================================== */
.shell .side .grp { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--light-gray-70); }
.side { overflow-y: auto; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 18px; flex: none;
  background: linear-gradient(135deg, hsl(203, 88%, 55%), hsl(203, 88%, 38%)); box-shadow: 0 8px 24px hsla(203, 88%, 47%, .45); }
.side form.logout { margin: 0; }
.main > .page > h1:first-child, .main > .page > .head h1 { margin-bottom: 6px; }
.main .page > h1 + .sub, .main .page > h1 + p.muted { margin-bottom: 18px; }
.panel { background: rgba(30, 30, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.modal .panel { box-shadow: none; }
.main.embed { padding: 4px 4px 40px; }
.app-loading { padding: 40px; text-align: center; color: var(--light-gray-70); }

/* formularios con etiqueta suelta (las pantallas de la web) */
form.panel label, .panel label { display: block; font-size: 13px; color: var(--light-gray-70); margin: 14px 0 5px; }
form.panel label:first-of-type, .panel .cols label { margin-top: 0; }
label.inl { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: var(--light-gray); font-size: 14px; cursor: pointer; }
.top-gap { margin-top: 16px; }
.panel h2:first-child { margin-top: 0; }
.panel p { margin: 10px 0; }
.panel .cols > div > label { margin-top: 0; }
button.btn { text-align: center; }
.btn.primary { background: linear-gradient(135deg, hsl(203, 88%, 52%), hsl(203, 88%, 40%)); color: #fff; border-color: transparent; box-shadow: 0 8px 22px hsla(203, 88%, 47%, .3); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, hsl(203, 88%, 58%), hsl(203, 88%, 44%)); color: #fff; }
form.inline { display: inline; margin: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; background: var(--onyx); color: var(--light-gray); }
.pill.ok { color: var(--ok); background: hsla(152, 62%, 44%, .14); }
.pill.warn { color: var(--warn); background: hsla(38, 90%, 55%, .14); }
.flash { display: flex; gap: 10px; padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; background: var(--onyx); border: 1px solid rgba(255, 255, 255, .1); }
.flash.ok { color: var(--ok); background: hsla(152, 62%, 44%, .12); border-color: hsla(152, 62%, 44%, .3); }
.flash.warn { color: var(--warn); background: hsla(38, 90%, 55%, .12); border-color: hsla(38, 90%, 55%, .3); }
.flash.err { color: hsl(0, 70%, 70%); background: hsla(0, 43%, 51%, .14); border-color: hsla(0, 43%, 51%, .4); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--light-gray-70); padding: 8px 10px; }
td { padding: 11px 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); vertical-align: middle; }
td a, .panel a:not(.btn) { color: var(--white-2); font-weight: 500; }
td a:hover, .panel a:not(.btn):hover { color: var(--accent); }
.panel { overflow-x: auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin: 10px 0 16px; }
.thumbs > div { display: flex; flex-direction: column; gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); }
.stat .n a, .stat a { color: var(--accent); font-size: 13px; }
.stat.link { display: block; transition: transform .25s; } .stat.link:hover { transform: translateY(-3px); }
.stat .n small { font-size: 15px; color: var(--light-gray-70); font-weight: 400; }
.quick { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.quick a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: var(--white-2); font-weight: 500; transition: all .25s; }
.quick a:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--accent); }
.quick a i { color: var(--accent); font-size: 18px; width: 22px; text-align: center; }
.svc { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.07); }
.svc:first-of-type { border-top: 0; }
.svc .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px hsla(38,90%,55%,.15); }
.svc .dot.up { background: var(--ok); box-shadow: 0 0 0 4px hsla(152,62%,44%,.18); animation: pulse 2.4s infinite; }
.svc .dot.down { background: var(--danger); box-shadow: 0 0 0 4px hsla(0,43%,51%,.2); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px hsla(152,62%,44%,0); } }
.svc b { color: var(--white-2); font-weight: 500; }
.mono.big { font-size: 20px; color: var(--white-1); user-select: all; overflow-wrap: anywhere; }
.page > .row.head-row { margin-bottom: 12px; }

/* acceso: SIEMPRE centrado y sin scroll */
html:has(body.login-page), body.login-page { height: 100%; overflow: hidden; }
.login { min-height: 100dvh; height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .box { width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 30px 30px 24px; text-align: center; }
.login .box form { text-align: left; }
.login .logo { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, hsl(203, 88%, 55%), hsl(203, 88%, 38%)); box-shadow: 0 10px 34px hsla(203, 88%, 47%, .55); animation: bob 3.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.login h1 { font-size: 24px; margin-bottom: 4px; }
.login .sub { margin: 4px auto 18px; }
.login .field { position: relative; display: block; }
.login .field > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--light-gray-70); pointer-events: none; }
.login .field input { padding: 11px 40px; border-radius: 12px; font-size: 15px; }
.login .field .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 8px 10px; color: var(--light-gray); border-radius: 8px; }
.login .field .eye:hover { color: var(--white-1); }
.login label.f { margin-bottom: 12px; }
.login .btn.primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.login .foot { margin-top: 16px; font-size: 12px; color: var(--light-gray-70); }
.orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orbs i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.orbs .o1 { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: hsl(203, 88%, 47%); animation: ad1 18s ease-in-out infinite alternate; }
.orbs .o2 { width: 38vw; height: 38vw; right: -10vw; bottom: -12vw; background: hsl(262, 70%, 50%); animation: ad2 22s ease-in-out infinite alternate; }
.orbs .o3 { width: 26vw; height: 26vw; left: 42vw; top: 30vh; background: hsl(180, 70%, 40%); opacity: .2; animation: ad3 26s ease-in-out infinite alternate; }
@keyframes ad1 { to { transform: translate(14vw, 12vh) scale(1.15); } }
@keyframes ad2 { to { transform: translate(-14vw, -10vh) scale(.9); } }
@keyframes ad3 { to { transform: translate(-18vw, -10vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .orbs i, .login .logo, .svc .dot { animation: none !important; } }

.panel .cols { margin-top: 14px; }
.panel .cols + label { margin-top: 14px; }

/* --- secciones plegables --- */
.side .grp { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; margin: 12px 0 2px; padding: 6px 12px; width: 100%; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--light-gray-70); cursor: pointer; border-radius: 8px; }
.side .grp:hover, .side .grp:focus-visible { background: rgba(255,255,255,.06); outline: none; }
.side .grp .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .22s ease; margin-right: 3px; }
.side .grp[aria-expanded="false"] .chev { transform: rotate(-45deg); }
.grp-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .24s ease, opacity .2s ease; }
.grp-body.shut { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }
.grp-in { overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .grp-body, .grp .chev { transition: none; } }

/* --- ventana de imágenes y proyectos --- */
.dlg { margin: auto; border: 0; padding: 0; background: transparent; color: inherit; width: min(760px, 94vw); max-height: 92vh; }
.dlg::backdrop { background: rgba(5,12,24,.65); backdrop-filter: blur(4px); }
.dlg-box { padding: 22px; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-box .head { display: flex; justify-content: space-between; align-items: center; }
.drop { border: 2px dashed rgba(255,255,255,.25); border-radius: 14px; padding: 22px; text-align: center; transition: border-color .2s, background .2s; }
.drop.over { border-color: hsl(203,88%,47%); background: rgba(40,150,230,.1); }
.imglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.imgrow { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.05); }
.imgrow img { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; }
.imgmeta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.imgacts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.err { color: #ff8a8a; min-height: 1.2em; margin: 0; }
.dlg-actions { display: flex; gap: 10px; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.logo-prev { max-height: 56px; border-radius: 8px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs > div { position: relative; }
.thumbs img { height: 80px; border-radius: 10px; display: block; }
@media (max-width: 600px) { .imgrow { grid-template-columns: 64px 1fr; } .imgacts { grid-column: 1 / -1; justify-content: flex-start; } }

/* --- CRM, ventas, correo --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; margin: 0; }
.stat b { font-size: 1.8rem; line-height: 1; }
.stat span { color: var(--light-gray-70); font-size: 13px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .cols2 { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
code.sec { word-break: break-all; }

#lines { width: 100%; margin: 10px 0 16px; }
#lines td, #lines th { padding: 4px; vertical-align: middle; }
#lines td:first-child { width: 46%; } #lines input { width: 100%; }
#lines th.r, #lines td.r { text-align: right; white-space: nowrap; }
.tot { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; justify-content: flex-end; }
.tot .grand { font-size: 1.15rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.svc-log{grid-column:1 / -1;margin:0 0 0 26px}.svc-log summary{cursor:pointer;color:var(--muted,#9aa6bb)}
.svc-log pre{margin:.4rem 0 0;padding:.7rem;border-radius:10px;background:rgba(0,0,0,.35);overflow:auto;font-size:.8rem;max-height:12rem;white-space:pre-wrap}

/* Logotipo de marca (imagen circular) */
.brand .logo, .login .logo { background: none; border-radius: 50%; overflow: hidden; box-shadow: 0 0 22px hsla(210, 100%, 55%, .5); }
.brand .logo img, .login .logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login .logo { width: 84px; height: 84px; }

/* v3: iconos blancos sobre fondos azules (antes azul sobre azul = invisible) */
.btn.primary .fa-duotone, .btn-pub .fa-duotone, .logo .fa-duotone, .login-btn .fa-duotone,
.btn.primary i, .btn-pub i, .logo i, .login-btn i { --fa-primary-color: #fff; --fa-secondary-color: #fff; --fa-secondary-opacity: .7; color: #fff; }
.btn.ghost .fa-duotone, .btn.sm:not(.primary) .fa-duotone { --fa-primary-color: var(--accent); --fa-secondary-color: var(--accent); }
.btn:not(.primary):not(.btn-pub):not(.wa):hover:not(:disabled) .fa-duotone { --fa-primary-color: var(--smoky-black); --fa-secondary-color: var(--smoky-black); }

/* utilidades (sin estilos en línea: la política de seguridad no los permite) */
.w-10 { max-width: 10rem; } .w-7 { max-width: 7rem; } .mt-s { margin-top: .6rem; } .pre-wrap { white-space: pre-wrap; }
