:root {
    --ink: #444250;
    --muted: #a0a1a2;
    --primary: #009bde;
    --warning: #ff6c0c;
    --accent: #8e004a;
    --surface: #ffffff;
    --surface-soft: #f5f6f8;
    --surface-strong: #eef2f7;
    --border: rgba(68, 66, 80, 0.12);
    --shadow: 0 18px 44px rgba(68, 66, 80, 0.08);
    --shadow-soft: 0 10px 24px rgba(68, 66, 80, 0.06);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --max-width: 1440px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(0, 155, 222, 0.08), transparent 30%),
        linear-gradient(180deg, #fbfcfe 0%, #f2f4f8 100%);
}

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

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

img {
    max-width: 100%;
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.app-body,
.auth-body {
    min-height: 100vh;
}

.shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid rgba(68, 66, 80, 0.08);
    backdrop-filter: blur(18px);
}

.sidebar-inner {
    display: flex;
    height: 100%;
    flex-direction: column;
    gap: 28px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--radius-md);
    background: transparent;
}

.sidebar-brand img {
    width: min(100%, 228px);
    height: auto;
    object-fit: contain;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

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

.sidebar-nav a {
    padding: 13px 16px;
    border-radius: 16px;
    color: rgba(68, 66, 80, 0.78);
    font-weight: 600;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
    background: rgba(0, 155, 222, 0.12);
    color: var(--ink);
    transform: translateX(3px);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(68, 66, 80, 0.04);
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.sidebar-footer strong {
    display: block;
    margin-top: 8px;
    color: var(--ink);
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 32px;
    background: rgba(242, 244, 248, 0.84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(68, 66, 80, 0.06);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--ink);
    border-radius: 999px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
}

.user-pill-copy {
    display: grid;
    justify-items: end;
}

.user-pill-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.page {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-copy,
.panel-copy,
.helper-copy,
.empty-copy {
    color: rgba(68, 66, 80, 0.74);
    line-height: 1.7;
}

.hero-band,
.panel,
.metric-panel,
.document-card,
.table-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-band {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 28px;
    border-radius: 30px;
}

.hero-band h2 {
    margin: 0;
    max-width: 18ch;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1.05;
}

.hero-actions,
.hero-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-stats div {
    min-width: 110px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(68, 66, 80, 0.04);
}

.hero-stats strong {
    display: block;
    font-size: 1.35rem;
}

.hero-stats span {
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-grid,
.analytics-grid,
.content-grid,
.split-workspace {
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

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

.metric-grid-user {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-panel {
    display: block;
    padding: 20px;
    border-radius: 24px;
}

.metric-panel-link {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-panel-link:hover,
.metric-panel-link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(68, 66, 80, 0.12);
    border-color: rgba(0, 155, 222, 0.22);
}

.metric-panel-link:focus-visible {
    outline: 0;
}

.metric-panel span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.metric-panel strong {
    display: block;
    margin: 10px 0 8px;
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
    line-height: 1;
}

.metric-panel p {
    margin: 0;
    color: rgba(68, 66, 80, 0.72);
    line-height: 1.6;
}

.metric-panel-alert strong {
    color: var(--warning);
}

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

.panel,
.document-card,
.table-card {
    padding: 24px;
    border-radius: 26px;
}

.panel-wide {
    grid-column: 1 / -1;
}

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

.panel-header h3,
.document-card h3,
.table-card strong,
.auth-form-panel h2 {
    margin: 0;
    font-size: 1.25rem;
}

.expandable-panel {
    padding: 0;
    overflow: hidden;
}

.expandable-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    cursor: pointer;
    list-style: none;
}

.expandable-summary::-webkit-details-marker {
    display: none;
}

.expandable-summary::marker {
    content: '';
}

.expandable-summary-copy {
    min-width: 0;
}

.expandable-summary-copy h3,
.expandable-summary-copy strong {
    display: block;
    margin: 0;
}

.expandable-summary-copy .panel-copy,
.expandable-summary-copy > span {
    display: block;
    margin: 6px 0 0;
    color: rgba(68, 66, 80, 0.72);
    line-height: 1.6;
}

.expandable-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.expandable-chevron {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(0, 155, 222, 0.12);
}

.expandable-chevron::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.18s ease;
}

.when-open {
    display: none;
}

.expandable-panel[open] .when-closed,
.expandable-inline[open] .when-closed {
    display: none;
}

.expandable-panel[open] .when-open,
.expandable-inline[open] .when-open {
    display: inline;
}

.expandable-panel[open] .expandable-chevron::before,
.expandable-inline[open] .expandable-chevron::before {
    transform: rotate(45deg);
}

.expandable-body {
    padding: 20px 24px 24px;
    border-top: 1px solid rgba(68, 66, 80, 0.08);
}

.panel-copy-spaced {
    margin: 0 0 16px;
}

.expandable-inline {
    margin: 0 0 18px;
    border-radius: 20px;
    background: rgba(68, 66, 80, 0.04);
}

.expandable-inline .expandable-summary {
    padding: 16px 18px;
}

.expandable-inline .expandable-body {
    padding: 0 18px 18px;
    border-top: 0;
}

.chart-canvas {
    width: 100%;
    min-height: 260px;
    max-height: 320px;
}

.chart-canvas-wide {
    min-height: 300px;
}

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

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

.stack-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(68, 66, 80, 0.08);
}

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

.stack-row p,
.table-card p,
.document-subline {
    margin: 4px 0 0;
    color: rgba(68, 66, 80, 0.68);
}

.split-workspace {
    grid-template-columns: minmax(320px, 430px) 1fr;
    align-items: start;
}

.split-workspace-wide {
    grid-template-columns: minmax(320px, 440px) 1fr;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

.form-grid-tight {
    gap: 14px;
}

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

.field span {
    font-weight: 700;
    font-size: 0.92rem;
}

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

.input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(245, 246, 248, 0.82);
    color: var(--ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.input:focus {
    outline: none;
    border-color: rgba(0, 155, 222, 0.45);
    box-shadow: 0 0 0 4px rgba(0, 155, 222, 0.12);
    transform: translateY(-1px);
}

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

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 32px;
    font-weight: 600;
}

.checkbox-field-compact {
    padding-top: 0;
}

.radio-card-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(245, 246, 248, 0.82);
    font-weight: 800;
    cursor: pointer;
}

.radio-card input {
    width: auto;
    accent-color: var(--primary);
}

.panel-divider {
    height: 1px;
    margin: 26px 0;
    background: rgba(68, 66, 80, 0.1);
}

.panel-header-compact {
    margin-bottom: 12px;
}

.user-filter-toolbar {
    align-items: stretch;
}

.user-filter-toolbar .input {
    flex: 1 1 280px;
}

.segmented-filter {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border-radius: 16px;
    background: rgba(68, 66, 80, 0.06);
}

.segmented-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 13px;
    border-radius: 12px;
    color: rgba(68, 66, 80, 0.72);
    font-weight: 800;
}

.segmented-filter a.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 18px;
    border: 0;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #30b4eb);
    box-shadow: 0 16px 32px rgba(0, 155, 222, 0.22);
}

.btn-secondary {
    color: var(--ink);
    background: rgba(68, 66, 80, 0.08);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #bf1168);
    box-shadow: 0 16px 32px rgba(142, 0, 74, 0.18);
}

.btn-success {
    color: #fff;
    background: linear-gradient(135deg, #0f9f6e, #22c58b);
    box-shadow: 0 16px 32px rgba(15, 159, 110, 0.2);
}

.btn-danger-soft {
    box-shadow: none;
}

.btn-block {
    width: 100%;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

.flash-success {
    background: rgba(0, 155, 222, 0.12);
    color: var(--ink);
}

.flash-error {
    background: rgba(142, 0, 74, 0.12);
    color: var(--accent);
}

.flash-info {
    background: rgba(255, 108, 12, 0.12);
    color: #944100;
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.badge-approved {
    background: rgba(15, 159, 110, 0.12);
    color: #0f9f6e;
}

.badge-pending,
.badge-warning {
    background: rgba(255, 108, 12, 0.12);
    color: #b45309;
}

.badge-rejected {
    background: rgba(142, 0, 74, 0.12);
    color: var(--accent);
}

.badge-muted {
    background: rgba(68, 66, 80, 0.08);
    color: rgba(68, 66, 80, 0.76);
}

.table-list,
.document-feed {
	margin-top: 22px;
    display: grid;
    gap: 16px;
}

.table-card-main,
.table-card-meta,
.document-card-head,
.document-meta,
.review-toolbar,
.upload-actions,
.file-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.table-card-main,
.document-card-head {
    justify-content: space-between;
    align-items: flex-start;
}

.table-card-meta,
.document-meta {
    margin-top: 14px;
    color: rgba(68, 66, 80, 0.72);
    font-size: 0.92rem;
}

.table-card-meta span,
.document-meta span {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(68, 66, 80, 0.05);
}

.table-card-address {
    margin: 14px 0 0;
    line-height: 1.7;
}

.table-user-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.table-user-row-copy {
    min-width: 0;
}

.table-user-row-copy strong,
.profile-details strong {
    display: block;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(68, 66, 80, 0.08);
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    image-rendering: auto;
}

.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

img.avatar {
    display: block;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
}

.avatar-sm {
    width: 42px;
    height: 42px;
}

.avatar-md {
    width: 72px;
    height: 72px;
}

.avatar-lg {
    width: 108px;
    height: 108px;
    font-size: 1.45rem;
}

.avatar-fallback {
    background: linear-gradient(135deg, #009bde, #8e004a);
    color: #fff;
}

.profile-panel {
    align-self: start;
}

.profile-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.profile-details {
    display: grid;
    gap: 10px;
}

.profile-panel-compact {
    margin-top: 22px;
}

.profile-photo-actions,
.profile-photo-inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-photo-inline-form {
    flex: 1 1 420px;
}

.profile-photo-inline-form .field {
    flex: 1 1 240px;
}

.profile-photo-delete-form {
    margin-top: 12px;
}

.file-input {
    padding-block: 12px;
}

.upload-picker {
    padding: 18px;
    border: 1px dashed rgba(0, 155, 222, 0.28);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(0, 155, 222, 0.05), rgba(255, 255, 255, 0.8));
}

.upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.upload-preview-item {
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.upload-preview-item img,
.upload-preview-icon {
    width: 100%;
    height: 124px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(0, 155, 222, 0.12), rgba(68, 66, 80, 0.06));
}

.upload-preview-icon {
    display: grid;
    place-items: center;
    color: var(--warning);
    font-weight: 800;
    font-size: 1rem;
}

.upload-preview-meta {
    padding: 12px;
}

.upload-preview-meta strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
}

.upload-preview-meta span {
    color: var(--muted);
    font-size: 0.84rem;
}

.document-card {
    display: grid;
    gap: 14px;
}

.inline-note {
    margin: 0;
    padding: 14px 16px;
    border-radius: 16px;
    line-height: 1.7;
}

.inline-note-warning {
    background: rgba(255, 108, 12, 0.1);
}

.inline-note-danger {
    background: rgba(142, 0, 74, 0.1);
}

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(142, 0, 74, 0.16);
    border-radius: 18px;
    background: rgba(142, 0, 74, 0.06);
}

.danger-zone strong {
    display: block;
    color: var(--accent);
}

.danger-zone p {
    margin: 4px 0 0;
    color: rgba(68, 66, 80, 0.72);
    font-size: 0.9rem;
    line-height: 1.5;
}

.document-preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 18px;
    align-items: start;
}

.document-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.document-thumb-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(68, 66, 80, 0.08);
    border-radius: 22px;
    background: rgba(245, 246, 248, 0.72);
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.document-thumb-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.document-thumb-media {
    overflow: hidden;
    background: rgba(68, 66, 80, 0.05);
}

.document-thumb-media img,
.document-thumb-pdf {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.document-thumb-pdf {
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--warning);
    background: linear-gradient(135deg, rgba(255, 108, 12, 0.16), rgba(68, 66, 80, 0.06));
}

.document-thumb-copy {
    display: grid;
    gap: 6px;
    padding: 14px;
}

.document-thumb-copy strong {
    font-size: 1rem;
}

.document-thumb-copy span {
    color: rgba(68, 66, 80, 0.72);
    font-size: 0.9rem;
    line-height: 1.45;
}

.document-summary-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(68, 66, 80, 0.04);
}

