:root {
    --bg: #edf4f2;
    --bg-soft: #f4f8f7;
    --panel: #ffffff;
    --panel-soft: #f7faf9;
    --ink: #152421;
    --muted: #64716f;
    --line: #d5e0dc;
    --line-strong: #b8c8c2;
    --accent: #0f6a5f;
    --accent-dark: #073f3a;
    --accent-soft: #dcefeb;
    --accent-2: #ee8d77;
    --accent-2-dark: #c66b58;
    --accent-2-soft: #fde9e4;
    --warn: #8a5a12;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --ok: #087443;
    --ok-soft: #dff7e8;
    --sidebar: #0b302d;
    --sidebar-2: #12433f;
    --shadow-sm: 0 1px 2px rgba(12, 43, 40, .08);
    --shadow-md: 0 18px 42px rgba(12, 43, 40, .14);
    --shadow-lg: 0 26px 70px rgba(12, 43, 40, .2);
    --radius: 8px;
    --sidebar-width: 276px;
}

* { box-sizing: border-box; }
html {
    min-width: 320px;
    background: var(--bg);
}
body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

body.app-shell {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(237, 244, 242, .95), rgba(244, 248, 247, .9) 46%, rgba(255, 255, 255, .94)),
        url("/images/integradoc-background.png") center / cover fixed,
        var(--bg);
}
@media (min-width: 561px) {
    body.app-shell.home-shell {
        background:
            linear-gradient(135deg, rgba(237, 244, 242, .76), rgba(244, 248, 247, .72) 46%, rgba(255, 255, 255, .80)),
            url("/images/integradoc-background.png") center / cover fixed,
            var(--bg);
    }
}
body.auth-shell {
    min-height: 100vh;
    background: var(--bg);
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}
a:hover {
    color: var(--accent);
    text-decoration: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid rgba(15, 106, 95, .22);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
    line-height: 1.12;
}
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p {
    color: var(--muted);
    margin: 8px 0 0;
}

.nav-toggle,
.menu-toggle {
    display: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(238, 141, 119, .08)),
        linear-gradient(90deg, var(--sidebar), var(--sidebar-2));
    box-shadow: 0 14px 34px rgba(12, 43, 40, .18);
    backdrop-filter: blur(16px);
}
.topbar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: min(320px, 36vw);
    background: linear-gradient(90deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03) 58%, transparent);
    pointer-events: none;
}
.topbar-inner {
    position: relative;
    z-index: 1;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.brand-block {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    min-width: 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 42px;
    padding: 4px 8px 4px 5px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04)),
        rgba(255, 255, 255, .07);
    color: white;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 22px rgba(7, 63, 58, .18);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.brand:hover {
    border-color: rgba(238, 141, 119, .38);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(238, 141, 119, .08)),
        rgba(255, 255, 255, .09);
    color: white;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 14px 28px rgba(7, 63, 58, .22);
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0)),
        linear-gradient(145deg, var(--accent-2), var(--accent));
    color: #f8fffd;
    font-size: 12px;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}
.brand-word {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.app-brand-mark {
    position: fixed;
    left: clamp(18px, 4vw, 58px);
    bottom: clamp(18px, 4vw, 48px);
    z-index: 0;
    width: clamp(120px, 14vw, 220px);
    max-width: 34vw;
    opacity: .11;
    filter: grayscale(.18) saturate(.72);
    pointer-events: none;
    user-select: none;
}
.role-chip {
    width: max-content;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 999px;
    padding: 4px 10px;
    color: white;
    background: rgba(255, 255, 255, .12);
    font-size: 12px;
    font-weight: 750;
    text-transform: capitalize;
}
.side-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: visible;
}
.side-nav a {
    isolation: isolate;
    color: rgba(247, 253, 252, .9);
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 999px;
    font-weight: 750;
    position: relative;
    overflow: hidden;
    transition: color .18s ease, transform .18s ease, box-shadow .18s ease;
    white-space: nowrap;
}
.side-nav a.nav-home {
    width: 42px;
    justify-content: center;
    padding: 9px 0;
    font-size: 19px;
}
.side-nav a.nav-home span {
    display: block;
    line-height: 1;
    transform: translateY(-1px);
}
.side-nav a::before {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    border-radius: inherit;
    background: rgba(255, 255, 255, .1);
    opacity: 0;
    transform: scale(.86);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.side-nav a::after {
    content: "";
    position: absolute;
    inset: auto 18px 6px;
    z-index: -1;
    height: 2px;
    border-radius: 99px;
    background: var(--accent-2);
    opacity: 0;
    transform: scaleX(.25);
    transition: opacity .18s ease, transform .18s ease;
}
.side-nav a:hover {
    color: white;
    transform: translateY(-1px);
}
.side-nav a:hover::before {
    opacity: 1;
    transform: scale(1);
}
.side-nav a:hover::after {
    opacity: .75;
    transform: scaleX(1);
}
.side-nav a.active {
    color: white;
    box-shadow: 0 10px 22px rgba(7, 63, 58, .18);
}
.side-nav a.active::before {
    opacity: 1;
    transform: scale(1);
    background:
        linear-gradient(90deg, rgba(238, 141, 119, .28), rgba(255, 255, 255, .1)),
        var(--sidebar-2);
}
.side-nav a.active::after {
    opacity: 1;
    transform: scaleX(1);
}
.logout-form {
    margin: 0;
}
.user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
}
.topbar .logout-form .ghost {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .28);
    color: white;
}
.logout-icon {
    margin-left: .35rem;
}
.topbar .logout-form .ghost:hover {
    background: rgba(238, 141, 119, .18);
    color: white;
    border-color: rgba(238, 141, 119, .46);
}

