:root {
  /* ---- Marca Russell Bedford ---- */
  --navy-900:#141d52; --navy-800:#1a2668; --navy-700:#223187; --navy-600:#33459e;
  --navy-500:#4a5cc0; --navy-300:#93a0e0; --navy-100:#dbe1f7; --navy-50:#eef1fb;
  --teal-700:#009b93; --teal-600:#00b8af; --teal-400:#3fd0c9; --teal-100:#cdf3f0;
  /* ---- Neutros (un solo ramp, base slate) ---- */
  --n-0:#ffffff; --n-25:#fbfcfd; --n-50:#f6f8fa; --n-100:#eef1f5; --n-150:#e6eaf0;
  --n-200:#dde2ea; --n-300:#c4cdd9; --n-400:#94a1b2; --n-500:#667085; --n-600:#4a5567;
  --n-700:#344054; --n-800:#1d2739; --n-900:#101828;
  /* ---- Roles semánticos (usar SOLO estos en componentes) ---- */
  --bg: var(--n-50); --surface: var(--n-0); --surface-sunken: var(--n-100); --surface-hover: var(--n-100);
  --border: var(--n-200); --border-strong: var(--n-300); --hairline: var(--n-150);
  --ink: var(--n-900); --fg: var(--n-800); --muted: var(--n-500); --faint: var(--n-400);
  --accent: var(--navy-700); --accent-hover: var(--navy-800); --accent-weak: var(--navy-50);
  --accent-ring: rgba(34, 49, 135, .22); --teal: var(--teal-600);
  --ok: #059669; --err: #dc2626; --warn-bg: #fef3c7; --warn-fg: #92400e;
  /* ---- Elevación en capas ---- */
  --e1: 0 1px 2px rgba(16,24,40,.04), 0 1px 1px rgba(16,24,40,.03);
  --e2: 0 1px 2px rgba(16,24,40,.05), 0 4px 8px -2px rgba(16,24,40,.06);
  --e3: 0 4px 6px -2px rgba(16,24,40,.05), 0 12px 20px -4px rgba(16,24,40,.10);
  --e4: 0 12px 24px -6px rgba(16,24,40,.12), 0 24px 48px -12px rgba(16,24,40,.18);
  --shadow: var(--e1);
  --ring-focus: 0 0 0 3px var(--accent-ring);
  /* ---- Radios / motion ---- */
  --r-sm:8px; --r-md:10px; --r-lg:14px; --r-xl:18px; --radius: 14px;
  --dur-1:120ms; --dur-2:180ms; --ease:cubic-bezier(.2,0,0,1);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  font-feature-settings: 'cv05', 'ss01'; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, .page-title, .stat-value, .vac-num { letter-spacing: -.018em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--err); min-height: 1.2em; font-size: .9rem; margin-top: .8rem; }

/* Botones */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--r-sm);
  border: 1px solid transparent; padding: .55rem .9rem;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: var(--e1); }
.btn.primary:hover { background: var(--accent-hover); box-shadow: var(--e2); }
.btn.primary:active { box-shadow: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }
.btn.icon { padding: .3rem .7rem; font-size: 1.3rem; line-height: 1; background: transparent; border-color: var(--border); }
.btn.icon:hover { background: var(--surface-hover); }
.btn.block { width: 100%; }

/* Marca */
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.logo { font-size: 1.25rem; }
.brand-btn { background: transparent; border: none; padding: 0; cursor: pointer; }
.brand-logo { height: 30px; display: block; }
.brand-logo-lg { height: 46px; display: block; margin: 0 auto; }