.document-summary-card h3 {
    margin: 0 0 14px;
    font-size: 1.35rem;
}

.reject-box {
    flex: 1 1 280px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(68, 66, 80, 0.04);
}

.reject-box summary {
    cursor: pointer;
    font-weight: 700;
}

.reject-box[open] summary {
    margin-bottom: 12px;
}

.document-user-group {
    display: grid;
    gap: 16px;
}

.document-user-group + .document-user-group {
    margin-top: 10px;
}

.document-user-group-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
}

.document-user-group-head h3 {
    margin: 0;
    font-size: 1.35rem;
}

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

.document-card-compact {
    gap: 0;
    padding: 0;
    overflow: hidden;
    align-content: start;
}

.document-thumb-card-main {
    width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.document-card-compact .document-thumb-media {
    position: relative;
}

.document-card-compact .document-thumb-media img,
.document-card-compact .document-thumb-pdf {
    height: 210px;
}

.document-thumb-empty {
    cursor: default;
}

.file-count-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(68, 66, 80, 0.82);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.document-card-copy {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.document-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.document-title-row strong {
    min-width: 0;
    line-height: 1.35;
    word-break: break-word;
}

.document-type-pill {
    flex-shrink: 0;
    max-width: 42%;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 155, 222, 0.1);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
}

.document-meta-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
}

