@import url("calendario.css"); /* calendario de trabajo */
/* CallCRM · estilos base heredados de MD Monitor (misma maqueta de UI) con la marca propia */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e3e8ef;
  --border-strong: #cfd7e2;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #7b8794;
  --primary: #24466b;
  --primary-hover: #1c3756;
  --link: #1d4f78;
  --brand: #d99a06;
  --danger: #d6334c;
  --danger-bg: #fff1f3;
  --ok: #15803d;
  --ok-bg: #e6f7ee;
  --warn: #b45309;
  --warn-bg: #fff8db;
  --warn-border: #f3dd8a;
  --nav-active: #e8eef5;
  --row-hover: #f8fafc;
  --cov-green: #15b375;
  --cov-red: #ef4456;
  --cov-yellow: #f5c242;
  --cov-purple: #7c3aed;
  --cov-grey: #e5e7eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .25);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
select, input, textarea { font: inherit; color: var(--text); }
h1 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ---------- Cabecera ---------- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border); height: 60px;
  display: flex; align-items: center; padding: 0 32px; gap: 28px; position: sticky; top: 0; z-index: 50;
}
.logo { font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.logo b { color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--text-2); padding: 7px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover { background: #f1f4f8; text-decoration: none; }
.nav a.active { background: var(--nav-active); color: var(--text); }
.scope { margin-left: auto; margin-right: auto; background: #eef2f6; color: var(--text-2); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; }
.scope.prov { display: inline-flex; align-items: center; gap: 6px; background: #eaf3f5; color: var(--primary); font-weight: 600; }
.user { text-align: right; line-height: 1.15; }
/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 40px rgba(16,24,40,.08); padding: 28px 28px 24px; }
.login .logo { font-size: 20px; display: block; margin-bottom: 4px; }
.login .field + .field { margin-top: 14px; }
.login .demo { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.login .demo .lab { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.user .name { font-weight: 600; }
.user .role { font-size: 11.5px; color: var(--muted); }

/* ---------- Página ---------- */
.page { max-width: 1880px; margin: 0 auto; padding: 24px 32px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head .sub { color: var(--text-2); margin-top: 3px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 14.5px; }
.card-head .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-body { padding: 16px 18px; }

/* ---------- Botones ---------- */
.btn { border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: 6px; padding: 7px 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.btn:hover { background: #f6f8fb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #f1b7c0; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.danger.solid { background: #c81e3c; border-color: #c81e3c; color: #fff; }
.btn.danger.solid:hover { background: #a9152f; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; }
.btn[disabled] { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 6px 13px; color: var(--text); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--primary); color: #fff; }
.seg.lg button { padding: 8px 16px; }
.link-btn { background: none; border: 0; color: var(--link); padding: 0 4px; font-weight: 500; }
.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

/* ---------- Formularios ---------- */
.field label { display: block; font-weight: 500; margin-bottom: 5px; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 10px; background: #fff; min-height: 36px;
}
select.input { appearance: auto; padding-right: 28px; }
.input:focus { outline: 2px solid #b9d4e6; outline-offset: 0; border-color: #8fb8d1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select, .filters input { border: 1px solid var(--border-strong); border-radius: 6px; padding: 6px 10px; background: #fff; min-height: 34px; }
.filters .sep { flex-basis: 100%; height: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; background: #fff; color: var(--text-2); cursor: pointer; user-select: none; }
.chip.on { border-color: var(--primary); color: var(--primary); font-weight: 600; background: #f3f8fa; }
.chip.on::before { content: "✓ "; }
.chip.ro { cursor: default; background: #f1f4f8; border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--link); }
.daybtns { display: flex; gap: 6px; }
.daybtns button { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border-strong); background: #fff; font-weight: 600; color: var(--text-2); }
.daybtns button.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Badges ---------- */
.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; line-height: 1.5; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: #f1f4f8; color: var(--muted); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.svc { display: inline-block; border: 1px solid; border-radius: 4px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 700; color: #fff; letter-spacing: .02em; }
.avatar.lg { width: 30px; height: 30px; font-size: 10.5px; }
.avatar.soft { color: var(--text); }

/* ---------- Tablas ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--row-hover); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl td.actions .link-btn { margin-left: 10px; }
.tbl .sub { color: var(--muted); font-size: 12px; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sorted::after { content: " ▾"; }
.tbl th.sorted.asc::after { content: " ▴"; }
.tbl.compact td { padding: 7px 12px; }
.tbl.num td.n, .tbl.num th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.dot { color: #c3cad4; text-align: right; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; color: var(--muted); }
.pager .pg { display: flex; align-items: center; gap: 8px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Avisos ---------- */
.alert { border-radius: 6px; padding: 10px 14px; border: 1px solid; }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-border); color: #8a4b08; }
.alert.info { background: #f1f5f9; border-color: var(--border); color: var(--text-2); }
.alert.danger { background: var(--danger-bg); border-color: #f3c3cb; color: #9f1d31; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow: auto; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); padding: 22px 24px; }
.modal.wide { max-width: 760px; }
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal .field + .field, .modal .grid2 + .field, .modal .field + .grid2, .modal .grid2 + .grid2, .modal .grid3 + .field, .modal .field + .grid3, .modal .grid2 + .grid3, .modal .grid3 + .grid2 { margin-top: 14px; }
.modal .help + .field, .modal .help + .grid2, .modal .alert + .field, .modal .chips + .field { margin-top: 14px; }
/* Los campos que van en la misma fila nunca heredan el margen entre campos */
.grid2 > .field, .grid3 > .field { margin-top: 0 !important; }
.grid2 > .field label, .grid3 > .field label { min-height: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-foot .left { margin-right: auto; }
.divider { border-top: 1px solid var(--border); margin: 22px 0 16px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Monitor ---------- */
.kpi3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 18px; }
.kpi { border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; background: #fafbfd; }
.kpi .v { font-size: 32px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.kpi .l { margin-top: 6px; color: var(--text-2); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { background: #f3f6fa; }
.kpi.green .v { color: var(--ok); }
.kpi.green.open { background: #f0fbf4; border-color: #4bc08a; }
.kpi.grey .v { color: #9aa5b1; }
.kpi.red.open { background: #fff4f5; border-color: #e45a6e; }
.kpi .l .arrow { font-size: 11px; color: var(--muted); }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.summary .lab { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.summary .lab .note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.summary .big { font-size: 30px; font-weight: 700; margin-top: 12px; letter-spacing: -.02em; }
.summary .big small { font-size: 14px; font-weight: 400; color: var(--text-2); margin-left: 8px; letter-spacing: 0; }
.summary .big.orange { color: #d97706; }
.summary .big.red { color: var(--danger); }
.summary .lines { color: var(--text-2); font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
.summary .go { display: block; margin-top: 22px; font-weight: 600; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.person:last-child { border-bottom: 0; }
.person .nm { font-weight: 600; }
.person .meta { color: var(--muted); font-size: 12px; }
.person .rt { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.person .rt .ends { color: #d97706; }
.gap-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.gap-row:last-child { border-bottom: 0; }
.gap-row .sq { width: 10px; height: 10px; border-radius: 2px; background: var(--cov-red); }

/* ---------- Turnos ---------- */
.toggle-views { margin-bottom: 14px; }
.turnos-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.doc-list { max-height: 720px; overflow: auto; }
.doc-list .it { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.doc-list .it:hover { background: var(--row-hover); }
.doc-list .it.on { background: #e8f0f7; font-weight: 600; }
.doc-list .it .m { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.cal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-head .title { font-weight: 700; font-size: 15px; }
.cal-head .who { font-weight: 600; }
.cal-head .avatars { display: flex; gap: 4px; }
.week { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.week .dh { text-align: center; padding: 10px 4px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.week .dh .dn { font-size: 11px; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.week .dh .dd { font-weight: 700; font-size: 15px; margin-top: 2px; }
.week .dh.today .dd span { background: var(--primary); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.week .dh.today { background: #f3f7fb; }
.week-body { display: grid; grid-template-columns: 56px repeat(7, 1fr); max-height: 640px; overflow: auto; position: relative; }
.hours { position: relative; }
.hours div { height: 44px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.daycol { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); background-size: 100% 44px; height: calc(44px * 24); user-select: none; }
.daycol.today { background-color: #f7fafd; }
.daycol.weekend { background-color: #fafbfd; }
.shift { position: absolute; left: 3px; right: 3px; border-radius: 4px; border-left: 4px solid; padding: 3px 6px; font-size: 11px; font-weight: 600; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.shift .av { position: absolute; top: 3px; right: 3px; }
.shift .x { position: absolute; right: 3px; bottom: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.shift.creating { background: rgba(27,75,90,.15); border: 1px dashed var(--primary); border-left-width: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-2); font-size: 12.5px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; border: 1px solid rgba(0,0,0,.08); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 150px; }
.month .mh { padding: 10px; text-align: center; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.month .mc { min-height: 120px; min-width: 0; overflow: hidden; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; }
.month .mc .dn { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.month .mc .dn b { color: var(--text); }
.month .mc .dn b.today { background: var(--primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.month .mc .dn .add { color: #c3cad4; cursor: pointer; }
.month .mc .dn .add:hover { color: var(--link); }
.month .mc.out { background: #fafbfd; }
.pill { display: flex; align-items: center; gap: 4px; min-width: 0; border: 1px solid; border-radius: 4px; padding: 2px 5px; font-size: 11px; font-weight: 600; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.pill .t { flex-shrink: 0; }
.pill.name { flex-wrap: wrap; row-gap: 1px; }
.pill .nm { flex: 1 0 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 10.5px; color: var(--text-2); line-height: 1.2; }
.pill .svc { font-size: 9.5px; padding: 0 4px; margin-left: auto; max-width: 58px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.pill .avatar { width: 15px; height: 15px; font-size: 6.5px; flex-shrink: 0; }
.pill.name { font-weight: 500; }
.pill.sel, .shift.sel { outline: 2px solid var(--primary); outline-offset: 1px; }
.shift.canc { opacity: .45; text-decoration: line-through; }
.selbar .card-body { background: #f8fafc; }
.more { font-size: 11px; color: var(--link); cursor: pointer; }

/* ---------- Cobertura ---------- */
.cov-wrap { overflow: auto; padding: 12px 14px; }
.cov { border-collapse: separate; border-spacing: 4px 8px; table-layout: fixed; }
.cov th { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 2px 0; white-space: nowrap; overflow: hidden; text-align: center; }
.cov th b { color: var(--text); }
.cov th.today b, .cov th.today { color: var(--danger); }
.cov th.hour { text-align: right; padding-right: 8px; font-weight: 500; vertical-align: middle; width: 48px; }
.cov td { width: 34px; height: 34px; padding: 0; background: transparent; }
.cov td .hh { display: flex; flex-direction: column; gap: 2px; height: 100%; border-radius: 5px; overflow: hidden; }
.cov .half { flex: 1; min-height: 16px; border-radius: 2px; background: var(--cov-grey); cursor: pointer; position: relative; }
.cov .half.g { background: var(--cov-green); } .cov .half.r { background: var(--cov-red); } .cov .half.y { background: var(--cov-yellow); } .cov .half.p { background: var(--cov-purple); }
.cov .half.g.x::after { content: "+"; color: #ffd84d; font-weight: 800; font-size: 11px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; line-height: 1; }
.cov .half.p::after { content: "◆"; color: #fff; font-size: 8px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cov .half:hover { outline: 2px solid var(--primary); outline-offset: -1px; z-index: 1; }
.cov.wk { width: 100%; }
.cov.wk td { width: auto; height: 46px; }
.cov.wk th.hour { width: 56px; }
.cov.wk .half { min-height: 20px; }
.cov.wk .half.g.x::after { font-size: 12px; justify-content: flex-end; padding-right: 8px; }
.cov.wk th .lines { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-weight: 500; color: var(--text-2); }
.cov.wk th .lines button { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--border-strong); background: #fff; font-size: 12px; padding: 0; line-height: 1; }
.cov.wk .half .n { position: absolute; left: 8px; top: 0; bottom: 0; display: flex; align-items: center; font-size: 10.5px; font-weight: 700; color: #fff; }
/* Popover de media hora */
.pop { width: 420px; }
.cov .half.sel { outline: 2px solid var(--primary); outline-offset: -1px; z-index: 1; }
.cov.wk .half.free { cursor: crosshair; }
.cov.dragging, .cov.dragging .half { user-select: none; cursor: crosshair; }
.cov .half.drg { background: #74b4f0 !important; outline: 0; }
.pop .ph { display: flex; align-items: center; padding: 14px 18px; font-size: 15px; border-bottom: 1px solid var(--border); }
.pop .pb { padding: 12px 18px 16px; overflow: auto; flex: 1; }
.pop hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.pop .pd { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.pop .pd .nm { font-weight: 600; } .pop .pd .meta { color: var(--muted); font-size: 12.5px; }
.pop .pl + .pl { margin-top: 12px; }
.pop .plh, #ccModal .plh { display: flex; align-items: center; margin-bottom: 8px; }
.tr-box { border: 1px solid #bcd3e6; background: #f3f8fc; border-radius: 8px; padding: 6px 8px; }
.tr-row { display: flex; align-items: flex-end; gap: 8px; }
.tr-row + .tr-row { margin-top: 6px; }
.tr-row label { flex: 1; font-size: 12.5px; color: var(--text-2); }
.tr-row label .input { margin-top: 2px; min-height: 34px; }
.tsel { font-variant-numeric: tabular-nums; }
.tr-row .link-btn { padding-bottom: 8px; }
.pop .popday { padding: 0; font-size: 15px; color: var(--primary); }
.pop .opts { display: grid; gap: 8px; margin-top: 10px; }
.pop .opt { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.pop .opt:hover, .pop .opt:first-child { border-color: var(--primary); background: #f6f9fb; }
.pop .opt .muted { font-size: 12.5px; margin-top: 2px; }
#ccModal .pl + .pl { margin-top: 12px; }
/* Mini calendario para "Editar grupo" */
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal .mch { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.mini-cal .mcd { display: flex; align-items: center; justify-content: center; height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; font-weight: 500; }
.mini-cal .mcd input { display: none; }
.mini-cal .mcd.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini-cal .mcd.pin::after { content: '●'; font-size: 7px; color: var(--warn); margin-left: 3px; }
.mini-cal .mcd.on.pin::after { color: #ffd84d; }
.cov-foot { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; background: #fafbfd; border-radius: 0 0 8px 8px; }
.side { position: fixed; top: 60px; right: 0; bottom: 0; width: 380px; background: #fff; border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(16,24,40,.08); transform: translateX(100%); transition: .2s; z-index: 60; display: flex; flex-direction: column; }
.side.open { transform: translateX(0); }
.side .sh { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.side .sb { padding: 16px 18px; overflow: auto; }
.group-head { background: #fafbfd; padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }

/* ---------- Informes ---------- */
.kpi4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi4 .k { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.kpi4 .lab { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi4 .big { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi4 .det { font-size: 12px; color: var(--text-2); margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.kpi4 .det b { color: var(--text); }
.rep-wrap { overflow-x: hidden; overflow-y: auto; max-height: 600px; }
.rep-foot { overflow-x: auto; overflow-y: hidden; background: #f8fafc; border-top: 2px solid var(--border-strong); padding-bottom: 14px; scrollbar-width: thin; scrollbar-color: #b8c2cf #f1f4f8; }
.rep-foot::-webkit-scrollbar { height: 12px; }
.rep-foot::-webkit-scrollbar-track { background: #f1f4f8; }
.rep-foot::-webkit-scrollbar-thumb { background: #b8c2cf; border-radius: 8px; border: 3px solid #f1f4f8; }
.rep-foot::-webkit-scrollbar-thumb:hover { background: #94a1b2; }
.rep-foot .rep td { border-bottom: 0; font-weight: 700; background: #f8fafc; }
.rep-foot .rep td.sticky, .rep-foot .rep td.sticky2 { background: #f8fafc; }
.rep { border-collapse: separate; border-spacing: 0; min-width: 1200px; width: 100%; }
.rep th.turnos, .rep td.turnos { width: 1%; }
.rep thead tr:nth-child(2) th { top: var(--rep-h1, 31px); }
.rep th { position: sticky; top: 0; background: #fafbfd; z-index: 2; font-size: 10px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.15; color: var(--muted); padding: 6px 7px; border-bottom: 1px solid var(--border); text-align: right; white-space: normal; vertical-align: bottom; max-width: 64px; }
.rep th.l, .rep td.l { text-align: left; }
.rep th.grp { text-align: center; border-left: 1px solid var(--border); background: #f1f5f9; color: var(--text-2); max-width: none; white-space: nowrap; }
.rep thead th[rowspan] { vertical-align: middle; }
.rep th.l { max-width: none; }
.rep td { padding: 8px 7px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.rep td.prov, .rep th.prov { width: 140px; min-width: 140px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.rep td.l { text-align: left; }
.rep td.sticky, .rep th.sticky { position: sticky; left: 0; background: #fff; z-index: 3; width: 170px; min-width: 170px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.rep th.sticky { z-index: 4; background: #fafbfd; }
.rep td.sticky2, .rep th.sticky2 { position: sticky; left: 170px; background: #fff; z-index: 3; width: 130px; min-width: 130px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; box-shadow: 4px 0 6px -4px rgba(16,24,40,.12); }
.rep th.sticky2 { background: #fafbfd; z-index: 4; }
.rep td.gl { border-left: 1px solid var(--border); }
.rep td b { font-weight: 700; }
.rep td.z { color: #c3cad4; }
.rep tbody tr:hover td { background: var(--row-hover); }
.rep.fact td.prov, .rep.fact th.prov { width: 72px; min-width: 72px; max-width: 72px; text-align: right; }
.rep.fact tr.subtotal td { background: #f1f5f9; border-bottom: 2px solid var(--border-strong); }
.rep.fact tr.subtotal:hover td { background: #e9eef4; }

/* ---------- Configuración ---------- */
.cfg-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-nav { position: sticky; top: 84px; }
.cfg-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 6px; color: var(--text-2); font-weight: 500; }
.cfg-nav a:hover { background: #eef2f6; text-decoration: none; }
.cfg-nav a.on { background: var(--nav-active); color: var(--text); font-weight: 600; }
.cfg-nav a .cnt { font-size: 11.5px; color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.cfg-nav a .cnt.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.cfg-nav .grp { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; font-weight: 600; }
.inline-form { background: #fafbfd; border-bottom: 1px solid var(--border); padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.inline-form .field { min-width: 160px; }
.inline-form .field.w { min-width: 240px; }
.inline-form .field.xs { min-width: 90px; }
.inline-form .help-row { flex-basis: 100%; color: var(--muted); font-size: 12px; margin-top: -4px; }
.swatch { display: inline-block; width: 30px; height: 22px; border-radius: 4px; border: 1px solid var(--border-strong); vertical-align: middle; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; }
.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .st { font-size: 12px; margin-top: 2px; }
.doc-row .st.pend { color: #c2410c; }
.doc-row .st.ok { color: var(--ok); }
.doc-row .st.cad { color: var(--danger); }
.doc-row .st.na { color: var(--muted); }
.req { color: var(--danger); margin-left: 3px; }
.tag { font-size: 10.5px; color: var(--danger); background: var(--danger-bg); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 18px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--text-2); font-weight: 500; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.search { position: relative; }
.search input { padding-left: 30px; width: 260px; }
.search::before { content: "⌕"; position: absolute; left: 10px; top: 6px; color: var(--muted); font-size: 16px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-row .s { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 12.5px; color: var(--text-2); }
.stat-row .s b { color: var(--text); font-size: 15px; margin-right: 4px; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #f1f4f8; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

@media (max-width: 1100px) {
  .page { padding: 16px; }
  .kpi3, .cards3, .kpi4 { grid-template-columns: 1fr; }
  .turnos-layout, .cfg-layout { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; gap: 14px; overflow-x: auto; overflow-y: visible; }
}

.mini-cal .mcd { position: relative; }
.mini-cal .mcd .pin { position: absolute; right: 4px; top: 0; font-style: normal; color: var(--warning, #d4a017); font-size: 14px; line-height: 1; }

/* Chip de ámbito desplegable (Administración: ver como proveedor) */
.scope-dd { position: relative; margin-left: auto; margin-right: auto; }
.scope-dd > summary { list-style: none; cursor: pointer; margin: 0; display: inline-flex; align-items: center; gap: 6px; user-select: none; white-space: nowrap; }
.scope-dd > summary::-webkit-details-marker { display: none; }
.scope-dd > summary .caret { font-size: 10px; opacity: .7; }
.scope-dd[open] > summary { outline: 2px solid var(--primary); outline-offset: 1px; }
.scope-menu { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); min-width: 280px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 14px 40px rgba(16,24,40,.16); padding: 6px; z-index: 50; display: grid; gap: 2px; }
.scope-menu .mh { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; font-weight: 600; }
.scope-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: #fff; border-radius: 7px; padding: 7px 10px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.scope-menu button:hover { background: var(--row-hover, #f3f6f9); }
.scope-menu button.on { background: #eaf3f5; color: var(--primary); font-weight: 600; }
.scope-menu button small { margin-left: auto; color: var(--muted); font-weight: 400; }
.scope-menu .avatar { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex: none; }
.scope-menu .avatar.adm { background: var(--primary); }
/* Página de elección de vista tras el login */
.login.acceso { max-width: 520px; }
.acceso-opts { display: grid; gap: 12px; margin-top: 18px; }
.opt-card { display: block; width: 100%; text-align: left; border: 1px solid var(--border-strong); border-radius: 10px; padding: 14px 16px; background: #fff; cursor: pointer; font: inherit; color: var(--text); }
.opt-card:hover { border-color: var(--primary); }
.opt-card.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.opt-card .t { display: block; font-weight: 700; font-size: 15px; }
.opt-card .d { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.opt-card.prov { cursor: default; }

/* Tooltip de la rejilla de cobertura: fijo encima de la celda, fuera del alcance del cursor */
.cov-tip { position: fixed; z-index: 1000; transform: translate(-50%, -100%); min-width: 230px; max-width: 320px; background: #1f2937; color: #fff; border-radius: 9px; padding: 10px 12px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 10px 30px rgba(16,24,40,.25); pointer-events: none; opacity: 0; transition: opacity .08s ease; }
.cov-tip.on { opacity: 1; }
.cov-tip::after { content: ""; position: absolute; left: var(--arrow-x, 50%); bottom: -6px; width: 12px; height: 12px; background: #1f2937; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.cov-tip.below { transform: translate(-50%, 0); }
.cov-tip.below::after { bottom: auto; top: -6px; }
.cov-tip .tt-h { color: #cbd5e1; font-size: 12px; margin-bottom: 4px; } .cov-tip .tt-h b { color: #fff; font-size: 13px; }
.cov-tip .tt-s { font-weight: 600; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cov-tip .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--cov-grey); flex: none; }
.cov-tip .dot.g { background: var(--cov-green); } .cov-tip .dot.r { background: var(--cov-red); } .cov-tip .dot.y { background: var(--cov-yellow); } .cov-tip .dot.p { background: var(--cov-purple); }
.cov-tip .tt-m { margin-top: 3px; color: #e5e7eb; } .cov-tip .tt-m b { color: #fff; }
.cov-tip .tt-f { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); color: #94a3b8; font-size: 11px; }

/* Color de registro (PR · PP · CP · 3º · DA) */
.reg { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; padding: 0 5px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #fff; background: var(--c, #999); border: 0; letter-spacing: .02em; vertical-align: middle; }
button.reg { cursor: pointer; opacity: .55; }
button.reg.on { opacity: 1; outline: 2px solid var(--c); outline-offset: 2px; }
.avatars button.reg + button.reg { margin-left: 4px; }
.shift .rg { position: absolute; left: 5px; bottom: 5px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff; }
.legend .sep { width: 1px; height: 14px; background: var(--border-strong); margin: 0 4px; }
.legend .reg { margin-right: 2px; }
.cb-list { max-height: 220px; overflow: auto; border: 1px solid var(--border-strong); border-radius: 8px; }
.cb-list label.check { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); margin: 0; cursor: pointer; }
.cb-list label.check:last-child { border-bottom: 0; }
.color-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.color-opts button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: #fff; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.color-opts button i { width: 12px; height: 12px; border-radius: 50%; }
.color-opts button.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); font-weight: 600; }
.color-opts button:disabled { opacity: .45; cursor: not-allowed; }
.reg.sm { min-width: 18px; height: 16px; font-size: 8.5px; padding: 0 4px; border-radius: 50%; width: 18px; }
.pill .reg.sm { flex-shrink: 0; margin-left: 2px; }
.shift .av .reg.sm { box-shadow: 0 0 0 1.5px #fff; }

/* Aviso de serie en el modal de turno (réplica del original) */
.serie-box { background: #eef7fc; border: 1px solid #bfe0f3; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.serie-box .serie-head { color: var(--text-2); margin-bottom: 10px; line-height: 1.45; }
.serie-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #cfe3ef; border-radius: 8px; padding: 10px 12px; background: #f6fbfe; cursor: pointer; margin: 0; }
.serie-opt + .serie-opt { margin-top: 8px; }
.serie-opt.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: #fff; }
.serie-opt input { margin-top: 3px; }
.serie-opt span { display: block; } .serie-opt small { display: block; color: var(--muted); margin-top: 2px; font-size: 12.5px; line-height: 1.4; }

/* Turnos: conmutador de vista y botones de acción en la misma fila */
.toolbar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-top .toggle-views { margin: 0; }
.toolbar-top .acts { flex-wrap: wrap; justify-content: flex-end; }

/* ---------- CallCRM: añadidos ---------- */
.cfg-nav a.on { background: #e8eef7; }
.badge.rol { background: #eef2ff; color: #3730a3; }
.badge.rol.superadmin { background: #fdf2f8; color: #9d174d; }
.badge.rol.admin { background: #eef2ff; color: #3730a3; }
.badge.rol.supervisor { background: #ecfdf5; color: #065f46; }
.badge.rol.agente { background: #f1f5f9; color: #475569; }
.tt { display: inline-block; border-radius: 4px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.dias { display: inline-flex; gap: 2px; }
.dias i { font-style: normal; width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; background: #f1f4f8; color: #c3cad4; }
.dias i.on { background: var(--primary); color: #fff; }
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.param-grid .field .help { min-height: 16px; }
@media (max-width: 900px) { .param-grid { grid-template-columns: 1fr; } }
.kpi4 .k .big.muted { color: var(--muted); }
.list-plain { margin: 0; padding: 0; list-style: none; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain li .d { color: var(--muted); white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap > table.tbl { min-width: 100%; }

/* ---------- Informe de horas ---------- */
.rep-h td.b { font-weight: 700; }
.rep-h td.warn-txt { color: #b45309; font-weight: 600; }
.rep-h tr.grp td { background: #eef2f6; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); padding: 8px 12px; }
.rep-h tr.grp2 td { background: #f8fafc; font-weight: 600; color: var(--text-2); padding: 6px 12px 6px 22px; }
.rep-h tr.subtotal td { background: #f1f5f9; border-bottom: 2px solid var(--border-strong); }
.rep-h tr.subtotal.emp td { background: #e8eef7; }
.rep-h tr.subtotal.total td { background: var(--primary); color: #fff; border-bottom: 0; }
.rep-h tr.subtotal.total td .muted { color: rgba(255,255,255,.75); }
.rep-h tr.subtotal.total td span[style] { color: rgba(255,255,255,.6) !important; }
@media print { .topbar, .page-head .flex, .inline-form, .toast, .modal-bg { display: none !important; } .page { padding: 0; max-width: none; } .card { box-shadow: none; border: 0; } }
