/* ==========================================================================
   CYP Control Center · app.css
   1. Tokens  2. Base  3. Layout  4. Components  5. Modules  6. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    /* Brand */
    --cyp-navy: #16324A;
    --cyp-navy-deep: #10283B;
    --cyp-blue: #2878D4;
    --cyp-blue-hover: #1F69BF;
    --cyp-blue-ink: #1D5FA8;
    --cyp-blue-soft: #DCEBF8;
    --cyp-cyan: #55B8D5;

    /* Surfaces */
    --cyp-bg: #F4F6F7;
    --cyp-surface: #FFFFFF;
    --cyp-surface-alt: #EEF2F4;
    --cyp-surface-soft: #F7F8F9;

    /* Text */
    --cyp-text: #17212B;
    --cyp-text-secondary: #65727D;
    --cyp-text-muted: #8A949C;

    /* Lines */
    --cyp-border: #D9DFE3;
    --cyp-border-soft: #E6EAED;
    --cyp-border-strong: #C8D0D6;

    /* States */
    --cyp-success: #25845B;
    --cyp-success-soft: #E5F1EB;
    --cyp-warning: #B7791F;
    --cyp-warning-soft: #F7EEDF;
    --cyp-danger: #C53F3F;
    --cyp-danger-soft: #F8E6E6;

    /* Radii: small and consistent */
    --cyp-radius-xs: 4px;
    --cyp-radius-sm: 6px;
    --cyp-radius-md: 8px;
    --cyp-radius-lg: 12px;

    /* Elevation: only for floating layers (menus, modals, overlays) */
    --cyp-shadow-float: 0 4px 16px rgba(16, 40, 59, .10), 0 1px 2px rgba(16, 40, 59, .06);
    --cyp-shadow-pop: 0 12px 32px rgba(16, 40, 59, .16), 0 2px 6px rgba(16, 40, 59, .08);

    /* Legacy names used across modules (mapped to the system above) */
    --cyp-primary: var(--cyp-blue);
    --cyp-primary-hover: var(--cyp-blue-hover);
    --cyp-primary-ink: var(--cyp-blue-ink);
    --cyp-primary-soft: #EAF2FA;
    --cyp-accent: var(--cyp-cyan);
    --cyp-accent-soft: #E4F2F7;
    --cyp-glass: #FFFFFF;
    --cyp-glass-strong: #FFFFFF;
    --cyp-text-primary: var(--cyp-text);
    --cyp-text-tertiary: var(--cyp-text-muted);
    --cyp-muted-soft: var(--cyp-surface-alt);

    --radius-xs: var(--cyp-radius-xs);
    --radius-sm: var(--cyp-radius-sm);
    --radius-md: var(--cyp-radius-md);
    --radius-lg: var(--cyp-radius-md);
    --radius-xl: var(--cyp-radius-lg);
    --radius: var(--cyp-radius-md);

    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: var(--cyp-shadow-float);
    --shadow-pop: var(--cyp-shadow-pop);

    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px;

    --dur: 150ms;
    --ease: cubic-bezier(.2, .6, .2, 1);
    --blur: none;

    --bg: var(--cyp-bg);
    --surface: var(--cyp-surface);
    --surface-2: var(--cyp-surface-soft);
    --surface-3: var(--cyp-surface-alt);
    --text: var(--cyp-text);
    --text-2: var(--cyp-text-secondary);
    --text-3: var(--cyp-text-muted);
    --border: var(--cyp-border);
    --border-2: var(--cyp-border-soft);
    --border-strong: var(--cyp-border-strong);

    --primary: var(--cyp-blue);
    --primary-hover: var(--cyp-blue-hover);
    --primary-ink: var(--cyp-navy);
    --accent: var(--cyp-blue);
    --accent-soft: var(--cyp-primary-soft);
    --accent-ink: var(--cyp-blue-ink);

    --success: var(--cyp-success);
    --success-soft: var(--cyp-success-soft);
    --warning: var(--cyp-warning);
    --warning-soft: var(--cyp-warning-soft);
    --danger: var(--cyp-danger);
    --danger-soft: var(--cyp-danger-soft);
    --muted-soft: var(--cyp-surface-alt);

    --sidebar-w: 236px;
    --sidebar-collapsed: 64px;
    --topbar-h: 56px;
    --page-pad: 28px;
    --shell-gap: 0px;
    --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --vh: 1vh;
}

/* Desktop density: the whole platform renders at 80 % on large screens (phones keep full size).
   Zoom also scales vh, so viewport-height layouts use --vh to keep filling the window. */
@media screen and (min-width: 1100px) {
    html { zoom: .8; }
    :root { --vh: calc(1vh / .8); }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: calc(var(--vh) * 100);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--cyp-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border-2); margin: 20px 0; }
::selection { background: var(--cyp-blue-soft); }
:focus-visible { outline: 2px solid var(--cyp-blue); outline-offset: 2px; border-radius: 4px; }