.main {
    position: relative;
    z-index: 1;
    width: min(100%, 1280px);
    margin: 0 auto;
    padding: 30px 24px 42px;
    min-width: 0;
}
.auth-main {
    min-height: 100vh;
    display: grid;
    align-items: center;
    justify-items: end;
    padding: 48px;
    background:
        linear-gradient(90deg, rgba(7, 63, 58, .12), rgba(237, 244, 242, .64) 42%, rgba(255, 255, 255, .96)),
        url("/images/integradoc-background.png") center / cover no-repeat,
        var(--bg);
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}
.page-head > div { min-width: 0; }
.page-head p { max-width: 720px; }
.welcome-section {
    min-height: calc(100vh - 148px);
    display: grid;
    align-items: center;
    justify-items: end;
    padding: clamp(24px, 8vw, 96px) 0;
}
.welcome-card {
    position: relative;
    width: min(620px, 100%);
    padding: clamp(28px, 6vw, 58px);
    overflow: hidden;
    border: 1px solid rgba(184, 200, 194, .82);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(247, 250, 249, .86) 64%, rgba(220, 239, 235, .72)),
        rgba(255, 255, 255, .94);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}
.welcome-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.welcome-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(15, 106, 95, .05) 1px, transparent 1px),
        linear-gradient(180deg, rgba(15, 106, 95, .04) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .48;
    pointer-events: none;
}
.welcome-card > * {
    position: relative;
    z-index: 1;
}
.welcome-user {
    display: inline-grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    width: fit-content;
    max-width: min(100%, 470px);
    margin-bottom: 16px;
    padding: 10px 14px 11px;
    border: 1px solid rgba(15, 106, 95, .14);
    border-radius: 16px;
    color: var(--accent-dark);
    background:
        linear-gradient(135deg, rgba(220, 239, 235, .88), rgba(253, 233, 228, .44)),
        rgba(255, 255, 255, .62);
    box-shadow: 0 12px 28px rgba(12, 43, 40, .08);
}
.welcome-user::before {
    content: "";
    grid-row: 1 / span 2;
    width: 10px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 0 4px rgba(15, 106, 95, .08);
}
.welcome-user-label {
    color: #5f706c;
    font-size: 12px;
    font-weight: 760;
    line-height: 1.1;
}
.welcome-user-name {
    min-width: 0;
    max-width: 100%;
    color: var(--accent-dark);
    font-size: clamp(16px, 1.7vw, 19px);
    font-weight: 900;
    line-height: 1.18;
    overflow-wrap: anywhere;
}
.welcome-card h1 {
    max-width: 540px;
    font-size: 50px;
}
@media (min-width: 561px) {
    .welcome-card h1 {
        display: inline-block;
        position: relative;
        padding-bottom: 11px;
        color: transparent;
        background: linear-gradient(180deg, var(--accent-dark), var(--accent) 56%, var(--accent-2-dark));
        -webkit-background-clip: text;
        background-clip: text;
        font-weight: 930;
        filter: drop-shadow(0 1px 1px rgba(12, 43, 40, .08));
    }
    .welcome-card h1::after {
        content: "";
        position: absolute;
        left: 3px;
        bottom: 0;
        width: 78px;
        height: 4px;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--accent), var(--accent-2));
    }
}
.welcome-card p {
    max-width: 500px;
    font-size: 18px;
    color: #4d5b58;
}
.welcome-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    width: fit-content;
    max-width: 100%;
    margin: 14px 0 15px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(8, 116, 67, .78);
    box-shadow: none;
    font-weight: 700;
}
.welcome-status span:last-child {
    min-width: 0;
}
.status-mobile,
.welcome-copy-mobile {
    display: none;
}
.status-ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-right: 6px;
    min-width: 8px;
    width: 8px;
    min-height: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(8, 116, 67, .38);
    color: transparent;
    font-size: 0;
    letter-spacing: 0;
}
.welcome-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}
.welcome-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(15, 106, 95, .16);
    border-radius: 999px;
    color: var(--accent-dark);
    background: rgba(220, 239, 235, .68);
    font-size: 12px;
    font-weight: 850;
}
@media (min-width: 1360px) {
    .welcome-card {
        transform: translateX(clamp(30px, 3.5vw, 56px));
    }
}
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.metrics article,
.panel,
.login-panel {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(213, 224, 220, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.metrics article {
    min-height: 112px;
    padding: 18px;
    display: grid;
    align-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.metrics article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.metrics article:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 106, 95, .36);
    box-shadow: var(--shadow-md);
}
.metrics strong {
    display: block;
    font-size: 42px;
    line-height: 1;
    color: var(--ink);
}
.metrics span,
.muted {
    color: var(--muted);
}
.panel,
.login-panel {
    padding: 20px;
}
.panel {
    overflow-x: auto;
    backdrop-filter: blur(10px);
}
.panel h2 + table,
.panel h2 + pre { margin-top: 12px; }

.grid {
    display: grid;
    gap: 18px;
}
.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-grid {
    display: grid;
    gap: 18px;
}
.dashboard-grid.two {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    align-items: start;
}
.dashboard-panel {
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.panel-head p {
    margin-top: 5px;
}
.compact {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 13px;
}
.document-list,
.activity-list {
    display: grid;
    gap: 10px;
}
.document-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(247, 250, 249, .86);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.document-item:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 106, 95, .28);
    box-shadow: 0 12px 24px rgba(12, 43, 40, .1);
}
.document-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    color: var(--accent-dark);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)),
        var(--accent-soft);
    font-size: 12px;
    font-weight: 850;
}
.document-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.document-title {
    color: var(--ink);
    font-weight: 850;
    overflow-wrap: anywhere;
}
.document-main span,
.document-meta span,
.activity-item span,
.activity-item time {
    color: var(--muted);
}
.document-meta {
    display: grid;
    justify-items: end;
    gap: 7px;
    min-width: 118px;
}
.document-meta strong {
    color: var(--ink);
    white-space: nowrap;
}
.activity-list {
    position: relative;
}
.activity-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.activity-item:last-child {
    border-bottom: 0;
}
.activity-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}
.activity-item div {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.activity-item strong {
    color: var(--ink);
    overflow-wrap: anywhere;
}
.activity-item time {
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
}
.empty-state {
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    background: rgba(247, 250, 249, .7);
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.kv {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(247, 250, 249, .88);
}
.kv small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
}
table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}
th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #4e5160;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    background: #f1f6f4;
}
tr:last-child td { border-bottom: 0; }
tbody tr {
    transition: background .16s ease;
}
tbody tr:hover {
    background: rgba(15, 106, 95, .06);
}
.table-wrap table th,
.table-wrap table td {
    white-space: nowrap;
}
.documents-table a {
    overflow-wrap: anywhere;
}
.documents-empty {
    text-align: center;
    color: var(--muted);
}

