:root {
    --bg: #f4f7f8;
    --surface: #ffffff;
    --surface-soft: #eef4f3;
    --text: #182522;
    --muted: #687773;
    --line: #dce6e3;
    --primary: #146b5b;
    --primary-dark: #0d4f43;
    --primary-soft: #ddf1ec;
    --warning: #aa6d08;
    --warning-soft: #fff3d6;
    --danger: #b33a3a;
    --danger-soft: #fde8e8;
    --success: #23764d;
    --success-soft: #e2f4e9;
    --neutral: #53636f;
    --neutral-soft: #e9eef2;
    --shadow: 0 18px 50px rgba(27, 56, 49, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.guest-body {
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background:
        radial-gradient(circle at top left, rgba(20, 107, 91, 0.16), transparent 35%),
        radial-gradient(circle at bottom right, rgba(40, 126, 171, 0.11), transparent 32%),
        #f5f8f7;
}

.guest-shell {
    width: min(100%, 560px);
}

.login-card,
.error-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(220, 230, 227, 0.9);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: clamp(26px, 5vw, 44px);
}

.error-card {
    text-align: center;
}

.login-brand {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
}

.login-brand h1,
.error-card h1 {
    margin: 2px 0 8px;
    line-height: 1.2;
    font-size: clamp(25px, 4vw, 34px);
}

.login-brand p,
.error-card p {
    margin: 0;
    color: var(--muted);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 9px 24px rgba(20, 107, 91, 0.23);
}

.brand-mark.large {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 15px;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    font-size: 14px;
    font-weight: 700;
    margin-top: 5px;
}

.login-form input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 107, 91, 0.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 19px;
    border: 0;
    border-radius: 13px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 24px rgba(20, 107, 91, 0.18);
}

.button-block {
    width: 100%;
    margin-top: 13px;
}

.login-note {
    margin: 24px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.alert {
    border-radius: 13px;
    padding: 13px 15px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-size: 14px;
}

.alert-error {
    color: #852929;
    background: var(--danger-soft);
    border-color: #f6caca;
}

.alert-warning {
    color: #76500c;
    background: var(--warning-soft);
    border-color: #f2dda8;
}

.alert-success {
    color: #185c3a;
    background: var(--success-soft);
    border-color: #bfe5cd;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px 18px;
    color: #eef9f6;
    background: linear-gradient(180deg, #123d35 0%, #0d2f29 100%);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand span {
    color: rgba(238, 249, 246, 0.67);
    font-size: 12px;
}

.nav-menu {
    display: grid;
    gap: 5px;
    margin-top: 20px;
}

.nav-section {
    margin: 15px 10px 4px;
    color: rgba(238, 249, 246, 0.48);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-item {
    min-height: 43px;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border-radius: 12px;
    color: rgba(238, 249, 246, 0.8);
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.11);
    color: #fff;
    font-weight: 750;
}

.nav-item.disabled {
    opacity: 0.62;
    cursor: default;
}

.nav-item small {
    font-size: 9px;
    color: rgba(238, 249, 246, 0.48);
}

.nav-icon {
    text-align: center;
    font-size: 17px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-summary {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 13px;
}

.user-summary strong,
.user-summary span {
    display: block;
}

.user-summary strong {
    max-width: 155px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.user-summary span {
    color: rgba(238, 249, 246, 0.61);
    font-size: 11px;
}

.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.13);
    font-weight: 800;
}

.logout-button {
    width: 100%;
    min-height: 39px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.main-content {
    min-width: 0;
}

.topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 19px clamp(22px, 4vw, 45px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(13px);
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
}

.topbar-date {
    text-align: right;
}

.topbar-date span,
.topbar-date small {
    display: block;
}

.topbar-date span {
    font-weight: 750;
}

.topbar-date small {
    color: var(--muted);
}

.page-content {
    padding: clamp(22px, 4vw, 42px);
}

.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    padding: 24px 26px;
    color: #fff;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 90% 10%, rgba(255,255,255,0.17), transparent 29%),
        linear-gradient(135deg, #166b5c, #0f4b41);
    box-shadow: 0 18px 42px rgba(15, 75, 65, 0.15);
}

.welcome-panel h2 {
    margin: 2px 0 5px;
    font-size: 25px;
}

.welcome-panel p:not(.eyebrow) {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
}

.welcome-panel .eyebrow {
    color: #bce8dd;
}

.status-pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.21);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 750;
}

.metrics-grid,
.section-grid {
    display: grid;
    gap: 16px;
}

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

.section-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.metric-card,
.status-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(29, 65, 55, 0.045);
}

.metric-card {
    padding: 21px;
}

.metric-card span,
.metric-card small {
    display: block;
}

.metric-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.metric-card strong {
    display: block;
    margin: 5px 0 3px;
    font-size: 31px;
    line-height: 1;
}

