:root {
    color-scheme: light;
    --ink: #18231f;
    --ink-soft: #32423c;
    --muted: #687871;
    --subtle: #89968f;
    --line: #dce5e1;
    --line-strong: #cbd8d2;
    --canvas: #f4f7f6;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --brand: #14745a;
    --brand-strong: #0d5b46;
    --brand-dark: #123c31;
    --brand-soft: #e7f4ef;
    --brand-pale: #f1f8f5;
    --blue: #4263c7;
    --blue-soft: #edf1ff;
    --amber: #a86616;
    --amber-soft: #fff5df;
    --red: #b24b48;
    --red-soft: #fdf0ef;
    --violet: #7552ad;
    --violet-soft: #f3effb;
    --shadow-sm: 0 2px 8px rgba(18, 60, 49, .05);
    --shadow-md: 0 12px 32px rgba(18, 60, 49, .08);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    transition: color .16s ease, background-color .16s ease, border-color .16s ease,
        box-shadow .16s ease, transform .16s ease;
}

a {
    color: inherit;
}

svg {
    display: block;
    fill: currentColor;
}

h1:focus {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(20, 116, 90, .2);
    outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .65;
}

/* Sesión y navegación global */

.session-splash,
.page-loading {
    display: grid;
    min-height: 100vh;
    padding: 32px;
    place-items: center;
    align-content: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(187, 226, 211, .45), transparent 28%),
        var(--canvas);
    text-align: center;
}

.session-splash-mark {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    place-items: center;
    border-radius: 16px;
    background: var(--brand);
    color: white;
    box-shadow: 0 10px 24px rgba(20, 116, 90, .22);
    animation: splash-pulse 1.5s ease-in-out infinite;
}

.session-splash-mark svg {
    width: 28px;
}

.session-splash > strong,
.page-loading > strong {
    font-size: 19px;
}

.session-splash > span:last-child,
.page-loading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.loading-spinner,
.button-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.page-loading .loading-spinner {
    margin-bottom: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes splash-pulse {
    50% { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20, 116, 90, .28); }
}

.app-header {
    position: sticky;
    z-index: 100;
    top: 0;
    border-bottom: 1px solid rgba(203, 216, 210, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 2px 12px rgba(18, 60, 49, .035);
    backdrop-filter: blur(14px);
}

.app-header-inner {
    display: grid;
    width: min(1240px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
    grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
    align-items: center;
    gap: 24px;
}

.app-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
}

.app-brand:hover .app-brand-mark {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(20, 116, 90, .2);
}

.app-brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--brand);
    color: white;
    transition: transform .16s ease, box-shadow .16s ease;
}

.app-brand-mark svg {
    width: 21px;
}

.app-brand-copy,
.account-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.2;
}

.app-brand-copy strong {
    font-size: 16px;
    letter-spacing: -.2px;
}

.app-brand-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.app-navigation {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}

