:root {
  --bg: #f5f4f0; --surface: #ffffff; --sidebar: #efede7; --line: #e3e0d7; --line-soft: #eeece5;
  --ink: #1c1e21; --ink-2: #5b5f66; --ink-3: #8a8e95;
  --accent: #1d6b52; --accent-ink: #ffffff; --accent-soft: #e3f0ea;
  --danger: #b3261e; --danger-soft: #fbe9e7; --warn: #a15c07; --warn-soft: #fcf1de; --info: #2b5c8a; --info-soft: #e5eef7; --muted-soft: #eeede8;
  --radius: 8px;
  --bs-body-font-family: 'Hanken Grotesk', system-ui, sans-serif; --bs-body-bg: var(--bg); --bs-body-color: var(--ink); --bs-border-color: var(--line);
  --bs-body-font-size: .9rem; --bs-link-color-rgb: 29,107,82; --bs-link-hover-color-rgb: 19,74,56;
}
body { background: var(--bg); color: var(--ink); font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { letter-spacing: -.01em; font-weight: 650; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex: 0 0 224px; background: var(--sidebar); border-right: 1px solid var(--line); padding: 1rem .75rem; display: flex; flex-direction: column; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; } }
.sidebar.offcanvas-lg { --bs-offcanvas-width: 240px; background: var(--sidebar); }
.brand { font-weight: 700; letter-spacing: -.02em; padding: .25rem .6rem 1rem; display: flex; align-items: center; gap: .55rem; font-size: 1rem; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: .8rem; }
.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item-link { display: flex; align-items: center; gap: .65rem; padding: .45rem .6rem; border-radius: 6px; color: var(--ink-2); font-weight: 500; text-align: left; cursor: pointer; }
.nav-item-link i { font-size: 1rem; width: 1.1rem; }
.nav-item-link:hover { background: rgba(0,0,0,.045); color: var(--ink); text-decoration: none; }
.nav-item-link.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.nav-item-link.active i { color: var(--accent); }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: .6rem; }
.main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; background: rgba(245,244,240,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 650; flex: 1; }
.content { padding: 1.5rem; max-width: 1240px; }
@media (max-width: 575px) { .content { padding: 1rem; } .topbar { padding: .5rem 1rem; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; } .page-head p { margin: .15rem 0 0; color: var(--ink-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-bottom: 1px solid var(--line-soft); font-weight: 600; gap: .75rem; flex-wrap: wrap; }
.panel-body { padding: 1rem; }
.section-gap { margin-top: 1.4rem; }
/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; }
.kpi .kpi-label { color: var(--ink-2); font-size: .78rem; font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.kpi .kpi-value { font-size: 1.15rem; font-weight: 650; margin-top: .3rem; min-height: 2.6rem; }
.kpi .kpi-value.single { font-size: 1.6rem; }
.kpi .kpi-sub { color: var(--ink-3); font-size: .76rem; }
.kpi.alert-tone { border-color: #e9c2bd; } .kpi.alert-tone .kpi-label i { color: var(--danger); }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; } .money .cur { color: var(--ink-3); font-size: .72em; font-weight: 600; letter-spacing: .04em; margin-right: .1rem; }
/* tables */
.table { --bs-table-bg: transparent; margin: 0; font-size: .85rem; }
.table > :not(caption) > * > * { padding: .5rem .85rem; border-bottom-color: var(--line-soft); vertical-align: middle; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; background: #faf9f6; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #faf9f6; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); }
.empty i { font-size: 1.4rem; display: block; margin-bottom: .3rem; }
/* badges */
.badge-soft { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tone-ok { background: var(--accent-soft); color: var(--accent); } .tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-warn { background: var(--warn-soft); color: var(--warn); } .tone-info { background: var(--info-soft); color: var(--info); } .tone-muted { background: var(--muted-soft); color: var(--ink-2); }
.rel.tone-danger { background: none; color: var(--danger); font-weight: 600; } .rel.tone-warn { background: none; color: var(--warn); font-weight: 600; } .rel.tone-muted { background: none; color: var(--ink-2); }
/* buttons & forms */
.btn { --bs-btn-font-size: .85rem; --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; --bs-btn-border-radius: 6px; font-weight: 500; }
.btn-accent { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--accent-ink); --bs-btn-hover-bg: #165540; --bs-btn-hover-border-color: #165540; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #134a38; --bs-btn-active-border-color: #134a38; --bs-btn-active-color: #fff; }
.btn-line { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink); --bs-btn-hover-bg: #f3f2ee; --bs-btn-hover-border-color: #cfccc2; --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: #eceae4; --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: #cfccc2; }
.btn-danger-line { --bs-btn-bg: var(--surface); --bs-btn-border-color: #e2b8b3; --bs-btn-color: var(--danger); --bs-btn-hover-bg: var(--danger-soft); --bs-btn-hover-border-color: #d99a93; --bs-btn-hover-color: var(--danger); --bs-btn-active-bg: var(--danger-soft); --bs-btn-active-color: var(--danger); --bs-btn-active-border-color: #d99a93; }
.btn-ghost { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--ink-2); --bs-btn-hover-bg: rgba(0,0,0,.05); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: transparent; }
.btn-xs { --bs-btn-padding-y: .12rem; --bs-btn-padding-x: .45rem; --bs-btn-font-size: .76rem; }
.form-control, .form-select { font-size: .88rem; border-color: var(--line); border-radius: 6px; background-color: var(--surface); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,107,82,.15); }
.form-label { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: .25rem; }
.form-text { font-size: .76rem; }
.req::after { content: ' *'; color: var(--danger); }
.dropdown-menu { font-size: .86rem; border-color: var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(20,20,20,.08); }
.dropdown-item i { color: var(--ink-3); margin-right: .35rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; }
.seg { display: inline-flex; background: var(--muted-soft); border-radius: 7px; padding: 2px; gap: 2px; }
.seg a { padding: .22rem .65rem; border-radius: 5px; color: var(--ink-2); font-size: .82rem; font-weight: 500; }
.seg a:hover { text-decoration: none; color: var(--ink); } .seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.inline-form { display: inline; } .inline-form-flex { display: inline-flex; gap: .25rem; align-items: center; }
/* modals */
.modal-content { border-color: var(--line); border-radius: 12px; box-shadow: 0 20px 50px rgba(20,20,20,.18); }
.modal-header { border-bottom-color: var(--line-soft); padding: .85rem 1.1rem; }
.modal-title { font-size: 1rem; font-weight: 650; margin: 0; }
.modal-body { padding: 1.1rem; }
.modal-footer { border-top-color: var(--line-soft); padding: .7rem 1.1rem; gap: .5rem; }
.modal-footer > * { margin: 0; }
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #961f18; --bs-btn-hover-border-color: #961f18; --bs-btn-active-bg: #861b15; --bs-btn-active-border-color: #861b15; }
.modal-backdrop { --bs-backdrop-opacity: .35; }
/* attention list */
.attn-group { padding: .45rem 1rem; background: #faf9f6; border-bottom: 1px solid var(--line-soft); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3); display: flex; justify-content: space-between; }
.attn-group.danger { color: var(--danger); } .attn-group.warn { color: var(--warn); }
.attn { display: flex; align-items: center; gap: .9rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line-soft); }
.attn:last-child { border-bottom: 0; }
.attn-type { width: 1.9rem; height: 1.9rem; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; background: var(--muted-soft); color: var(--ink-2); }
.attn-main { flex: 1; min-width: 0; } .attn-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-meta { color: var(--ink-2); font-size: .8rem; }
.attn-actions { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 767px) { .attn { flex-wrap: wrap; } .attn-actions { width: 100%; justify-content: flex-start; padding-left: 2.8rem; } }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; margin: 0; } .kv dt { color: var(--ink-3); font-weight: 500; font-size: .8rem; } .kv dd { margin: 0; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; box-shadow: 0 12px 40px rgba(20,20,20,.06); }
.login-card .brand { padding: 0 0 1.25rem; }
.text-muted { color: var(--ink-3) !important; }
@media print { .sidebar, .topbar { display: none; } }
.narrow { max-width: 760px; }
/* segmented filters scroll sideways on narrow screens instead of widening the page */
.filters .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .filters .seg::-webkit-scrollbar { display: none; }
.seg a { white-space: nowrap; }
.modal, .dropdown-menu { --bs-modal-bg: var(--surface); --bs-dropdown-bg: var(--surface); }
.nowrap { white-space: nowrap; }
/* Reports */
.report-h { font-size: .95rem; font-weight: 650; margin: 1.6rem 0 .6rem; } .report-h h2 { font-size: .95rem; font-weight: 650; }
.report-kpis { margin-bottom: .75rem; } .report-kpis .kpi-value { min-height: 0; }
.cur-tag { color: var(--ink-3); font-size: .68rem; font-weight: 600; letter-spacing: .05em; }
.bar-cell { min-width: 150px; } .bar-cell .money { display: block; font-size: .85rem; }
.bar-cell .bar { display: block; width: 100%; height: 4px; margin-top: .3rem; appearance: none; -webkit-appearance: none; border: 0; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.bar-cell .bar::-webkit-progress-bar { background: var(--line-soft); } .bar-cell .bar::-webkit-progress-value { background: var(--accent); border-radius: 2px; } .bar-cell .bar::-moz-progress-bar { background: var(--accent); border-radius: 2px; }
.bar-cell.zero .money { color: var(--ink-3); }
@media (max-width: 575.98px) { .bar-cell { min-width: 0; } .table td.bar-cell, .table th { padding-left: .6rem; padding-right: .6rem; } .report-kpis { grid-template-columns: 1fr 1fr; } .report-kpis .kpi-sub { display: none; } .report-kpis .kpi-value.single { font-size: 1.25rem; } }
/* Initials avatar: six neutral tones picked by client id */
.av { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; font-size: .78rem; font-weight: 650; letter-spacing: .02em; background: #e6e3da; color: #4a4d52; }
.av-sm { width: 26px; height: 26px; font-size: .68rem; } .av-lg { width: 52px; height: 52px; font-size: 1.1rem; }
.av-0 { background: #e6e3da; color: #4a4d52; } .av-1 { background: #dfe6e2; color: #2f4f43; } .av-2 { background: #e3e4ea; color: #3d4560; }
.av-3 { background: #eae2dc; color: #5e4636; } .av-4 { background: #e1e6e9; color: #35505e; } .av-5 { background: #e8e3ea; color: #54405c; }
.client-cell { display: inline-flex; align-items: center; gap: .6rem; color: inherit; } .client-cell:hover { text-decoration: none; } .client-cell:hover span:last-child { text-decoration: underline; }
/* Client detail */
.client-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.client-id { flex: 1; min-width: 0; } .client-id h1 { font-size: 1.35rem; margin: 0 0 .15rem; overflow-wrap: anywhere; }
.client-contact { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.client-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ctabs { border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 1.1rem; }
.ctabs::-webkit-scrollbar { display: none; }
.ctabs .nav-link { color: var(--ink-2); font-weight: 500; font-size: .86rem; white-space: nowrap; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: .55rem .85rem; background: none; }
.ctabs .nav-link:hover { color: var(--ink); } .ctabs .nav-link i { color: var(--ink-3); margin-right: .15rem; }
.ctabs .nav-link.active { color: var(--ink); border-bottom-color: var(--accent); background: none; font-weight: 600; } .ctabs .nav-link.active i { color: var(--accent); }
.tab-count { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px; background: var(--muted-soft); color: var(--ink-2); font-size: .7rem; font-weight: 600; text-align: center; }
.tab-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.kpi-value a { font-weight: 600; }
/* Task board */
.tboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; align-items: start; }
@media (max-width: 767.98px) { .tboard { grid-template-columns: minmax(0, 1fr); } }
.tcol { background: #efede7; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-width: 0; }
.tcol-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .1rem .2rem .55rem; }
.tcol-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0; }
.tcol-count { display: inline-block; margin-left: .3rem; min-width: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .72rem; text-align: center; letter-spacing: 0; }
.tcol-body { display: flex; flex-direction: column; gap: .5rem; min-height: 4.5rem; border-radius: 6px; transition: background-color .12s; }
.tcol-body.is-over { background: rgba(29,107,82,.09); outline: 2px dashed rgba(29,107,82,.45); outline-offset: 2px; }
.tcol-empty { color: var(--ink-3); font-size: .8rem; text-align: center; padding: 1.1rem .5rem; border: 1px dashed var(--line); border-radius: 6px; }
.tcard ~ .tcol-empty { display: none; }
.tcol-foot { padding: .6rem .2rem .1rem; font-size: .8rem; }
.tcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: .6rem .7rem .45rem; cursor: grab; }
.tcard:hover { border-color: #cfccc2; box-shadow: 0 1px 3px rgba(20,20,20,.06); }
.tcard.is-dragging { opacity: .45; cursor: grabbing; }
.tcard.is-saving { opacity: .7; }
.tcard-top { display: flex; align-items: flex-start; gap: .5rem; }
.tcard-title { font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; } .tcard-title:hover { text-decoration: underline; }
.tcard.is-done .tcard-title { color: var(--ink-3); text-decoration: line-through; }
.prio { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: .4rem; background: var(--ink-3); }
.prio-alta { background: var(--danger); } .prio-normal { background: #c9a227; } .prio-baja { background: #9aa0a6; }
.tcard-meta { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: .35rem 0 0 1.05rem; font-size: .78rem; color: var(--ink-2); }
.tcard-chip { color: var(--ink-2); max-width: 100%; overflow-wrap: anywhere; } .tcard-chip i { color: var(--ink-3); }
.tcard-move { margin: .25rem 0 0 .45rem; }
.tcard-move .btn { --bs-btn-padding-x: .3rem; color: var(--ink-3); } .tcard-move .btn:hover { color: var(--ink); }
.tcard-move .dropdown-menu { --bs-dropdown-min-width: 9rem; font-size: .82rem; }
.tcard-move .dropdown-menu form { margin: 0; }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1100; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
@media (hover: none) { .tcard { cursor: default; } }