.document-meta-compact span {
    width: 100%;
}

.document-notes {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(0, 155, 222, 0.08);
    line-height: 1.65;
}

.document-user-type-badge {
    margin-left: 6px;
    padding-block: 4px;
    vertical-align: middle;
}

.document-tools-panel {
    margin: 0 18px 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(68, 66, 80, 0.04);
}

.document-tools-panel summary {
    cursor: pointer;
    font-weight: 800;
}

.document-tools-panel[open] summary {
    margin-bottom: 12px;
}

.upload-picker-compact {
    padding: 14px;
}

.file-manager-list {
    display: grid;
    gap: 10px;
}

.file-manager-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(68, 66, 80, 0.08);
}

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

.file-manager-row span {
    min-width: 0;
    word-break: break-word;
    color: rgba(68, 66, 80, 0.78);
    font-size: 0.9rem;
}

.review-toolbar-compact {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 18px 18px;
}

.review-toolbar-compact > form,
.review-toolbar-compact > details,
.review-action-static,
.review-toolbar-compact .btn {
    width: 100%;
}

.document-status-button {
    grid-column: 1 / -1;
}

.reject-box-compact {
    flex: initial;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.reject-box-compact summary.btn {
    list-style: none;
}

.reject-box-compact summary.btn::-webkit-details-marker {
    display: none;
}

.reject-box-compact[open] {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 18px;
    background: rgba(68, 66, 80, 0.04);
}

.btn-small {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 0.86rem;
}

.empty-panel {
    text-align: center;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox[hidden] {
    display: none;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 28, 0.72);
    backdrop-filter: blur(8px);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(12, 18, 28, 0.28);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox.is-open .lightbox-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lightbox-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 0;
}

.lightbox-close {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: rgba(68, 66, 80, 0.08);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.lightbox-stage-wrap {
    position: relative;
    padding: 20px 70px 24px;
}

.lightbox-stage {
    min-width: 0;
}

.lightbox-dialog > .lightbox-stage {
    padding: 20px 24px 24px;
}

.lightbox-image,
.lightbox-frame {
    display: block;
    width: 100%;
    min-height: min(76vh, 760px);
    max-height: min(76vh, 760px);
    border: 0;
    border-radius: 20px;
    background: rgba(68, 66, 80, 0.04);
}

.lightbox-image {
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(68, 66, 80, 0.12);
    color: var(--ink);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.lightbox-nav:hover {
    background: rgba(0, 155, 222, 0.16);
}

.lightbox-nav-prev {
    left: 16px;
}

.lightbox-nav-next {
    right: 16px;
}

body.lightbox-open {
    overflow: hidden;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
    min-height: auto;
    width: min(calc(100% - 28px), 1280px);
    margin: 0 auto;
    padding: 14px 0;
    gap: 16px;
    align-items: stretch;
}


.auth-panel {
    padding: clamp(28px, 5vw, 52px);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.auth-panel-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(0, 155, 222, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 246, 248, 0.94));
}

.brand-mark {
    width: clamp(220px, 30vw, 320px);
    padding: 8px;
    border-radius: 24px;
    background: transparent;
    box-shadow: none;
}

.auth-panel-brand h1 {
    margin: 0;
    max-width: 11ch;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.96;
}

.auth-copy {
    max-width: 42ch;
    margin: 18px 0 0;
    color: rgba(68, 66, 80, 0.78);
    line-height: 1.8;
}

.auth-feature-list {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.auth-feature-list div {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
}

.auth-feature-list strong {
    display: block;
    margin-bottom: 6px;
}

.auth-feature-list span {
    color: rgba(68, 66, 80, 0.72);
    line-height: 1.7;
}

.auth-panel-form {
    display: grid;
    align-content: center;
    gap: 18px;
}

.auth-panel-form .flash-stack {
    width: 100%;
    margin-bottom: 0;
}

.auth-form-panel {
    width: 100%;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: transparent;
}

.auth-form-panel h2 {
    margin: 0;
    font-size: 1.85rem;
}

.auth-form-link {
    margin: 16px 0 0;
    text-align: center;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(17, 24, 39, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.report-table {
    display: grid;
    gap: 0;
    overflow: auto;
    border-radius: 22px;
    border: 1px solid rgba(68, 66, 80, 0.08);
}

.report-row {
    display: grid;
    grid-template-columns: 92px minmax(180px, 1.25fr) minmax(150px, 1fr) minmax(150px, 1fr) 120px 120px 120px 100px;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(68, 66, 80, 0.08);
}

.report-row-head {
    background: rgba(0, 155, 222, 0.08);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.report-row span {
    min-width: 0;
    line-height: 1.45;
    word-break: break-word;
}

.report-preview-stack {
    display: grid;
    gap: 8px;
    align-items: start;
}

.report-thumb {
    display: inline-flex;
    width: 72px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid rgba(68, 66, 80, 0.08);
    border-radius: 14px;
    background: rgba(245, 246, 248, 0.82);
    cursor: pointer;
}

.report-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-thumb-pdf {
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-band,
.metric-panel,
.panel,
.document-card,
.table-card {
    animation: rise-in 0.45s ease both;
}

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

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

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

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

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 30;
        width: min(86vw, 320px);
        transform: translateX(-104%);
        transition: transform 0.22s ease;
    }

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

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 16px 18px;
    }

    .page {
        width: min(calc(100% - 24px), 100%);
        padding-top: 22px;
    }

    .split-workspace,
    .content-grid,
    .analytics-grid,
    .document-preview-layout {
        grid-template-columns: 1fr;
    }

    .panel-wide {
        grid-column: auto;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        width: min(calc(100% - 20px), 100%);
        padding: 10px 0;
    }
}

@media (max-width: 720px) {
    .auth-panel-form {
        align-content: start;
    }

    .auth-panel-form .flash-stack {
        order: -1;
    }

    .hero-band,
    .panel,
    .metric-panel,
    .document-card,
    .table-card {
        padding: 20px;
        border-radius: 22px;
    }

    .expandable-panel {
        padding: 0;
    }

    .hero-band,
    .panel-header,
    .expandable-summary,
    .document-card-head,
    .table-card-main,
    .stack-row,
    .lightbox-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .expandable-action {
        align-self: flex-start;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 14px;
    }

    .topbar-left,
    .topbar-right {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .metric-grid,
    .metric-grid-user,
    .field-row,
    .radio-card-group {
        grid-template-columns: 1fr;
    }

    .topbar-left .eyebrow {
        display: none;
    }

    .topbar-right {
        width: auto;
        margin-left: auto;
    }

    .user-pill {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
    }

    .user-pill-label {
        display: none;
    }

    .report-row {
        grid-template-columns: 1fr;
    }

    .document-card-grid,
    .review-toolbar-compact {
        grid-template-columns: 1fr;
    }

    .document-user-group-head,
    .document-title-row,
    .file-manager-row,
    .danger-zone,
    .profile-photo-actions,
    .profile-photo-inline-form,
    .segmented-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .document-type-pill {
        max-width: none;
        text-align: left;
    }

    .lightbox-stage-wrap {
        padding: 16px 18px 20px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 28px;
        width: 42px;
        height: 42px;
        transform: none;
    }

    .lightbox-nav-prev {
        left: 28px;
    }

    .lightbox-nav-next {
        right: 28px;
    }

    .btn,
    .input {
        width: 100%;
    }

    .upload-preview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .upload-preview-grid {
        grid-template-columns: 1fr;
    }

    .hero-band h2,
    .auth-panel-brand h1 {
        max-width: none;
    }
}