.app-nav-link {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 14px;
    align-items: center;
    gap: 7px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.app-nav-link svg {
    width: 18px;
    height: 18px;
}

.app-nav-link:hover {
    color: var(--brand);
}

.app-nav-link.active {
    background: var(--surface);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
}

.account-menu {
    display: flex;
    justify-self: end;
    align-items: center;
    gap: 10px;
}

.account-avatar,
.audit-user i {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.account-copy {
    max-width: 150px;
}

.account-copy strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.logout-button {
    display: inline-flex;
    min-height: 36px;
    padding: 7px 10px;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.logout-button svg {
    width: 17px;
}

.logout-button:hover {
    border-color: #f0d8d6;
    background: var(--red-soft);
    color: var(--red);
}

/* Estructura de páginas */

.app-shell {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 72px;
}

.breadcrumbs {
    display: flex;
    min-height: 24px;
    align-items: center;
    gap: 7px;
    color: var(--subtle);
    font-size: 12px;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--brand);
}

.breadcrumbs strong {
    overflow: hidden;
    color: var(--ink-soft);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumbs svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.page-heading {
    display: flex;
    min-height: 112px;
    padding: 24px 0 26px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.page-heading h1 {
    max-width: 800px;
    margin: 5px 0 5px;
    color: var(--ink);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 750;
    letter-spacing: -1.25px;
    line-height: 1.15;
}

.page-heading p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--brand);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.65px;
}

.eyebrow.light {
    color: #a7dccc;
}

.muted {
    color: var(--muted);
}

.content-panel,
.detail-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel-heading,
.section-heading,
.audit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.panel-heading h2,
.section-heading h3,
.audit-heading h3 {
    margin: 0;
    color: var(--ink);
    font-size: 19px;
    letter-spacing: -.35px;
}

.panel-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.primary,
.secondary,
.ghost,
.edit-link,
.clear-filter-button,
.filter-chip,
.quick-ranges button {
    border: 0;
    cursor: pointer;
    font-weight: 750;
}

.primary,
.secondary {
    display: inline-flex;
    min-height: 42px;
    padding: 10px 17px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 9px;
}

.primary {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: white;
    box-shadow: 0 4px 11px rgba(20, 116, 90, .14);
}

.primary:hover:not(:disabled) {
    border-color: var(--brand-strong);
    background: var(--brand-strong);
    box-shadow: 0 7px 16px rgba(20, 116, 90, .2);
    transform: translateY(-1px);
}

.secondary {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}

.secondary:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.button-link {
    width: fit-content;
    text-decoration: none;
}

.action-with-icon svg,
.compact-button svg {
    width: 18px;
    height: 18px;
}

.compact-button {
    min-height: 36px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
}

.full {
    width: 100%;
}

/* Tablero */

.dashboard-heading {
    padding-bottom: 28px;
}

.metrics-grid {
    display: grid;
    margin-bottom: 22px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.metric-card {
    display: flex;
    min-height: 110px;
    padding: 20px;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 12px;
}

.metric-icon svg {
    width: 22px;
}

.metric-blue { background: var(--blue-soft); color: var(--blue); }
.metric-amber { background: var(--amber-soft); color: var(--amber); }
.metric-green { background: var(--brand-soft); color: var(--brand); }
.metric-violet { background: var(--violet-soft); color: var(--violet); }

.metric-card > div {
    min-width: 0;
}

.metric-card div > span,
.metric-card small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.metric-card div > span {
    font-weight: 750;
    letter-spacing: .45px;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin: 1px 0 0;
    color: var(--ink);
    font-size: 27px;
    line-height: 1.15;
}

.activity-board {
    overflow: hidden;
}

.board-toolbar {
    display: flex;
    padding: 22px 24px 17px;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.board-toolbar h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.4px;
}

.board-toolbar p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.search-control {
    position: relative;
    width: min(390px, 100%);
}

.search-control > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 18px;
    color: var(--subtle);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-control input {
    width: 100%;
    height: 42px;
    padding: 9px 38px 9px 40px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
}

.search-control input::placeholder {
    color: var(--subtle);
}

.search-control input:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(20, 116, 90, .1);
}

.search-control button {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    transform: translateY(-50%);
}

.filter-chips {
    display: flex;
    padding: 0 24px 17px;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.filter-chip {
    display: inline-flex;
    min-height: 32px;
    padding: 6px 10px;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.filter-chip span {
    display: inline-grid;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-soft);
    font-size: 9px;
}

.filter-chip:hover,
.filter-chip.active {
    border-color: #b7d7cb;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.filter-chip.active span {
    background: var(--surface);
}

.activity-list {
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.activity-card {
    position: relative;
    display: grid;
    margin-top: 12px;
    overflow: hidden;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(18, 60, 49, .025);
}

.activity-card:hover {
    border-color: #c5d7d0;
    box-shadow: 0 8px 24px rgba(18, 60, 49, .07);
    transform: translateY(-1px);
}

.priority-marker { width: 5px; }
.priority-1 { background: #d8645b; }
.priority-2 { background: #d9a53d; }
.priority-3 { background: #78ae95; }

.activity-card-body {
    min-width: 0;
    padding: 17px 20px 16px;
}

.activity-card-top,
.card-badges,
.activity-facts,
.progress-copy {
    display: flex;
    align-items: center;
}

.activity-card-top {
    justify-content: space-between;
    gap: 15px;
}

.card-badges {
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
}

.status-badge,
.soft-badge,
.entity-badge,
.record-count {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .35px;
}

.status-badge {
    padding: 5px 8px;
    gap: 5px;
}

.status-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-1 { background: var(--blue-soft); color: var(--blue); }
.status-2 { background: var(--amber-soft); color: var(--amber); }
.status-3 { background: var(--brand-soft); color: var(--brand); }
.status-4 { background: var(--red-soft); color: var(--red); }

.soft-badge {
    padding: 5px 8px;
    background: #eef2f0;
    color: var(--muted);
}

.activity-number {
    color: var(--subtle);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 10px;
}

.priority-label {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.priority-text-1 { color: var(--red); }
.priority-text-2 { color: var(--amber); }
.priority-text-3 { color: var(--brand); }

.activity-title {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: 10px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.35px;
    line-height: 1.25;
    text-decoration: none;
}

.activity-title:hover {
    color: var(--brand);
}

.activity-description {
    display: block;
    max-width: 880px;
    margin: 4px 0 12px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.activity-facts {
    flex-wrap: wrap;
    gap: 11px 24px;
}

.activity-facts > span {
    display: inline-flex;
    min-width: 145px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.activity-facts > span > svg {
    width: 17px;
    flex: 0 0 17px;
    color: var(--subtle);
}

.activity-facts > span > span {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.activity-facts small {
    color: var(--subtle);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.activity-facts strong {
    margin-top: 2px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
}

.deadline.overdue,
.deadline.overdue svg,
.deadline.overdue strong {
    color: var(--red);
}

.activity-progress-row {
    display: grid;
    max-width: 450px;
    margin-top: 14px;
    grid-template-columns: 105px minmax(120px, 1fr);
    align-items: center;
    gap: 12px;
}

.progress-copy {
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 10px;
}

.progress-copy strong {
    color: var(--brand);
    font-size: 11px;
}

.progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eeeb;
}

.progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), #31a27e);
}

.activity-card-actions {
    display: flex;
    min-width: 126px;
    padding: 16px;
    align-items: flex-end;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    border-left: 1px solid var(--line);
    background: #fbfcfb;
}

.card-action-link,
.context-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
}

.card-action-link svg,
.context-link svg {
    width: 15px;
}

.card-action-link:hover,
.context-link:hover {
    color: var(--brand-strong);
    text-decoration: underline;
}

.empty-state {
    display: grid;
    min-height: 270px;
    padding: 40px 24px;
    place-items: center;
    align-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-state > span {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
    place-items: center;
    border-radius: 15px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 14px;
    font-weight: 800;
}

.empty-state svg {
    width: 25px;
}

.empty-state h1,
.empty-state h3 {
    margin: 0;
    color: var(--ink);
}

.empty-state h3 {
    font-size: 17px;
}

.empty-state p {
    max-width: 430px;
    margin: 6px 0 17px;
    font-size: 13px;
}

.empty-state.compact,
.empty.compact {
    min-height: 180px;
    padding: 28px 20px;
}

.page-empty {
    min-height: calc(100vh - 190px);
}

/* Detalle de actividad */

.detail-page-heading {
    align-items: flex-end;
}

.detail-meta {
    display: flex;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 17px;
    color: var(--muted);
    font-size: 12px;
}

.detail-meta > span:not(.status-badge) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.detail-meta svg {
    width: 15px;
    color: var(--subtle);
}

.detail-progress-summary {
    width: min(260px, 100%);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.detail-progress-summary > div:first-child {
    display: flex;
    margin-bottom: 8px;
    align-items: baseline;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
}

.detail-progress-summary strong {
    color: var(--brand);
    font-size: 16px;
}

.detail-tabs {
    position: sticky;
    z-index: 40;
    top: 72px;
    display: flex;
    margin: 0 0 15px;
    padding: 6px;
    gap: 4px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(248, 250, 249, .96);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    scrollbar-width: thin;
}

.detail-tab {
    display: inline-flex;
    min-height: 40px;
    padding: 8px 14px;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.detail-tab > svg {
    width: 17px;
}

.detail-tab > span {
    display: inline-grid;
    min-width: 20px;
    height: 19px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    background: #edf1ef;
    font-size: 9px;
}

.detail-tab:hover {
    color: var(--brand);
}

.detail-tab.active {
    background: var(--surface);
    color: var(--brand-strong);
    box-shadow: var(--shadow-sm);
}

.detail-tab.active > span {
    background: var(--brand-soft);
}

.detail-panel {
    margin-bottom: 24px;
    padding: 26px 28px;
}

.section-heading {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.section-heading .eyebrow,
.audit-heading .eyebrow {
    display: block;
    margin-bottom: 4px;
}

.required-note,
.record-count {
    color: var(--muted);
    font-size: 10px;
}

.record-count {
    padding: 6px 9px;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.form-grid {
    display: grid;
    margin: 23px 0 25px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.form-grid label,
.subactivity-form label,
.filter-fields label {
    min-width: 0;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 750;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.subactivity-form input,
.subactivity-form select,
.subactivity-form textarea,
.filter-fields input,
.filter-fields select {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.form-grid input,
.form-grid select,
.subactivity-form input,
.subactivity-form select,
.filter-fields input,
.filter-fields select {
    height: 42px;
    padding: 9px 11px;
}

.form-grid textarea,
.subactivity-form textarea {
    min-height: 106px;
    padding: 10px 11px;
    resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.subactivity-form input:focus,
.subactivity-form select:focus,
.subactivity-form textarea:focus,
.filter-fields input:focus,
.filter-fields select:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(20, 116, 90, .1);
}

label small {
    display: block;
    margin-top: 5px;
    color: var(--subtle);
    font-size: 10px;
    font-weight: 500;
    text-align: right;
}

.wide {
    grid-column: span 3;
}

.editor-actions {
    display: flex;
    padding-top: 19px;
    align-items: center;
    gap: 9px;
    border-top: 1px solid var(--line);
}

.ghost,
.edit-link {
    padding: 8px 10px;
    border-radius: 7px;
    background: transparent;
    color: var(--brand);
    font-size: 12px;
}

.ghost:hover,
.edit-link:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.notice {
    margin: 0 0 15px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
}

.notice.success {
    border-color: #c9e3d8;
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.notice.error {
    border-color: #f0cfcd;
    background: var(--red-soft);
    color: var(--red);
}

.workspace-grid {
    display: grid;
    margin-top: 22px;
    grid-template-columns: minmax(270px, .72fr) minmax(430px, 1.55fr);
    gap: 24px;
}

.subactivity-form {
    align-self: start;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.subactivity-form h3 {
    margin: 4px 0 16px;
    font-size: 17px;
}

.subactivity-form label {
    display: block;
    margin-bottom: 14px;
}

.subactivity-form .muted {
    margin: 3px 0 15px;
    font-size: 11px;
}

.form-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-row > * {
    flex: 1;
}

.subactivity-card {
    display: flex;
    margin-bottom: 10px;
    padding: 15px;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.subactivity-card.is-done {
    border-color: #cce2d9;
    background: var(--brand-pale);
}

.subactivity-status {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid #c7ddd4;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
    font-weight: 900;
}

.subactivity-content {
    min-width: 0;
    flex: 1;
}

.subactivity-content > p {
    margin: 2px 0 8px;
    color: var(--ink-soft);
    font-size: 13px;
}

.subactivity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    color: var(--muted);
    font-size: 10px;
}

.finished {
    color: var(--brand-strong);
    font-weight: 750;
}

.subactivity-actions {
    display: flex;
    margin: 7px 0 0 -9px;
    flex-wrap: wrap;
    gap: 2px;
}

.inline-audit {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.inline-audit .section-heading {
    padding-bottom: 10px;
}

.inline-audit h4 {
    margin: 0;
    font-size: 14px;
}

.empty {
    display: grid;
    min-height: 180px;
    padding: 24px;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    color: var(--muted);
    text-align: center;
}

/* Auditoría */

.page-heading-stat {
    display: grid;
    min-width: 170px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.page-heading-stat span,
.page-heading-stat small {
    color: var(--muted);
    font-size: 10px;
}

.page-heading-stat span {
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.page-heading-stat strong {
    font-size: 24px;
    line-height: 1.2;
}

.audit-page-panel {
    padding: 24px;
}

.clear-filter-button {
    padding: 7px 9px;
    border-radius: 7px;
    background: transparent;
    color: var(--brand);
    font-size: 11px;
}

.clear-filter-button:hover {
    background: var(--brand-soft);
}

.audit-filter-card {
    display: grid;
    margin-top: 20px;
    padding: 17px;
    grid-template-columns: auto 1px minmax(380px, 1fr);
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.filter-section-title {
    display: block;
    margin-bottom: 9px;
    color: var(--subtle);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 1.3px;
}

.filter-fields {
    display: flex;
    align-items: flex-end;
    gap: 9px;
}

.filter-period .filter-fields label {
    width: 142px;
}

.filter-details .filter-fields label {
    min-width: 145px;
    flex: 1;
}

.filter-details .audit-search-label {
    min-width: 190px;
    flex: 1.35;
}

.date-separator {
    padding-bottom: 10px;
    color: var(--subtle);
}

.filter-apply {
    min-height: 40px;
    padding: 8px 13px;
    font-size: 11px;
}

.filter-divider {
    width: 1px;
    background: var(--line);
}

.quick-ranges {
    display: flex;
    margin-top: 9px;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 7px;
    color: var(--subtle);
    font-size: 9px;
}

.quick-ranges button {
    padding: 2px;
    background: transparent;
    color: var(--brand);
    font-size: 9px;
}

.quick-ranges button:hover {
    text-decoration: underline;
}

.audit-search {
    position: relative;
    display: block;
}

.audit-search svg {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 16px;
    color: var(--subtle);
    transform: translateY(-50%);
}

.audit-search input {
    padding-left: 33px;
}

.audit-results-heading {
    display: flex;
    margin: 19px 0 4px;
    padding: 11px 2px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}

.audit-results-heading strong {
    color: var(--ink);
}

.activity-audit > .muted {
    margin: 6px 0 0;
    font-size: 12px;
}

.audit-timeline {
    margin-top: 18px;
}

.audit-event {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;
    padding-bottom: 14px;
}

.audit-event:not(:last-child) .audit-rail::after {
    position: absolute;
    top: 32px;
    bottom: -14px;
    left: 16px;
    width: 1px;
    background: var(--line);
    content: "";
}

.audit-rail {
    position: relative;
}

.audit-action-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.audit-action-icon.action-crear,
.audit-action-icon.action-terminar,
.audit-action-icon.action-login {
    border-color: #c4dfd4;
    background: var(--brand-soft);
    color: var(--brand);
}

.audit-action-icon.action-editar,
.audit-action-icon.action-reabrir {
    border-color: #d5dbf2;
    background: var(--blue-soft);
    color: var(--blue);
}

.audit-action-icon.action-logout {
    border-color: #ecd6d4;
    background: var(--red-soft);
    color: var(--red);
}

.audit-event-card {
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.audit-event-heading,
.audit-event-footer,
.audit-event-tags,
.audit-user {
    display: flex;
    align-items: center;
}

.audit-event-heading {
    justify-content: space-between;
    gap: 14px;
}

.audit-event-tags {
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
}

.audit-action-label {
    color: var(--ink-soft);
    font-size: 11px;
}

.audit-action-label.action-crear,
.audit-action-label.action-terminar,
.audit-action-label.action-login { color: var(--brand-strong); }
.audit-action-label.action-editar,
.audit-action-label.action-reabrir { color: var(--blue); }
.audit-action-label.action-logout { color: var(--red); }

.entity-badge {
    padding: 4px 7px;
    gap: 4px;
    background: #eef2f0;
    color: var(--muted);
}

.entity-badge b {
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 9px;
}

.audit-event-heading time {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    color: var(--subtle);
    font-size: 9px;
}

.audit-event-heading time strong {
    color: var(--muted);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 10px;
}

.audit-description {
    margin: 7px 0 9px;
    color: var(--ink-soft);
    font-size: 12px;
}

.audit-event-footer {
    justify-content: space-between;
    gap: 15px;
}

.audit-user {
    gap: 7px;
    color: var(--muted);
    font-size: 10px;
}

.audit-user i {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 8px;
}

.audit-user strong {
    color: var(--ink-soft);
}

.audit-changes {
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.audit-change {
    display: grid;
    grid-template-columns: minmax(115px, .75fr) minmax(135px, 1fr) minmax(135px, 1fr);
}

.audit-change:not(:last-child) {
    border-bottom: 1px solid var(--line);
}

.audit-change > * {
    min-width: 0;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    font-size: 10px;
}

.audit-change > *:not(:last-child) {
    border-right: 1px solid var(--line);
}

.audit-change-heading {
    background: #f3f6f5;
    color: var(--muted);
    font-weight: 800;
}

.old-value {
    background: #fffafa;
    color: #99524f;
}

.new-value {
    background: #f8fcfa;
    color: var(--brand-strong);
}

/* Acceso y login */

.auth-page {
    display: grid;
    min-height: 100vh;
    padding: 28px;
    place-items: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(190, 226, 212, .55), transparent 32%),
        var(--canvas);
}

.access-card {
    display: flex;
    width: min(440px, 100%);
    padding: 38px;
    align-items: center;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.access-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 17px;
    place-items: center;
    border-radius: 15px;
    background: var(--brand-soft);
    color: var(--brand);
}

.access-icon svg {
    width: 25px;
}

.access-card h1 {
    margin: 6px 0;
    font-size: 25px;
    letter-spacing: -.7px;
}

.access-card p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    padding: 28px;
    place-items: center;
    background:
        radial-gradient(circle at 85% 20%, rgba(187, 226, 211, .5), transparent 27%),
        #eef4f1;
}

.login-layout {
    display: grid;
    width: min(1020px, 100%);
    min-height: 630px;
    overflow: hidden;
    grid-template-columns: 1.05fr .95fr;
    border: 1px solid rgba(205, 220, 213, .9);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(18, 60, 49, .14);
}

.login-intro {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: 44px;
    justify-content: space-between;
    flex-direction: column;
    background:
        radial-gradient(circle at 100% 0, rgba(75, 164, 131, .42), transparent 37%),
        linear-gradient(145deg, #174c3d, #0e352b);
    color: white;
}

.login-intro::after {
    position: absolute;
    right: -80px;
    bottom: -110px;
    width: 330px;
    height: 330px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow:
        0 0 0 45px rgba(255, 255, 255, .025),
        0 0 0 90px rgba(255, 255, 255, .018);
    content: "";
}

.login-logo {
    position: relative;
    z-index: 1;
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.login-logo > span,
.mobile-login-logo {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, .14);
}

.login-logo svg,
.mobile-login-logo svg {
    width: 22px;
}

.login-logo strong {
    font-size: 17px;
}

.login-intro-copy {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: auto 0;
}

.login-intro-copy h1 {
    margin: 10px 0 14px;
    font-size: clamp(32px, 4vw, 46px);
    letter-spacing: -1.7px;
    line-height: 1.08;
}

.login-intro-copy p {
    margin: 0;
    color: rgba(255, 255, 255, .7);
    font-size: 14px;
}

.login-benefits {
    position: relative;
    z-index: 1;
    display: grid;
    margin: 30px 0 0;
    padding: 0;
    gap: 10px;
    list-style: none;
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
}

.login-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-benefits span {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #a7e1cf;
    font-size: 10px;
    font-weight: 900;
}

.login-form-panel {
    display: flex;
    padding: 50px 52px;
    justify-content: center;
    flex-direction: column;
}

.mobile-login-logo {
    display: none;
    margin-bottom: 16px;
    background: var(--brand);
    color: white;
}

.login-form-heading h2 {
    margin: 6px 0 4px;
    font-size: 30px;
    letter-spacing: -1px;
}

.login-form-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.login-form-panel form {
    margin-top: 27px;
}

.field-label {
    display: block;
    margin: 15px 0 6px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 750;
}

.input-with-icon {
    position: relative;
}

.input-with-icon > svg {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    width: 18px;
    color: var(--subtle);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-with-icon > input {
    width: 100%;
    height: 45px;
    padding: 10px 13px 10px 41px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
}

.input-with-icon > input:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(20, 116, 90, .1);
}

.password-input > input {
    padding-right: 72px;
}

.password-input > button {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 5px 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--brand);
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
    transform: translateY(-50%);
}

.password-input > button:hover {
    background: var(--brand-soft);
}

.remember-option {
    display: flex;
    margin: 17px 0;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-soft);
    cursor: pointer;
}

.remember-option input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--brand);
}

.remember-option span {
    font-size: 11px;
    font-weight: 750;
}

.remember-option small {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 9px;
    text-align: left;
}

.login-submit {
    min-height: 45px;
    margin-top: 3px;
}

.login-submit svg {
    width: 18px;
}

.login-submit .button-spinner {
    width: 17px;
    height: 17px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, .35);
    border-top-color: white;
}

.demo-credentials {
    display: flex;
    margin-top: 26px;
    padding-top: 17px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
}

.demo-credentials > div {
    display: flex;
    flex-direction: column;
}

.demo-credentials span {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 800;
}

.demo-credentials small {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 8px;
}

.demo-credentials code {
    padding: 5px 7px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 9px;
    white-space: nowrap;
}

/* Validación y errores */

.valid.modified:not([type=checkbox]) {
    border-color: var(--brand);
}

.invalid {
    border-color: var(--red) !important;
}

.validation-message {
    margin-top: 4px;
    color: var(--red);
    font-size: 11px;
}

.blazor-error-boundary {
    padding: 1rem;
    background: var(--red);
    color: white;
}

.blazor-error-boundary::after {
    content: "Se produjo un error inesperado.";
}

/* Responsive */

@media (max-width: 1050px) {
    .app-header-inner {
        grid-template-columns: 1fr auto auto;
    }

    .account-copy {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .audit-filter-card {
        grid-template-columns: 1fr;
    }

    .filter-divider {
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 820px) {
    .app-header-inner {
        width: min(100% - 28px, 1240px);
        min-height: 66px;
        gap: 12px;
    }

    .app-brand-copy small,
    .logout-button span {
        display: none;
    }

    .app-brand-mark {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .app-navigation {
        justify-self: center;
    }

    .app-nav-link {
        min-height: 36px;
        padding: 7px 10px;
    }

    .app-shell {
        width: min(100% - 28px, 1200px);
        padding-top: 18px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wide {
        grid-column: span 2;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .activity-card {
        grid-template-columns: 5px minmax(0, 1fr);
    }

    .activity-card-actions {
        grid-column: 2;
        padding: 10px 18px 14px;
        align-items: center;
        justify-content: flex-end;
        flex-direction: row;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .login-layout {
        width: min(580px, 100%);
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-intro {
        display: none;
    }

    .mobile-login-logo {
        display: grid;
    }
}

@media (max-width: 640px) {
    .app-header-inner {
        grid-template-columns: 1fr auto;
        padding: 9px 0 8px;
    }

    .app-navigation {
        width: 100%;
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .app-nav-link {
        flex: 1;
        justify-content: center;
    }

    .account-menu {
        gap: 6px;
    }

    .account-avatar {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .detail-tabs {
        top: 112px;
    }

    .page-heading,
    .board-toolbar,
    .panel-heading,
    .section-heading,
    .audit-heading,
    .audit-event-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading {
        padding: 20px 0 22px;
    }

    .page-heading .primary,
    .page-heading-stat,
    .search-control {
        width: 100%;
    }

    .page-heading-stat {
        min-width: 0;
    }

    .metrics-grid {
        gap: 9px;
    }

    .metric-card {
        min-height: 95px;
        padding: 15px;
        align-items: flex-start;
    }

    .metric-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .metric-icon svg {
        width: 19px;
    }

    .metric-card strong {
        font-size: 22px;
    }

    .metric-card small {
        display: none;
    }

    .board-toolbar {
        padding: 18px;
    }

    .filter-chips {
        padding: 0 18px 15px;
    }

    .activity-list {
        padding: 0 8px 8px;
    }

    .activity-card-body {
        padding: 15px;
    }

    .activity-card-top {
        align-items: flex-start;
    }

    .activity-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .activity-facts > span {
        min-width: 0;
    }

    .activity-progress-row {
        grid-template-columns: 90px minmax(100px, 1fr);
    }

    .detail-panel,
    .audit-page-panel {
        padding: 20px 17px;
    }

    .detail-progress-summary {
        width: 100%;
    }

    .detail-tab {
        min-width: 125px;
        flex: 0 0 auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: auto;
    }

    .editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .editor-actions button {
        width: 100%;
    }

    .filter-fields {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-period .filter-fields label,
    .filter-details .filter-fields label,
    .filter-details .audit-search-label {
        width: 100%;
        min-width: 0;
    }

    .date-separator {
        display: none;
    }

    .audit-results-heading,
    .audit-event-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-change {
        grid-template-columns: 1fr;
        padding: 7px 0;
    }

    .audit-change-heading {
        display: none;
    }

    .audit-change > * {
        padding: 4px 9px;
        border-right: 0 !important;
    }

    .old-value::before {
        content: "Anterior: ";
        font-weight: 800;
    }

    .new-value::before {
        content: "Nuevo: ";
        font-weight: 800;
    }

    .login-page {
        padding: 14px;
    }

    .login-layout {
        border-radius: 16px;
    }

    .login-form-panel {
        padding: 32px 25px;
    }

    .demo-credentials {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .app-brand-copy {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .metric-card {
        gap: 10px;
    }

    .activity-facts {
        grid-template-columns: 1fr;
    }

    .activity-progress-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .activity-card-actions {
        justify-content: space-between;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row > * {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