.icon {
    width: 16px; height: 16px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.icon--lg { width: 20px; height: 20px; }
.icon--xl { width: 26px; height: 26px; stroke-width: 1.5; }

.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--cyp-blue); }
.label-tech { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* 3. Layout ---------------------------------------------------------------- */
/* Presentation bar (administrators only) */
.pvbar { position: relative; z-index: 60; background: var(--cyp-navy-deep); color: rgba(255, 255, 255, .78); font-size: 12.5px; }
.pvbar__in { max-width: 1440px; margin: 0 auto; min-height: 40px; padding: 5px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pvbar__label { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.pvbar__label .icon { width: 14px; height: 14px; }
.pvbar__tabs { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .08); }
.pvbar__tab {
    display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px;
    border: 0; border-radius: 4px; background: transparent; color: rgba(255, 255, 255, .78);
    font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pvbar__tab .icon { width: 15px; height: 15px; }
.pvbar__tab:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.pvbar__tab.is-active { background: #fff; color: var(--cyp-navy); }
.pvbar__who { display: flex; align-items: center; gap: 8px; }
.pvbar__who label { color: rgba(255, 255, 255, .6); white-space: nowrap; }
.pvbar__who select {
    height: 28px; max-width: 300px; padding: 0 28px 0 10px; border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, .22); background-color: rgba(255, 255, 255, .08); color: #fff;
    font-size: 12.5px; cursor: pointer;
}
.pvbar__who select option { color: var(--text); background: #fff; }
.pvbar__note { margin-left: auto; padding: 2px 8px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .22); font-size: 11.5px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
@media (max-width: 720px) {
    .pvbar__in { gap: 8px; padding: 6px 10px; }
    .pvbar__label { display: none; }
    .pvbar__tabs { width: 100%; }
    .pvbar__tab { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; }
    .pvbar__tab .icon { display: none; }
    .pvbar__who { flex: 1; min-width: 0; }
    .pvbar__who select { flex: 1; min-width: 0; max-width: none; }
}

.shell { display: flex; min-height: calc(var(--vh) * 100); }
.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Sidebar: flat column with a right separator */
.sidebar {
    position: sticky; top: 0; height: calc(var(--vh) * 100);
    width: var(--sidebar-w); flex: none;
    background: var(--cyp-surface); color: var(--text-2);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: width var(--dur) var(--ease);
    z-index: 40;
}
.sidebar__brand {
    height: 72px; display: flex; align-items: center; gap: 12px; flex: none;
    padding: 0 20px; color: var(--text); border-bottom: 1px solid var(--border-2);
}
.sidebar__brand:hover { color: var(--text); }
.brand-logo { width: 38px; height: 38px; flex: none; object-fit: contain; }
.brand-mark {
    width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none;
    background: var(--cyp-navy); color: #fff;
    display: grid; place-items: center;
    font-weight: 600; font-size: 11px; letter-spacing: .02em;
}
.brand-text { line-height: 1.2; overflow: hidden; white-space: nowrap; }
.brand-text strong { display: block; font-size: 17px; font-weight: 700; letter-spacing: .06em; color: var(--cyp-navy); }
.brand-text span { font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 10px 0 16px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-group__label {
    padding: 12px 20px 5px; font-size: 10.5px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
    white-space: nowrap;
}
.nav-item {
    position: relative; display: flex; align-items: center; gap: 11px;
    height: 34px; padding: 0 20px; border-radius: 0;
    color: var(--text-2); font-weight: 500; font-size: 13.5px; white-space: nowrap;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item .icon { width: 16px; height: 16px; color: var(--text-3); transition: color var(--dur) var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover .icon { color: var(--text-2); }
.nav-item.is-active { background: transparent; color: var(--text); font-weight: 600; }
.nav-item.is-active .icon { color: var(--cyp-navy); }
.nav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 5px; bottom: 5px;
    width: 3px; background: var(--cyp-blue);
}
.nav-item__label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item__badge {
    min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--radius-xs);
    background: var(--surface-3); color: var(--text-2);
    font-size: 11px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.nav-item__badge--alert { background: var(--danger-soft); color: var(--danger); }

.sidebar__footer { padding: 8px 0; border-top: 1px solid var(--border-2); }
.sidebar__collapse {
    width: 100%; height: 34px; border: 0; background: transparent; cursor: pointer;
    display: flex; align-items: center; gap: 11px; padding: 0 20px;
    color: var(--text-3); font-size: 13px;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidebar__collapse:hover { background: var(--surface-2); color: var(--text-2); }

.is-collapsed .sidebar { width: var(--sidebar-collapsed); }
.is-collapsed .brand-text,
.is-collapsed .nav-group__label,
.is-collapsed .nav-item__label,
.is-collapsed .nav-item__badge,
.is-collapsed .sidebar__collapse span { display: none; }
.is-collapsed .nav-group + .nav-group { border-top: 1px solid var(--border-2); padding-top: 6px; }
.is-collapsed .nav-item { justify-content: center; padding: 0; }
.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }
.is-collapsed .brand-logo { width: 32px; height: 32px; }
.is-collapsed .sidebar__collapse { justify-content: center; padding: 0; }
.is-collapsed .sidebar__collapse .icon { transform: rotate(180deg); }

/* Topbar: breadcrumb, search, Nuevo, notifications, user */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
    padding: 0 24px 0 28px;
    background: var(--cyp-surface);
    border-bottom: 1px solid var(--border);
}
.topbar__menu, .topbar__search-btn { display: none; }
.topbar__title { font-size: 14.5px; font-weight: 600; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--text); }
.topbar__title .crumb { color: var(--text-2); font-weight: 400; }
.topbar__title .crumb:hover { color: var(--cyp-blue); }
.topbar__title .sep { color: var(--border-strong); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.search { position: relative; width: 300px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 15px; height: 15px; }
.search input {
    width: 100%; height: 36px; padding: 0 40px 0 34px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    outline: none; font-size: 13.5px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search input:focus { background: #fff; border-color: var(--cyp-blue); box-shadow: 0 0 0 3px rgba(40, 120, 212, .14); }
.search kbd {
    position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
    font: 500 11px var(--font); color: var(--text-3);
    border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: #fff;
}

.icon-btn {
    position: relative; width: 36px; height: 36px; border-radius: var(--radius-sm);
    display: grid; place-items: center; border: 1px solid transparent;
    background: transparent; color: var(--text-2); cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn.is-active { background: var(--surface-3); color: var(--cyp-navy); }
.icon-btn__dot {
    position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 600; display: grid; place-items: center;
    border: 2px solid #fff;
}

.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    background: var(--cyp-navy); color: #fff;
    display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.avatar--sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar--soft { background: var(--surface-3); color: var(--cyp-navy); }
.user-chip { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; padding: 2px; border-radius: 20px; }
.user-chip .avatar { transition: box-shadow var(--dur) var(--ease); }
.user-chip:hover .avatar { box-shadow: 0 0 0 3px var(--surface-3); }

/* Page */
.page { padding: 26px var(--page-pad) 56px; max-width: 1560px; width: 100%; margin: 0 auto; }
.page--narrow { max-width: 1000px; }
.page--stage { max-width: none; padding: 16px var(--page-pad) 20px; display: flex; flex-direction: column; flex: 1; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header__eyebrow { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.page-header__eyebrow .icon { display: none; }
.page-header__title { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; color: var(--text); }
.page-header__subtitle { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.page-header__meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--text-2); font-size: 13.5px; }
.page-header__meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.page-header__meta .icon { width: 14px; height: 14px; color: var(--text-3); }
.page-header__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: none; }

.section { margin-top: 28px; }
.section__header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section__title { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.section__title small { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 6px; }
.section__link { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.section__link .icon { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.section__link:hover .icon { transform: translateX(2px); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); gap: 20px; align-items: start; }
.grid--main-wide { grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* 4. Components ------------------------------------------------------------ */

/* Buttons: one solid primary per context, the rest outline / ghost / text */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent;
    font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
    text-decoration: none; color: var(--text);
}
.btn .icon { width: 15px; height: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--cyp-blue); border-color: var(--cyp-blue); color: #fff; }
.btn--primary:hover { background: var(--cyp-blue-hover); border-color: var(--cyp-blue-hover); color: #fff; }
.btn--secondary { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn--soft { background: #fff; border-color: var(--border-strong); color: var(--cyp-blue-ink); }
.btn--soft:hover { background: var(--surface-2); border-color: var(--cyp-blue); color: var(--cyp-blue-ink); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--danger { background: #fff; border-color: #E5BDBD; color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--success { background: var(--success); border-color: var(--success); color: #fff; }
.btn--success:hover { background: #1E7150; color: #fff; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn--sm .icon { width: 14px; height: 14px; }
.btn--icon { width: 36px; padding: 0; }
.btn--sm.btn--icon { width: 30px; }
.btn--block { width: 100%; }

/* Panels (cards): flat surface with a 1px border, no elevation */
.card {
    background: var(--cyp-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.card__header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 50px; padding: 12px 18px; border-bottom: 1px solid var(--border-2);
}
.card__title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title .icon { display: none; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__footer { padding: 11px 18px; border-top: 1px solid var(--border-2); background: var(--surface-2); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* Floating panel over maps and 3D scenes */
.glass {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--cyp-shadow-float);
}

/* KPI band: metrics sit in one strip separated by vertical dividers */
.metrics {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
    background: var(--border-2); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
}
.metric {
    position: relative; display: block; color: inherit; min-width: 0;
    background: var(--cyp-surface); padding: 15px 20px 14px;
    transition: background var(--dur) var(--ease);
}
a.metric:hover { background: var(--surface-2); color: inherit; }
.metric__label { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric__label .icon { display: none; }
.metric__value { margin-top: 6px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric__hint { margin-top: 4px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.metric--success .metric__value { color: var(--success); }
.metric--danger .metric__value { color: var(--danger); }

.stat-strip {
    display: flex; flex-wrap: wrap; margin-top: 12px;
    background: var(--cyp-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.stat-strip__item {
    flex: 1 1 0; min-width: 160px; display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; color: inherit;
    transition: background var(--dur) var(--ease);
}
.stat-strip__item:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.stat-strip__item:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.stat-strip__item + .stat-strip__item { border-left: 1px solid var(--border-2); }
a.stat-strip__item:hover { background: var(--surface-2); color: inherit; }
.stat-strip__value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-strip__label { font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.stat-strip__item--alert .stat-strip__value { color: var(--danger); }

/* Status: dot + text. Full label only for critical states (.badge--strong) */
.badge {
    --dot: var(--text-3);
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.3;
    color: var(--text);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: none; }
.badge .icon { display: none; }
.badge--neutral { --dot: #9AA4AC; }
.badge--info { --dot: var(--cyp-blue); }
.badge--accent { --dot: var(--cyp-cyan); }
.badge--success { --dot: var(--success); }
.badge--warning { --dot: var(--warning); }
.badge--danger { --dot: var(--danger); color: var(--danger); }
.badge--muted { --dot: transparent; color: var(--text-3); }
.badge--muted::before { box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.badge--lg { font-size: 14px; }
.badge--strong {
    height: 21px; padding: 0 7px; gap: 0; border-radius: var(--radius-xs);
    font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    background: var(--danger); color: #fff;
}
.badge--strong::before { display: none; }
.badge--strong.badge--warning { background: var(--warning); }

.tag-urgency {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--text-2);
}
.tag-urgency--danger { height: 21px; padding: 0 7px; border-radius: var(--radius-xs); background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.tag-urgency--warning { color: var(--warning); font-weight: 600; }
.tag-urgency--accent { color: var(--cyp-blue-ink); }
.tag-urgency--neutral { color: var(--text-3); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--border-2); }
.form-section__title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.form-section__desc { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--border-2); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; font-weight: 500; color: var(--text); display: flex; justify-content: space-between; gap: 8px; }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 12px; color: var(--text-3); }
.field-error { font-size: 12.5px; color: var(--danger); }
.input, .select, .textarea {
    width: 100%; height: 36px; padding: 0 11px;
    background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    outline: none; font-size: 14px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select {
    appearance: none; padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2365727D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--cyp-blue); box-shadow: 0 0 0 3px rgba(40, 120, 212, .14); }
.input--error, .has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.input--sm, .select--sm { height: 32px; font-size: 13px; }
.input-group { position: relative; }
.input-group__prefix { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group__suffix { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group .input { padding-left: 24px; }
.input-group--suffix .input { padding-left: 11px; padding-right: 30px; }
.input.num { text-align: right; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--cyp-blue); margin: 0; }

.segmented { display: inline-flex; padding: 2px; background: var(--surface-3); border-radius: var(--radius-sm); gap: 2px; }
.segmented a, .segmented button {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
    border-radius: 4px; color: var(--text-2); font-weight: 500; font-size: 13px; border: 0; background: transparent; cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented a:hover { color: var(--text); }
.segmented .is-active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.segmented--radio label { position: relative; display: inline-flex; }
.segmented--radio input { position: absolute; opacity: 0; pointer-events: none; }
.segmented--radio span {
    display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 4px;
    color: var(--text-2); font-weight: 500; font-size: 13px; cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented--radio span:hover { color: var(--text); }
.segmented--radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.segmented--radio input:focus-visible + span { box-shadow: 0 0 0 2px var(--cyp-blue); }

/* Project form */
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-3 { grid-column: span 3; }
.form-grid + .form-grid, .form-grid + .inset-panel, .inset-panel + .form-grid, .form-grid + datalist + * { margin-top: 16px; }
.form-grid > .grid-item { min-width: 0; }
.subgrid { margin-top: 16px; }
.record-type { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-2); }
.record-type__label { font-size: 13px; font-weight: 600; color: var(--text); }
.project-form__alert { margin-bottom: 18px; }
.inset-panel { padding: 14px 16px 16px; background: var(--surface-2, #F7F8F9); border: 1px solid var(--border-2); border-radius: var(--radius-sm); }
.inset-panel__title { font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.inset-panel__title .muted { font-weight: 400; }
.radio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: 36px; }
.calc-value { display: flex; align-items: center; justify-content: flex-end; height: 36px; padding: 0 11px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 14px; }
.contact-detail { align-self: end; min-height: 36px; display: flex; align-items: center; margin: 0; color: var(--text-2); font-size: 13px; }
.portal-sections { display: grid; gap: 8px; margin-top: 12px; padding-left: 2px; }
.missing-list { margin: 10px 0 0 18px; display: grid; gap: 4px; font-weight: 500; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters .search { width: 260px; }
.filters .select, .filters .input { height: 36px; width: auto; min-width: 150px; font-size: 13.5px; }
.filters__clear { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; }
.filters__clear:hover { color: var(--danger); }
.filters__count { margin-left: auto; color: var(--text-2); font-size: 13px; }

/* Tables: the central component */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.card > .table-wrap, .card .table-wrap--flush { border: 0; border-radius: 0; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-2);
    padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    white-space: nowrap; letter-spacing: .05em; text-transform: uppercase;
}
.table td { height: 48px; padding: 9px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: #F8FAFB; }
.table .col-num, .table th.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .col-check { width: 36px; }
.table--compact td { height: 42px; padding: 7px 16px; }
.table tr.is-alert td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.is-warning td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.th-sort .icon { width: 12px; height: 12px; opacity: .35; }
.th-sort:hover { color: var(--text); }
.th-sort.is-active { color: var(--text); }
.th-sort.is-active .icon { opacity: 1; }
.cell-main { font-weight: 500; color: var(--text); display: block; }
a.cell-main:hover { color: var(--accent); }
.cell-sub { font-size: 12.5px; color: var(--text-2); display: block; margin-top: 1px; }
.cell-code { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.row-link { color: inherit; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-2); font-size: 13px; color: var(--text-2); }
.pagination__pages { display: flex; gap: 4px; }
.pagination__pages a, .pagination__pages span {
    min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm);
    display: grid; place-items: center; color: var(--text-2); font-weight: 500;
}
.pagination__pages a { transition: background var(--dur) var(--ease); }
.pagination__pages a:hover { background: var(--cyp-primary-soft); color: var(--cyp-primary-ink); }
.pagination__pages .is-active { background: var(--primary); color: #fff; }
.pagination__pages .is-disabled { opacity: .4; }

/* Empty state */
.empty {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 36px 24px; gap: 6px;
}
.empty__icon { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-3); display: grid; place-items: center; margin-bottom: 6px; }
.empty__title { font-weight: 600; font-size: 14.5px; }
.empty__text { color: var(--text-2); font-size: 13.5px; max-width: 380px; }
.empty .btn { margin-top: 10px; }
.empty--inline { flex-direction: row; text-align: left; padding: 16px 18px; gap: 12px; }
.empty--inline .empty__icon { width: 34px; height: 34px; margin: 0; }
.empty--inline .btn { margin: 0 0 0 auto; }

/* Tabs */
.tabs {
    display: flex; gap: 4px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--border); width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    height: 42px; padding: 0 12px; color: var(--text-2); font-weight: 500; white-space: nowrap;
    transition: color var(--dur) var(--ease);
}
.tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: transparent; transition: background var(--dur) var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a:hover::after { background: var(--border-strong); }
.tabs a.is-active { color: var(--text); font-weight: 600; }
.tabs a.is-active::after { background: var(--cyp-blue); }
.tabs a .icon { display: none; }
.tabs__count { font-size: 11.5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tabs a.is-active .tabs__count { color: var(--text-2); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
    min-width: 220px; padding: 5px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
    display: none;
}
.dropdown.is-open .dropdown__menu { animation: pop-in var(--dur) var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown__menu--left { right: auto; left: 0; }
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border-radius: 4px; border: 0; background: transparent;
    color: var(--text); font-size: 13.5px; text-align: left; cursor: pointer;
    transition: background var(--dur) var(--ease);
}
.dropdown__item:hover { background: var(--surface-3); color: var(--text); }
.dropdown__item:hover .icon { color: var(--text); }
.dropdown__item .icon { color: var(--text-2); }
.dropdown__item--danger, .dropdown__item--danger .icon { color: var(--danger); }
.dropdown__sep { height: 1px; background: var(--border-2); margin: 6px 0; }
.dropdown__header { padding: 8px 10px 6px; }
.dropdown__header strong { display: block; font-size: 13.5px; }
.dropdown__header span { font-size: 12px; color: var(--text-2); }

/* Dialog (modal + drawer) */
dialog.modal {
    width: min(560px, calc(100vw - 32px)); max-height: calc(var(--vh) * 100 - 48px);
    padding: 0; border: 1px solid var(--border); border-radius: var(--cyp-radius-lg);
    background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
    overflow: hidden;
}
dialog.modal--wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal--sm { width: min(420px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(16, 40, 59, .38); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .18s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.modal__form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border-2); }
.modal__title { font-size: 16px; font-weight: 600; }
.modal__subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border-2); background: var(--surface-2); }

dialog.drawer {
    margin: 0 0 0 auto; height: calc(var(--vh) * 100); max-height: calc(var(--vh) * 100); width: min(480px, 100vw);
    padding: 0; border: 0; border-left: 1px solid var(--border); background: var(--surface);
    box-shadow: var(--shadow-pop);
}
dialog.drawer::backdrop { background: rgba(16, 40, 59, .32); }
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .2s var(--ease); }
@keyframes drawer-in { from { transform: translateX(16px); opacity: .7; } to { transform: none; opacity: 1; } }

/* Flash & toast */
.flash {
    display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; margin-bottom: 18px;
    border-radius: var(--radius-sm); border: 1px solid; border-left-width: 3px; font-size: 13.5px; background: #fff;
}
.flash .icon { margin-top: 2px; }
.flash--success { border-color: var(--border); border-left-color: var(--success); color: var(--text); }
.flash--error { border-color: var(--border); border-left-color: var(--danger); color: var(--text); }
.flash--warning { border-color: var(--border); border-left-color: var(--warning); color: var(--text); }
.flash--info { border-color: var(--border); border-left-color: var(--cyp-blue); color: var(--text); }
.flash--success .icon { color: var(--success); }
.flash--error .icon { color: var(--danger); }
.flash--warning .icon { color: var(--warning); }
.flash--info .icon { color: var(--cyp-blue); }
.flash__close { margin-left: auto; border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; padding: 0; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
    display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px;
    padding: 11px 14px; border-radius: var(--radius); background: var(--primary-ink); color: #fff;
    box-shadow: var(--shadow-pop); font-size: 13.5px; animation: modal-in .18s var(--ease);
}
.toast--error { background: var(--danger); }

/* Progress */
.progress { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--cyp-blue); border-radius: 3px; transition: width .3s var(--ease); }
.progress--success .progress__bar { background: var(--success); }
.progress--warning .progress__bar { background: var(--warning); }
.progress--danger .progress__bar { background: var(--danger); }
.progress-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.progress-label strong { color: var(--text); font-variant-numeric: tabular-nums; }

.prob { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.prob__bar { width: 56px; height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.prob__bar span { display: block; height: 100%; background: var(--cyp-blue); }
.prob--high .prob__bar span { background: var(--cyp-navy); }
.prob--low .prob__bar span { background: var(--text-3); }

/* Description list */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.dl--stack { grid-template-columns: 1fr; gap: 2px; }
.dl--stack dd { margin-bottom: 10px; }
.dl--compact { grid-template-columns: minmax(110px, auto) 1fr; gap: 7px 14px; font-size: 13px; }
.dl--compact dd { text-align: right; }

/* Side panel: one bordered column split into sections (replaces stacks of small cards) */
.side-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.side-panel__section { padding: 16px 18px; }
.side-panel__section + .side-panel__section { border-top: 1px solid var(--border-2); }
.side-panel__section--flush { padding: 0; }
.side-panel__head { padding: 12px 18px 4px; }
.side-panel__pad { padding: 4px 18px 16px; }
.side-panel__title { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); margin-bottom: 10px; }
.side-panel__head .side-panel__title { margin-bottom: 0; }
.side-panel .task { padding: 10px 18px; }

.kv { display: flex; flex-direction: column; gap: 3px; }
.kv__label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kv__value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv__value--lg { font-size: 22px; letter-spacing: -.01em; }

/* Timeline */
.timeline { position: relative; }
.timeline__day { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 14px 0 8px; }
.timeline__day:first-child { padding-top: 0; }
.activity { position: relative; display: flex; gap: 10px; padding: 0 0 16px; }
.activity:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.activity__icon {
    width: 13px; height: 13px; flex: none; margin-top: 5px; border-radius: 50%;
    background: #fff; border: 2px solid var(--border-strong); z-index: 1;
}
.activity__icon .icon { display: none; }
.activity--cambio_estado .activity__icon { border-color: var(--cyp-blue); }
.activity--sistema .activity__icon { border-color: var(--border); background: var(--surface-3); }
.activity__body { flex: 1; min-width: 0; }
.activity__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.activity__subject { font-weight: 500; }
.activity__meta { font-size: 12.5px; color: var(--text-3); }
.activity__text { margin-top: 4px; color: var(--text-2); font-size: 13.5px; white-space: pre-line; }
.activity__context { font-size: 12.5px; margin-top: 4px; }

/* Task item */
.task { display: flex; align-items: flex-start; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border-2); }
.task:last-child { border-bottom: 0; }
.task__check {
    width: 18px; height: 18px; margin-top: 1px; flex: none; border-radius: 4px;
    border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer;
    display: grid; place-items: center; color: transparent; padding: 0;
}
.task__check:hover { border-color: var(--success); color: var(--success); }
.task__check .icon { width: 11px; height: 11px; stroke-width: 3; }
.task.is-done .task__check { background: var(--success); border-color: var(--success); color: #fff; }
.task.is-done .task__title { text-decoration: line-through; color: var(--text-3); }
.task__body { flex: 1; min-width: 0; }
.task__title { font-weight: 500; }
.task__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.task__meta .meta-item { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.task__meta .meta-item + .meta-item::before { content: ""; width: 1px; height: 11px; background: var(--border-strong); margin-right: 8px; }
.task__meta .text-danger, .task__meta .text-warning { font-weight: 500; }
.task__meta .icon { display: none; }
a.meta-item:hover { color: var(--cyp-blue); }
.task__right { display: flex; align-items: center; gap: 8px; flex: none; }

/* Checklist */
.checklist { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border-2); }
.check-item:last-child { border-bottom: 0; }
.check-item__box {
    width: 18px; height: 18px; flex: none; border-radius: 4px; border: 1.5px solid var(--border-strong);
    background: var(--surface); display: grid; place-items: center; color: transparent; cursor: pointer; padding: 0;
}
.check-item__box .icon { width: 13px; height: 13px; stroke-width: 3; }
.check-item__box:disabled { cursor: default; }
.check-item.is-done .check-item__box { background: var(--success); border-color: var(--success); color: #fff; }
.check-item__label { flex: 1; font-weight: 500; }
.check-item.is-done .check-item__label { color: var(--text-2); }
.check-item__meta { font-size: 12px; color: var(--text-3); }

/* 5. Modules --------------------------------------------------------------- */

/* Dashboard header */
.cc-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.cc-header__title { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.cc-header__subtitle { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.cc-header__date { text-transform: capitalize; }
.cc-header__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cc-header__hello { color: var(--text-2); font-size: 13.5px; margin-right: 6px; }

/* Priorities */
.priority-list { display: flex; flex-direction: column; }
.priority {
    display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 14px;
    padding: 12px 18px; border-bottom: 1px solid var(--border-2);
}
.priority:last-child { border-bottom: 0; }
.priority__title { font-weight: 500; display: block; color: var(--text); }
a.priority__title:hover { color: var(--accent); }
.priority__context { font-size: 12.5px; color: var(--text-2); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.priority__context .icon { width: 13px; height: 13px; }
.priority__actions { display: flex; gap: 6px; }
.priority.is-resolved { opacity: .45; }

/* Flow summary */
.flow-summary { display: flex; flex-direction: column; }
.flow-summary__row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 18px; border-bottom: 1px solid var(--border-2); gap: 12px; }
.flow-summary__row:last-child { border-bottom: 0; }
.flow-summary__label { color: var(--text-2); font-size: 13.5px; }
.flow-summary__value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.flow-summary__row--total { background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.flow-summary__row--total .flow-summary__value { font-size: 22px; }

/* Stage bar (pipeline summary) */
.stagebar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.stagebar__item { padding: 14px 16px; color: inherit; position: relative; min-width: 0; }
.stagebar__item + .stagebar__item { border-left: 1px solid var(--border-2); }
a.stagebar__item:hover { background: var(--surface-2); color: inherit; }
.stagebar__label { font-size: 12.5px; color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagebar__count { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stagebar__amount { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stagebar__fill { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--cyp-blue); }
.stagebar__item--won .stagebar__fill { background: var(--success); }

/* Horizontal bars (reports, flow) */
.hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; align-items: center; gap: 12px; padding: 7px 0; font-size: 13.5px; }
.hbar__label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar__fill { height: 100%; background: var(--accent); border-radius: 4px; }
.hbar__fill--success { background: var(--success); }
.hbar__fill--danger { background: var(--danger); }
.hbar__fill--muted { background: #B9C1C8; }
.hbar__value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Cashflow table */
.cash-neg { color: var(--danger); font-weight: 600; }
.cash-pos { color: var(--success); font-weight: 600; }
.cash-bar { display: flex; flex-direction: column; gap: 3px; width: 120px; }
.cash-bar span { display: block; height: 5px; border-radius: 3px; }
.cash-bar .in { background: var(--success); }
.cash-bar .out { background: #C9A15A; }

/* Kanban */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.kanban__col { flex: 0 0 272px; background: #F0F2F4; border: 1px solid var(--border-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; max-height: calc(var(--vh) * 100 - 230px); }
.kanban__col.is-over { box-shadow: inset 0 0 0 2px var(--cyp-blue); background: #EAF0F6; }
.kanban__head { padding: 11px 12px 9px; border-bottom: 1px solid var(--border-2); }
.kanban__title { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.kanban__count { font-size: 12px; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.kanban__sum { font-size: 12px; color: var(--text-2); margin-top: 1px; font-variant-numeric: tabular-nums; }
.kanban__list { padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 60px; flex: 1; }
.kanban__col--closed { flex-basis: 220px; opacity: .85; }
.pcard {
    position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; color: inherit; cursor: grab;
    transition: border-color var(--dur) var(--ease);
}
.pcard:hover { border-color: var(--text-3); color: inherit; }
.pcard.is-dragging { opacity: .5; cursor: grabbing; }
.pcard:has(.pcard__alert) { box-shadow: inset 3px 0 0 var(--danger); }
.pcard:has(.pcard__alert--warning) { box-shadow: inset 3px 0 0 var(--warning); }
.pcard__code { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 6px; }
.pcard__name { font-weight: 600; font-size: 13.5px; margin-top: 2px; line-height: 1.35; }
.pcard__client { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.pcard__amount { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.pcard__next { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border-2); font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__alert { margin-top: 6px; font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 5px; }
.pcard__alert--warning { color: var(--warning); }
.pcard__alert .icon { display: none; }

/* Project detail */
.entity-head { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 24px 0; margin-bottom: 0; }
.entity-head__top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.entity-head__code { font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.entity-head__title { font-size: 26px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.entity-head__sub { margin-top: 6px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13.5px; }
.entity-head__sub .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.entity-head__sub .meta-item + .meta-item::before { content: ""; width: 1px; height: 12px; background: var(--border-strong); margin: 0 12px; }
.entity-head__sub .icon { display: none; }
.entity-head__stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 18px -24px 0; border-top: 1px solid var(--border-2); }
.entity-head__stat { min-width: 0; padding: 13px 20px 14px; }
.entity-head__stat + .entity-head__stat { border-left: 1px solid var(--border-2); }
.entity-head__stat .kv__label { font-size: 11.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.entity-head__stat .kv__value { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-head__stat .kv__value--lg { font-size: 22px; }
.entity-head__stat .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-head + .tabs { margin-top: 4px; }
.blocker {
    display: flex; align-items: flex-start; gap: 10px; margin: 0 -24px; padding: 10px 24px;
    background: var(--warning-soft); border-top: 1px solid #EAD8B8; color: #6E4A0E; font-size: 13.5px;
}
.blocker .icon { margin-top: 2px; }
.blocker a, .blocker .link-btn { margin-left: 6px; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.blocker--info { background: var(--accent-soft); border-top-color: #CADCEA; color: var(--accent-ink); }
.link-btn { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.project-band { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 2fr) minmax(0, .9fr); grid-auto-flow: row; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0 -24px; padding: 9px 24px; border-top: 1px solid var(--border-2); font-size: 13px; }
.project-meta > span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.project-meta > span + span::before { content: ""; width: 1px; height: 12px; background: var(--border-strong); margin: 0 14px; }
.project-meta .muted { color: var(--text-3); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -24px; padding: 6px 18px; border-top: 1px solid var(--border-2); }

.next-action { display: flex; gap: 14px; align-items: flex-start; }
.next-action__icon { display: none; }
.next-action__title { font-weight: 600; font-size: 17px; line-height: 1.35; }
.next-action-panel { border: 1px solid var(--border); border-left: 3px solid var(--cyp-blue); border-radius: var(--radius-md); background: #fff; padding: 16px 20px; }
.next-action-panel--overdue { border-left-color: var(--danger); }
.next-action-panel__label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--cyp-blue-ink); }
.next-action-panel--overdue .next-action-panel__label { color: var(--danger); }

.stage-track { display: flex; gap: 2px; margin: 0 -24px; overflow: hidden; border-radius: 0 0 7px 7px; }
.blocker + .stage-track, .stage-track + .blocker { border-radius: 0; }
.stage-track span { flex: 1; height: 3px; background: var(--surface-3); }
.stage-track span.is-done { background: var(--cyp-blue); }
.stage-track span.is-current { background: var(--cyp-navy); }
.stage-track--won span.is-done, .stage-track--won span.is-current { background: var(--success); }
.stage-track--lost span.is-current { background: var(--danger); }

/* Quote editor */
.items-table input { border: 1px solid transparent; background: transparent; height: 32px; padding: 0 8px; width: 100%; border-radius: 5px; outline: none; }
.items-table input:hover { border-color: var(--border); }
.items-table input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.items-table td { padding: 4px 6px; }
.items-table th { padding: 8px 10px; }
.items-table .col-desc { min-width: 280px; }
.items-table .col-qty { width: 90px; }
.items-table .col-unit { width: 80px; }
.items-table .col-price { width: 140px; }
.items-table .col-total { width: 140px; text-align: right; padding-right: 14px; font-variant-numeric: tabular-nums; font-weight: 500; }
.items-table tr.is-section td { background: var(--surface-2); }
.items-table tr.is-section input { font-weight: 600; }
.items-table .col-cost, .col-cost-block { display: none; }
.items-table.show-costs .col-cost { display: table-cell; }
.show-costs-on .col-cost-block { display: flex; }
.items-table .col-cost input { color: var(--text-2); }
.table-section td { background: var(--surface-2); font-size: 12.5px; letter-spacing: .02em; }
.result.is-current { background: var(--accent-soft); }
.stat-strip__item--warning .stat-strip__value { color: var(--warning); }
.totals { width: 320px; margin-left: auto; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.totals__row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.totals__row--total { font-size: 17px; font-weight: 600; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }

.stale { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.stale--warning { color: var(--warning); }
.stale--danger { color: var(--danger); }
.stale--ok { color: var(--text-2); font-weight: 500; }
.stale .icon { width: 14px; height: 14px; }

.alert-bar {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 14px;
    background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--radius-sm); color: var(--text); font-size: 13.5px;
}
.alert-bar > .icon { color: var(--warning); }
.alert-bar--danger { border-left-color: var(--danger); }
.alert-bar--danger > .icon { color: var(--danger); }
.alert-bar a { font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Risk panel */
.risk-panel { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.risk-panel--bajo { border-left: 3px solid var(--success); }
.risk-panel--medio { border-left: 3px solid var(--warning); }
.risk-panel--alto { border-left: 3px solid var(--danger); }

/* Contact card */
.contact { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); }
.contact:last-child { border-bottom: 0; }
.contact__name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.contact__role { font-size: 12.5px; color: var(--text-2); }
.contact__lines { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 13px; }
.contact__lines a, .contact__lines span { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.contact__lines a:hover { color: var(--accent); }
.contact__lines .icon { width: 13px; height: 13px; }

/* Documents: small file-type marker */
.doc-icon {
    width: 30px; height: 36px; border-radius: 2px 7px 2px 2px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; flex: none;
    font-size: 8.5px; font-weight: 600; letter-spacing: .04em; line-height: 1;
}
.doc-icon .icon { width: 14px; height: 14px; align-self: center; }
.doc-icon--pdf { color: var(--danger); border-color: #E3C3C3; }
.doc-icon--img { color: var(--cyp-blue); border-color: #C5D6E8; }
.doc-icon--sheet { color: var(--success); border-color: #BFD8CB; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone {
    position: relative; display: block;
    border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center;
    background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--cyp-blue); background: #F3F7FB; color: var(--cyp-blue-ink); }
.dropzone .icon { margin: 0 auto 8px; width: 22px; height: 22px; }
.dropzone__file { margin-top: 8px; font-weight: 600; color: var(--text); }

/* Auth */
.auth { min-height: calc(var(--vh) * 100); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; padding: 16px; }
.auth__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px; }
.auth__form { width: 100%; max-width: 410px; padding: 36px 34px 30px; border-radius: var(--radius-xl); }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.auth__brand .brand-logo { width: 40px; height: 40px; }
.auth__brand strong { display: block; font-size: 16px; letter-spacing: .06em; }
.auth__brand span { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.auth__title { font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
.auth__subtitle { color: var(--text-2); margin: 6px 0 26px; }
.auth__submit { height: 42px; margin-top: 6px; }
.auth__aside {
    position: relative; overflow: hidden; border-radius: var(--radius-xl);
    background: linear-gradient(160deg, rgba(255, 255, 255, .75), rgba(231, 242, 255, .6));
    border: 1px solid rgba(255, 255, 255, .9); box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; justify-content: space-between; padding: 40px clamp(28px, 5vw, 64px) 48px;
}
.auth__aside::before {
    content: ""; position: absolute; inset: 0; opacity: .6; pointer-events: none;
    background-image: linear-gradient(rgba(40, 120, 212, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(40, 120, 212, .06) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}
.auth__stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 320px; }
.auth__model { width: min(520px, 100%); height: auto; }
.auth__chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--text); border-radius: 12px; }
.auth__chip .icon { color: var(--cyp-primary); }
.auth__chip--a { top: 14%; left: 6%; }
.auth__chip--b { top: 42%; right: 2%; }
.auth__chip--c { bottom: 10%; left: 14%; }
.auth__quote { position: relative; max-width: 520px; }
.auth__quote h2 { font-size: 24px; font-weight: 600; color: var(--text); line-height: 1.28; letter-spacing: -.015em; }
.auth__quote p { margin-top: 12px; color: var(--text-2); font-size: 14.5px; }
.auth__foot { margin-top: 32px; font-size: 12px; color: var(--text-3); }
.error-page { max-width: 520px; margin: 10vh auto; text-align: center; }
.error-page__code { font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--text-3); }
.error-page h1 { font-size: 24px; margin-top: 8px; }
.error-page p { color: var(--text-2); margin-top: 8px; }

/* Search results */
.result-group + .result-group { margin-top: 20px; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-2); color: inherit; }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--surface-2); color: inherit; }

/* Settings nav */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 24px); }
.settings-nav { border-left: 1px solid var(--border); }
.settings-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text-2); font-weight: 500; transition: color var(--dur) var(--ease); }
.settings-nav a .icon { width: 15px; height: 15px; color: var(--text-3); }
.settings-nav a:hover { color: var(--text); }
.settings-nav a.is-active { color: var(--text); font-weight: 600; }
.settings-nav a.is-active::before { content: ""; position: absolute; left: -1px; top: 4px; bottom: 4px; width: 2px; background: var(--cyp-blue); }
.settings-nav a.is-active .icon { color: var(--cyp-navy); }

.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-module td { background: var(--surface-2); font-weight: 600; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }

/* Print (quote) */
.print-doc { max-width: 820px; margin: 0 auto; padding: 48px; background: #fff; }
.print-toolbar { max-width: 820px; margin: 20px auto 0; display: flex; justify-content: flex-end; gap: 8px; }
.print-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid var(--primary); }
.print-title { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: .02em; }
.print-meta { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 13px; }
.print-section { margin-top: 28px; }
.print-terms { font-size: 12.5px; color: var(--text-2); white-space: pre-line; }
.print-company { text-align: right; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.print-company strong { color: var(--text); font-size: 15px; }
.print-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); border-bottom: 1.5px solid var(--primary); padding: 8px 6px; }
.print-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.print-table .num { text-align: right; white-space: nowrap; }
.print-table tr.is-section td { font-weight: 600; background: var(--surface-2); }
.print-sign { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; font-size: 12px; text-align: center; color: var(--text-2); }
.print-sign div { border-top: 1px solid var(--text-3); padding-top: 8px; }
.print-foot { margin-top: 36px; font-size: 11px; color: var(--text-3); text-align: center; }

/* Tareas · Mi día · Documentos · Notificaciones · Búsqueda (W1) */
.task-section .card__header .card__title .icon { color: var(--text-2); }
.task-section--danger { border-left: 3px solid var(--danger); }
.task-section--danger .card__title, .task-section--danger .card__title .icon { color: var(--danger); }
.task-section--warning .card__title .icon { color: var(--warning); }
.task-section--muted .card__title { color: var(--text-2); }
.task-section__empty { padding: 14px 18px; color: var(--text-3); font-size: 13.5px; }
.task.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.task.is-done.is-overdue { box-shadow: none; }
.task__time { width: 44px; flex: none; padding-top: 1px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.task__title { display: flex; align-items: center; gap: 6px; }
.task__system { display: inline-grid; place-items: center; color: var(--warning); }
.task__system .icon { width: 14px; height: 14px; }
.task__actions { display: flex; align-items: center; gap: 2px; opacity: .55; transition: opacity .12s; }
.task:hover .task__actions, .task__actions:focus-within { opacity: 1; }
.task__actions form { display: contents; }

.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.doc-meta:empty { display: none; }
.doc-version { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-version .icon { width: 12px; height: 12px; }
.doc-version--plain { color: var(--text-2); font-weight: 500; }
.doc-row--old td { color: var(--text-2); }
.doc-row--old .cell-main { color: var(--text-2); }
.inline-icon { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.alert-bar--info { background: var(--accent-soft); border-color: #CADCEA; color: var(--accent-ink); }
.alert-bar .spacer-left { margin-left: auto; white-space: nowrap; }
.filters .check { height: 34px; padding: 0 4px; color: var(--text-2); }

.notif-list { display: flex; flex-direction: column; }
.notif-day { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 12px 18px 6px; background: var(--surface-2); border-bottom: 1px solid var(--border-2); }
.notif { border-bottom: 1px solid var(--border-2); }
.notif:last-child { border-bottom: 0; }
.notif__btn {
    display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 18px;
    border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit;
}
.notif__btn:hover { background: var(--surface-2); }
.notif__icon {
    width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-3); color: var(--text-2);
}
.notif__icon .icon { width: 15px; height: 15px; }
.notif--warning .notif__icon { background: var(--warning-soft); color: var(--warning); }
.notif--danger .notif__icon { background: var(--danger-soft); color: var(--danger); }
.notif__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif__title { font-weight: 500; color: var(--text-2); }
.notif__text { font-size: 13px; color: var(--text-2); }
.notif__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.notif__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; }
.notif__go { color: var(--text-3); flex: none; margin-top: 6px; }
.notif.is-unread { background: var(--surface-2); }
.notif.is-unread .notif__title { font-weight: 600; color: var(--text); }
.notif.is-unread.notif--info .notif__icon { background: var(--accent-soft); color: var(--accent); }
.notif.is-unread.notif--danger { box-shadow: inset 3px 0 0 var(--danger); }
.notif.is-unread.notif--warning { box-shadow: inset 3px 0 0 var(--warning); }

.search--wide { width: min(520px, 100%); }
.filters .search--wide { width: min(520px, 100%); }
.result__icon { width: 32px; height: 32px; flex: none; border-radius: 7px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; }
.result__icon .icon { width: 15px; height: 15px; }
.result__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__sub { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result__go { color: var(--text-3); }
.result:hover .result__go { color: var(--accent); }

/* Finanzas (W2) */
.metrics--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fin-form .form-grid { grid-template-columns: 1fr; }
.cashflow-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cashflow-bar + .cashflow-bar { margin-top: 4px; }
.cashflow-bar span { display: block; height: 100%; border-radius: 3px; }
.cashflow-bar__in { background: var(--success); }
.cashflow-bar__out { background: var(--text-3); }

/* Mercado Público · Configuración · Reportes (W3) */
.tender-progress { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.tender-progress .progress { flex: 1; }
.tender-progress__label { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.tender-cal { display: flex; flex-direction: column; }
.tender-cal__item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border-2); }
.tender-cal__item:last-child { border-bottom: 0; }
.tender-cal__date {
    width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 0;
    border-radius: var(--radius-sm); background: var(--surface-3); line-height: 1.1;
}
.tender-cal__day { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tender-cal__month { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.tender-cal__body { flex: 1; min-width: 0; }
.tender-cal__title { font-weight: 500; }
.tender-cal__meta { font-size: 12.5px; color: var(--text-2); }
.tender-cal__right { display: flex; align-items: center; gap: 8px; flex: none; }
.tender-cal__rel { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.tender-cal__item--danger .tender-cal__date { background: var(--danger-soft); color: var(--danger); }
.tender-cal__item--warning .tender-cal__date { background: var(--warning-soft); color: #93600F; }
.tender-cal__item--success .tender-cal__date { background: var(--success-soft); color: #23664A; }
.tender-cal__item--info .tender-cal__date, .tender-cal__item--accent .tender-cal__date { background: var(--accent-soft); color: var(--accent-ink); }
.tender-cal__form { display: grid; grid-template-columns: 160px minmax(0, 1fr) 210px auto; gap: 10px; align-items: end; }

.task-list { display: flex; flex-direction: column; }

.settings-avatar { width: 44px; height: 44px; font-size: 15px; }
.settings-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; transition: border-color .12s; }
.settings-card { transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.settings-card:hover { border-color: var(--text-3); color: inherit; }
.settings-card__icon { width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm); display: grid; place-items: center; border: 1px solid var(--border); color: var(--text-2); }
.settings-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-card__title { font-weight: 600; }
.settings-card__desc { font-size: 13px; color: var(--text-2); }
.settings-card__arrow { color: var(--text-3); flex: none; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 24px; }
.perm-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.perm-group__title { padding: 0; margin-bottom: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.role-card { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.catalog-table td { vertical-align: middle; }
.form-actions--sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, rgba(244, 246, 247, .97) 70%, transparent); }

.report-list { display: flex; flex-direction: column; }
.report-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-2); color: inherit; }
.report-list li:last-child .report-item { border-bottom: 0; }
.report-item:hover { background: var(--surface-2); color: inherit; }
.report-item__icon { width: 32px; height: 32px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.report-item__icon .icon { width: 15px; height: 15px; }
.report-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.report-item__title { font-weight: 500; }
.report-item__desc { font-size: 12.5px; color: var(--text-2); }
.report-item__arrow { color: var(--text-3); flex: none; }
.report-item:hover .report-item__arrow { color: var(--accent); }
@media (max-width: 860px) {
    .settings-cards { grid-template-columns: 1fr; }
    .tender-cal__form { grid-template-columns: 1fr; }
    .metrics--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Command Center · Automatizaciones (core) */
.metrics--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metrics--6 .metric__value { font-size: 24px; }
@media (max-width: 1480px) { .metrics--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cc-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.priority--compact { grid-template-columns: minmax(0, 1fr); }

/* Visual stage (Command Center, Modelo) */
.cc-stage, .mv-stage {
    position: relative; overflow: hidden; isolation: isolate;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #EEF2F5 0%, #E4EAEF 100%);
    border: 1px solid var(--border);
}
.cc-stage::before, .mv-stage::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(22, 50, 74, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(22, 50, 74, .06) 1px, transparent 1px);
    background-size: 40px 40px;
}
.cc-stage { height: clamp(630px, 74vh, 780px); }
.cc-stage__viewport, .mv-stage__viewport { position: absolute; inset: 0; display: grid; place-items: center; }
.cc-stage__viewport canvas, .mv-stage__viewport canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; outline: none; }
.cc-stage__fallback { width: min(460px, 62%); height: auto; opacity: .9; transition: opacity .4s var(--ease); }
.is-3d .cc-stage__fallback { opacity: 0; }
.cc-stage__load { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; }
.viewer-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 7px 12px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--border); }
.viewer-loading::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--cyp-blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cc-panels {
    position: absolute; inset: 16px; z-index: 2; pointer-events: none;
    display: grid; grid-template-columns: 290px minmax(0, 1fr) 290px; grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "op . pipe" "cob . pipe" ". . cap" "prio prio prio";
    gap: 14px;
}
.cc-panel { pointer-events: auto; display: block; color: inherit; padding: 15px 16px; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.cc-panel:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cc-panel--op { grid-area: op; }
.cc-panel--pipe { grid-area: pipe; align-self: start; }
.cc-panel--cob { grid-area: cob; align-self: start; }
.cc-panel--cap { grid-area: cap; align-self: end; }
.cc-panel--prio { grid-area: prio; justify-self: center; width: min(760px, 100%); }
.cc-panel__label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.cc-panel__value { margin-top: 8px; font-size: 25px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cc-panel__hint { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.cc-panel__note { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-2); display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.cc-panel__note .icon { width: 14px; height: 14px; }
.cc-panel__note--danger { color: var(--danger); font-weight: 600; }
.cc-panel__foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--text-2); }

.cc-op { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.ring {
    --p: 0; --size: 74px; --thick: 8px;
    position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--cyp-blue) calc(var(--p) * 1%), var(--surface-3) calc(var(--p) * 1%));
}
.ring::after { content: ""; position: absolute; inset: var(--thick); border-radius: 50%; background: #fff; }
.ring__value { position: relative; z-index: 1; font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-op__text { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.cc-op__text strong { font-size: 15px; color: var(--text); }
.cc-op__alert { display: inline-flex; align-items: center; gap: 5px; color: var(--warning); font-weight: 600; margin-top: 2px; }
.cc-op__alert .icon { width: 13px; height: 13px; }

.cc-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.cc-bars__row { display: grid; grid-template-columns: 102px minmax(0, 1fr) 22px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.cc-bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-bars__track { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cc-bars__track span { display: block; height: 100%; border-radius: 2px; background: var(--cyp-blue); }
.cc-bars__n { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.cc-prio__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cc-prio__count { margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.cc-prio__count strong { color: var(--text); font-size: 16px; }
.cc-prio__list { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cc-prio__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 11px; background: rgba(247, 250, 253, .9); border: 1px solid var(--border-2); color: inherit; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.cc-prio__item:hover { background: #fff; border-color: rgba(40, 120, 212, .25); color: inherit; }
.cc-prio__icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--cyp-primary-soft); color: var(--cyp-primary); }
.cc-prio__icon .icon { width: 15px; height: 15px; }
.cc-prio__item--danger .cc-prio__icon { background: var(--danger-soft); color: var(--danger); }
.cc-prio__item--warning .cc-prio__icon { background: var(--warning-soft); color: var(--warning); }
.cc-prio__body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cc-prio__body strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-prio__body span { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-prio__go { color: var(--text-3); width: 14px; height: 14px; }
.cc-strip { margin-top: 14px; }

/* Command Center home */
.cc-date { text-transform: none; letter-spacing: .04em; }
.cc-band { margin-bottom: 0; }
.cc-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; color: var(--text-2); font-size: 13.5px; }
.cc-attn-table td { height: 46px; }
.cc-attn-table .cell-main { font-weight: 500; }
.cc-agenda__time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--cyp-navy); }
.cc-model { overflow: hidden; }
.cc-model__thumb { display: block; position: relative; height: 190px; background: linear-gradient(180deg, #EEF2F5, #E4EAEF); border-bottom: 1px solid var(--border-2); }
.cc-model__thumb::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(22, 50, 74, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(22, 50, 74, .06) 1px, transparent 1px); background-size: 28px 28px; }
.cc-model__thumb img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; padding: 8px 10px; transition: transform .18s var(--ease); }
.cc-model__thumb:hover img { transform: scale(1.02); }
.cc-model__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.cc-model__foot strong { display: block; font-size: 14px; font-weight: 600; }
.cc-model__foot span { font-size: 12.5px; color: var(--text-2); }
.cc-portfolio { display: flex; flex-direction: column; gap: 16px; }
.cc-facts { margin: 0; display: flex; flex-direction: column; }
.cc-facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-2); font-size: 13.5px; }
.cc-facts div:first-child { padding-top: 0; }
.cc-facts dt { color: var(--text-2); }
.cc-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-line { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.ms-line__item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
.ms-line__item::before { content: ""; position: absolute; top: 11px; left: calc(-50% + 12px); right: calc(50% + 12px); height: 2px; background: var(--surface-3); }
.ms-line__item:first-child::before { display: none; }
.ms-line__item.is-done::before, .ms-line__item.is-current::before { background: var(--cyp-primary); }
.ms-line__dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--surface-3); color: #fff; }
.ms-line__dot .icon { width: 13px; height: 13px; }
.is-done .ms-line__dot { background: var(--cyp-primary); border-color: var(--cyp-primary); }
.is-current .ms-line__dot { border-color: var(--cyp-primary); background: #fff; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 12px var(--cyp-primary); }
.ms-line__label { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--text); }
.is-pending .ms-line__label { color: var(--text-2); font-weight: 500; }
.ms-line__date { font-size: 11px; color: var(--text-3); }
@media (max-width: 860px) {
    .ms-line { grid-auto-flow: row; }
    .ms-line__item { flex-direction: row; text-align: left; }
    .ms-line__item::before { display: none; }
    .ms-line__date { margin-left: auto; }
}
/* Stage toolbar (chips, controls) */
.stage-bar { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-md); pointer-events: auto; }
.chip {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip .icon { width: 15px; height: 15px; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.chip.is-off { color: var(--text-3); }
.chip.is-off .chip__dot { background: #CBD5DF !important; }
.chip__dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chip--solid.is-active { background: var(--cyp-navy); color: #fff; border-color: var(--cyp-navy); }
.chip__count { font-size: 11px; font-weight: 500; padding: 0 5px; border-radius: 3px; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.tool-btn {
    width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2);
    display: grid; place-items: center; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tool-btn:hover { background: var(--surface-3); color: var(--text); }
.tool-btn.is-active { background: var(--surface-3); color: var(--cyp-navy); }
.tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

/* Model view */
.mv { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.mv-stage { flex: 1; min-height: 560px; height: calc(var(--vh) * 100 - var(--topbar-h) - 36px); }
.mv-stage:fullscreen { border-radius: 0; height: calc(var(--vh) * 100); }
.mv-overlay { position: absolute; inset: 14px; z-index: 2; pointer-events: none; display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.mv-top { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mv-left, .mv-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.mv-left { grid-column: 1; grid-row: 2; }
.mv-right { grid-column: 3; grid-row: 2; }
.mv-bottom { grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: center; }
.mv-panel { pointer-events: auto; padding: 14px 15px; }
.mv-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mv-panel__close { width: 26px; height: 26px; border: 0; background: transparent; color: var(--text-3); border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.mv-panel__close:hover { background: var(--surface-3); color: var(--text); }
.mv-panel__close .icon { width: 14px; height: 14px; }
.mv-project { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: var(--radius-md); }
.mv-project .select { height: 32px; min-width: 260px; max-width: 360px; border-color: var(--border); background-color: var(--surface-2); font-weight: 500; font-size: 13px; }
.mv-project__label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.mv-progress { display: flex; align-items: center; gap: 14px; }
.mv-progress .ring { --size: 68px; --thick: 7px; }
.mv-progress .ring__value { font-size: 17px; }
.mv-kv { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.mv-kv div { display: flex; justify-content: space-between; gap: 10px; }
.mv-kv dt { color: var(--text-2); }
.mv-kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.mv-timeline { display: flex; flex-direction: column; gap: 0; }
.mv-phase { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding-bottom: 12px; font-size: 12.5px; }
.mv-phase:last-child { padding-bottom: 0; }
.mv-phase:not(:last-child)::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: var(--surface-3); }
.mv-phase.is-done:not(:last-child)::before { background: var(--cyp-primary); }
.mv-phase__dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; display: grid; place-items: center; z-index: 1; }
.mv-phase.is-done .mv-phase__dot { background: var(--cyp-primary); border-color: var(--cyp-primary); color: #fff; }
.mv-phase.is-done .mv-phase__dot .icon { width: 10px; height: 10px; stroke-width: 3; }
.mv-phase.is-current .mv-phase__dot { border-color: var(--cyp-primary); }
.mv-phase.is-current .mv-phase__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyp-primary); }
.mv-phase__name { font-weight: 600; }
.mv-phase.is-pending .mv-phase__name { color: var(--text-2); font-weight: 500; }
.mv-phase__date { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mv-fin-bar { margin: 10px 0 12px; }
.mv-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--text-2); }
.mv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mv-hint { pointer-events: none; font-size: 11.5px; color: var(--text-2); padding: 5px 9px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .8); align-self: end; }
.mv-models { pointer-events: auto; }
.mv-models a.chip { text-decoration: none; }
.mv-note { display: flex; align-items: center; gap: 6px; margin: 10px 4px 0; }
.mv-note .icon { width: 14px; height: 14px; flex: none; }

/* Digital Project Viewer (component styles in viewer.css) */
.pv-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pv-picker__field { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pv-picker .select { height: 34px; min-width: 220px; max-width: 360px; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.pv--page { --pv-h: max(480px, calc(var(--vh) * 100 - var(--topbar-h) - 320px)); }
.cc-model__thumb + .cc-model__foot .btn { white-space: nowrap; }
@media (max-width: 860px) {
    .pv-picker, .pv-picker__field, .pv-picker .select { width: 100%; max-width: none; min-width: 0; }
}

/* Map */
.map-stage { position: relative; flex: 1; min-height: 560px; height: calc(var(--vh) * 100 - var(--topbar-h) - 36px); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: #EEF2F4; }
.map-canvas { position: absolute; inset: 0; z-index: 1; }
.map-canvas.leaflet-container { background: #EEF2F4; font-family: var(--font); }
.map-overlay { position: absolute; inset: 14px; z-index: 500; pointer-events: none; display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.map-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.map-list { grid-column: 1; grid-row: 2; pointer-events: auto; display: flex; flex-direction: column; min-height: 0; max-height: 100%; padding: 0; overflow: hidden; align-self: start; }
.map-list__head { padding: 13px 15px 10px; border-bottom: 1px solid var(--border-2); }
.map-list__items { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.map-list__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 9px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; text-align: left; color: inherit; transition: background var(--dur) var(--ease); }
.map-list__item:hover { background: var(--surface-2); }
.map-list__item.is-active { background: var(--surface-3); }
.map-list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.map-list__body strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list__body span { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-card { grid-column: 3; grid-row: 2; pointer-events: auto; align-self: start; padding: 16px; animation: pop-in var(--dur) var(--ease); }
.map-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.map-card__code { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.map-card__title { font-size: 15px; font-weight: 600; line-height: 1.3; margin-top: 2px; }
.map-card__client { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.map-card .mv-kv { margin: 14px 0; }
.map-zoom { display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: var(--radius-md); pointer-events: auto; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot--oportunidad, .map-pin--oportunidad { background: var(--cyp-blue); }
.dot--cotizacion, .map-pin--cotizacion { background: var(--warning); }
.dot--adjudicado, .map-pin--adjudicado { background: var(--success); }
.dot--critico, .map-pin--critico { background: var(--danger); }
.dot--terminado, .map-pin--terminado { background: #94A1AE; }
.map-marker { background: transparent; border: 0; }
.map-pin { display: block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(16, 40, 59, .35); transition: transform var(--dur) var(--ease); }
.map-pin--critico { box-shadow: 0 0 0 3px rgba(197, 63, 63, .25), 0 1px 4px rgba(16, 40, 59, .35); }
.map-marker:hover .map-pin, .map-marker.is-active .map-pin { transform: scale(1.2); }
.map-tiles { filter: grayscale(1) brightness(1.06) contrast(.85); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .8) !important; border-radius: 4px 0 0 0; }

/* PDF viewer */
.pdfv { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 560px; height: calc(var(--vh) * 100 - var(--topbar-h) - 36px); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); background: #E8ECEF; }
.pdfv:fullscreen { border-radius: 0; height: calc(var(--vh) * 100); }
.pdfv__bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; }
.pdfv__name { position: absolute; top: 12px; left: 14px; z-index: 3; max-width: 32%; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.pdfv__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfv__name .icon { color: #C73B3B; }
.pdfv__actions { position: absolute; top: 12px; right: 14px; z-index: 3; display: flex; gap: 6px; }
.pdfv__pages { flex: 1; overflow: auto; padding: 72px 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pdfv__page { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(16, 40, 59, .12); border-radius: 2px; }
.pdfv__page canvas { display: block; border-radius: 2px; }
.pdfv__pageinput { width: 46px; height: 30px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: #fff; }
.pdfv__zoom { min-width: 48px; text-align: center; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pdfv__count { font-size: 12.5px; color: var(--text-2); padding: 0 4px; white-space: nowrap; }
.pdfv__error { margin: auto; max-width: 420px; text-align: center; color: var(--text-2); }

/* Analytics */
.chart-card .card__body { padding: 14px 18px 18px; }
.chart-box { position: relative; height: 260px; }
.chart-box--lg { height: 300px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chart-head__value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart-head__sub { font-size: 12.5px; color: var(--text-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Document cards */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.doc-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); transition: border-color var(--dur) var(--ease); }
.doc-card:hover { border-color: var(--text-3); }
.doc-card__top { display: flex; align-items: flex-start; gap: 10px; }
.doc-card__name { font-weight: 600; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; color: var(--text); }
.doc-card__name:hover { color: var(--cyp-primary); }
.doc-card__meta { font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.doc-card__actions { display: flex; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-2); }

@media (max-width: 1280px) {
    .cc-panels { grid-template-columns: 260px minmax(0, 1fr) 260px; }
    .mv-overlay { grid-template-columns: 270px minmax(0, 1fr) 270px; }
    .map-overlay { grid-template-columns: 270px minmax(0, 1fr) 290px; }
}
@media (max-width: 1080px) {
    .cc-stage { height: auto; min-height: 0; display: flex; flex-direction: column; }
    .cc-stage__viewport { position: relative; height: 340px; }
    .cc-panels { position: static; inset: auto; padding: 0 14px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-template-areas: "op pipe" "cob cap" "prio prio"; }
    .cc-panel--cap { align-self: stretch; }
    .cc-panel--pipe, .cc-panel--cob { align-self: stretch; }
    .mv-stage { height: auto; min-height: 0; display: flex; flex-direction: column; }
    .mv-stage__viewport { position: relative; height: 420px; }
    .mv-overlay { position: static; inset: auto; padding: 12px; grid-template-columns: 1fr 1fr; grid-template-rows: none; }
    .mv-top { order: -1; }
    .mv-left, .mv-right { grid-column: auto; grid-row: auto; }
    .mv-bottom { grid-row: auto; }
    .mv-hint { display: none; }
    .map-overlay { grid-template-columns: minmax(0, 1fr) 300px; }
    .map-list { display: none; }
    .map-card { grid-column: 2; }
}
@media (max-width: 860px) {
    .cc-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .cc-panels { grid-template-columns: 1fr; grid-template-areas: "op" "pipe" "cob" "cap" "prio"; padding: 0 10px 10px; gap: 10px; }
    .cc-stage__viewport { height: 260px; }
    .cc-prio__list { grid-template-columns: 1fr; }
    .mv-overlay { grid-template-columns: 1fr; }
    .mv-stage__viewport { height: 340px; }
    .mv-project { flex-wrap: wrap; width: 100%; }
    .mv-project .select { min-width: 0; width: 100%; max-width: none; }
    .stage-bar { flex-wrap: wrap; }
    .map-stage, .pdfv { height: calc(var(--vh) * 100 - 110px); min-height: 460px; }
    .map-overlay { grid-template-columns: 1fr; inset: 10px; }
    .map-card { grid-column: 1; grid-row: auto; align-self: end; }
    .pdfv__name { display: none; }
    .pdfv__bar { left: 10px; transform: none; }
    .pdfv__actions { right: 10px; }
    .pdfv__pages { padding: 64px 8px 20px; }
}

/* 6. Responsive ------------------------------------------------------------ */
@media (max-width: 1280px) {
    .grid--main { grid-template-columns: minmax(0, 1fr) 320px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    :root { --page-pad: 24px; }
    .grid--main, .grid--main-wide { grid-template-columns: minmax(0, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .search { width: 220px; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}

@media (max-width: 860px) {
    :root { --page-pad: 16px; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; height: auto;
        transform: translateX(-100%); transition: transform .2s var(--ease);
        width: 272px;
    }
    .drawer-open .sidebar { box-shadow: var(--shadow-pop); }
    .is-collapsed .sidebar { width: 272px; }
    .is-collapsed .brand-text, .is-collapsed .nav-group__label, .is-collapsed .nav-item__label,
    .is-collapsed .nav-item__badge { display: revert; }
    .is-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }
    .is-collapsed .sidebar__brand { justify-content: flex-start; padding: 0 18px; }
    .sidebar__footer { display: none; }
    .drawer-open .sidebar { transform: none; }
    .drawer-open .shell::after { content: ""; position: fixed; inset: 0; background: rgba(16, 40, 59, .36); z-index: 35; }
    .topbar { padding: 0 10px 0 6px; gap: 8px; }
    .topbar__menu { display: grid; }
    .topbar .search, .topbar .btn-new-label { display: none; }
    .topbar__search-btn { display: grid; }
    .page { padding: 18px 14px 40px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .page-header__title { font-size: 24px; }
    .metrics--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .entity-head { padding: 16px 16px 0; }
    .entity-head__stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 16px -16px 0; }
    .entity-head__stat { border-top: 1px solid var(--border-2); }
    .entity-head__stat + .entity-head__stat { border-left: 0; }
    .entity-head__stat:nth-child(even) { border-left: 1px solid var(--border-2); }
    .stage-track, .blocker, .project-meta, .quick-actions { margin-left: -16px; margin-right: -16px; }
    .project-meta { padding-left: 16px; padding-right: 16px; }
    .quick-actions { padding-left: 10px; padding-right: 10px; }
    .blocker { padding-left: 16px; padding-right: 16px; }
    .cc-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .cc-header__date { text-align: left; }
    .metric__value { font-size: 24px; }
    .stat-strip__item { min-width: 50%; }
    .stat-strip__item + .stat-strip__item { border-left: 0; }
    .stat-strip__item:nth-child(even) { border-left: 1px solid var(--border-2); }
    .stat-strip__item:nth-child(n+3) { border-top: 1px solid var(--border-2); }
    .stagebar { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stagebar__item + .stagebar__item { border-left: 0; }
    .stagebar__item { border-bottom: 1px solid var(--border-2); }
    .form-grid, .form-grid--3, .form-grid--4 { grid-template-columns: 1fr; }
    .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
    .record-type { flex-direction: column; align-items: flex-start; }
    .segmented--radio { flex-wrap: wrap; }
    .entity-head__top { flex-direction: column; gap: 14px; }
    .entity-head__title { font-size: 22px; }
    .filters .search { width: 100%; }
    .filters .select { flex: 1 1 140px; min-width: 0; }
    .filters__count { width: 100%; margin-left: 0; }
    .priority { grid-template-columns: minmax(0, 1fr) auto; }
    .priority .tag-urgency { grid-column: 1 / -1; justify-self: start; min-width: 0; }
    .hbar { grid-template-columns: 110px minmax(0, 1fr) 90px; }
    .auth { grid-template-columns: 1fr; padding: 12px; }
    .auth__panel { padding: 12px; }
    .auth__form { padding: 28px 22px 24px; }
    .auth__aside { display: none; }
    .dl { grid-template-columns: 120px 1fr; }
    .hide-md { display: none !important; }

    /* Stacked tables */
    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: 12px 14px; border-bottom: 1px solid var(--border-2); position: relative; }
    .table--stack tbody tr:last-child { border-bottom: 0; }
    .table--stack td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .table--stack td::before { content: attr(data-label); color: var(--text-2); font-size: 12.5px; text-align: left; flex: none; }
    .table--stack td.cell-primary { display: block; text-align: left; padding-bottom: 6px; }
    .table--stack td.cell-primary::before { display: none; }
    .table--stack td.col-actions { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
    .table--stack td.col-actions::before { display: none; }
    .table--stack td.hide-sm { display: none; }
    .table--stack .col-num { text-align: right; }
    .table--stack tr.is-alert td:first-child, .table--stack tr.is-warning td:first-child { box-shadow: none; }
    .table--stack tr.is-alert { box-shadow: inset 3px 0 0 var(--danger); }
    .table--stack tr.is-warning { box-shadow: inset 3px 0 0 var(--warning); }
}

@media (max-width: 560px) {
    .metrics { grid-template-columns: 1fr 1fr; }
    .metric { padding: 12px 14px; }
    .metric__value { font-size: 20px; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .page-header__actions { width: 100%; }
    .page-header__actions .btn { flex: 1; }
    .totals { width: 100%; }
    .toast-region { left: 12px; right: 12px; bottom: 12px; }
    .toast { max-width: none; }
}

/* Terreno y portales (vista interna) */
.kv-list { display: grid; gap: 14px; margin: 0; }
.kv-list dd { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo-grid a { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .18s ease; }
.photo-grid a:hover img { opacity: .9; }
.line-list { list-style: none; margin: 0; padding: 0; }
.line-list > li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.line-list > li:last-child { border-bottom: 0; }
.line-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line-list__main strong { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-list__main span { font-size: 12px; color: var(--text-2); }
.milestone-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong, #cfd6e0); display: grid; place-items: center; background: #fff; color: #fff; flex: none; cursor: pointer; padding: 0; }
.milestone-dot .icon { width: 13px; height: 13px; }
.milestone-dot.is-done { background: var(--success); border-color: var(--success); }
.thread-msg { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; background: #fff; }
.thread-msg--staff { background: var(--surface-2); border-left: 3px solid var(--cyp-blue); }
.thread-msg__meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }

/* Sitio web (editor del sitio público) */
.site-actions { display: inline-flex; align-items: center; gap: 2px; }
.site-actions form { margin: 0; }
.site-actions .btn[disabled] { opacity: .35; pointer-events: none; }
.table tr.is-muted td { color: var(--text-3); }
.table tr.is-muted .input, .table tr.is-muted img { opacity: .55; }
.site-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); display: block; background: var(--surface-3); }
.site-image__row { display: flex; gap: 14px; align-items: flex-start; }
.site-image__thumb { flex: none; width: 112px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.site-image__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-image__input { flex: 1; min-width: 0; }
.site-image__input .field__hint { margin-top: 6px; }
.site-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.site-photo { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.site-photo.is-muted .site-photo__img img { opacity: .45; }
.site-photo__img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-3); }
.site-photo__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-photo__flag { position: absolute; left: 8px; top: 8px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: rgba(15, 23, 42, .78); color: #fff; }
.site-photo__form { display: grid; gap: 6px; padding: 10px 10px 4px; }
.site-photo__selects { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.site-photo .site-actions { padding: 2px 6px 6px; justify-content: flex-end; }
.site-lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) {
    .site-lead { grid-template-columns: 1fr; }
    .site-image__row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
    .sidebar, .topbar, .print-toolbar, .toast-region { display: none !important; }
    body { background: #fff; }
    .shell { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
    .print-doc { padding: 0; max-width: none; }
    .page { padding: 0; }
}


/* Command Center compact — alta densidad, visual sobrio */
.cc-home {
    font-size: 13px;
}
.cc-home .page-header {
    align-items: center;
    margin-bottom: 14px;
    gap: 16px;
}
.cc-home .page-header__eyebrow {
    margin-bottom: 3px;
    font-size: 10.5px;
}
.cc-home .page-header__title {
    font-size: 24px;
    line-height: 1.12;
    letter-spacing: -.015em;
}
.cc-home .page-header > div > p {
    margin-top: 4px !important;
    font-size: 12.5px;
}
.cc-home .page-header__actions {
    gap: 5px;
}
.cc-home .btn--sm {
    height: 28px;
    padding-inline: 9px;
    font-size: 12px;
}
.cc-home .metrics {
    border-radius: 8px;
}
.cc-home .metrics--6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
.cc-home .metric {
    padding: 10px 13px 9px;
    min-height: 76px;
}
.cc-home .metric__label {
    font-size: 10px;
    letter-spacing: .055em;
}
.cc-home .metric__value,
.cc-home .metrics--6 .metric__value {
    margin-top: 4px;
    font-size: 19px;
    font-weight: 600;
}
.cc-home .metric__hint {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.25;
}
.cc-home .section {
    margin-top: 14px;
}
.cc-home .grid {
    gap: 12px;
}
.cc-home .grid--main {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 12px;
}
.cc-home .stack {
    gap: 12px;
}
.cc-home .card {
    border-radius: 8px;
}
.cc-home .card__header {
    min-height: 42px;
    padding: 8px 13px;
    gap: 10px;
}
.cc-home .card__title {
    font-size: 13.5px;
}
.cc-home .card__body {
    padding: 12px 13px;
}
.cc-home .section__link {
    font-size: 11.5px;
}
.cc-home .small {
    font-size: 11.5px;
}
.cc-home .table {
    font-size: 12px;
}
.cc-home .table th {
    padding: 7px 11px;
    font-size: 9.75px;
    letter-spacing: .045em;
}
.cc-home .table td {
    height: 38px;
    padding: 6px 11px;
}
.cc-home .table--compact td {
    height: 35px;
    padding: 5px 10px;
}
.cc-home .cell-main {
    font-size: 12px;
}
.cc-home .cell-sub {
    margin-top: 1px;
    font-size: 10.75px;
}
.cc-home .badge {
    gap: 5px;
    font-size: 11.5px;
}
.cc-home .badge::before {
    width: 6px;
    height: 6px;
}
.cc-home .cc-empty {
    padding: 12px 13px;
    font-size: 12px;
}
.cc-home .cc-facts {
    font-size: 12px;
}
.cc-home .cc-facts > div {
    padding-block: 6px;
}
.cc-home .money.strong {
    font-size: 12.5px;
}
.cc-home .row--wrap {
    gap: 6px;
}

@media (max-width: 1380px) {
    .cc-home .metrics--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cc-home .grid--main { grid-template-columns: minmax(0, 1fr) 270px; }
}
@media (max-width: 1080px) {
    .cc-home .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .cc-home .metrics--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cc-home .page-header__title { font-size: 22px; }
}


/* Command Center v2 — layout aprobado: compacto, sin iconos, una vista */
.page:has(.cc-dashboard-v2) {
    max-width: none;
    padding: 14px 18px 18px;
}
.cc-dashboard-v2 {
    --cc2-gap: 10px;
    color: var(--text);
}
.cc-dashboard-v2 .cc2-header {
    margin-bottom: 10px;
    align-items: center;
}
.cc-dashboard-v2 .cc2-header .page-header__eyebrow {
    margin-bottom: 2px;
    font-size: 10px;
}
.cc-dashboard-v2 .cc2-header .page-header__title {
    font-size: 25px;
    line-height: 1.08;
}
.cc2-view-links {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 12px;
}
.cc2-view-links a {
    padding: 5px 11px;
    color: var(--cyp-blue);
}
.cc2-view-links a + a {
    border-left: 1px solid var(--border);
}
.cc2-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.cc2-kpi {
    display: flex;
    min-width: 0;
    min-height: 68px;
    flex-direction: column;
    justify-content: center;
    padding: 9px 16px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: inherit;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cc2-kpi:hover {
    color: inherit;
    border-color: var(--border-strong);
}
.cc2-kpi > span {
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.15;
}
.cc2-kpi > strong {
    margin-top: 3px;
    color: var(--cyp-navy);
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.cc2-kpi > small {
    margin-top: 3px;
    color: var(--text-2);
    font-size: 10.5px;
    line-height: 1.15;
}
.cc2-kpi--blue { background: #F5F9FE; border-color: #CFE0F4; }
.cc2-kpi--green { background: #F5FBF8; border-color: #D2E9DC; }
.cc2-kpi--violet { background: #F8F6FC; border-color: #DDD6F1; }
.cc2-kpi--mint { background: #F4FBF8; border-color: #D0E8DD; }
.cc2-kpi--amber { background: #FFF9F0; border-color: #EEDDBB; }
.cc2-kpi--red { background: #FFF7F7; border-color: #EFCFCF; }

.cc2-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.95fr) minmax(280px, .98fr);
    grid-template-areas:
        "attention day"
        "statuses top";
    gap: var(--cc2-gap);
    margin-top: 10px;
    align-items: stretch;
}
.cc2-card {
    min-width: 0;
    overflow: hidden;
    border-radius: 7px;
}
.cc2-card .card__header {
    min-height: 38px;
    padding: 7px 12px;
}
.cc2-card .card__title {
    font-size: 13.5px;
}
.cc2-card .section__link {
    font-size: 11px;
}
.cc2-attention { grid-area: attention; }
.cc2-day { grid-area: day; }
.cc2-statuses { grid-area: statuses; }
.cc2-top { grid-area: top; }

.cc2-table,
.cc2-top-table {
    table-layout: fixed;
    font-size: 11.25px;
}
.cc2-table th,
.cc2-top-table th {
    padding: 6px 10px;
    font-size: 9.5px;
    letter-spacing: .035em;
}
.cc2-table td,
.cc2-top-table td {
    height: 31px;
    padding: 5px 10px;
}
.cc2-table th:nth-child(1) { width: 23%; }
.cc2-table th:nth-child(2) { width: 24%; }
.cc2-table th:nth-child(3) { width: 20%; }
.cc2-table th:nth-child(4) { width: 33%; }
.cc2-table td,
.cc2-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc2-table .cell-main,
.cc2-top-table .cell-main {
    font-size: 11.25px;
}
.cc2-status {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    height: 20px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 10.25px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc2-status--success { background: #E5F5EC; color: #207A4B; }
.cc2-status--award { background: #FFF1D4; color: #9A6500; }
.cc2-status--tender { background: #EEE9FA; color: #6652A4; }
.cc2-status--danger { background: #FDE8E8; color: #B83A3A; }
.cc2-status--development { background: #E8F4FD; color: #2E6FA3; }
.cc2-status--scheduled { background: #E8F1FC; color: #326BA7; }
.cc2-status--pending { background: #FFF0D8; color: #A46300; }
.cc2-status--redesign { background: #EEF1F4; color: #596875; }
.cc2-status--neutral { background: #EEF1F4; color: #596875; }

.cc2-day-list {
    padding: 3px 10px 5px;
}
.cc2-day-item {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 47px;
    padding: 5px 3px;
    color: inherit;
    border-bottom: 1px solid var(--border-2);
}
.cc2-day-item:last-child { border-bottom: 0; }
.cc2-day-item:hover { color: var(--cyp-blue); }
.cc2-check {
    width: 15px;
    height: 15px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: #fff;
}
.cc2-day-text {
    overflow: hidden;
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc2-day-time {
    color: var(--text-2);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}
.cc2-day-empty {
    min-height: 145px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 9px;
    padding: 14px;
    color: var(--text-2);
    font-size: 11.5px;
}

.cc2-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 12px 10px;
}
.cc2-bar-row {
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr) 24px 35px;
    align-items: center;
    gap: 8px;
    min-height: 18px;
    color: inherit;
}
.cc2-bar-row:hover { color: inherit; }
.cc2-bar-label {
    overflow: hidden;
    font-size: 10.75px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc2-bar-track {
    height: 7px;
    overflow: hidden;
    border-radius: 2px;
    background: #EDF1F4;
}
.cc2-bar-fill {
    display: block;
    height: 100%;
    border-radius: 2px;
}
.cc2-bar-fill--success { background: #62BD83; }
.cc2-bar-fill--award { background: #F3BB45; }
.cc2-bar-fill--tender { background: #8F7BD7; }
.cc2-bar-fill--danger { background: #E76565; }
.cc2-bar-fill--development { background: #5399E8; }
.cc2-bar-fill--scheduled { background: #7AB0E7; }
.cc2-bar-fill--pending { background: #9AA6B2; }
.cc2-bar-fill--redesign { background: #AEB8C0; }
.cc2-bar-fill--neutral { background: #97A5B2; }
.cc2-bar-row strong,
.cc2-bar-row small {
    text-align: right;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}
.cc2-bar-row small { color: var(--text-2); }

.cc2-top-table th:first-child,
.cc2-top-table td:first-child {
    width: 28px;
    padding-right: 0;
}
.cc2-top-table th:last-child,
.cc2-top-table td:last-child {
    width: 105px;
}
.cc2-rank {
    color: var(--text-3);
    text-align: center;
    font-size: 10.5px;
}
.cc2-top-table .money {
    font-size: 10.75px;
    white-space: nowrap;
}

@media (min-width: 1180px) {
    .cc-dashboard-v2 {
        zoom: .86;
    }
}
@media (min-width: 1500px) and (min-height: 900px) {
    .cc-dashboard-v2 {
        zoom: .92;
    }
}
@media (max-width: 1179px) {
    .cc2-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "attention" "day" "statuses" "top";
    }
    .cc2-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Estado de la cartera — tabla ejecutiva */
.cc2-status-table {
    table-layout: fixed;
    font-size: 11.25px;
}
.cc2-status-table th {
    padding: 6px 10px;
    font-size: 9.5px;
    letter-spacing: .035em;
}
.cc2-status-table td {
    height: 29px;
    padding: 4px 10px;
}
.cc2-status-table th:first-child { width: 46%; }
.cc2-status-table th:nth-child(2) { width: 13%; }
.cc2-status-table th:nth-child(3) { width: 25%; }
.cc2-status-table th:nth-child(4) { width: 16%; }
.cc2-status-link {
    display: inline-flex;
    max-width: 100%;
    color: inherit;
}
.cc2-status-link:hover { color: inherit; }
.cc2-status-table .money,
.cc2-status-table .strong {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.cc2-statuses .card__header > div {
    min-width: 0;
}
.cc2-statuses .card__header .small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
}


/* Proyectos — acceso principal a Cartera junto al título */
.page-header__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.project-portfolio-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 40, 59, .04);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.project-portfolio-link:hover {
    border-color: var(--cyp-blue);
    background: var(--accent-soft);
    color: var(--cyp-blue);
}
.project-portfolio-link.is-active {
    border-color: var(--cyp-blue);
    background: var(--accent-soft);
    color: var(--cyp-blue);
}
@media (max-width: 760px) {
    .page-header__title-row {
        align-items: flex-start;
        gap: 9px;
    }
    .project-portfolio-link {
        min-height: 36px;
        padding: 0 13px;
        font-size: 13.5px;
    }
}