.metric-card small {
    color: #94a09c;
    font-size: 11px;
}

.status-card {
    position: relative;
    overflow: hidden;
    padding: 17px 20px;
}

.status-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: currentColor;
}

.status-card span,
.status-card strong {
    display: block;
}

.status-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.status-card strong {
    margin-top: 2px;
    font-size: 26px;
}

.status-ok { color: var(--success); }
.status-warning { color: var(--warning); }
.status-danger { color: var(--danger); }
.status-neutral { color: var(--neutral); }

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    min-width: 0;
    padding: 21px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 17px;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
}

.panel-count {
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 11px;
    font-weight: 750;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

td small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-vencido {
    color: var(--danger);
    background: var(--danger-soft);
}

.badge-por-vencer {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge-sin-emo {
    color: var(--neutral);
    background: var(--neutral-soft);
}

.process-list {
    display: grid;
}

.process-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.process-row:last-child {
    border-bottom: 0;
}

.process-row span {
    color: var(--muted);
}

.process-row strong {
    min-width: 30px;
    text-align: center;
    color: var(--primary-dark);
}

.empty-state {
    padding: 28px 18px;
    text-align: center;
    border: 1px dashed #cbdad6;
    border-radius: 14px;
    background: #fafcfc;
}

.empty-state strong,
.empty-state p {
    display: block;
}

.empty-state p {
    max-width: 570px;
    margin: 5px auto 0;
    color: var(--muted);
    font-size: 13px;
}

.compact-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.compact-stat span {
    color: var(--muted);
    font-size: 13px;
}

.compact-stat strong {
    font-size: 24px;
}

.panel-note {
    margin: 17px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.debug-box {
    padding: 13px;
    text-align: left;
    white-space: pre-wrap;
    background: #f5f5f5;
    border-radius: 10px;
    overflow-wrap: anywhere;
}

code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #edf1f0;
}

@media (max-width: 1120px) {
    .metrics-grid,
    .section-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 15px;
    }

    .nav-menu,
    .sidebar-footer {
        display: none;
    }

    .brand {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .topbar {
        min-height: auto;
        padding: 17px 20px;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .page-content {
        padding: 20px;
    }
}

@media (max-width: 590px) {
    .guest-body {
        padding: 15px;
    }

    .login-card,
    .error-card {
        border-radius: 21px;
        padding: 23px;
    }

    .login-brand {
        display: block;
    }

    .login-brand .brand-mark {
        margin-bottom: 16px;
    }

    .topbar-date {
        display: none;
    }

    .welcome-panel {
        display: block;
        padding: 21px;
    }

    .status-pill {
        display: inline-flex;
        margin-top: 15px;
    }

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

    .page-content {
        padding: 15px;
    }

    .panel {
        padding: 17px;
    }
}

/* Fase 2B: empresas y obras */
select,
textarea {
    font: inherit;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}

.page-heading h2 {
    margin: 2px 0 5px;
    font-size: 25px;
}

.page-heading p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.button-secondary {
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--line);
}

.button-danger {
    color: #fff;
    background: var(--danger);
}

.button-success {
    color: #fff;
    background: var(--success);
}

.filter-panel {
    margin-bottom: 16px;
    padding: 17px 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) minmax(180px, 0.6fr) auto;
    gap: 14px;
    align-items: end;
}

.filters-grid-works {
    grid-template-columns: minmax(230px, 1.3fr) minmax(230px, 0.9fr) minmax(150px, 0.5fr) auto;
}

.filter-actions,
.form-actions {
    display: flex;
    gap: 9px;
}

.form-panel {
    max-width: 980px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

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

.form-span-2 {
    grid-column: 1 / -1;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-group label {
    font-size: 13px;
    font-weight: 750;
}

.field-group label span {
    color: var(--danger);
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field-group textarea {
    resize: vertical;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(20, 107, 91, 0.11);
}

.field-group small,
.readonly-field small {
    color: var(--muted);
    font-size: 11px;
}

.readonly-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.form-actions {
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.alert-list {
    margin: 7px 0 0 20px;
    padding: 0;
}

.badge-active {
    color: var(--success);
    background: var(--success-soft);
}

.badge-inactive {
    color: var(--neutral);
    background: var(--neutral-soft);
}

.table-actions {
    white-space: nowrap;
}

.table-actions,
.table-actions form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.link-action,
.link-button {
    padding: 0;
    color: var(--primary);
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.link-action:hover,
.link-button:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.pagination a {
    color: var(--primary);
    font-weight: 750;
    text-decoration: none;
}

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

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 0.7fr);
    gap: 16px;
    margin-bottom: 16px;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}

.detail-list div {
    min-width: 0;
}

.detail-list dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.detail-full {
    grid-column: 1 / -1;
}

.stats-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.large-stat {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.large-stat:last-child {
    border-bottom: 0;
}

.large-stat strong,
.large-stat span {
    display: block;
}

.large-stat strong {
    font-size: 27px;
}

.large-stat span {
    color: var(--muted);
    font-size: 12px;
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
}

.danger-zone strong,
.danger-zone small {
    display: block;
}

.danger-zone small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.empty-action {
    margin-top: 15px;
}

.access-denied {
    max-width: 640px;
    margin: 40px auto;
    text-align: center;
}

.access-denied h2 {
    margin: 2px 0 8px;
}

.access-denied p {
    margin: 0 0 20px;
    color: var(--muted);
}

@media (max-width: 1040px) {
    .filters-grid,
    .filters-grid-works {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 760px) {
    .page-heading {
        display: block;
    }

    .page-heading > .button,
    .heading-actions {
        margin-top: 15px;
    }

    .heading-actions {
        justify-content: flex-start;
    }

    .filters-grid,
    .filters-grid-works,
    .form-grid-2,
    .detail-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .form-span-2,
    .detail-full {
        grid-column: auto;
    }

    .filter-actions,
    .form-actions,
    .danger-zone {
        flex-wrap: wrap;
    }
}

.welcome-actions {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.welcome-link {
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
}

.welcome-link:hover {
    text-decoration: underline;
}

/* Fase 2C: personas, catálogos y vínculos laborales */
.mobile-nav-button,
.mobile-nav-close,
.mobile-nav-backdrop {
    display: none;
}

.topbar-title {
    min-width: 0;
    flex: 1;
}

.filters-grid-people {
    grid-template-columns: minmax(260px, 1.5fr) minmax(210px, .7fr) minmax(160px, .5fr) auto;
}

.filters-grid-employments {
    grid-template-columns: minmax(240px, 1.5fr) minmax(190px, .8fr) minmax(190px, .8fr) minmax(150px, .55fr) auto;
}

.badge-pending {
    color: #6555a5;
    background: #eeeafd;
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.link-danger {
    color: var(--danger);
}

.section-space {
    margin-top: 16px;
}

.timeline {
    display: grid;
    gap: 0;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    padding: 0 0 20px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 15px;
    bottom: 0;
    width: 2px;
    background: var(--line);
}

.timeline-marker {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: 4px;
    border: 3px solid var(--primary-soft);
    border-radius: 50%;
    background: var(--primary);
}

.timeline-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.timeline-heading span,
.timeline-item p,
.timeline-item small {
    color: var(--muted);
    font-size: 12px;
}

.timeline-item p {
    margin: 3px 0;
}

.timeline-item small {
    display: block;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.catalog-create {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.catalog-list {
    display: grid;
}

.catalog-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(150px, auto) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.catalog-row:last-child {
    border-bottom: 0;
}

.catalog-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.catalog-edit input {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
}

.catalog-edit input:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(20, 107, 91, 0.1);
}

.catalog-meta {
    display: grid;
    justify-items: start;
    gap: 4px;
}

.catalog-meta small {
    color: var(--muted);
    font-size: 10px;
}

.narrow-panel {
    max-width: 760px;
}

.cease-summary {
    margin-bottom: 24px;
    padding: 18px;
    border-radius: 14px;
    background: var(--surface-soft);
}

@media (max-width: 1220px) {
    .filters-grid-people,
    .filters-grid-employments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        z-index: 50;
        top: 0;
        left: 0;
        width: min(86vw, 300px);
        height: 100vh;
        padding: 20px 16px 16px;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .2);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar .nav-menu {
        display: grid;
    }

    .sidebar .sidebar-footer {
        display: block;
    }

    .mobile-nav-button {
        display: inline-grid;
        place-items: center;
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        color: var(--primary-dark);
        font-size: 20px;
        cursor: pointer;
    }

    .mobile-nav-close {
        display: inline-grid;
        place-items: center;
        width: 34px;
        height: 34px;
        margin-left: auto;
        border: 0;
        border-radius: 10px;
        background: rgba(255,255,255,.08);
        color: #fff;
        font-size: 24px;
        cursor: pointer;
    }

    .mobile-nav-backdrop {
        position: fixed;
        z-index: 40;
        inset: 0;
        background: rgba(7, 28, 24, .5);
    }

    body.nav-open {
        overflow: hidden;
    }

    body.nav-open .mobile-nav-backdrop {
        display: block;
    }

    .topbar {
        gap: 13px;
    }
}

@media (max-width: 680px) {
    .filters-grid-people,
    .filters-grid-employments,
    .catalog-create,
    .catalog-row,
    .catalog-edit {
        grid-template-columns: 1fr;
    }

    .catalog-meta {
        justify-items: start;
    }

    .timeline-heading {
        display: block;
    }
}