form.stack,
.stack {
    display: grid;
    gap: 16px;
}
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid rgba(213, 224, 220, .9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}
.mobile-filter-box {
    margin-bottom: 18px;
}
.filters-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.filters-toggle-button {
    display: none;
}
label {
    display: grid;
    gap: 7px;
    color: #434854;
    font-weight: 750;
}
input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #c3d1cc;
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--ink);
    background: rgba(255, 255, 255, .96);
    box-shadow: inset 0 1px 0 rgba(12, 43, 40, .03);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover,
select:hover,
textarea:hover {
    border-color: #9fb4ad;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 106, 95, .13);
}
textarea {
    min-height: 128px;
    resize: vertical;
}
.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 650;
}
.check input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}
.check-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.check-list.compact {
    gap: 4px;
    margin-top: 0;
}
.check-list.compact .check {
    font-size: 13px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 10px 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(15, 106, 95, .16);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.button:hover,
button:hover {
    color: white;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, var(--accent-dark), #04484d);
    box-shadow: 0 14px 28px rgba(15, 106, 95, .24);
    transform: translateY(-2px);
}
.ghost {
    background: rgba(255, 255, 255, .9);
    border-color: var(--line-strong);
    color: var(--ink);
    box-shadow: 0 8px 18px rgba(12, 43, 40, .08);
}
.ghost:hover {
    background: var(--accent-soft);
    border-color: rgba(15, 106, 95, .3);
    color: var(--accent-dark);
    box-shadow: 0 12px 24px rgba(12, 43, 40, .12);
}
.danger {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, var(--danger), #8f1f16);
}
.danger:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #8f1f16, #6f1711);
    box-shadow: 0 10px 22px rgba(180, 35, 24, .2);
}
.full {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid rgba(15, 106, 95, .14);
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
}
.alert {
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-sm);
}
.alert.success {
    border-color: #b8ebc7;
    background: var(--ok-soft);
    color: var(--ok);
}
.alert.error {
    border-color: #fecaca;
    background: #fff7f7;
    color: var(--danger);
}
.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.login-panel {
    width: min(480px, 100%);
    margin-right: 4vw;
    padding: 34px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .88);
    border-color: rgba(255, 255, 255, .62);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}
