:root {
    --green-950: #0a2f1d;
    --green-900: #104b2c;
    --green-800: #166534;
    --green-700: #198344;
    --green-100: #dcf4e4;
    --green-50: #f0faf3;
    --red-950: #451017;
    --red-900: #721824;
    --red-800: #9f1d2a;
    --red-700: #bd2635;
    --red-100: #fde3e5;
    --red-50: #fff4f5;
    --ink: #162019;
    --muted: #68736c;
    --line: #dce4df;
    --soft: #f4f7f5;
    --white: #ffffff;
    --warning: #b26405;
    --warning-bg: #fff5da;
    --danger: #b4232d;
    --danger-bg: #fff0f1;
    --success: #15703b;
    --success-bg: #e9f8ef;
    --shadow-sm: 0 2px 9px rgba(15, 37, 23, 0.06);
    --shadow-md: 0 16px 44px rgba(17, 36, 23, 0.11);
    --radius-sm: 9px;
    --radius: 15px;
    --radius-lg: 24px;
    --sidebar-width: 272px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(26, 125, 68, 0.24);
    outline-offset: 2px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.18;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.28rem, 2vw, 1.75rem);
}

h3 {
    font-size: 1rem;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--green-700);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.theme-admin .eyebrow,
.theme-admin-public .eyebrow {
    color: var(--red-700);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--green-950);
}

.brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand strong {
    font-size: 1.22rem;
    letter-spacing: -0.03em;
}

.brand small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.69rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: var(--white);
    background: var(--green-800);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-light,
.brand-light small {
    color: var(--white);
}

.brand-light small {
    opacity: 0.63;
}

.brand-light .brand-mark {
    color: var(--green-950);
    background: var(--white);
}

.theme-admin .brand-light .brand-mark,
.theme-admin-public .brand-light .brand-mark {
    color: var(--red-900);
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1.2;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button-primary {
    color: var(--white);
    background: var(--green-800);
    box-shadow: 0 6px 18px rgba(22, 101, 52, 0.18);
}

.button-primary:hover {
    background: var(--green-900);
}

.button-admin {
    color: var(--white);
    background: var(--red-800);
    box-shadow: 0 6px 18px rgba(159, 29, 42, 0.18);
}

.button-admin:hover {
    background: var(--red-900);
}

.button-light {
    color: var(--green-900);
    background: var(--white);
}

.button-outline {
    color: var(--green-800);
    border-color: #a8cdb5;
    background: var(--white);
}

.button-outline:hover {
    border-color: var(--green-800);
    background: var(--green-50);
}

.button-outline-admin {
    color: var(--red-800);
    border-color: #deb0b5;
    background: var(--white);
}

.button-outline-admin:hover {
    border-color: var(--red-800);
    background: var(--red-50);
}

.button-ghost {
    color: var(--muted);
    border-color: var(--line);
    background: transparent;
}

.button-ghost:hover {
    color: var(--ink);
    background: var(--white);
}

.button-block {
    width: 100%;
}

.button-small {
    min-height: 36px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 0.82rem;
}

.button-large {
    min-height: 52px;
}

.button-group,
.form-actions,
.document-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-button {
    padding: 0;
    border: 0;
    cursor: pointer;
    color: var(--green-800);
    background: transparent;
    font-weight: 700;
}

.link-button-light {
    color: rgba(255, 255, 255, 0.72);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 11px;
    font-weight: 650;
}

.alert a {
    text-decoration: underline;
}

.alert-success {
    color: var(--success);
    border-color: #a8dab9;
    background: var(--success-bg);
}

.alert-error {
    color: var(--danger);
    border-color: #efb8bd;
    background: var(--danger-bg);
}

.alert-warning {
    color: #8a4c00;
    border-color: #e7c37a;
    background: var(--warning-bg);
}

.alert-info {
    color: #245a7f;
    border-color: #b3d2e7;
    background: #edf7fd;
}

/* Authentication */

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(380px, 0.95fr) minmax(460px, 1.05fr);
    background: var(--white);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(30px, 5vw, 70px);
    color: var(--white);
    background:
        radial-gradient(circle at 80% 18%, rgba(106, 211, 138, 0.19), transparent 26%),
        radial-gradient(circle at 10% 80%, rgba(70, 173, 107, 0.14), transparent 30%),
        linear-gradient(145deg, var(--green-950), var(--green-800));
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
}