/* ---- Login (split-screen: formulario + panel de marca) ---- */
.login-page { display: grid; grid-template-columns: 1fr 1.05fr; min-height: 100vh; background: var(--bg); }
.login-form-side { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 384px; }
.login-title { margin: 0; font-size: 1.55rem; letter-spacing: -.02em; }
.login-sub { color: var(--muted); margin: .35rem 0 1.7rem; font-size: .9rem; }
/* Panel de marca (visual: logo centrado + glow + patrón de puntos, sin texto) */
.login-brand {
  position: relative; overflow: hidden; color: #fff; padding: 56px 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--navy-600), var(--navy-900));
}
.login-brand::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}
/* Glow decorativo (acento teal) detrás del logo */
.login-brand__glow {
  position: absolute; z-index: 0; width: 540px; height: 540px; max-width: 90%; border-radius: 50%;
  left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(circle, rgba(0, 184, 175, .38), rgba(0, 184, 175, 0) 62%);
  filter: blur(26px);
}
.login-brand__inner { position: relative; z-index: 1; display: flex; }
.login-brand__chip {
  display: inline-flex; align-items: center; justify-content: center; background: #fff;
  border-radius: 20px; padding: 22px 30px; box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
}
.login-brand__chip img { height: 56px; display: block; }
.login-brand__powered { position: absolute; left: 0; right: 0; text-align: center; bottom: 30px; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { order: -1; padding: 40px 26px; }
  .login-brand__glow { width: 320px; height: 320px; }
  .login-brand__chip { padding: 16px 22px; }
  .login-brand__chip img { height: 40px; }
  .login-brand__powered { position: static; margin-top: 22px; }
  .login-form-side { padding: 30px 18px 44px; }
}
form { display: flex; flex-direction: column; gap: 1rem; }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
input, select {
  font: inherit; color: var(--fg); padding: .6rem .7rem; border: 1px solid var(--border);
  border-radius: 9px; background: #fff; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring-focus); }
input:disabled { background: var(--surface-hover); color: var(--muted); cursor: not-allowed; }
#samlBtn { margin-top: .8rem; display: flex; align-items: center; justify-content: center; gap: .55rem; }
.ms-logo { width: 15px; height: 15px; flex: 0 0 15px; }
.soon { font-size: .64rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-sunken); padding: 1px 7px; border-radius: 999px; }
.opt { color: var(--muted); font-weight: 400; font-style: italic; }
.login-note { margin-top: 1rem; font-size: .8rem; line-height: 1.45; color: var(--fg); background: var(--accent-weak); border: 1px solid var(--navy-100); padding: .65rem .8rem; border-radius: 9px; }
.login-note strong { color: var(--accent); }

