/* ========== Reset / base ========== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1f2733;
  background: #fafbfc;
  display: flex;
}
a { color: #b8860b; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ========== Login ========== */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 85% -10%, #fdfaf2 0%, transparent 55%),
    #fafbfc;
}
.login-card {
  background: #ffffff; padding: 36px; border-radius: 16px;
  width: 380px; display: flex; flex-direction: column; gap: 14px;
  border: 1px solid #e7e9ee;
  box-shadow: 0 20px 50px rgba(31,39,51,0.10);
}
.login-card h1 {
  margin: 0 0 8px; font-size: 18px; color: #b8860b;
  letter-spacing: 0.5px; font-weight: 700;
}
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; color: #6b7685; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
}
.login-card input {
  padding: 11px 12px; border-radius: 8px; border: 1px solid #d9dee6;
  background: #fff; color: #1f2733; font-size: 14px;
}
.login-card input:focus { outline: 2px solid #e0a82e; outline-offset: -1px; border-color: transparent; }
.login-card button {
  padding: 12px; border-radius: 8px; border: 0;
  background: linear-gradient(135deg, #e7b53c, #cf971c);
  color: #3a2c08; font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
}
.err { color: #dc2626; margin: 0; font-size: 13px; }

/* ========== Sidebar ========== */
.sidebar {
  width: 240px; min-width: 240px; height: 100vh;
  background: #ffffff; border-right: 1px solid #e7e9ee;
  display: flex; flex-direction: column; padding: 20px 14px;
  position: sticky; top: 0;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px 22px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #e7b53c 0%, #cf971c 100%);
  color: #3a2c08;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(207,151,28,0.30);
}
.brand-name {
  font-weight: 700; font-size: 14px; color: #1f2733;
  letter-spacing: 0.3px;
}
.brand-sub { color: #9aa3b0; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; }

.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 18px; margin-top: 8px; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title {
  font-size: 10px; text-transform: uppercase; color: #9aa3b0;
  letter-spacing: 0.8px; padding: 6px 10px; font-weight: 700;
}
.sidebar nav button {
  background: transparent; border: 0; color: #4b5563;
  padding: 9px 10px; border-radius: 7px; text-align: left;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  position: relative;
}
.sidebar nav button:hover { background: #f3f4f6; color: #1f2733; }
.sidebar nav button.active {
  background: linear-gradient(90deg, rgba(207,151,28,0.14), rgba(207,151,28,0.04));
  color: #a9760a; font-weight: 600;
}
.sidebar nav button.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 3px; background: #cf971c; border-radius: 0 3px 3px 0;
}
.sidebar nav .badge {
  margin-left: auto; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  border-top: 1px solid #e7e9ee; padding-top: 14px; margin-top: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.user { display: flex; gap: 10px; align-items: center; padding: 4px 6px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #e7b53c, #cf971c); color: #3a2c08;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-name { font-weight: 500; font-size: 13px; color: #1f2733; }
.user-sub { color: #9aa3b0; font-size: 11px; }
.logout-btn {
  background: transparent; border: 1px solid #d9dee6; color: #6b7685;
  padding: 8px; border-radius: 7px; font-size: 12px; width: 100%;
}
.logout-btn:hover { background: #f3f4f6; color: #1f2733; }

/* ========== Content ========== */
.content { flex: 1; padding: 30px 36px; min-width: 0; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 24px;
}
.page-header h1 {
  margin: 0 0 4px; font-size: 24px; font-weight: 700; color: #1f2733;
  letter-spacing: -0.3px;
}
.page-sub { margin: 0; color: #6b7685; font-size: 13px; }

.period-tabs {
  display: flex; gap: 2px; background: #ffffff;
  border: 1px solid #e3e6ec; border-radius: 9px; padding: 3px;
}
.period-tabs button {
  background: transparent; border: 0; color: #6b7685;
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
}
.period-tabs button.active {
  background: linear-gradient(135deg, #e7b53c, #cf971c);
  color: #3a2c08;
}
.period-tabs button { cursor: pointer; }
.period-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.custom-range { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e3e6ec; border-radius: 9px; padding: 6px 8px; }
.custom-range input[type="date"] { border: 1px solid #e7e9ee; border-radius: 7px; padding: 5px 9px; font-size: 12px; color: #3a4150; font-family: inherit; }
.custom-range input[type="date"]:focus { outline: none; border-color: #e0a82e; }
.cr-sep { color: #9aa3b0; font-size: 13px; }
.cr-apply { padding: 6px 14px; font-size: 12px; }

/* ========== KPI cards ========== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: #ffffff; padding: 18px 20px; border-radius: 12px;
  border: 1px solid #e7e9ee; box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.kpi .label {
  font-size: 10px; color: #9aa3b0; text-transform: uppercase;
  letter-spacing: 0.7px; font-weight: 700;
}
.kpi .value {
  font-size: 26px; font-weight: 700; margin-top: 8px; color: #1f2733;
  font-variant-numeric: tabular-nums;
}
.kpi .value small { font-size: 12px; color: #9aa3b0; font-weight: 500; display: block; margin-top: 2px; letter-spacing: 0; }
.kpi.highlight {
  background:
    linear-gradient(135deg, rgba(231,181,60,0.14), rgba(207,151,28,0.04)),
    #ffffff;
  border-color: rgba(207,151,28,0.30);
}
.kpi.highlight .value { color: #a9760a; }

/* ========== Cards / tablas ========== */
.rankings-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .rankings-row { grid-template-columns: 1fr; } }

/* ========== Grid de gráficas (Resumen) ========== */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } .chart-grid .card[style*="span 2"] { grid-column: auto !important; } }
.chart-box { padding: 16px; height: 240px; position: relative; }

.card {
  background: #ffffff; border-radius: 12px; border: 1px solid #e7e9ee;
  overflow: hidden; box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.card-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef0f4;
}
.card-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: #1f2733; }
.card-header .hint { margin: 3px 0 0; font-size: 11px; color: #9aa3b0; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; vertical-align: middle; }
th {
  background: #fafbfc; color: #9aa3b0; font-weight: 700;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid #eef0f4;
}
tbody tr { border-bottom: 1px solid #f0f2f5; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; cursor: pointer; }

.cell-acct { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(31,39,51,0.15);
}
img.avatar { object-fit: cover; background: #eef0f4; }
.acct-meta { display: flex; flex-direction: column; min-width: 0; }
.acct-handle { font-weight: 600; font-size: 13px; color: #1f2733; }
.acct-sub { font-size: 11px; color: #9aa3b0; }

.spark { width: 100px; height: 32px; }

.bar-cuota { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.bar-track {
  flex: 1; height: 6px; background: #eef0f4; border-radius: 99px; overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 99px; }
.bar-pct { font-size: 12px; color: #6b7685; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

.conv-pill {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.conv-good { background: rgba(22,163,74,0.12); color: #15803d; }
.conv-mid  { background: rgba(202,138,4,0.14); color: #a16207; }
.conv-low  { background: rgba(220,38,38,0.12); color: #b91c1c; }

/* Health score pill — gradiente según valor */
.health-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.health-dot { width: 6px; height: 6px; border-radius: 50%; }
.health-90 { background: rgba(22,163,74,0.12); color: #15803d; }
.health-90 .health-dot { background: #16a34a; }
.health-70 { background: rgba(101,163,13,0.14); color: #4d7c0f; }
.health-70 .health-dot { background: #65a30d; }
.health-50 { background: rgba(202,138,4,0.14); color: #a16207; }
.health-50 .health-dot { background: #ca8a04; }
.health-30 { background: rgba(234,88,12,0.14); color: #c2410c; }
.health-30 .health-dot { background: #ea580c; }
.health-0  { background: rgba(220,38,38,0.12); color: #b91c1c; }
.health-0 .health-dot { background: #dc2626; }
.health-warm { background: rgba(217,119,6,0.14); color: #b45309; }
.health-warm .health-dot { background: #d97706; }
.health-gray { background: rgba(107,118,133,0.12); color: #6b7685; }
.health-gray .health-dot { background: #9aa3b0; }

.num { font-variant-numeric: tabular-nums; font-weight: 600; color: #1f2733; }

.estado-pill {
  display: inline-block; padding: 1px 7px; border-radius: 99px;
  font-size: 10px; font-weight: 700; vertical-align: middle;
}

/* ========== Videos grid ========== */
.video-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px;
}
.video-card {
  background: #ffffff; border: 1px solid #e7e9ee; border-radius: 12px;
  overflow: hidden; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.video-card:hover { transform: translateY(-2px); border-color: #e0a82e; box-shadow: 0 8px 20px rgba(31,39,51,0.10); }
.video-thumb {
  width: 100%; aspect-ratio: 9/16; object-fit: cover; background: #eef0f4; display: block;
}
.video-meta { padding: 11px 13px; }
.video-views { font-weight: 700; font-size: 16px; color: #a9760a; font-variant-numeric: tabular-nums; }
.video-acct { font-size: 12px; color: #4b5563; }
.video-date { font-size: 11px; color: #9aa3b0; margin-top: 5px; }

/* miniatura con badge de views encima */
.video-thumb-wrap { position: relative; }
.video-views-badge {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(15,20,30,0.82); color: #fff; font-weight: 700; font-size: 13px;
  padding: 3px 9px 3px 7px; border-radius: 8px; display: flex; align-items: center; gap: 5px;
  font-variant-numeric: tabular-nums; backdrop-filter: blur(2px); letter-spacing: .2px;
}
.video-views-badge svg { width: 13px; height: 13px; opacity: .92; }
.video-caption {
  font-size: 11px; color: #6b7685; margin-top: 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-acct-row { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.video-acct-row .avatar { width: 22px; height: 22px; min-width: 22px; font-size: 9px; border-radius: 6px; }
.video-eng { display: flex; gap: 12px; font-size: 11px; color: #6b7685; margin-top: 5px; }
.video-engpct { color: #a9760a; font-weight: 700; margin-left: auto; }

/* ficha de rendimiento (detalle de cuenta) */
.rend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 12px; }
.rend-card { background: #fff; border: 1px solid #e7e9ee; border-radius: 12px; padding: 13px 15px; box-shadow: 0 1px 2px rgba(31,39,51,0.04); }
.rend-card .rk { font-size: 10px; color: #9aa3b0; text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 5px; }
.rend-card .rv { font-size: 21px; font-weight: 800; color: #1f2733; font-variant-numeric: tabular-nums; margin-top: 3px; }
.rend-card .rv.pos { color: #16a34a; }
.rend-card .rv.neg { color: #dc2626; }
.rend-card .rh { font-size: 10.5px; color: #9aa3b0; margin-top: 2px; }

/* crecimiento de cuentas (resumen) */
.crec-list { padding: 6px 4px 10px; }
.crec-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.crec-row:hover { background: #faf7ef; }
.crec-row .avatar { width: 30px; height: 30px; min-width: 30px; font-size: 11px; }
.crec-h { flex: 1; font-size: 13px; color: #2b3340; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crec-f { font-size: 12px; color: #9aa3b0; font-variant-numeric: tabular-nums; }
.crec-d { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.crec-d.pos { color: #16a34a; }
.crec-d.neg { color: #dc2626; }

/* ========== Tareas ========== */
.tarea-card { padding: 0; overflow: hidden; margin-bottom: 14px; }
.tarea-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #eef0f4; }
.tarea-card-head .avatar { width: 38px; height: 38px; min-width: 38px; font-size: 13px; }
.tarea-acct { font-size: 15px; font-weight: 700; color: #1f2733; }
.tarea-acct-sub { font-size: 12px; color: #9aa3b0; margin-top: 1px; }
.add-mini {
  width: 32px; height: 32px; min-width: 32px; border-radius: 9px; border: 1px solid #e3e6ec;
  background: #fff; color: #b07d10; font-size: 18px; line-height: 1; cursor: pointer; font-weight: 700;
}
.add-mini:hover { border-color: #e0a82e; background: #fbf7ec; }
.tarea-list { padding: 6px 8px 8px; }
.tarea-row { display: flex; align-items: flex-start; gap: 11px; padding: 10px 10px; border-radius: 9px; }
.tarea-row:hover { background: #faf7ef; }
.tarea-row.done .tarea-texto { text-decoration: line-through; color: #9aa3b0; }
.tarea-check {
  width: 22px; height: 22px; min-width: 22px; margin-top: 1px; border-radius: 7px;
  border: 2px solid #d7c48a; background: #fff; color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.tarea-row.done .tarea-check { background: #16a34a; border-color: #16a34a; }
.tarea-main { flex: 1; min-width: 0; }
.tarea-texto { font-size: 13.5px; color: #2b3340; line-height: 1.4; white-space: pre-wrap; }
.tarea-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.prio-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.prio-alta { background: #fdeaea; color: #c0392b; }
.prio-normal { background: #fbf0d6; color: #8a6810; }
.prio-baja { background: #eef0f4; color: #6b7685; }
.fch { font-size: 10.5px; font-weight: 600; color: #6b7685; background: #eef0f4; padding: 2px 8px; border-radius: 20px; }
.fch.hoy { background: #e7f3ea; color: #1c7a3f; }
.fch.tarde { background: #fdeaea; color: #c0392b; }
.tarea-por { font-size: 11px; color: #9aa3b0; }
.tarea-del {
  background: none; border: 0; color: #c9ccd3; font-size: 14px; cursor: pointer; padding: 2px 4px; margin-top: 1px;
}
.tarea-del:hover { color: #dc2626; }
.modal-body textarea {
  width: 100%; box-sizing: border-box; border: 1px solid #e3e6ec; border-radius: 9px;
  padding: 9px 11px; font: inherit; font-size: 13px; color: #2b3340; resize: vertical; margin-top: 4px;
}
.modal-body textarea:focus { outline: none; border-color: #e0a82e; }
.modal-seg { display: inline-flex; margin-top: 4px; }

/* ========== Comparar cuentas ========== */
.cmp-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cmp-pick { flex: 1; min-width: 0; }
.cmp-pick .acpick, .cmp-pick .acpick-btn { width: 100%; }
.cmp-vs { font-weight: 800; color: #b8bec9; font-size: 13px; flex: none; }
.cmp-card { padding: 0; overflow: hidden; margin-bottom: 16px; }
.cmp-heads { display: flex; }
.cmp-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.cmp-head + .cmp-head { border-left: 1px solid #eef0f4; }
.cmp-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cmp-head .avatar { width: 34px; height: 34px; min-width: 34px; }
.cmp-h { font-size: 14px; font-weight: 700; color: #1f2733; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-m { font-size: 11px; color: #9aa3b0; }
.cmp-table { border-top: 1px solid #eef0f4; }
.cmp-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid #f2f4f7; }
.cmp-row:last-child { border-bottom: 0; }
.cmp-cell { text-align: center; font-size: 15px; font-weight: 700; color: #6b7685; font-variant-numeric: tabular-nums; padding: 11px 8px; }
.cmp-cell.win { color: #a9760a; }
.cmp-label { font-size: 10.5px; color: #9aa3b0; text-align: center; text-transform: uppercase; letter-spacing: .4px; padding: 0 14px; min-width: 150px; }

/* ========== Accesos (credenciales por cuenta) ========== */
.acc-head { cursor: pointer; user-select: none; }
.acc-head h3 { margin: 0; }
.acc-chev { color: #9aa3b0; font-size: 12px; transition: transform .15s; display: inline-block; flex: none; }
.acc-head.open .acc-chev { transform: rotate(90deg); }
.acc-list.collapsed { display: none; }
.acc-list { padding: 6px 10px 12px; }
.acc-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.acc-row:hover { background: #faf7ef; }
.acc-k { width: 140px; min-width: 140px; font-size: 12px; color: #9aa3b0; }
.acc-v { flex: 1; font-size: 13px; color: #2b3340; word-break: break-all; }
.acc-v.link { color: #a9760a; text-decoration: none; }
.acc-v.link:hover { text-decoration: underline; }
.acc-v.secret { letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.acc-v.empty { color: #c9ccd3; }
.acc-btn { background: none; border: 1px solid #e7e9ee; border-radius: 7px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: #6b7685; flex: none; }
.acc-btn:hover { border-color: #e0a82e; color: #a9760a; }
.acc-notas { padding: 9px 10px; font-size: 12px; color: #6b7685; background: #faf7ef; border-radius: 8px; margin: 4px 8px 4px; white-space: pre-wrap; }

/* ========== Observaciones + SIM ========== */
.obs-text { width: 100%; box-sizing: border-box; border: 1px solid #e3e6ec; border-radius: 9px; padding: 10px 12px; font: inherit; font-size: 13px; color: #2b3340; resize: vertical; }
.obs-text:focus { outline: none; border-color: #e0a82e; }
.obs-save { padding: 7px 16px; font-size: 13px; }
.disp-sim { border-top: 1px solid #eef0f4; margin: 6px 0 2px; }
.disp-sim-head { cursor: pointer; user-select: none; }
.disp-sim .acc-k { width: 130px; min-width: 130px; }

/* ========== Equipo (permisos) ========== */
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; margin-top: 6px; }
.perm-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #3a4150; cursor: pointer; }
.perm-check input { width: 15px; height: 15px; accent-color: #cf971c; }
.u-edit { margin-right: 6px; }

/* cabecera de estadísticas + barra de filtros del buscador */
.bsc-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bsc-stat {
  background: #fff; border: 1px solid #e7e9ee; border-radius: 12px; padding: 13px 18px;
  min-width: 130px; box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.bsc-stat .k { font-size: 10px; color: #9aa3b0; text-transform: uppercase; letter-spacing: .6px; }
.bsc-stat .v { font-size: 23px; font-weight: 800; color: #1f2733; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bsc-stat .v.gold { color: #a9760a; }
.bsc-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.seg { display: flex; gap: 2px; background: #fff; border: 1px solid #e3e6ec; border-radius: 9px; padding: 3px; }
.seg button { background: transparent; border: 0; color: #6b7685; padding: 6px 13px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.seg button.active { background: linear-gradient(135deg, #e7b53c, #cf971c); color: #3a2c08; }
.bsc-select { background: #fff; border: 1px solid #e3e6ec; border-radius: 9px; padding: 7px 12px; font-size: 12px; font-weight: 600; color: #3a4150; cursor: pointer; }
.bsc-select:focus { outline: none; border-color: #e0a82e; }

/* selector de cuenta propio (sustituye al <select> nativo feo) */
.acpick { position: relative; }
.acpick-btn {
  background: #fff; border: 1px solid #e3e6ec; border-radius: 9px; padding: 7px 12px;
  font-size: 12px; font-weight: 600; color: #3a4150; cursor: pointer;
  display: flex; align-items: center; gap: 10px; justify-content: space-between; min-width: 175px;
}
.acpick-btn:hover { border-color: #e0a82e; }
.acpick-btn .lbl { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.acpick-btn .lbl .at { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acpick-btn .chev { color: #9aa3b0; font-size: 10px; transition: transform .15s; flex: none; }
.acpick.open .acpick-btn { border-color: #e0a82e; }
.acpick.open .acpick-btn .chev { transform: rotate(180deg); }
.acpick-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 245px;
  background: #fff; border: 1px solid #e3e6ec; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(31,39,51,0.16); padding: 7px; display: none;
}
.acpick.open .acpick-panel { display: block; }
.acpick-search {
  width: 100%; border: 1px solid #e7e9ee; border-radius: 8px; padding: 8px 10px;
  font-size: 12px; margin-bottom: 6px; box-sizing: border-box; color: #3a4150;
}
.acpick-search:focus { outline: none; border-color: #e0a82e; }
.acpick-list { max-height: 248px; overflow: auto; }
.acpick-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 7px;
  font-size: 12.5px; color: #3a4150; cursor: pointer;
}
.acpick-item:hover { background: #faf3e2; }
.acpick-item.sel { background: #fbf0d6; color: #7a5908; font-weight: 700; }
.acpick-item .tick { width: 13px; color: #cf971c; visibility: hidden; flex: none; }
.acpick-item.sel .tick { visibility: visible; }
.acpick-item .avatar, .acpick-btn .avatar {
  width: 26px; height: 26px; min-width: 26px; font-size: 10px; border-radius: 50%; flex: none;
}
.acpick-item .at { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acpick-all-av {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%; flex: none;
  background: #f3e6c4; color: #8a6810; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.acpick-empty { padding: 12px; text-align: center; color: #9aa3b0; font-size: 12px; }

/* ========== Dispositivos ========== */
.disp-card {
  background: #ffffff; border: 1px solid #e7e9ee; border-radius: 12px;
  margin-bottom: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.disp-head {
  padding: 16px 20px; border-bottom: 1px solid #eef0f4;
  display: flex; align-items: center; justify-content: space-between;
}
.disp-name { font-weight: 700; font-size: 14px; color: #1f2733; }
.disp-meta { font-size: 11px; color: #9aa3b0; margin-top: 3px; }
.disp-badge {
  background: rgba(207,151,28,0.14); color: #a9760a; padding: 4px 10px;
  border-radius: 99px; font-size: 11px; font-weight: 700;
}

/* ========== Alertas ========== */
.alert-card {
  background: #ffffff; border: 1px solid #e7e9ee; border-radius: 12px;
  margin-bottom: 12px; padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  border-left: 3px solid var(--alert-color, #cf971c);
  box-shadow: 0 1px 2px rgba(31,39,51,0.04);
}
.alert-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--alert-bg, rgba(207,151,28,0.14));
  color: var(--alert-color, #cf971c);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; font-size: 13px; color: #1f2733; }
.alert-detail { font-size: 12px; color: #6b7685; margin-top: 2px; }
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
.alert-actions a {
  font-size: 12px; padding: 6px 12px; border-radius: 6px;
  background: #f3f4f6; color: #1f2733; font-weight: 500;
  border: 1px solid #e3e6ec;
}
.alert-actions a:hover { background: #e9ebef; }
.alert-section-title {
  font-size: 11px; text-transform: uppercase; color: #9aa3b0;
  letter-spacing: 0.8px; font-weight: 700; margin: 20px 0 10px;
}
.alert-section-title:first-child { margin-top: 0; }
.alert-section-count {
  background: #eef0f4; color: #a9760a;
  padding: 1px 8px; border-radius: 99px; font-size: 10px;
  margin-left: 8px;
}
.alert-empty {
  background: #ffffff; border: 1px solid #e7e9ee; border-radius: 12px;
  padding: 24px; text-align: center; color: #6b7685; font-size: 13px;
}

/* ========== Formulario añadir cuenta ========== */
.add-form { margin-bottom: 16px; padding-bottom: 16px; }
.add-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 14px 20px 4px;
}
.add-row input {
  flex: 1; min-width: 140px;
  padding: 9px 12px; border-radius: 8px; border: 1px solid #d9dee6;
  background: #fff; color: #1f2733; font-size: 13px;
}
.add-row input:focus { outline: 2px solid #e0a82e; outline-offset: -1px; border-color: transparent; }
.btn-primary {
  padding: 9px 18px; border-radius: 8px; border: 0;
  background: linear-gradient(135deg, #e7b53c, #cf971c);
  color: #3a2c08; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.05); }
.form-msg { padding: 4px 20px 0; font-size: 12px; min-height: 16px; color: #15803d; }
.form-msg.err { color: #b91c1c; }
.btn-del {
  background: transparent; border: 1px solid #e3e6ec; color: #9aa3b0;
  width: 26px; height: 26px; border-radius: 6px; font-size: 12px; line-height: 1;
}
.btn-del:hover { background: #fdecec; color: #dc2626; border-color: #f5c2c2; }

/* ========== Botón + y barra de acción ========== */
.action-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 16px; }
.add-btn {
  padding: 9px 16px; border-radius: 9px; border: 0;
  background: linear-gradient(135deg, #e7b53c, #cf971c);
  color: #3a2c08; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 2px 6px rgba(207,151,28,0.25);
}
.add-btn:hover { filter: brightness(1.05); }
.add-btn .plus { font-size: 16px; line-height: 1; margin-top: -1px; }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,25,35,0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.12s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: 440px; max-width: 100%;
  box-shadow: 0 30px 70px rgba(0,0,0,0.28); overflow: hidden;
  animation: pop 0.14s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px;
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1f2733; }
.modal-close { background: transparent; border: 0; color: #9aa3b0; font-size: 18px; line-height: 1; }
.modal-close:hover { color: #1f2733; }
.modal-body { padding: 4px 22px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal-body label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #6b7685;
}
.modal-body input {
  padding: 11px 13px; border-radius: 9px; border: 1px solid #d9dee6;
  font-size: 14px; color: #1f2733; text-transform: none; letter-spacing: 0;
}
.modal-body input:focus { outline: 2px solid #e0a82e; outline-offset: -1px; border-color: transparent; }
.modal-msg { min-height: 16px; font-size: 12px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid #eef0f4; background: #fafbfc; margin-top: 8px;
}
.modal-cancel {
  padding: 10px 18px; border-radius: 9px; border: 1px solid #d9dee6;
  background: #fff; color: #4b5563; font-size: 13px; font-weight: 600;
}
.modal-cancel:hover { background: #f3f4f6; }

/* ========== Combobox (desplegable propio) ========== */
.combo { position: relative; }
.combo > input { width: 100%; }
.combo-list {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid #e3e6ec; border-radius: 10px;
  box-shadow: 0 14px 36px rgba(31,39,51,0.16); max-height: 230px; overflow-y: auto;
  display: none; padding: 5px;
}
.combo-list.open { display: block; }
.combo-item {
  padding: 9px 12px; font-size: 14px; cursor: pointer; color: #1f2733;
  border-radius: 7px; display: flex; align-items: center; gap: 9px;
}
.combo-item:hover, .combo-item.active { background: #faf3e3; color: #a9760a; }
.combo-item .ci-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 700;
}
.combo-item.create { color: #6b7685; border-top: 1px solid #eef0f4; margin-top: 4px; padding-top: 11px; }
.combo-item.create:hover { color: #a9760a; }
.combo-empty { padding: 12px; font-size: 13px; color: #9aa3b0; text-align: center; }

/* ========== Misc ========== */
.loading { color: #9aa3b0; padding: 40px 0; text-align: center; }
.empty { color: #9aa3b0; padding: 30px; text-align: center; font-size: 13px; }
.section-title {
  font-size: 11px; text-transform: uppercase; color: #9aa3b0;
  letter-spacing: 0.8px; font-weight: 700; margin: 0 0 12px;
}

/* Scrollbars finos */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f4f6f9; }
::-webkit-scrollbar-thumb { background: #d4d9e0; border-radius: 99px; border: 2px solid #f4f6f9; }
::-webkit-scrollbar-thumb:hover { background: #b9c0ca; }