.auth-brand-panel::before {
    width: 430px;
    height: 430px;
    top: -220px;
    right: -160px;
}

.auth-brand-panel::after {
    width: 260px;
    height: 260px;
    right: 20px;
    bottom: -170px;
}

.auth-brand-admin {
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 123, 131, 0.16), transparent 26%),
        radial-gradient(circle at 10% 80%, rgba(230, 80, 92, 0.13), transparent 30%),
        linear-gradient(145deg, var(--red-950), var(--red-800));
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin-block: 90px;
}

.auth-brand-copy .eyebrow {
    color: #b9f2c9;
}

.auth-brand-admin .auth-brand-copy .eyebrow {
    color: #ffc8cd;
}

.auth-brand-copy h1 {
    max-width: 600px;
    margin-bottom: 22px;
    font-size: clamp(2.3rem, 4.5vw, 4.7rem);
}

.auth-brand-copy > p:not(.eyebrow) {
    max-width: 590px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 1.05rem;
}

.trust-list {
    display: grid;
    margin: 32px 0 0;
    padding: 0;
    gap: 13px;
    list-style: none;
}

.trust-list li {
    position: relative;
    padding-left: 30px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 650;
}

.trust-list li::before {
    position: absolute;
    display: grid;
    width: 19px;
    height: 19px;
    left: 0;
    top: 2px;
    place-items: center;
    border-radius: 50%;
    color: var(--green-950);
    background: #b9f2c9;
    content: "✓";
    font-size: 0.72rem;
    font-weight: 900;
}

.auth-brand-admin .trust-list li::before {
    color: var(--red-950);
    background: #ffc8cd;
}

