/* APC ACTIVA - portal de operaciones
   Paleta del logo: azul profundo, azul claro, naranja de acento. */

:root {
  --blue-900: #0a1c47;
  --blue-800: #102a69;
  --blue-700: #1a3fd0;
  --blue-600: #2160d8;
  --blue-500: #2f7fe0;
  --blue-300: #35a8e0;
  --orange:   #f4511e;
  --orange-d: #d43e10;

  --ink:    #101828;
  --ink-2:  #344054;
  --ink-3:  #566072;
  --muted:  #7b8698;
  --line:   #e7ebf1;
  --line-2: #dfe4ec;
  --bg:     #f5f7fb;
  --card:   #fff;
  --hover:  #f8fafc;

  --ok:     #067a4e;
  --ok-bg:  #e7f6ef;
  --ok-br:  #b9e5cf;
  --red:    #b42318;
  --red-bg: #fdeceb;
  --red-br: #f6cdc9;
  --warn:   #b54708;

  --r:    10px;
  --r-sm: 7px;
  --sh:   0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --sh-2: 0 8px 28px rgba(16,24,40,.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: -.1px; }
.muted { color: var(--muted); }
.neg { color: var(--red); }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
.hide { display: none !important; }

/* ------------------------------------------------------------------ login - */

.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 560px at 12% -12%, rgba(53,168,224,.30), transparent 60%),
    radial-gradient(760px 480px at 112% 112%, rgba(244,81,30,.20), transparent 55%),
    linear-gradient(160deg, var(--blue-900) 0%, #0d2358 55%, #07142f 100%);
}
.login-wrap { width: 100%; max-width: 392px; }
.login-card { background: var(--card); border-radius: 16px; padding: 32px 30px 28px; box-shadow: 0 24px 64px rgba(3,10,30,.44); }
.login-brand { text-align: center; margin-bottom: 20px; }
.login-brand img { width: 172px; max-width: 100%; height: auto; }
.login-h { margin: 0 0 22px; font-size: 18px; font-weight: 640; letter-spacing: -.2px; text-align: center; }
.login-sub { margin: 3px 0 22px; font-size: 12.8px; color: var(--muted); text-align: center; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-foot { margin: 18px 0 0; text-align: center; color: rgba(255,255,255,.5); font-size: 12px; }

/* ------------------------------------------------------------------ shell -- */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 232px; flex: 0 0 232px;
  background: linear-gradient(180deg, var(--blue-900) 0%, #08183d 62%, #061229 100%);
  color: #c3d4ee; display: flex; flex-direction: column;
  padding: 18px 12px; position: sticky; top: 0; height: 100vh;
}
.side-brand { background: #fff; border-radius: 8px; padding: 10px; margin: 0 4px 22px; }
.side-logo { display: block; width: 100%; height: auto; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-i {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: var(--r-sm);
  color: #a9c0e3; font-size: 13.5px; font-weight: 500;
  transition: background .14s ease, color .14s ease;
}
.nav-i:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-i.on { background: linear-gradient(90deg, var(--blue-700), var(--blue-600)); color: #fff; box-shadow: 0 2px 10px rgba(26,63,208,.35); }

.ico { width: 16px; height: 16px; flex: 0 0 16px; background: currentColor; }
.ico-home  { -webkit-mask: var(--m-home) center/contain no-repeat; mask: var(--m-home) center/contain no-repeat; }
.ico-users { -webkit-mask: var(--m-users) center/contain no-repeat; mask: var(--m-users) center/contain no-repeat; }
.ico-prov  { -webkit-mask: var(--m-prov) center/contain no-repeat; mask: var(--m-prov) center/contain no-repeat; }
.ico-call  { -webkit-mask: var(--m-call) center/contain no-repeat; mask: var(--m-call) center/contain no-repeat; }

:root {
  --m-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  --m-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8m7 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6M2 20c0-3.3 3.1-6 7-6s7 2.7 7 6zm15.5 0c0-2.3-1-4.3-2.6-5.6 3.2.3 5.6 2.4 5.6 5.1V20z'/%3E%3C/svg%3E");
  --m-prov: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h16a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m0 9h16a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1m2.5 2.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2m0-9a1 1 0 1 0 0 2 1 1 0 0 0 0-2'/%3E%3C/svg%3E");
  --m-call: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.6 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.6 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
  --m-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%237b8698' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1.5 2 6 6.5 10.5 2'/%3E%3C/svg%3E");
}

.side-foot { border-top: 1px solid rgba(255,255,255,.09); padding-top: 14px; margin-top: 14px; }
.who { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; padding: 0 4px; }
.who-av {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-300));
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.who-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-t strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t span { color: #7f9bc4; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.logout-f { margin: 0 4px; }

.main { flex: 1; padding: 24px 28px 90px; min-width: 0; }

/* ------------------------------------------------------------------- head -- */

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head-l { min-width: 0; }
.back { display: inline-block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.back::before { content: "← "; }
.back:hover { color: var(--blue-700); text-decoration: none; }
.head-h { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.45px; }
.head-s { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.head-meta { display: flex; align-items: center; gap: 9px; margin-top: 6px; flex-wrap: wrap; font-size: 12.5px; }
.head-actions { display: flex; align-items: center; gap: 7px; }

/* ------------------------------------------------------------------- kpis -- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 1px; }
.kpi-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 620; }
.kpi-v { font-size: 25px; font-weight: 660; letter-spacing: -.7px; line-height: 1.25; }
.kpi-m { font-size: 12px; color: var(--muted); }
.kpi-accent { background: linear-gradient(135deg, var(--blue-800), var(--blue-700)); border-color: transparent; }
.kpi-accent .kpi-l, .kpi-accent .kpi-m { color: rgba(255,255,255,.68); }
.kpi-accent .kpi-v { color: #fff; font-size: 18px; }

/* ------------------------------------------------------------------ cards -- */

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 18px 18px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-h h2 { margin: 0; font-size: 14px; font-weight: 640; letter-spacing: -.1px; }
.lnk { font-size: 12.5px; font-weight: 550; }
.empty { color: var(--muted); font-size: 13.5px; margin: 4px 0; }

.card-id { background: linear-gradient(135deg, #fbfcff, #f4f7ff); border-color: #dde6f8; }
.card-cred { background: linear-gradient(135deg, #fbfcff, #f2f6ff); border-color: #dde6f8; padding: 14px 18px; }
.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 18px; }
.cred { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cred-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 620; }
.cred strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ tabs --- */

.tabs { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 16px; }
.tabs-nav {
  display: flex; gap: 2px; padding: 6px 6px 0; overflow-x: auto;
  border-bottom: 1px solid var(--line); background: #fcfdfe;
  border-radius: var(--r) var(--r) 0 0;
}
.tab {
  position: relative; border: none; background: none; cursor: pointer;
  padding: 9px 13px 10px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  font: inherit; font-size: 12.8px; font-weight: 560; color: var(--muted);
  white-space: nowrap; transition: color .14s ease, background .14s ease;
}
.tab:hover { color: var(--ink-2); background: rgba(16,24,40,.03); }
.tab.on { color: var(--blue-700); background: var(--card); }
.tab.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--blue-700); border-radius: 2px 2px 0 0; }
.tab-bad { display: inline-block; margin-left: 6px; min-width: 16px; padding: 0 4px; border-radius: 100px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; }

/* El <head> marca html.js antes del primer pintado, asi el formulario nace
   ya en modo pestanas. Sin JS no hay marca: se ven todos los paneles y no se
   pierde ningun campo. */
.tab-panel { display: block; padding: 18px; }
html:not(.js) .tabs .tabs-nav { display: none; }
html:not(.js) .tabs .tab-panel + .tab-panel { border-top: 1px solid var(--line); }
.js .tabs .tab-panel { display: none; }
.js .tabs .tab-panel.on { display: block; }

/* -------------------------------------------------------------- formulario - */

.grid-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px 16px; }

.fld { display: flex; flex-direction: column; gap: 4px; position: relative; min-width: 0; }
.fld-wide { grid-column: 1 / -1; }
.fld-l { font-size: 11.8px; font-weight: 600; color: var(--ink-3); letter-spacing: .005em; }
.fld-l em { color: var(--orange); font-style: normal; }
.fld-h { font-size: 11.2px; color: var(--muted); line-height: 1.35; }
.fld-e { font-size: 11.2px; color: var(--red); font-weight: 550; }
.fld-in { position: relative; display: block; }
.fld-unit {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: var(--muted); pointer-events: none;
  background: #f4f6fa; border-radius: 4px; padding: 1px 5px;
}
.fld-i.has-unit { padding-right: 44px; }

.fld-i {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; font: inherit; font-size: 13.2px; color: var(--ink);
  transition: border-color .13s ease, box-shadow .13s ease, background .13s ease;
}
textarea.fld-i { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.fld-i::placeholder { color: #a8b1c0; }
.fld-i:hover:not(:disabled) { border-color: #ccd5e2; }
.fld-i:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47,127,224,.13); }
.fld-i:disabled { background: #f4f6fa; color: var(--muted); cursor: not-allowed; }
.fld-i.bad { border-color: var(--red); background: #fffbfb; }
.fld-i.bad:focus { box-shadow: 0 0 0 3px rgba(180,35,24,.12); }

select.fld-i {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: var(--m-caret); background-repeat: no-repeat;
  background-position: right 9px center; background-size: 11px; padding-right: 28px;
}
input[type="date"].fld-i { padding-right: 6px; }
input[type="number"].fld-i { -moz-appearance: textfield; }
input[type="number"].fld-i::-webkit-outer-spin-button,
input[type="number"].fld-i::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.filters { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.fld-search { min-width: 240px; flex: 1 1 240px; max-width: 380px; }
.fld-sel { width: auto; min-width: 150px; }

/* Barra de guardado fija abajo */
.form-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -28px -90px; padding: 12px 28px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(16,24,40,.06);
}
.form-bar-note { font-size: 11.8px; color: var(--muted); margin-left: auto; }

/* ---------------------------------------------------------------- botones -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 16px; border: none; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: #fff; font: inherit; font-size: 13.2px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.1); transition: filter .13s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; height: 38px; margin-top: 2px; }
.btn-alt { background: linear-gradient(135deg, var(--orange), var(--orange-d)); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-xs { height: 20px; padding: 0 6px; font-size: 11px; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fff; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 550;
  cursor: pointer; transition: border-color .13s ease, color .13s ease, background .13s ease;
}
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-700); background: #fafcff; text-decoration: none; }
.form-bar .btn-ghost { height: 34px; padding: 0 14px; font-size: 13.2px; }

/* ----------------------------------------------------------------- tablas -- */

.tbl-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px 2px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.tbl th {
  text-align: left; font-size: 10.8px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 650; padding: 0 10px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid #f2f5f9; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl-hover tbody tr { transition: background .12s ease; }
.tbl-hover tbody tr:hover { background: var(--hover); }
.lnk-strong { font-weight: 600; color: var(--ink); }
.lnk-strong:hover { color: var(--blue-700); }

.list { list-style: none; margin: 0; padding: 0; }
.list-i { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f5f9; }
.list-i:last-child { border-bottom: none; }
.list-main { display: flex; flex-direction: column; line-height: 1.3; color: var(--ink); min-width: 0; }
.list-main strong { font-weight: 600; font-size: 13.5px; }
.list-main .muted { font-size: 12px; }

/* ------------------------------------------------------------------ tags --- */

.tag { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 640; letter-spacing: .01em; }
.tag-green { background: var(--ok-bg); color: var(--ok); }
.tag-red   { background: var(--red-bg); color: var(--red); }
.tag-blue  { background: #eaf1fe; color: var(--blue-700); }

.pill { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 100px; background: #eff2f7; color: var(--ink-2); font-size: 12px; font-weight: 630; }
a.pill:hover { background: var(--blue-700); color: #fff; text-decoration: none; }
.pill-live { background: var(--ok-bg); color: var(--ok); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: var(--ok); }
.dot-wait { background: #e3a008; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.secret { letter-spacing: .5px; }

/* --------------------------------------------------------------- mensajes -- */

.flashes { margin-bottom: 14px; display: flex; flex-direction: column; gap: 7px; }
.flash { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.2px; font-weight: 500; }
.flash-ok  { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-br); }
.flash-err { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-br); }
.alert { padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 14px; background: var(--red-bg); color: var(--red); border: 1px solid var(--red-br); font-size: 13.2px; font-weight: 500; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 12.5px; }

/* ------------------------------------------------- panel usuario final ----- */

.filters-card { padding: 16px 18px; }
.filters-act { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.deflist { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: baseline; }
.deflist dt { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.deflist dd { margin: 0; font-size: 13.2px; overflow-wrap: anywhere; }

.page-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.flash-warn { background: #fff7ed; color: #7c3d09; border: 1px solid #f6c99a; margin-bottom: 14px;
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 13.2px; }

.ico-cdr { -webkit-mask: var(--m-cdr) center/contain no-repeat; mask: var(--m-cdr) center/contain no-repeat; }
.ico-dev { -webkit-mask: var(--m-dev) center/contain no-repeat; mask: var(--m-dev) center/contain no-repeat; }
.ico-rate { -webkit-mask: var(--m-rate) center/contain no-repeat; mask: var(--m-rate) center/contain no-repeat; }
:root {
  --m-cdr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2h9l5 5v15a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1m8 1.5V8h4.5zM7 12h10v1.6H7zm0 4h10v1.6H7zm0-8h4v1.6H7z'/%3E%3C/svg%3E");
  --m-dev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2m0 3v9h10V5zm5 11.5a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4'/%3E%3C/svg%3E");
  --m-rate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.4 11.6 12.4 2.6A2 2 0 0 0 11 2H4a2 2 0 0 0-2 2v7c0 .53.21 1.04.59 1.41l9 9a2 2 0 0 0 2.82 0l7-7a2 2 0 0 0 0-2.82zM6.5 8A1.5 1.5 0 1 1 8 6.5 1.5 1.5 0 0 1 6.5 8z'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------- codecs ---- */

.panel-note { margin: 0 0 16px; font-size: 12.8px; color: var(--muted); }
.codec-group + .codec-group { margin-top: 18px; }
.codec-h {
  margin: 0 0 8px; font-size: 11px; font-weight: 660; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
.codec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 6px 12px; }
.codec {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: #fcfdfe;
  transition: border-color .13s ease, background .13s ease;
}
.codec.on { border-color: #c7dcfa; background: #f7faff; }
.codec:hover { border-color: #ccd5e2; }
.codec-pick { display: flex; align-items: baseline; gap: 8px; flex: 1; cursor: pointer; min-width: 0; }
.codec-pick input { width: 15px; height: 15px; accent-color: var(--blue-700); cursor: pointer; flex: 0 0 15px; }
.codec-n { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; }
.codec-d { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codec-p {
  width: 46px; height: 26px; flex: 0 0 46px; text-align: center;
  border: 1px solid var(--line-2); border-radius: 5px; background: #fff;
  font: inherit; font-size: 12.5px; color: var(--ink);
  -moz-appearance: textfield;
}
.codec-p::-webkit-outer-spin-button, .codec-p::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.codec-p:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 2px rgba(47,127,224,.15); }

/* ------------------------------------------------- acciones de fila -------- */

.row-acts { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.inline-f { margin: 0; display: inline; }

/* --------------------------------------------- barra de suplantacion ------- */

.impbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -6px 0 14px; padding: 9px 14px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, #eef4ff, #e4edff);
  border: 1px solid #bed3f7; color: var(--blue-800); font-size: 12.8px;
}
.impbar-t strong { font-weight: 680; }

/* Aviso de sesion de desarrollador */
.devbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 0 14px; padding: 8px 14px; border-radius: var(--r-sm);
  background: repeating-linear-gradient(135deg, #fff7ed, #fff7ed 10px, #fef0e0 10px, #fef0e0 20px);
  border: 1px solid #f6c99a; color: #7c3d09; font-size: 12.5px;
}
.devbar strong { font-weight: 680; font-size: 12.5px; }
.devbar code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.8px;
  background: rgba(124,61,9,.09); padding: 1px 5px; border-radius: 4px; }

/* --------------------------------------------------------- number pools --- */

.ico-pool { -webkit-mask: var(--m-pool) center/contain no-repeat; mask: var(--m-pool) center/contain no-repeat; }
:root {
  --m-pool: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c4.4 0 8 1.35 8 3v14c0 1.65-3.6 3-8 3s-8-1.35-8-3V5c0-1.65 3.6-3 8-3m0 2c-3.4 0-6 .9-6 1.5S8.6 7 12 7s6-.9 6-1.5S15.4 4 12 4M6 9.4V12c0 .6 2.6 1.5 6 1.5s6-.9 6-1.5V9.4c-1.6.7-3.8 1-6 1s-4.4-.3-6-1m0 6V19c0 .6 2.6 1.5 6 1.5s6-.9 6-1.5v-3.6c-1.6.7-3.8 1-6 1s-4.4-.3-6-1'/%3E%3C/svg%3E");
}

.howto { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.howto li + li { margin-top: 5px; }
.howto code, .panel-note code, .fld-h code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.8px; background: #eff2f7; border-radius: 4px; padding: 1px 5px;
}

.card-danger { border-color: #f3d3cf; background: linear-gradient(135deg, #fffcfc, #fdf5f4); }
.card-danger .card-h h2 { color: var(--red); }
.btn-danger { background: linear-gradient(135deg, #c53024, #a51d13); }
.danger-acts { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.danger-acts .muted { font-size: 12.5px; max-width: 460px; }

.fld-file { height: auto; padding: 7px 10px; line-height: 1.4; }
.pool-name-note { margin-top: 14px; margin-bottom: 0; }

/* ---------------------------------------------------------- panel CallerID - */

.cid-top { margin-bottom: 16px; }

.cid-group {
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fcfdfe; padding: 12px 14px 14px; margin-bottom: 16px;
}
.cid-h {
  margin: 0 0 10px; font-size: 11px; font-weight: 660; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

.cid-opt { padding: 7px 0; border-bottom: 1px solid #f0f3f8; }
.cid-opt:last-child { border-bottom: none; }
.cid-opt.off { opacity: .55; }

.cid-pick { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.cid-pick input { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--blue-700); cursor: pointer; }
.cid-pick input:disabled { cursor: not-allowed; }
.cid-lbl { font-size: 13.2px; color: var(--ink-2); font-weight: 550; }

.cid-extra { margin: 6px 0 0 23px; display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.cid-note { display: block; margin: 3px 0 0 23px; font-size: 11.2px; color: var(--muted); }
.cid-hint { margin: 4px 0 8px 23px; font-size: 12.2px; }

.cid-sub {
  margin-top: 8px; padding: 10px 12px; border-left: 2px solid var(--line-2);
  background: #fff; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  display: flex; flex-direction: column; gap: 7px;
}
.cid-sub[hidden] { display: none; }
.cid-dev { max-width: 130px; }
.cid-num { max-width: 260px; }

.cid-hdr { display: flex; flex-direction: column; gap: 5px; }
.cid-hdr + .cid-hdr { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cid-hdr-l { font-size: 11px; font-weight: 660; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cid-hdr .fld-i { max-width: 260px; }

.cid-inline { display: flex; gap: 8px; align-items: center; }
.cid-inline .fld-i:first-child { flex: 1 1 auto; }
.cid-inline .cid-blk { width: 84px; flex: 0 0 84px; }

.cid-rest { margin-top: 4px; }
.cid-fake { margin-top: 16px; }

/* ------------------------------- CallerID compacto (vista del cliente) ----- */

.card-cid { max-width: 520px; }
.cid-mini { max-width: 420px; }
.cid-mini-name { margin-bottom: 10px; }
.cid-mini-save { margin-top: 12px; }

/* Version angosta del grupo de opciones: sin caja, lineas de 1px, filas bajas. */
.cid-slim { border: none; background: none; padding: 0; margin: 0; }
.cid-slim .cid-opt { padding: 5px 0; border-bottom: 1px solid var(--line); }
.cid-slim .cid-opt:first-child { border-top: 1px solid var(--line); }
.cid-slim .cid-pick { gap: 7px; }
.cid-slim .cid-pick input { width: 13px; height: 13px; flex: 0 0 13px; }
.cid-slim .cid-lbl { font-size: 12.5px; font-weight: 500; }
.cid-slim .cid-extra { margin: 4px 0 0 20px; gap: 4px; max-width: 100%; }
.cid-slim .cid-note { margin: 2px 0 0 20px; }
.cid-slim .fld-i { height: 30px; font-size: 12.5px; }
.cid-slim .cid-sub {
  margin-top: 5px; padding: 6px 9px; gap: 4px;
  background: #fafbfd; border-left: 1px solid var(--line-2);
}
.cid-slim .cid-sub .cid-pick { align-items: center; }
.cid-slim .cid-dev { width: 78px; height: 26px; margin-left: 6px; }

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
  .side-brand { margin: 0; padding: 6px 9px; width: 108px; flex: 0 0 108px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .nav-i span:not(.ico) { display: none; }
  .nav-i { padding: 8px 10px; }
  .side-foot { border: none; margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 8px; }
  .who { margin: 0; }
  .who-t { display: none; }
  .main { padding: 18px 14px 90px; }
  .cols { grid-template-columns: 1fr; }
  .form-bar { margin: 0 -14px -90px; padding: 10px 14px; }
  .form-bar-note { display: none; }
}
