:root {
  --bg: #F7F5F0; --surface: #ffffff; --border: #E6E3DA;
  --text: #2B2E33; --muted: #6B6D70;
  --navy: #2B2E33; --navy-2: #3A3D43; --navy-text: #C9C7C0;
  --accent: #2B2E33; --accent-dark: #1D1F23; --accent-soft: #EDEAE2;
  --danger: #B04A44; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 Inter, "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar { background: var(--navy); color: var(--navy-text); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; padding: 4px 8px 22px; }
.logo { width: 30px; height: 30px; display: block; flex: none; }
.wm { letter-spacing: -.02em; }
.wm i { font-style: normal; color: #EDEAE2; }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--navy-text); text-decoration: none; font-weight: 500; }
nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav a:hover { background: var(--navy-2); color: #fff; }
nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 #EDEAE2; }
@media (min-width: 961px) { .sidebar nav { overflow-y: auto; min-height: 0; flex: 0 1 auto; scrollbar-width: thin; scrollbar-color: #3A3D43 transparent; } .sidebar .me { flex: none; margin-top: auto; } }
nav .nav-parent { cursor: pointer; }
nav .nav-group { display: flex; flex-direction: column; }
nav .nav-group.up { flex-direction: column-reverse; }
nav .nav-parent .chev { margin-left: auto; width: 15px; height: 15px; transition: transform .2s; transform: rotate(0deg); }
nav .nav-parent.open .chev { transform: rotate(180deg); }
nav .nav-group.up .nav-parent .chev { transform: rotate(180deg); }
nav .nav-group.up .nav-parent.open .chev { transform: rotate(0deg); }
nav .nav-parent.has-active { color: #fff; }
nav .subnav { display: grid; gap: 2px; margin: 4px 0 2px 14px; padding-left: 8px; border-left: 1px solid var(--navy-2); }
nav .subnav[hidden] { display: none; }
nav a.sub { padding: 7px 10px; font-size: 14px; }
nav a.sub svg { width: 16px; height: 16px; }
.tut-list { display: grid; gap: 10px; }
.tut-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.tut-info { display: grid; gap: 3px; } .tut-info b { font-size: 15px; }
.tut-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tut-actions .btn, #support-body a.btn { text-decoration: none; display: inline-flex; align-items: center; }
@media (max-width: 640px) { .tut-row { flex-direction: column; align-items: flex-start; } .tut-actions { justify-content: flex-start; } }
.sidebar-foot { margin-top: auto; padding: 8px; font-size: 12px; color: #8C8E92; }

/* Topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 650; }
.timer { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; min-width: 320px; }
.timer #description { flex: 1; max-width: 340px; }
.timer select { max-width: 190px; }
#clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 17px; min-width: 84px; text-align: center; }

main { padding: 24px 28px 40px; max-width: 1180px; }
.view { display: grid; gap: 18px; }

/* Controles */
input, select { height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font: inherit; font-weight: 550; cursor: pointer; color: var(--text); }
.btn:hover { background: #F1F0EA; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.stop { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border: 0; background: transparent; color: var(--muted); height: 30px; padding: 0 8px; }
.btn.ghost:hover { color: var(--danger); background: #fdecec; }
.link { color: var(--accent); text-decoration: none; font-weight: 550; font-size: 13px; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi strong { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }

/* Gráfico */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-val { font-size: 11px; color: var(--muted); height: 14px; }
.bar { width: 100%; max-width: 44px; background: #3A3D43; border-radius: 6px 6px 0 0; min-height: 3px; }
.bar.today { background: #2B2E33; }
.bar.zero { background: var(--border); }
.bar-label { font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* Reparto */
.share-row { margin-bottom: 14px; }
.share-top { display: flex; justify-content: space-between; margin-bottom: 5px; font-weight: 550; }
.share-top span:last-child { color: var(--muted); font-weight: 500; }
.track { height: 8px; background: #EDECE6; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; }

/* Tablas */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--border); }
td { padding: 11px 8px; border-bottom: 1px solid #EEEDE6; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F9F8F4; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-top: 1px solid var(--border); border-bottom: 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; }
.badge-live { background: #EAF1EC; color: #4F7A68; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; }

/* Formularios */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row input { flex: 1; min-width: 160px; }
.form-row.two { margin-top: 4px; }
.form-row.two label { flex: 1; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(460px, 92vw); box-shadow: 0 20px 60px rgba(15,23,42,.3); }
dialog::backdrop { background: rgba(43,46,51,.5); }
dialog form { padding: 22px; display: grid; gap: 14px; }
dialog h2 { margin: 0; font-size: 17px; }
dialog label { display: grid; gap: 5px; font-weight: 550; font-size: 13px; }
dialog input, dialog select { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; gap: 12px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } nav { flex-direction: row; } .sidebar-foot { display: none; }
  nav a.active { box-shadow: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; }
  .topbar, main { padding-left: 16px; padding-right: 16px; } .timer { min-width: 0; width: 100%; flex-wrap: wrap; }
}

/* Vista Día */
.day-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.day-nav, .day-right { display: flex; align-items: center; gap: 8px; }
.day-right { gap: 16px; }
#day-label { min-width: 170px; text-align: center; font-weight: 600; text-transform: capitalize; }
.day-total { color: var(--muted); }
.day-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
.log { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid #EEEDE6; }
.log:last-child { border-bottom: 0; }
.log-main { display: flex; flex-direction: column; gap: 3px; }
.log-client { font-size: 12px; font-style: italic; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.log-project { font-weight: 600; }
.log-time { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
.log-time strong { font-size: 16px; }
.log-actions { display: flex; gap: 2px; }
.btn.ghost.edit:hover { color: var(--accent); background: var(--accent-soft); }

/* Empresas y proyectos */
.client-block { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.client-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
.client-head .btn { height: 30px; }
.client-head > span:last-child { display: flex; align-items: center; gap: 4px; }

/* Selector Día / Hoja de horas */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; width: max-content; }
.seg button { border: 0; background: transparent; padding: 0 16px; height: 34px; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }

/* Hoja de horas */
.ts-wrap { overflow-x: auto; margin-top: 8px; }
table.ts th, table.ts td { text-align: center; }
table.ts th:first-child, table.ts td:first-child { text-align: left; min-width: 230px; }
table.ts th.today { color: var(--text); background: #F1F0EA; }
.ts-cell { cursor: pointer; font-variant-numeric: tabular-nums; color: var(--muted); }
.ts-cell.has { color: var(--text); font-weight: 600; }
.ts-cell:hover { background: var(--accent-soft); }
.ts-tot { font-weight: 700; font-variant-numeric: tabular-nums; }
table.ts tfoot td { font-variant-numeric: tabular-nums; }
.ts-add { margin-top: 14px; max-width: 320px; }

/* Filtros de informes */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters select, .filters input { min-width: 150px; }
.report-actions { margin-left: auto; display: flex; gap: 8px; }

/* Login / configuración inicial */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: var(--navy); padding: 20px; }
.auth-card { background: #fff; width: min(400px, 100%); border-radius: 14px; padding: 30px 28px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 18px; }
.auth-card h1 { margin: 0 0 6px; font-size: 21px; }
.auth-lead { color: var(--muted); margin: 0 0 14px; }
.auth-card form { display: grid; gap: 14px; margin-top: 14px; }
.auth-card label { display: grid; gap: 5px; font-weight: 550; font-size: 13px; }
.auth-card input { width: 100%; }
.auth-card .btn { height: 40px; }
.auth-error { margin: 0; padding: 9px 12px; border-radius: 8px; background: #fff0f0; color: var(--danger); font-size: 13px; }
.auth-foot { margin: 16px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.hint { font-weight: 400; color: var(--muted); }

/* Usuario en la barra lateral */
.me { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--navy-2); }
.me-name { color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.me-top .me-name { flex: 1 1 auto; min-width: 0; }
.me-role { flex: none; font-size: 12px; color: #8C8E92; white-space: nowrap; }
.app-ver { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line, #E7E5E0); font-size: 12px; color: var(--muted, #8C8E92); }
.me-actions { display: flex; gap: 6px; }
.me-actions button { flex: 1; height: 30px; border-radius: 7px; border: 1px solid var(--navy-2); background: transparent; color: var(--navy-text); font: inherit; font-size: 12px; cursor: pointer; }
.me-actions button:hover { background: var(--navy-2); color: #fff; }
.me + .sidebar-foot { margin-top: 0; }

/* Usuarios y equipos */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--navy); }
.badge.owner { background: #EDEAE2; }
.badge.off { background: #EDECE7; color: var(--muted); }
tr.inactive td { color: var(--muted); }
.members { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 4px 0; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-weight: 450; }
.member-row label { display: flex; align-items: center; gap: 6px; font-weight: 450; font-size: 13px; }
.member-row input[type=checkbox] { width: auto; height: auto; }
.team-block { padding: 14px 4px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.team-block:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dialog-error { margin: 0; color: var(--danger); font-size: 13px; }

/* ===== v0.6 ===== */
.nowrap { white-space: nowrap; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #EDEAE2; color: #2B2E33; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.btn.bill { width: 36px; padding: 0; font-weight: 700; background: var(--navy); color: #EDEAE2; border-color: var(--navy); }
.btn.bill.off { background: #fff; color: var(--muted); border-color: var(--border); text-decoration: line-through; }
.check-line { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.check-line input { width: auto !important; height: auto !important; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--navy); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.tag.nb { background: #EDECE7; color: var(--muted); }

/* estados */
.badge.st-pending { background: #fff4d6; color: #8a5a00; }
.badge.st-ok { background: #EAF1EC; color: #4F7A68; }
.badge.st-bad { background: #ffe9e9; color: var(--danger); }
.ts-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px 12px; }
.ts-status label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.ts-status-actions { margin-left: auto; display: flex; gap: 8px; }

/* informes */
#rs-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi small { color: var(--muted); font-size: 12px; }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.sw.bill, .stack .b { background: var(--navy); }
.sw.nobill, .stack .nb { background: #EDEAE2; }
.stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; min-height: 3px; }
.stack.zero { background: var(--border); }
.chart { height: 210px; gap: 6px; }
.bar-label.we { color: #9C9EA2; }
.att-note { margin-bottom: 12px; }
.att-wrap { overflow-x: auto; }
table.att { border-collapse: separate; border-spacing: 0; }
table.att th, table.att td { white-space: nowrap; }
table.att th.we { color: #9C9EA2; }
.att-cell { text-align: center; font-size: 11px; min-width: 34px; padding: 6px 3px; border-left: 1px solid #F0EFE9; }
.att-cell.ok { background: #EAF1EC; color: #4F7A68; font-weight: 600; }
.att-cell.part { background: #fff4d6; color: #8a5a00; font-weight: 600; }
.att-cell.miss { background: #fff0f0; }
.att-cell.we { background: #F6F5F1; color: #9C9EA2; }
td.pos { color: #4F7A68; font-weight: 600; } td.neg { color: var(--danger); font-weight: 600; }

/* diálogos anchos */
dialog.wide-dialog { width: min(720px, 94vw); }
.dlg-body { padding: 22px; display: grid; gap: 14px; max-height: 80vh; overflow: auto; }
#invoice-form { max-height: 86vh; overflow: auto; }
.iv-table { margin-top: 4px; }
.iv-table tfoot td { font-weight: 600; }
#dt-list table tfoot td { font-weight: 700; }
.im-errors { margin: 0; padding-left: 18px; max-height: 160px; overflow: auto; font-size: 13px; color: var(--danger); }
#im-result p { margin: 4px 0; }

/* ajustes */
.set-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.set-grid label { display: grid; gap: 5px; font-weight: 550; font-size: 13px; }
.set-grid .wide { grid-column: 1 / -1; }
.set-grid input, .set-grid select { width: 100%; }
@media (max-width: 720px) { .set-grid { grid-template-columns: 1fr; } }

.content { min-width: 0; }
.view > * { min-width: 0; }

/* v0.6.1: anillos, variación y flechas de periodo */
.period-nav { display: flex; align-items: flex-end; gap: 6px; }
.period-nav label { margin-right: 2px; }
.period-nav .btn { width: 36px; padding: 0; font-size: 18px; line-height: 1; }
.delta { font-size: 12px; font-weight: 700; margin-left: 6px; }
.delta.up { color: #4F7A68; } .delta.down { color: var(--danger); }
.kpi small .delta { margin-left: 8px; }
.donut-block { padding: 6px 0 14px; border-top: 1px solid var(--border); }
.donut-block:first-of-type { border-top: 0; }
.donut-block h3 { margin: 10px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.donut-row { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.donut { width: 300px; height: auto; flex: none; overflow: visible; }
.donut .seg { transition: transform .2s ease, opacity .2s ease; transform-origin: 170px 122px; cursor: pointer; }
.donut .seg.on { transform: translate(var(--dx), var(--dy)) scale(1.07); }
.donut.has-hot .seg:not(.on) { opacity: .55; }
.dn-total { font-size: 26px; font-weight: 700; fill: var(--text); transition: opacity .15s; }
.dn-hov { font-size: 20px; font-weight: 700; fill: var(--text); opacity: 0; transition: opacity .15s; }
.dn-h2 { font-size: 13px; font-weight: 600; fill: var(--muted); }
.donut.has-hot .dn-total { opacity: 0; }
.donut.has-hot .dn-hov { opacity: 1; }
.dn-legend li { padding: 3px 6px; margin: 0 -6px; border-radius: 6px; transition: background .15s; }
.dn-legend li.on { background: #EEEDE8; }
@media (prefers-reduced-motion: reduce) { .donut .seg { transition: none; } }
.dn-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; min-width: 240px; }
.dn-legend li { display: flex; align-items: center; gap: 10px; }
.dn-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.dn-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.dn-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dn-legend { flex: 0 1 480px; }
.kpi small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.kpi small .delta { margin-left: 0; }

/* v0.7 · Empresas, proyectos y tareas */
.c-toolbar .grow { flex: 1; min-width: 220px; }
.c-toolbar .grow input { width: 100%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.pager .btn[disabled] { opacity: .4; cursor: default; }
.small { font-size: 12px; }
.is-archived { opacity: .65; }
.proj-row { padding: 8px 0 8px 18px; border-top: 1px solid var(--border); }
.proj-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.proj-actions .btn { height: 28px; }
.bud { margin-top: 6px; max-width: 420px; }
.bud-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.bud-bar { height: 5px; border-radius: 99px; background: #EDECE7; overflow: hidden; }
.bud-bar i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.bud.warn .bud-bar i { background: #b08a3e; }
.bud.over .bud-bar i { background: var(--danger); }
.task-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.task-row .btn { height: 28px; }
.td-add { display: flex; gap: 8px; }
.td-add input, .td-add select { flex: 1; }
dialog textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; }
#task-select { max-width: 160px; }

/* Anillos de Informes en cuadrícula 2 × 2 */
#rs-donuts-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
#rs-donuts-card > .card-head { grid-column: 1 / -1; }
#rs-donuts-card .donut-block { border-top: 1px solid var(--border); padding: 8px 0 16px; min-width: 0; }
#rs-donuts-card .donut-row { gap: 20px; }
#rs-donuts-card .dn-legend { flex: 1 1 220px; min-width: 200px; }
@media (max-width: 1150px) { #rs-donuts-card { grid-template-columns: minmax(0, 1fr); } }
main:has(#view-informes:not([hidden])) { max-width: 1560px; }
#rs-donuts-card .donut { width: 270px; }
#rs-donuts-card .donut-row { align-items: flex-start; }
#rs-donuts-card .dn-legend { padding-top: 34px; }

/* Logo 3D por empleado */
.donut.logo3d { width: 270px; height: 246px; }
.donut.logo3d .seg { transform-origin: 453px 540px; }
.donut.logo3d .seg.on { transform: translate(var(--dx), var(--dy)) scale(1.03); }
.logo3d .dn-total { font-size: 80px; }
.logo3d .dn-hov { font-size: 72px; }
.logo3d .dn-h2 { font-size: 52px; }

/* ---------- Jornada ---------- */
.j-now { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.j-clock { font-size: 52px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.j-actions { display: flex; gap: 10px; margin-top: 14px; }
.j-actions .btn { min-width: 120px; padding: 12px 18px; font-size: 15px; }
.j-today { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 220px; }
.j-today li b { font-variant-numeric: tabular-nums; margin-right: 6px; }
.j-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.j-sign { margin: 0 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.j-ev { display: inline-block; margin: 0 10px 2px 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.j-ev.gone { text-decoration: line-through; opacity: .5; }
.j-ev.void { color: var(--muted); font-style: italic; }
.j-warn { color: #8a5a00; font-size: 12px; }
.j-off td { color: var(--muted); }
.j-req { padding: 8px 0; border-top: 1px solid var(--line, #E0DED6); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.j-dec { margin-left: auto; display: flex; gap: 6px; }
#view-jornada h3 { font-size: 13px; margin: 10px 0 2px; color: var(--muted); }

/* ---------- Ojo de contraseña ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted, #5E6063); cursor: pointer; border-radius: 6px; padding: 0; }
.pw-eye:hover { color: var(--text, #2B2E33); background: rgba(0,0,0,.05); }

/* ---------- Casillas y selector de empresas ---------- */
input[type=checkbox] { width: auto; height: auto; accent-color: var(--accent, #2B2E33); }
label.check { display: block; }
label.check input[type=checkbox] { margin-right: 8px; vertical-align: middle; }
.client-pick { display: grid; gap: 2px; max-height: 190px; overflow: auto; border: 1px solid var(--border, #E0DED6); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.pick-row { display: flex !important; align-items: center; gap: 8px; font-weight: 500; padding: 4px 0; cursor: pointer; }
#u-access-wrap { margin-top: 4px; }

/* ---------- Proyecto: facturación mensual y presupuesto ---------- */
.sec { border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 14px; }
.sec h3 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg2 { display: flex; gap: 6px; }
.seg2 button { flex: 1; height: 36px; border: 1px solid var(--border); background: #fff; border-radius: 8px; font: inherit; font-weight: 550; cursor: pointer; color: var(--text); }
.seg2 button.on { background: #2B2E33; color: #fff; border-color: #2B2E33; }
.unit { display: flex; }
.unit span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; background: #F1F0EB; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.unit input { border-radius: 0 8px 8px 0; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair.solo { grid-template-columns: 1fr; }
.t-budget { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 10px; }
.t-budget input { width: 110px; height: 30px; }
.t-budget small { color: var(--muted); }
.task-row { align-items: center; }
/* Avisos de presupuesto */
.budget-alerts { margin-bottom: 14px; }
.alert-card { border: 1px solid #D9D5C9; background: #EDEAE2; border-radius: 12px; padding: 12px 16px; display: grid; gap: 6px; }
.alert-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.alert-row.over { color: #a3232b; font-weight: 600; }

/* ---------- Selector de idioma ---------- */
.lang-sw { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-left: 12px; flex: none; background: #fff; }
.lang-sw button { border: 0; background: transparent; padding: 7px 11px; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.lang-sw button.on { background: #2B2E33; color: #fff; }
.auth-card .lang-sw { position: absolute; top: 14px; right: 14px; margin: 0; }
.auth-card { position: relative; }

/* ---------- Proyectos comunes ---------- */
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#pd-money { display: grid; gap: 14px; }
#pd-share-wrap { display: grid; gap: 8px; }
#pd-share-list { max-height: 220px; }
.shared-block { border-color: #EDEAE2; background: #fffdf8; }
.shared-block .client-head strong { letter-spacing: .01em; }
.proj-share { margin-top: 2px; }
@media (max-width: 720px) { .head-btns { width: 100%; } .head-btns .btn { flex: 1; } }

/* ---------- Calendario laboral ---------- */
.j-hol td { background: #fffaf0; }
td.neg { color: #a1262b; }
.js-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.js-week label { display: grid; gap: 4px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.js-week input { width: 100%; min-width: 0; padding: 8px 4px; text-align: center; }
#jl-info { align-self: center; }
@media (max-width: 720px) { .js-week { grid-template-columns: repeat(4, 1fr); } }

select:disabled{opacity:.7;cursor:not-allowed}
.auth-brand .wm i { font-style: normal; color: #EDEAE2; }


.auth-brand .wm i { color: #2B2E33; }

@media (min-width: 961px) and (max-height: 860px) {
  .sidebar { padding-top: 14px; padding-bottom: 12px; }
  .brand { padding-bottom: 12px; }
  .sidebar nav { gap: 2px; }
  .sidebar nav a { padding-top: 7px; padding-bottom: 7px; }
  .sidebar nav a.sub { padding-top: 5px; padding-bottom: 5px; }
  .sidebar .me { padding-top: 8px; }
  #install-btn { margin-top: 6px; }
}

#vid-dialog { border: 0; border-radius: 14px; padding: 14px; width: min(980px, 94vw); background: #1f2124; color: #fff; }
#vid-dialog::backdrop { background: rgba(15, 17, 20, .72); }
#vid-dialog .vid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#vid-dialog video { display: block; width: 100%; max-height: 78vh; border-radius: 8px; background: #000; }