.auth-brand-foot {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.73rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-form-panel {
    display: grid;
    min-height: 100vh;
    padding: 48px;
    place-items: center;
    background:
        linear-gradient(rgba(22, 101, 52, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 101, 52, 0.025) 1px, transparent 1px),
        var(--white);
    background-size: 34px 34px;
}

.auth-card {
    width: min(100%, 470px);
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h2 {
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.auth-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.auth-switch {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-switch a,
.form-inline-between a {
    color: var(--green-800);
    font-weight: 750;
}

.theme-admin-public .auth-switch a {
    color: var(--red-800);
}

/* Forms */

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

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

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

.field > span:first-child,
.filter-bar label > span {
    color: #2c3730;
    font-size: 0.79rem;
    font-weight: 800;
}

.field small,
.filter-bar small {
    color: var(--muted);
    font-size: 0.75rem;
}

.field input,
.field select,
.field textarea,
.filter-bar input,
.filter-bar select,
.input-suffix input {
    width: 100%;
    min-height: 45px;
    padding: 10px 13px;
    border: 1px solid #cad5ce;
    border-radius: 10px;
    color: var(--ink);
    background: var(--white);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--green-700);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(25, 131, 68, 0.1);
}

.theme-admin .field input:focus,
.theme-admin .field select:focus,
.theme-admin .field textarea:focus,
.theme-admin .filter-bar input:focus,
.theme-admin .filter-bar select:focus,
.theme-admin-public .field input:focus {
    border-color: var(--red-700);
    box-shadow: 0 0 0 4px rgba(189, 38, 53, 0.09);
}

.field input:disabled {
    color: #58635d;
    border-color: #e0e6e2;
    background: #f1f4f2;
    cursor: not-allowed;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 82px;
}

.password-field button {
    position: absolute;
    top: 50%;
    right: 9px;
    padding: 5px 7px;
    transform: translateY(-50%);
    border: 0;
    color: var(--green-800);
    background: transparent;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
}

.theme-admin-public .password-field button {
    color: var(--red-800);
}

.otp-input {
    height: 60px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 850;
    letter-spacing: 0.55em;
}

.read-only-identity {
    padding: 13px 15px;
    border: 1px solid #b7d5c0;
    border-radius: 11px;
    background: var(--green-50);
}

.read-only-identity span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
}

.form-inline-between {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.switch-row {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfcfb;
    cursor: pointer;
}

.switch-row input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--red-800);
}

.switch-row span {
    display: grid;
    gap: 3px;
}

.switch-row small {
    color: var(--muted);
}

.switch-warning {
    border-color: #ecd4a0;
    background: #fffaf0;
}

.upload-zone {
    position: relative;
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 28px;
    border: 2px dashed #d2a3a8;
    border-radius: 15px;
    text-align: center;
    background: var(--red-50);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.upload-zone:hover {
    border-color: var(--red-700);
    background: #ffedef;
}

.upload-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.upload-zone strong {
    margin-top: 12px;
    font-size: 1.05rem;
}

.upload-zone small {
    margin-top: 5px;
    color: var(--muted);
}

.upload-symbol,
.document-icon,
.document-illustration {
    display: grid;
    place-items: center;
    color: var(--red-800);
    border: 1px solid #efc7cb;
    border-radius: 10px;
    background: var(--white);
    font-size: 0.72rem;
    font-weight: 900;
}

.upload-symbol {
    width: 54px;
    height: 66px;
    box-shadow: var(--shadow-sm);
}

.upload-zone-large {
    min-height: 260px;
}

.input-suffix {
    display: flex;
    align-items: center;
}

.input-suffix input {
    border-radius: 10px 0 0 10px;
}

.input-suffix b {
    display: grid;
    min-height: 45px;
    padding-inline: 15px;
    place-items: center;
    border: 1px solid #cad5ce;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    color: var(--muted);
    background: var(--soft);
}

/* Employee */

.employee-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(20, 81, 43, 0.1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
}

.header-inner {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
}

.employee-nav {
    display: flex;
    align-items: center;
    gap: 7px;
}

.employee-nav > a {
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 700;
}

.employee-nav > a:hover,
.employee-nav > a.active {
    color: var(--green-800);
    background: var(--green-50);
}

.employee-main {
    min-height: calc(100vh - 150px);
    padding: 34px 0 70px;
}

.employee-hero {
    position: relative;
    display: grid;
    min-height: 330px;
    align-items: center;
    grid-template-columns: 1.45fr 0.55fr;
    overflow: hidden;
    padding: clamp(28px, 5vw, 58px);
    border-radius: var(--radius-lg);
    color: var(--white);
    background:
        radial-gradient(circle at 90% 10%, rgba(146, 237, 170, 0.23), transparent 25%),
        linear-gradient(135deg, var(--green-950), var(--green-800));
    box-shadow: 0 18px 48px rgba(16, 75, 44, 0.18);
}

.employee-hero::after {
    position: absolute;
    width: 340px;
    height: 340px;
    right: -180px;
    bottom: -220px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    content: "";
}

.employee-hero > div {
    position: relative;
    z-index: 1;
}

.employee-hero .eyebrow {
    color: #b9f2c9;
}

.employee-hero h1 {
    max-width: 660px;
    margin-bottom: 14px;
}

.employee-hero > div:first-child > p:not(.eyebrow) {
    max-width: 660px;
    margin-bottom: 26px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.04rem;
}

.hero-stat {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(8px);
}

.hero-stat-number {
    font-size: 4rem;
    font-weight: 850;
    line-height: 1;
}

.hero-stat small {
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.6);
}

.section-heading,
.page-intro,
.page-actions,
.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading {
    margin: 48px 0 20px;
}

.section-heading h2,
.page-intro h1,
.panel-heading h2 {
    margin-bottom: 0;
}

.section-heading > a,
.panel-heading > a {
    color: var(--green-800);
    font-weight: 750;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 17px;
}

.document-card {
    display: grid;
    padding: 21px;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.document-icon {
    width: 42px;
    height: 50px;
}

.document-card-copy h3,
.document-row-main h2 {
    margin: 4px 0;
}

.document-card-copy p,
.document-row-main p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.document-period {
    color: var(--green-700);
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.document-card .document-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
}

.security-note {
    display: flex;
    margin-top: 32px;
    align-items: center;
    padding: 22px 25px;
    gap: 16px;
    border: 1px solid #bddbc7;
    border-radius: var(--radius);
    background: var(--green-50);
}

.security-shield {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--green-800);
    font-weight: 900;
}

.security-note h3 {
    margin-bottom: 4px;
}

.security-note p {
    margin: 0;
    color: var(--muted);
}

.page-intro {
    margin-bottom: 25px;
}

.page-intro h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.page-intro p:last-child,
.page-description {
    margin: 8px 0 0;
    color: var(--muted);
}

.filter-bar {
    display: flex;
    align-items: flex-end;
    padding: 18px;
    gap: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.filter-bar label {
    display: grid;
    min-width: 180px;
    gap: 6px;
}

.result-summary,
.table-summary {
    display: flex;
    margin: 22px 0 12px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.86rem;
}

.result-summary strong,
.table-summary strong {
    color: var(--ink);
}

.document-list {
    display: grid;
    gap: 12px;
}

.document-row {
    display: grid;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 19px 22px;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.document-row .document-icon {
    width: 48px;
    height: 58px;
}

.employee-footer {
    padding: 23px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: var(--white);
    font-size: 0.78rem;
}

.employee-footer .container {
    display: flex;
    justify-content: space-between;
}

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

/* Admin shell */

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

.sidebar {
    position: fixed;
    z-index: 50;
    display: flex;
    width: var(--sidebar-width);
    height: 100vh;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 18px 18px;
    color: var(--white);
    background:
        radial-gradient(circle at 30% 5%, rgba(255, 135, 143, 0.14), transparent 23%),
        linear-gradient(180deg, var(--red-950), #671620 75%, #55131c);
}

.sidebar .brand {
    margin: 0 10px 28px;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 11px 12px;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 680;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.nav-symbol {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.66);
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.58rem;
    font-weight: 900;
}

.sidebar-nav a.active .nav-symbol {
    color: var(--red-950);
    background: var(--white);
}

.nav-divider {
    height: 1px;
    margin: 10px 12px;
    background: rgba(255, 255, 255, 0.11);
}

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

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

.sidebar-user > span:last-child,
.identity-cell > span:last-child,
.filename-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.sidebar-user strong,
.sidebar-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user small {
    color: rgba(255, 255, 255, 0.54);
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    color: var(--red-950);
    background: #ffd8dc;
    font-size: 0.72rem;
    font-weight: 900;
}

.avatar-admin {
    color: var(--red-900);
    background: var(--red-100);
}

.app-main {
    min-width: 0;
    grid-column: 2;
}

.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: space-between;
    padding: 16px clamp(24px, 4vw, 52px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
}

.topbar h1 {
    margin: 0;
    font-size: 1.7rem;
}

.topbar .eyebrow {
    margin-bottom: 2px;
}

.topbar-profile {
    display: flex;
    align-items: center;
    padding: 8px 11px;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2baa5d;
    box-shadow: 0 0 0 3px #dcf7e6;
}

.menu-button {
    display: none;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    background: var(--white);
    cursor: pointer;
    font-weight: 750;
}

.page-content {
    width: min(100%, 1640px);
    margin-inline: auto;
    padding: 30px clamp(24px, 4vw, 52px) 70px;
}

.page-actions {
    margin-bottom: 20px;
}

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

.form-panel,
.guide-panel,
.settings-panel {
    padding: 25px;
}

.panel-heading {
    margin-bottom: 21px;
}

.panel-heading .eyebrow {
    margin-bottom: 5px;
}

.panel-heading h2 {
    font-size: 1.3rem;
}

.panel-empty {
    padding: 32px 20px;
    color: var(--muted);
    text-align: center;
}

.panel-empty-success {
    color: var(--success);
}

.admin-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 23px;
    padding: 24px 28px;
    border: 1px solid #ead4d6;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 88% 30%, rgba(190, 38, 53, 0.08), transparent 22%),
        var(--white);
}

.admin-welcome h2 {
    margin-bottom: 6px;
}

.admin-welcome p:last-child {
    margin: 0;
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.metric-card {
    display: flex;
    min-height: 155px;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.metric-card strong {
    margin: 10px 0 7px;
    font-size: 2.3rem;
    line-height: 1;
}

.metric-card a,
.metric-foot {
    margin-top: auto;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.metric-card a:hover {
    color: var(--red-800);
}

.metric-label {
    color: #59655e;
    font-size: 0.77rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-alert {
    border-color: #e8b9bd;
    background: var(--red-50);
}

.metric-alert strong {
    color: var(--red-800);
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    margin-top: 16px;
    gap: 16px;
}

.admin-dashboard-grid .panel {
    padding: 23px;
}

.timeline-list {
    display: grid;
}

.timeline-item {
    display: grid;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px 5px;
    gap: 12px;
    border-top: 1px solid #edf1ee;
}

.timeline-item:first-child {
    border-top: 0;
}

.timeline-status {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #a5afa8;
}

.status-completed {
    background: #2ba95f;
}

.status-failed {
    background: var(--red-700);
}

.status-processing {
    background: #d18a21;
}

.timeline-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.timeline-main small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-count {
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--red-800);
    background: var(--red-50);
    font-size: 0.75rem;
    font-weight: 850;
}

.bar-list {
    display: grid;
    gap: 14px;
}

.bar-item {
    display: grid;
    align-items: center;
    grid-template-columns: 120px minmax(70px, 1fr) 32px;
    gap: 10px;
    font-size: 0.79rem;
}

.bar-track,
.bar-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 99px;
    background: #f0e4e5;
}

.bar-progress {
    width: 100%;
    border: 0;
    appearance: none;
}

.bar-progress::-webkit-progress-bar {
    border-radius: 99px;
    background: #f0e4e5;
}

.bar-progress::-webkit-progress-value {
    border-radius: 99px;
    background: linear-gradient(90deg, var(--red-900), #da4b58);
}

.bar-progress::-moz-progress-bar {
    border-radius: 99px;
    background: linear-gradient(90deg, var(--red-900), #da4b58);
}

.latest-import {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr auto auto;
    margin-top: 16px;
    padding: 22px 25px;
    gap: 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.latest-import h2 {
    margin: 9px 0 4px;
}

.latest-import p {
    margin: 0;
    color: var(--muted);
}

.latest-import-stats {
    display: flex;
    gap: 24px;
}

.latest-import-stats span {
    display: flex;
    flex-direction: column;
    color: var(--muted);
    font-size: 0.72rem;
}

.latest-import-stats strong {
    color: var(--ink);
    font-size: 1.2rem;
}

/* Tables and admin modules */

.table-panel {
    overflow: hidden;
}

.table-panel > .panel-heading {
    padding: 23px 23px 0;
}

.table-panel > .table-summary {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfb;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 16px;
    border-bottom: 1px solid #e8eeea;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #657069;
    background: #f8faf9;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    font-size: 0.83rem;
}

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

tbody tr:hover td {
    background: #fdfefe;
}

.identity-cell {
    display: flex;
    min-width: 210px;
    align-items: center;
    gap: 10px;
}

.identity-cell small,
.filename-cell small,
.table-subtext {
    color: var(--muted);
    font-size: 0.71rem;
}

.filename-cell {
    max-width: 260px;
}

.filename-cell span,
.filename-cell {
    overflow-wrap: anywhere;
}

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

.inline-form {
    display: inline;
    margin-left: 8px;
}

.table-link {
    padding: 0;
    border: 0;
    color: var(--red-800);
    background: transparent;
    cursor: pointer;
    font-size: 0.79rem;
    font-weight: 780;
}

.table-link + .table-link {
    margin-left: 8px;
}

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

.badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 850;
    white-space: nowrap;
}

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

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

.badge-warning {
    color: #8b520a;
    background: var(--warning-bg);
}

.badge-neutral {
    color: #5c6660;
    background: #edf1ef;
}

.admin-filter {
    margin-bottom: 18px;
}

.admin-filter .search-field {
    min-width: min(360px, 100%);
    flex: 1;
}

.breadcrumb {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.8rem;
}

.breadcrumb a {
    color: var(--red-800);
    font-weight: 750;
}

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

.guide-panel {
    max-width: 480px;
}

.guide-panel h2 {
    margin-bottom: 18px;
}

.check-list {
    display: grid;
    padding: 0;
    gap: 12px;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 27px;
}

.check-list li::before {
    position: absolute;
    display: grid;
    width: 18px;
    height: 18px;
    left: 0;
    top: 2px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--red-800);
    content: "✓";
    font-size: 0.65rem;
    font-weight: 900;
}

.help-note {
    margin: 20px 0 0;
    padding: 13px;
    border-radius: 10px;
    color: var(--muted);
    background: var(--soft);
    font-size: 0.8rem;
}

.warning-note {
    color: #7d4d0e;
    border: 1px solid #ecd5a6;
    background: #fff9eb;
}

.admin-two-columns {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

.report-panel {
    margin-top: 18px;
    padding: 22px;
}

.report-metrics {
    display: flex;
    gap: 22px;
}

.report-metrics span {
    display: flex;
    flex-direction: column;
    color: var(--muted);
}

.report-metrics strong {
    color: var(--ink);
    font-size: 1.5rem;
}

.error-list {
    margin-bottom: 0;
    color: var(--danger);
}

.import-layout {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    gap: 20px;
}

.import-layout .form-panel {
    max-width: none;
}

.secure-pill {
    padding: 6px 10px;
    border-radius: 99px;
    color: var(--success);
    background: var(--success-bg);
    font-size: 0.69rem;
    font-weight: 850;
}

.process-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.72rem;
}

.process-preview span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.process-preview b {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--red-800);
}

.process-preview i {
    height: 1px;
    flex: 1;
    margin-inline: 5px;
    background: #dfc4c6;
}

.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.report-header h2 {
    margin: 10px 0 5px;
}

.report-header p {
    margin: 0;
    color: var(--muted);
}

.report-metrics-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 18px;
    gap: 12px;
}

.report-metrics-cards span {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.report-metrics-cards .report-success {
    border-color: #b5d9c1;
    background: var(--success-bg);
}

.report-metrics-cards .report-danger {
    border-color: #e7b7bc;
    background: var(--danger-bg);
}

.report-header + .report-metrics,
.report-metrics-cards + .panel,
.panel + .table-panel {
    margin-top: 18px;
}

.tab-nav {
    display: flex;
    margin-bottom: 17px;
    overflow-x: auto;
    gap: 4px;
    border-bottom: 1px solid var(--line);
}

.tab-nav a {
    padding: 10px 15px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 750;
    white-space: nowrap;
}

.tab-nav a:hover,
.tab-nav a.active {
    color: var(--red-800);
    border-color: var(--red-800);
}

.resolve-layout {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    gap: 20px;
}

.resolve-layout > .panel {
    padding: 24px;
}

.document-preview-card {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--soft);
}

.document-preview-card p {
    margin: 4px 0 12px;
    color: var(--muted);
}

.large-document-icon {
    width: 58px;
    height: 70px;
    flex: 0 0 58px;
}

.extracted-text {
    margin-top: 16px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.extracted-text summary {
    cursor: pointer;
    color: var(--red-800);
    font-weight: 750;
}

.extracted-text pre {
    max-height: 260px;
    overflow: auto;
    margin: 13px 0 0;
    padding: 13px;
    color: #445049;
    background: #f3f5f4;
    font: 0.72rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
}

.secondary-danger-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.admin-management-grid {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.5fr);
    gap: 20px;
}

.sticky-panel {
    position: sticky;
    top: 112px;
}

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

.admin-security-note {
    max-width: 760px;
    border-color: #e3c0c4;
    background: var(--red-50);
}

.admin-security-note .security-shield {
    background: var(--red-800);
}

.details-cell {
    display: block;
    max-width: 330px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    display: flex;
    min-height: 330px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
    border: 1px dashed #cbd6cf;
    border-radius: var(--radius);
    text-align: center;
    background: var(--white);
}

.fatal-shell {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
    background: var(--soft);
}

.fatal-shell .empty-state {
    width: min(100%, 620px);
    box-shadow: var(--shadow-md);
}

.compact-empty {
    min-height: 260px;
}

.empty-state h2,
.empty-state h3 {
    margin: 15px 0 7px;
}

.empty-state p {
    max-width: 520px;
    color: var(--muted);
}

.empty-code {
    color: var(--green-800);
    font-size: 3rem;
    font-weight: 900;
}

.document-illustration {
    width: 68px;
    height: 82px;
}

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

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

    .admin-management-grid {
        grid-template-columns: 1fr;
    }

    .sticky-panel {
        position: static;
        max-width: 760px;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        min-height: auto;
        padding: 28px 34px 42px;
    }

    .auth-brand-copy {
        margin: 50px 0 0;
    }

    .auth-brand-copy h1 {
        max-width: 780px;
        font-size: 2.5rem;
    }

    .auth-brand-foot,
    .trust-list {
        display: none;
    }

    .auth-form-panel {
        min-height: auto;
        padding: 55px 28px 80px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: var(--shadow-md);
    }

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

    .app-main {
        grid-column: auto;
    }

    .menu-button {
        display: inline-flex;
    }

    .topbar {
        justify-content: flex-start;
        gap: 16px;
    }

    .topbar-profile {
        margin-left: auto;
    }

    .admin-dashboard-grid,
    .import-layout,
    .resolve-layout,
    .admin-two-columns {
        grid-template-columns: 1fr;
    }

    .guide-panel {
        max-width: none;
    }

    .employee-hero {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-stat {
        min-height: 145px;
        align-items: flex-start;
    }

    .latest-import {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .filter-bar label {
        flex: 1;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100% - 28px, 1180px);
    }

    .employee-menu-button {
        display: inline-flex;
    }

    .employee-nav {
        position: absolute;
        display: none;
        top: 70px;
        right: 14px;
        left: 14px;
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 13px;
        background: var(--white);
        box-shadow: var(--shadow-md);
    }

    .employee-nav.open {
        display: flex;
    }

    .employee-nav form .button {
        width: 100%;
    }

    .employee-main {
        padding-top: 20px;
    }

    .employee-hero {
        min-height: auto;
        padding: 30px 25px;
    }

    .employee-hero h1 {
        font-size: 2.3rem;
    }

    .document-grid,
    .two-column-grid,
    .form-grid,
    .report-metrics-cards {
        grid-template-columns: 1fr;
    }

    .document-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .document-row .document-actions {
        grid-column: 1 / -1;
    }

    .section-heading,
    .page-actions,
    .report-header,
    .admin-welcome {
        align-items: stretch;
        flex-direction: column;
    }

    .employee-footer .container {
        flex-direction: column;
        gap: 5px;
    }

    .page-content {
        padding: 22px 14px 60px;
    }

    .topbar {
        min-height: 74px;
        padding: 12px 14px;
    }

    .topbar .eyebrow,
    .topbar-profile {
        display: none;
    }

    .topbar h1 {
        font-size: 1.25rem;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        min-height: 135px;
        padding: 16px;
    }

    .metric-card strong {
        font-size: 1.9rem;
    }

    .bar-item {
        grid-template-columns: 95px minmax(60px, 1fr) 28px;
    }

    .latest-import-stats,
    .report-metrics {
        flex-wrap: wrap;
    }

    .process-preview i {
        display: none;
    }

    .process-preview {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .form-actions,
    .button-group {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .button,
    .button-group .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-brand-panel {
        padding: 22px 22px 32px;
    }

    .auth-brand-copy {
        margin-top: 34px;
    }

    .auth-brand-copy h1 {
        font-size: 2rem;
    }

    .auth-form-panel {
        padding: 45px 20px 70px;
    }

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

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

    .document-card .document-actions {
        display: grid;
    }

    .filter-bar label,
    .filter-bar .search-field {
        min-width: 100%;
    }

    .filter-bar .button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