/* ---- Topbar ---- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .8rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.user { display: flex; align-items: center; gap: 1rem; font-size: .9rem; color: var(--muted); }
.user span { font-weight: 600; color: var(--fg); }

.container { max-width: 1240px; margin: 0 auto; padding: 1.5rem 2rem; }

/* Shell con menú lateral */
.shell { display: flex; align-items: flex-start; }
.nav-toggle { border: none; background: transparent; font-size: 1.2rem; color: var(--muted); cursor: pointer; padding: .15rem .5rem; border-radius: 8px; margin-right: .2rem; line-height: 1; }
.nav-toggle:hover { background: var(--surface-hover); color: var(--fg); }
.shell.nav-collapsed .sidebar { display: none; }
.sidebar { flex: 0 0 214px; width: 214px; background: var(--surface); border-right: 1px solid var(--border); padding: 1rem .7rem; position: sticky; top: 57px; align-self: flex-start; height: calc(100vh - 57px); overflow-y: auto; }
.content { flex: 1; min-width: 0; }
.nav-menu { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; border: none; background: transparent; padding: .58rem .8rem; border-radius: 9px; font: inherit; font-size: .92rem; color: var(--ink); cursor: pointer; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.nav-item:hover { background: var(--surface-hover); }
.nav-item.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.disabled { color: var(--muted); opacity: .55; cursor: default; }
.nav-ico { font-size: 1.1rem; width: 1.4rem; text-align: center; flex: 0 0 1.4rem; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); }
.nav-item.active .nav-ico { color: var(--accent); }
.svg-ico, .ico { width: 1.15em; height: 1.15em; display: block; }
.nav-ico .ico { width: 1.2rem; height: 1.2rem; }
.tool-ico .ico { width: 1.7rem; height: 1.7rem; color: var(--accent); }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); padding: .5rem; }
  .nav-menu { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-item { flex-direction: column; gap: .1rem; padding: .5rem .6rem; font-size: .68rem; }
  .nav-ico { width: auto; }
}

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.monthnav { display: flex; align-items: center; gap: .8rem; }
.monthnav h2 { margin: 0; font-size: 1.15rem; min-width: 9.5rem; text-align: center; text-transform: capitalize; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.stat-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Agenda ---- */
.agenda { display: flex; flex-direction: column; gap: 1rem; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); }
.day-date { font-weight: 600; text-transform: capitalize; }
.day-total { font-size: .85rem; color: var(--accent); font-weight: 600; }
.entry { display: flex; gap: 1rem; padding: .8rem 1.1rem; align-items: flex-start; }
.entry + .entry { border-top: 1px solid var(--surface-hover); }
.entry .hrs { flex: 0 0 3.2rem; font-weight: 700; color: var(--accent); }
.entry .body { flex: 1; min-width: 0; }
.entry .proj { font-weight: 600; }
.entry .desc { color: var(--muted); font-size: .9rem; }
.entry .meta { flex: 0 0 auto; color: var(--muted); font-size: .82rem; text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Mis Horas — switcher de vistas */
.hview-tabs { display: inline-flex; gap: 4px; background: var(--surface-sunken); border-radius: 10px; padding: 4px; margin: .2rem 0 1rem; }
.hview-tabs button { border: none; background: transparent; padding: .45rem .9rem; border-radius: 7px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; font-weight: 600; }
.hview-tabs button.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* Vista Calendario */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { position: relative; min-height: 48px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 4px 6px; overflow: hidden; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has:hover { border-color: var(--accent); }
.cal-cell.sel { border-color: var(--accent); box-shadow: var(--ring-focus); }
.cal-d { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cal-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--teal); }
.cal-h { position: absolute; left: 7px; bottom: 9px; font-weight: 800; font-size: .95rem; color: var(--accent); }
.day-detail { margin-top: 1rem; }
/* Horas: vista (calendario/timeline) a la izquierda + detalle del día a la derecha */
.hours-2col { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 1.2rem; align-items: start; }
.hours-side { position: sticky; top: 72px; }
.hours-side .day-detail { margin-top: 0; }
@media (max-width: 860px) { .hours-2col { grid-template-columns: 1fr; } .hours-side { position: static; } }

/* Vista Timeline */
.timeline { display: flex; flex-direction: column; gap: 5px; }
.tl-row { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; cursor: pointer; padding: 3px 6px; border-radius: 8px; }
.tl-row:hover { background: var(--surface-hover); }
.tl-row.sel { background: var(--accent-weak); }
.tl-date { font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.tl-track { background: var(--surface-sunken); border-radius: 6px; height: 22px; overflow: hidden; }
.tl-bar { height: 100%; background: linear-gradient(90deg, #4fd0c9, #00b8af); border-radius: 6px; color: #fff; font-size: .74rem; font-weight: 700; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; min-width: 34px; }
.tl-n { text-align: center; font-size: .78rem; color: var(--muted); }

/* Vista Grilla */
.hgrid td, .hgrid th { font-size: .88rem; }
.hgrid .desc-cell { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hgrid .acc { text-align: right; white-space: nowrap; }
@media (max-width: 560px) { .cal-cell { min-height: 48px; } .tl-row { grid-template-columns: 76px 1fr 26px; } }

/* Tags */
.tag { font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; }
.tag.warn { background: var(--warn-bg); color: var(--warn-fg); }
.tag.prov { background: var(--warn-bg); color: var(--warn-fg); }

/* ---- Panel de carga ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; margin-bottom: 1.5rem; }
.panel-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid .wide { grid-column: 1 / -1; }
details summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: .7rem; font-weight: 500; }
.actions { display: flex; gap: .7rem; }
.modes { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.radio { flex-direction: row; align-items: center; gap: .4rem; color: var(--fg); font-weight: 500; cursor: pointer; }
.radio input { width: auto; }
.preview { margin-top: 1rem; background: #0f172a; color: #cbd5e1; border-radius: 9px; padding: 1rem; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; font-family: ui-monospace, monospace; }
.req { color: var(--err); font-weight: 700; }
.carga-msg { margin-top: 1rem; padding: .7rem .9rem; border-radius: 9px; font-size: .9rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--surface-hover); color: var(--fg); }
.carga-msg.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.carga-msg.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.carga-msg .small { width: 100%; font-size: .82rem; opacity: .85; }
.cap { display: inline-flex; align-items: baseline; gap: .15rem; }
.btn-del, .btn-edit { margin-left: .4rem; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .9rem; line-height: 1; padding: .1rem .35rem; border-radius: 6px; }
.btn-del:hover { background: #fef2f2; color: var(--err); }
.btn-edit:hover { background: var(--accent-weak); color: var(--accent); }
.btn-del[disabled], .btn-edit[disabled] { opacity: .5; cursor: default; }

/* Spinner + estado cargando en botones */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.spin { display: inline-block; width: .85em; height: .85em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: -.12em; margin-right: .4rem; }
.btn[disabled] { opacity: .7; cursor: progress; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem); background: #111827; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: .9rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #065f46; }
.toast.error { background: #991b1b; }

/* Confirmación propia (autónoma: no depende del modal ABM recortable) */
.confirm-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .42); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 120; padding: 1rem; animation: fade var(--dur-2) var(--ease); }
.confirm-box { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--e4); width: min(420px, 100%); padding: 1.3rem 1.4rem 1.1rem; animation: pop var(--dur-2) var(--ease); }
.confirm-msg { font-size: .98rem; color: var(--fg); margin-bottom: 1.1rem; line-height: 1.4; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.pv-box { width: min(540px, 100%); text-align: left; }
.pv-head { font-size: 1rem; font-weight: 600; margin-bottom: .8rem; }
.pv-days { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 42vh; overflow-y: auto; margin-bottom: .8rem; padding: .15rem; }
.pv-day { font-size: .8rem; background: var(--accent-weak); color: var(--accent); border-radius: 6px; padding: 3px 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.pv-skip { margin-bottom: 1rem; line-height: 1.6; }
.pv-motivo { opacity: .65; }
select.combo-error { border-color: #dc2626; color: #991b1b; }

/* Panel Interno · alta de usuario (roles) */
.map-roles { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.map-roles .chk { flex-direction: row; align-items: center; gap: .35rem; font-size: .85rem; color: var(--fg); font-weight: 500; }
.role-tag { display: inline-flex; align-items: center; gap: .15rem; }
.role-x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 .15rem; opacity: .65; }
.role-x:hover { opacity: 1; }
.role-add { font-size: .74rem; padding: .12rem .25rem; margin-left: .35rem; border-radius: 6px; vertical-align: middle; }

/* Carga de horas · repetir en días hábiles */
.repetir-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .8rem; }
.chk-inline { flex-direction: row; align-items: center; gap: .4rem; font-weight: 600; color: var(--fg); cursor: pointer; }
.chk-inline input { width: auto; }
.repetir-box input[type="date"] { max-width: 180px; }

/* ---- Suite / herramientas ---- */
.brand-btn { background: transparent; border: none; cursor: pointer; font-family: inherit; }
.page-title { font-size: 1.5rem; margin: 0 0 .2rem; }
.page-sub { color: var(--muted); margin: 0 0 1.5rem; }
.tool-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.tool-head .page-title { margin: 0; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tool-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; font-family: inherit; }
.tool-card:hover:not(.disabled) { transform: translateY(-2px); box-shadow: var(--e3); border-color: var(--border-strong); }
.tool-card.disabled { opacity: .5; cursor: default; }
.tool-ico { font-size: 1.8rem; }
.tool-name { font-weight: 700; font-size: 1.05rem; margin-top: .6rem; }
.tool-desc { color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* ---- Reportes ---- */
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.rep-controls { margin: 1.2rem 0; }
.rep-controls input { max-width: 340px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.rep { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.rep th { text-align: left; padding: .7rem .9rem; color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
table.rep td { padding: .7rem .9rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.rep tr:last-child td { border-bottom: none; }
table.rep tbody tr { transition: background var(--dur-1) var(--ease); }
table.rep tbody tr:hover td { background: var(--surface-hover); }
table.rep td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.status { background: var(--accent-weak); color: var(--accent); }
.prog-cell { display: flex; align-items: center; gap: .6rem; min-width: 150px; }
.prog { flex: 1; height: 7px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.prog-bar { height: 100%; background: var(--accent); border-radius: 999px; }
.prog-num { font-size: .8rem; color: var(--muted); width: 2.8rem; text-align: right; }

/* ---- Dashboard ---- */
/* Vistas con listas/tablas: usan más ancho de pantalla (menos apretado) */
#view-horas, #view-clientes, #view-diagnostico, #view-reportes { max-width: 1440px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-bottom: 1.5rem; }
.bars { display: flex; flex-direction: column; gap: .75rem; }
.bar .bar-top { display: flex; justify-content: space-between; gap: .8rem; font-size: .85rem; margin-bottom: .28rem; }
.bar .bar-name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .bar-val { font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar .bar-track { height: 8px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.bar .bar-fill { height: 100%; background: linear-gradient(90deg, #223187, #60a5fa); border-radius: 999px; }
.bars .empty { padding: 1.5rem; }
.muted.sm { font-size: .8rem; font-weight: 400; }
.sync-note { font-size: .78rem; text-align: right; margin-top: -.6rem; }

/* Aprobaciones */
.apr-head { font-size: 1.05rem; margin-bottom: 1rem; }
.apr-count { font-weight: 800; color: var(--accent); font-size: 1.3rem; }
.apr-list { display: flex; flex-direction: column; gap: .8rem; }
.apr-item { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.apr-title { font-weight: 600; }
.apr-sub { color: var(--muted); font-size: .88rem; margin-top: .2rem; }
.apr-meta { text-align: right; flex: 0 0 auto; }
.apr-imp { font-weight: 700; color: var(--accent); }
.apr-item { align-items: flex-start; }
.apr-flow { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.apr-flow b { color: var(--ink); }
.apr-actions { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.btn.sm { padding: .32rem .7rem; font-size: .82rem; }
.apr-ok { background: #16a34a; color: #fff; border: none; }
.apr-ok:hover { background: #15803d; }
.apr-msg { margin-left: .3rem; }

/* Asistente IA */
.ai-messages { min-height: 40vh; max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; padding: .4rem; }
.ai-hint { color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; line-height: 1.7; }
.ai-msg { display: flex; flex-direction: column; max-width: 82%; }
.ai-user { align-self: flex-end; align-items: flex-end; }
.ai-assistant { align-self: flex-start; align-items: flex-start; }
.ai-bubble { padding: .7rem 1rem; border-radius: 14px; line-height: 1.55; box-shadow: var(--shadow); }
.ai-user .ai-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-assistant .ai-bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-typing { color: var(--muted); }
.ai-steps { font-size: .72rem; color: var(--muted); margin-top: .25rem; padding: 0 .3rem; }
.ai-form { display: flex; gap: .6rem; margin-top: 1rem; }
.ai-form input { flex: 1; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px; font: inherit; }

/* Gestión de Proyectos — filas clickeables (E4) */
.gp-row { cursor: pointer; }
.gp-row:hover td { background: var(--surface-hover); }

/* Modal genérico */
.modal-overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .42); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 4vh 1rem; }
.modal-overlay.open { display: flex; }
.modal-dialog { background: var(--surface); border-radius: 16px; box-shadow: var(--e4); width: min(880px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; animation: pop var(--dur-2) var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); }
.modal-x { border: none; background: transparent; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }
.modal-x:hover { background: var(--surface-hover); color: var(--ink); }
.modal-body { padding: 1rem 1.4rem; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.4rem; border-top: 1px solid var(--border); background: var(--n-25); }

/* Motor de ABM — form auto-generado del schema (con tabs por sección) */
.abm-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: .2rem 0 .8rem; }
.abm-tab { border: none; background: transparent; padding: .5rem .9rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.abm-tab-n { font-size: .68rem; background: var(--surface-sunken); color: var(--muted); padding: 0 6px; border-radius: 999px; margin-left: .2rem; }
.abm-tab.active .abm-tab-n { background: var(--accent-weak); color: var(--accent); }
.abm-tabpane { }
.abm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.4rem; padding: .4rem .3rem .7rem; }
.abm-grid label { display: flex; flex-direction: column; gap: .2rem; }
.abm-grid .cap { font-size: .78rem; color: var(--muted); }
.abm-grid input, .abm-grid select { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); }
.abm-grid input[type="checkbox"] { width: 18px; height: 18px; align-self: flex-start; }
.abm-combo-tag { font-size: .6rem; background: var(--teal-100); color: var(--teal-700); padding: 1px 5px; border-radius: 5px; vertical-align: middle; }
input.field-err { border-color: var(--err); }
input.field-err:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .16); }
input.field-ok { border-color: var(--ok); }
.cuit-hint { margin-top: .3rem; font-size: .78rem; min-height: 1em; }
.cuit-dup { margin-top: .5rem; padding: .5rem .7rem; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg); font-size: .84rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.abm-req .cap { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .abm-grid { grid-template-columns: 1fr; } }

/* Carga de horas en modal */
.carga-panel { border: none; box-shadow: none; border-radius: 0; margin: 0; width: 100%; max-height: 92vh; overflow-y: auto; padding: 1rem 1.4rem 1.4rem; }
.carga-panel .panel-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding-bottom: .8rem; margin-bottom: 1rem; }

/* Autocomplete (proveedor de la rendición) */
.ac-wrap { position: relative; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; margin-top: 3px; }
.ac-item { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: .5rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.ac-item:hover { background: var(--surface-hover); }
.ac-item .muted { font-size: .78rem; }

/* Pedido de venta — ítems (colección) */
.ped-items-head { display: flex; align-items: center; justify-content: space-between; margin: 1.1rem 0 .5rem; }
.ped-items { display: flex; flex-direction: column; gap: .5rem; }
.ped-item { display: grid; grid-template-columns: 1fr 92px 120px 30px; gap: .5rem; align-items: center; }
.ped-item input { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.pi-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; border-radius: 6px; padding: .3rem; }
.pi-del:hover { background: #fee2e2; color: #dc2626; }
.ped-total { text-align: right; font-weight: 700; color: var(--accent); margin-top: .7rem; }

/* Clientes (ABM) */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: var(--muted); }
.tag.ok { background: #dcfce7; color: #15803d; }

/* Mis Proyectos */
.proy-list { display: flex; flex-direction: column; gap: .7rem; }
.proy-item { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #7c3aed; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.proy-name { font-weight: 600; }
.proy-sub { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.proy-meta { text-align: right; flex: 0 0 auto; }
.proy-h { font-weight: 800; color: #7c3aed; }

/* Mis Recibos */
.rec-list { display: flex; flex-direction: column; gap: .7rem; }
.rec-item { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #16a34a; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; cursor: pointer; }
.rec-period { font-weight: 600; text-transform: capitalize; }
.rec-sub { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.rec-neto { text-align: right; }
.rec-neto-num { font-weight: 800; color: #16a34a; font-size: 1.15rem; }
.rec-neto-lbl { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.rec-toggle { padding: .2rem .5rem; }
.rec-detail { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .8rem; }
.rec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.rec-col-h { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: .4rem; }
.rec-line { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: .9rem; border-bottom: 1px dashed var(--hairline); }
.rec-line.muted { color: var(--muted); }
.rec-total { font-weight: 700; border-bottom: none; border-top: 1px solid var(--border); margin-top: .2rem; padding-top: .45rem; }
.rec-neto-row { display: flex; justify-content: space-between; margin-top: .9rem; padding: .7rem 1rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; font-weight: 800; color: #15803d; font-size: 1.05rem; }
@media (max-width: 560px) { .rec-cols { grid-template-columns: 1fr; gap: .8rem; } }

/* Mis Datos */
.datos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.dato { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--surface-hover); }
.dato .dl { color: var(--muted); font-size: .88rem; }
.dato .dv { font-weight: 600; text-align: right; }

/* Vacaciones */
.vac-card { background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); color: #fff; border-radius: var(--radius); padding: 2.6rem 2rem; text-align: center; box-shadow: 0 10px 30px -8px rgba(20, 29, 82, .45); max-width: 460px; margin: 0 auto; }
.vac-num { font-size: 4.2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.vac-lbl { font-size: 1.05rem; opacity: .92; margin-top: .5rem; }
.vac-meta { margin-top: 1.6rem; font-size: .9rem; opacity: .85; line-height: 1.5; }
.vac-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; max-width: 460px; margin: 1.2rem auto 0; }
.vac-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem .6rem; text-align: center; }
.vac-stat-n { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.vac-stat-l { font-size: .74rem; color: var(--muted); margin-top: .15rem; }

/* Tendencia (columnas por mes) */
.trend { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: .5rem; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.trend .col .barv { width: 100%; max-width: 42px; background: linear-gradient(180deg, #8892cc, #223187); border-radius: 5px 5px 0 0; }
.trend .col .lbl { font-size: .7rem; color: var(--muted); }
.trend .col .v { font-size: .68rem; color: var(--accent); font-weight: 700; }

/* Flujo de caja: barras pareadas facturado vs cobrado */
.cf-legend { display: flex; gap: 1.2rem; margin: .2rem 0 .3rem; }
.cf-key { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.cf-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cf-sw.cf-fact, .cf-bar.cf-fact { background: linear-gradient(180deg, #8892cc, #223187); }
.cf-sw.cf-cob, .cf-bar.cf-cob { background: linear-gradient(180deg, #86efac, #16a34a); }
.cashflow { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: .5rem; }
.cf-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.cf-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.cf-bar { width: 46%; max-width: 20px; border-radius: 4px 4px 0 0; }
.cf-col .lbl { font-size: .7rem; color: var(--muted); }

@media (max-width: 560px) {
  .stats, .stats-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .entry .meta { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* Panel Interno — tabs (Diagnóstico / Mapeo) */
.pi-tabs{display:flex;gap:.4rem;border-bottom:1px solid var(--border);margin:.2rem 0 .2rem}
.pi-tab{background:none;border:none;border-bottom:2px solid transparent;padding:.5rem .8rem;font:inherit;font-weight:600;color:var(--muted,#64748b);cursor:pointer}
.pi-tab.active{color:var(--accent);border-bottom-color:var(--accent)}
.pi-tab:hover{color:var(--ink,#0f172a)}
.fer-sec-title { font-weight: 600; font-size: .92rem; margin: .2rem 0 .6rem; }