.login-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.login-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--sidebar), var(--accent));
    color: white;
    font-weight: 850;
    box-shadow: 0 12px 24px rgba(12, 43, 40, .18);
}
.login-kicker {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
}
.login-panel h1 {
    max-width: 360px;
    font-size: 34px;
}
.login-panel p {
    max-width: 360px;
}
.login-divider {
    height: 1px;
    margin: 22px 0;
    background: linear-gradient(90deg, rgba(15, 106, 95, .28), rgba(238, 141, 119, .28), transparent);
}

pre {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: auto;
    background: #102724;
    color: #eef7f4;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid #244844;
}
.pagination {
    margin-top: 16px;
}
.pagination nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1180px) {
    .topbar-inner {
        flex-wrap: wrap;
    }
    .side-nav {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .metrics {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
    .dashboard-grid.two {
        grid-template-columns: 1fr;
    }
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    body.app-shell:has(.nav-toggle:checked) {
        overflow: hidden;
    }
    .topbar {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        max-height: calc(100dvh - 10px);
        overflow-x: hidden;
        overflow-y: hidden;
        overscroll-behavior: contain;
    }
    .menu-toggle {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 60;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border-radius: var(--radius);
        background: var(--sidebar);
        color: white;
        box-shadow: 0 12px 28px rgba(12, 43, 40, .24);
        cursor: pointer;
        font-size: 25px;
        line-height: 1;
        transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
    }
    .menu-toggle:hover {
        background: var(--accent-dark);
        transform: translateY(-1px);
    }
    .nav-toggle:checked ~ .topbar {
        overflow-y: auto;
        box-shadow: 0 20px 44px rgba(12, 43, 40, .24);
    }
    .topbar-inner {
        width: 100%;
        padding: 14px 76px 14px 16px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .nav-toggle:checked + .menu-toggle {
        background: var(--accent-dark);
    }
    .brand-block {
        display: flex;
        gap: 10px;
        padding: 0;
    }
    .brand {
        min-height: 40px;
        font-size: 21px;
    }
    .side-nav {
        display: none;
        order: initial;
        flex-basis: auto;
        gap: 7px;
        width: 100%;
        overflow-x: hidden;
        padding: 10px 0 0;
        border-top: 1px solid rgba(255, 255, 255, .18);
    }
    .side-nav a {
        min-height: 44px;
        padding: 10px 12px;
        white-space: normal;
    }
    .side-nav a:hover {
        transform: none;
    }
    .side-nav a.active {
        box-shadow: 0 10px 22px rgba(7, 63, 58, .18);
    }
    .nav-toggle:checked ~ .topbar .side-nav {
        display: grid;
    }
    .user-actions {
        display: none;
        margin-left: 0;
        align-items: stretch;
        gap: 10px;
    }
    .nav-toggle:checked ~ .topbar .user-actions {
        display: grid;
        justify-content: stretch;
    }
    .nav-toggle:checked ~ .topbar .logout-form {
        display: block;
        width: fit-content;
        justify-self: start;
    }
    .nav-toggle:checked ~ .topbar .logout-form .ghost.full {
        width: auto;
        min-width: 88px;
        padding-inline: 18px;
    }
    .main {
        width: 100%;
        padding: 90px 20px 28px;
    }
    .welcome-section {
        justify-items: center;
    }
    .auth-main {
        justify-items: center;
        padding: 18px;
        background:
            linear-gradient(180deg, rgba(237, 244, 242, .74), rgba(255, 255, 255, .96)),
            url("/images/integradoc-background.png") center / cover no-repeat,
            var(--bg);
    }
    .login-panel {
        margin-right: 0;
    }
    .metrics,
    .grid.two,
    .dashboard-grid.two,
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .page-head {
        flex-direction: column;
    }
    .actions,
    .actions .button,
    .actions button,
    .page-head > .button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .mobile-filter-box {
        display: grid;
        gap: 10px;
    }
    .filters-toggle-button {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        min-height: 44px;
        width: 100%;
        padding: 11px 14px;
        border: 1px solid rgba(15, 106, 95, .18);
        border-radius: var(--radius);
        color: var(--accent-dark);
        background:
            linear-gradient(135deg, rgba(255, 255, 255, .84), rgba(220, 239, 235, .76)),
            var(--panel);
        box-shadow: var(--shadow-sm);
        cursor: pointer;
        font-weight: 850;
    }
    .filters-toggle:checked + .filters-toggle-button {
        border-color: rgba(15, 106, 95, .34);
        background:
            linear-gradient(135deg, rgba(220, 239, 235, .94), rgba(255, 255, 255, .82)),
            var(--panel);
    }
    .filters-toggle:not(:checked) ~ .documents-filters {
        display: none;
    }
    .documents-filters {
        margin-bottom: 0;
    }
    .documents-table-wrap {
        overflow-x: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .documents-table-wrap table {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }
    .documents-table thead {
        display: none;
    }
    .documents-table tbody,
    .documents-table tr,
    .documents-table td {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    .documents-table tbody {
        display: grid;
        gap: 12px;
    }
    .documents-table tbody tr {
        padding: 14px;
        border: 1px solid rgba(213, 224, 220, .95);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, .94);
        box-shadow: var(--shadow-sm);
    }
    .documents-table tbody tr:hover {
        background: rgba(255, 255, 255, .96);
    }
    .documents-table-wrap .documents-table th,
    .documents-table-wrap .documents-table td {
        white-space: normal;
    }
    .documents-table td {
        display: grid;
        grid-template-columns: 108px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 9px 0;
        border-bottom: 1px solid rgba(213, 224, 220, .72);
        overflow-wrap: anywhere;
    }
    .documents-table td * {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .documents-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }
    .documents-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 850;
        text-transform: uppercase;
    }
    .documents-table td[data-label="Numero"] {
        grid-template-columns: 1fr;
        gap: 5px;
        padding-top: 0;
    }
    .documents-table td[data-label="Numero"]::before {
        display: none;
    }
    .documents-table td[data-label="Numero"] a {
        display: inline-flex;
        width: fit-content;
        max-width: 100%;
        color: var(--ink);
        font-size: 18px;
        font-weight: 850;
    }
    .documents-empty {
        display: block;
        padding: 18px;
        border: 1px dashed var(--line-strong);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, .82);
    }
    .documents-empty::before {
        content: "";
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }
    h1 {
        font-size: 28px;
    }
    h2 {
        font-size: 20px;
    }
    .welcome-card h1 {
        font-size: 39px;
        max-width: 290px;
        font-weight: 840;
        color: transparent;
        background: linear-gradient(180deg, rgba(7, 63, 58, .92), rgba(15, 106, 95, .86) 58%, rgba(198, 107, 88, .80));
        -webkit-background-clip: text;
        background-clip: text;
        filter: drop-shadow(0 1px 2px rgba(255, 255, 255, .42));
    }
    .welcome-card p {
        font-size: 17px;
        max-width: 300px;
        font-weight: 710;
        color: rgba(7, 63, 58, .86);
        text-shadow: 0 1px 2px rgba(255, 255, 255, .48);
    }
    .welcome-section {
        min-height: calc(100vh - 70px);
        align-items: start;
        justify-items: center;
        margin: -16px -14px -22px;
        padding: 108px 16px 32px;
        text-align: center;
        background:
            linear-gradient(180deg, rgba(237, 244, 242, .40), rgba(255, 255, 255, .56) 44%, rgba(237, 244, 242, .70)),
            url("/images/integradoc-background.png") 24% center / cover no-repeat,
            rgba(237, 244, 242, .72);
        box-shadow: none;
    }
    .welcome-card {
        width: 100%;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        display: grid;
        justify-items: center;
    }
    .welcome-card::before {
        display: none;
    }
    .welcome-card::after {
        display: none;
    }
    .welcome-user {
        display: inline-grid;
        max-width: min(100%, 310px);
        margin-bottom: 14px;
        padding: 8px 12px 9px;
        border-color: rgba(15, 106, 95, .1);
        border-radius: 14px;
        background:
            linear-gradient(135deg, rgba(220, 239, 235, .58), rgba(253, 233, 228, .28)),
            rgba(255, 255, 255, .42);
        box-shadow: 0 8px 20px rgba(12, 43, 40, .05);
    }
    .welcome-user::before {
        height: 32px;
        opacity: .72;
        box-shadow: 0 0 0 3px rgba(15, 106, 95, .05);
    }
    .welcome-user-label {
        color: rgba(95, 112, 108, .78);
        font-size: 11px;
        font-weight: 690;
    }
    .welcome-user-name {
        color: rgba(7, 63, 58, .88);
        font-size: 15px;
        font-weight: 790;
    }
    .welcome-status {
        width: fit-content;
        margin: 13px auto 10px;
        padding: 9px 12px;
        border-color: rgba(8, 116, 67, .1);
        background: rgba(223, 247, 232, .56);
        box-shadow: 0 8px 18px rgba(12, 43, 40, .05);
        font-size: 13px;
        font-weight: 730;
        color: rgba(8, 116, 67, .86);
    }
    .status-ok,
    .status-desktop,
    .welcome-copy-desktop {
        display: none;
    }
    .status-mobile,
    .welcome-copy-mobile {
        display: inline;
    }
    .welcome-tags {
        display: none;
    }
    .auth-main {
        padding: 14px;
    }
    .topbar-inner {
        padding-left: 12px;
        padding-right: 68px;
    }
    .brand-block {
        gap: 0;
    }
    .brand {
        min-height: 38px;
        padding-right: 7px;
        font-size: 19px;
    }
    .brand-mark {
        width: 31px;
        height: 31px;
        font-size: 11px;
    }
    .role-chip {
        padding: 4px 8px;
        font-size: 11px;
    }
    .main {
        padding: 86px 14px 22px;
    }
    .app-brand-mark {
        left: 14px;
        bottom: 14px;
        z-index: 2;
        width: 118px;
        max-width: 38vw;
        opacity: .13;
        filter: grayscale(.2) saturate(.7);
    }
    .panel,
    .login-panel {
        padding: 16px;
    }
    .page-head {
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-head p {
        font-size: 14px;
    }
    .panel-head,
    .document-item,
    .activity-item {
        grid-template-columns: 1fr;
    }
    .panel-head {
        display: grid;
        gap: 10px;
        margin-bottom: 12px;
    }
    .panel-head .button {
        width: fit-content;
        min-height: 34px;
        padding: 8px 12px;
    }
    .document-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        justify-items: start;
        width: 100%;
        gap: 8px;
        min-width: 0;
    }
    .document-meta strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .document-item {
        gap: 9px;
        padding: 12px;
    }
    .document-main span,
    .document-meta span,
    .activity-item span,
    .activity-item time {
        font-size: 13px;
    }
    .dashboard-grid {
        gap: 14px;
    }
    .document-list,
    .activity-list {
        gap: 10px;
    }
    .activity-item {
        gap: 8px;
        padding: 10px 0;
    }
    .activity-dot,
    .document-icon {
        display: none;
    }
    .activity-item time {
        text-align: left;
        white-space: normal;
    }
    .login-panel {
        padding-top: 24px;
    }
    .login-panel h1 {
        font-size: 28px;
    }
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }
    .metrics article {
        min-height: 86px;
        padding: 14px 14px 14px 16px;
    }
    .metrics article:nth-child(5) {
        grid-column: 1 / -1;
        min-height: 74px;
    }
    .metrics strong {
        font-size: 30px;
    }
    .metrics span {
        font-size: 12px;
        font-weight: 720;
    }
    .filters {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .table-wrap:not(.documents-table-wrap) {
        border-radius: var(--radius);
    }
    table:not(.documents-table) {
        min-width: 680px;
    }
    th,
    td {
        padding: 11px 12px;
    }
}

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