:root {
    --font-sans: "Aptos", "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI", Roboto, Arial, sans-serif;
    --bg: #eef3f8;
    --panel: #ffffff;
    --ink: #17212f;
    --muted: #647184;
    --line: #d8e1eb;
    --teal: #0b8f8f;
    --teal-soft: #e1f5f3;
    --coral: #e85d4f;
    --amber: #f0a202;
    --green: #2f9d66;
    --violet: #5b67f1;
    --blue: #2563eb;
    --shadow: 0 18px 45px rgba(23, 33, 47, .09);
    --soft-shadow: 0 10px 28px rgba(23, 33, 47, .07);
}

:root[data-theme="dark"] {
    --bg: #0f172a;
    --panel: #111827;
    --ink: #e8edf5;
    --muted: #9aa7ba;
    --line: #2b394f;
    --teal: #38b8b0;
    --teal-soft: #123c42;
    --coral: #fb7167;
    --amber: #fbbf24;
    --green: #45c486;
    --violet: #8b92ff;
    --blue: #60a5fa;
    --shadow: 0 22px 50px rgba(0, 0, 0, .34);
    --soft-shadow: 0 14px 32px rgba(0, 0, 0, .22);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(238, 243, 248, .94) 35%, #eef3f8 100%);
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 400;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    gap: 12px;
    align-content: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(56, 184, 176, .16), transparent 30%),
        linear-gradient(180deg, rgba(238, 243, 248, .98), rgba(255, 255, 255, .96));
    color: var(--ink);
    transition: opacity .28s ease, visibility .28s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 5px solid rgba(15, 139, 141, .14);
    border-top-color: var(--teal);
    border-right-color: var(--blue);
    box-shadow: 0 16px 32px rgba(15, 139, 141, .16);
    animation: loaderSpin .8s linear infinite;
}

.app-loader b {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

body.app-loading .app-loader {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

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

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at 20% 0%, rgba(56, 184, 176, .12), transparent 34%),
        linear-gradient(180deg, #0b1120 0%, #111827 48%, #0f172a 100%);
}

:root[data-theme="dark"] .app-loader {
    background:
        radial-gradient(circle at 50% 42%, rgba(56, 184, 176, .16), transparent 30%),
        linear-gradient(180deg, rgba(11, 18, 32, .98), rgba(15, 23, 42, .96));
}

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

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
    background: #0b1220;
    color: var(--ink);
}

:root[data-theme="dark"] select option {
    background: #0b1220;
    color: var(--ink);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
    color: #8fa0b6;
    opacity: 1;
}

:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4);
    opacity: .9;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea {
    min-height: 88px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 139, 141, .12);
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background:
        linear-gradient(180deg, rgba(12, 20, 34, .98), rgba(20, 29, 48, .96)),
        #111827;
    color: #e8eef8;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 12px 0 32px rgba(15, 23, 42, .18);
    transition: transform .22s ease;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    border: 0;
    padding: 0;
    background: rgba(10, 16, 28, .48);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}

.brand strong {
    display: block;
}

.brand small,
.eyebrow {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar .brand small {
    color: #9ca8ba;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--teal), var(--blue), var(--violet));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(15, 139, 141, .28);
    overflow: hidden;
}

.brand-mark.has-logo {
    background: rgba(255, 255, 255, .08);
    padding: 5px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar nav {
    display: grid;
    gap: 8px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    color: #c7d0df;
    font-weight: 800;
    position: relative;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(255, 255, 255, .11);
    color: #fff;
    transform: translateX(2px);
}

.sidebar nav a.active::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: var(--teal);
}

.nav-ico {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, .12);
}

.nav-ico .icon {
    width: 16px;
    height: 16px;
}

.btn .icon,
.icon-link .icon {
    width: 16px;
    height: 16px;
}

.app-shell {
    margin-left: 248px;
    padding: 26px;
    min-height: 100vh;
    max-width: calc(100vw - 248px);
    overflow-x: clip;
    transition: margin-left .22s ease, max-width .22s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-104%);
}

body.sidebar-collapsed .app-shell {
    margin-left: 0;
    max-width: 100vw;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 18px 22px;
    border: 1px solid rgba(216, 225, 235, .72);
    border-radius: 8px;
    background: rgba(238, 243, 248, .86);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 26px rgba(23, 33, 47, .05);
    max-width: 100%;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mobile-menu-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    color: var(--ink);
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 9px;
    cursor: pointer;
    box-shadow: var(--soft-shadow);
}

.mobile-menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    display: block;
    transition: transform .18s ease, opacity .18s ease;
}

body.sidebar-open .mobile-menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.sidebar-open .mobile-menu-button span:nth-child(2) {
    opacity: 0;
}

body.sidebar-open .mobile-menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 31px;
    letter-spacing: 0;
    line-height: 1.05;
}

.top-actions,
.row,
.doc-toolbar,
.table-actions,
.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-actions {
    flex-wrap: nowrap;
    min-width: max-content;
    white-space: nowrap;
}

.table-actions .inline {
    display: inline-flex;
}

.table-actions .icon-link {
    white-space: nowrap;
    min-width: max-content;
}

.btn,
.icon-link {
    border: 0;
    border-radius: 8px;
    padding: 10px 13px;
    cursor: pointer;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.btn:hover,
.icon-link:hover,
.icon-button:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 139, 141, .22);
}

.btn.subtle {
    background: #fff;
    border: 1px solid var(--line);
    color: #2b3646;
}

.btn.danger,
.danger {
    background: var(--coral);
    color: #fff;
}

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

.danger-text {
    color: var(--coral);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon-link {
    background: #f3f7fb;
    color: #263445;
    font-size: 12px;
    border: 1px solid transparent;
}

.icon-link.icon-only {
    width: 38px;
    height: 36px;
    padding: 0;
}

.icon-button {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    font-weight: 900;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    color: var(--teal);
}

.theme-toggle .theme-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-sun {
    display: block;
}

:root[data-theme="dark"] .theme-toggle .theme-moon {
    display: none;
}

.icon-button b {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--coral);
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
}

.profile-menu {
    position: relative;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .94);
    cursor: pointer;
    box-shadow: var(--soft-shadow);
}

.profile-chip-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 900;
    overflow: hidden;
}

.profile-chip-avatar img,
.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-chip .icon {
    color: var(--muted);
    width: 16px;
    height: 16px;
}

.profile-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    width: 230px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 25;
    padding: 8px;
}

.profile-panel.open {
    display: grid;
}

.profile-panel a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border-radius: 8px;
    color: #253246;
    font-weight: 900;
}

.profile-panel a:hover {
    background: #f3f6fa;
}

.notif {
    position: relative;
}

.notif-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    width: 330px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 20;
    padding: 14px;
    backdrop-filter: blur(12px);
}

.notif-panel.open {
    display: grid;
    gap: 10px;
}

.notif-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.notif-summary span {
    border-radius: 8px;
    background: #f3f6fa;
    padding: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.notif-summary b {
    display: block;
    color: var(--ink);
    font-size: 18px;
}

.notif-section {
    display: grid;
    gap: 7px;
}

.notif-section p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.notif-panel a {
    display: grid;
    gap: 3px;
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f7f9fc);
    border: 1px solid #edf2f7;
}

.notif-panel a.document_upload {
    border-left: 4px solid var(--teal);
}

.notif-panel a.message {
    border-left: 4px solid var(--violet);
}

.notif-panel a.other {
    border-left: 4px solid var(--amber);
}

.notif-badge {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 8px;
    background: #e6f6f5;
    color: var(--teal);
    font-size: 11px;
    font-weight: 900;
}

.notif-item.message .notif-badge {
    background: #ecebff;
    color: var(--violet);
}

.notif-item.other .notif-badge {
    background: #fff3d6;
    color: #9a6500;
}

.notif-panel small,
.doc-name + small,
.thread small,
.chat small {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

td .doc-name + small {
    display: inline-flex;
    margin-left: 8px;
    vertical-align: middle;
}

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

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

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

.panel,
.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--soft-shadow);
    padding: 18px;
    margin-bottom: 16px;
    min-width: 0;
}

.panel {
    background: rgba(255, 255, 255, .94);
}

.panel h2,
.panel h3,
.login-card h2 {
    margin: 0 0 14px;
    letter-spacing: 0;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-head h2 {
    line-height: 1.1;
}

.split {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    align-items: stretch;
}

.dashboard-hero {
    min-height: 210px;
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(13, 22, 38, .94), rgba(15, 139, 141, .7)),
        url('auth-bg.svg') center / cover no-repeat;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    overflow: hidden;
}

.dashboard-hero .eyebrow {
    color: rgba(255, 255, 255, .74);
}

.dashboard-hero h2 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.03;
}

.metric {
    margin: 0;
    min-height: 148px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 14px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(216, 225, 235, .78);
    border-left: 0;
    padding: 20px;
    background:
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--metric-color, var(--teal)) 18%, transparent) 0 34%, transparent 35%),
        linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(248, 251, 253, .9));
    box-shadow: 0 16px 34px rgba(23, 33, 47, .08);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.metric::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--metric-color, var(--teal)), color-mix(in srgb, var(--metric-color, var(--teal)) 55%, #fff));
}

.metric::after {
    content: '';
    position: absolute;
    right: -38px;
    bottom: -42px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--metric-color, var(--teal)) 20%, #fff) 0 58%, transparent 59%);
    pointer-events: none;
}

.metric:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--metric-color, var(--teal)) 34%, var(--line));
    box-shadow: 0 20px 42px rgba(23, 33, 47, .12);
}

.metric-icon {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: var(--metric-color, var(--teal));
    background: linear-gradient(145deg, color-mix(in srgb, var(--metric-color, var(--teal)) 12%, #ffffff), #ffffff);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--metric-color, var(--teal)) 22%, transparent),
        0 12px 20px color-mix(in srgb, var(--metric-color, var(--teal)) 12%, transparent);
    z-index: 1;
}

.metric-icon .icon {
    width: 20px;
    height: 20px;
}

.metric.b {
    --metric-color: var(--violet);
}

.metric.c {
    --metric-color: var(--coral);
}

.metric.d {
    --metric-color: var(--amber);
}

.metric.e {
    --metric-color: #2d6cdf;
}

.metric.f {
    --metric-color: var(--green);
}

.metric.a {
    --metric-color: var(--teal);
}

.metric-label {
    max-width: 112px;
    color: #66758a;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.22;
    z-index: 1;
}

.metric strong {
    align-self: end;
    color: var(--ink);
    font-size: clamp(32px, 3.4vw, 42px);
    line-height: .98;
    letter-spacing: 0;
    z-index: 1;
}

.storage-panel {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 380px);
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #fff, #f7fbff);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
}

.storage-panel h2 {
    margin: 0;
}

.storage-panel span,
.storage-panel small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.storage-meter-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(216, 225, 235, .92);
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 10px 22px rgba(23, 33, 47, .06);
}

.storage-meter-head,
.storage-meter-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.storage-meter-head strong {
    color: var(--teal);
    font-size: 24px;
    line-height: 1;
}

.storage-meter-foot small {
    font-size: 11px;
}

.storage-meter {
    height: 18px;
    border-radius: 999px;
    background: #e7edf4;
    overflow: hidden;
    box-shadow: inset 0 2px 6px rgba(23, 33, 47, .08);
}

.storage-meter span {
    position: relative;
    display: block;
    width: var(--storage-width, 0%);
    min-width: 8px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), #2d6cdf, var(--violet));
    box-shadow: 0 8px 18px rgba(15, 139, 141, .25);
}

.storage-meter span::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent);
    transform: translateX(-100%);
    animation: storageShine 2.8s ease-in-out infinite;
}

.dashboard-period-panel {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(0, 2fr);
    align-items: end;
    gap: 16px;
}

.dashboard-period-panel h2 {
    margin-bottom: 6px;
}

.dashboard-period-panel > div > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-period-form {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(140px, .9fr) minmax(140px, .9fr) auto auto;
    align-items: end;
    gap: 10px;
}

.dashboard-period-form label {
    gap: 5px;
}

.dashboard-period-form label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.dashboard-period-form input,
.dashboard-period-form select {
    min-height: 42px;
}

.dashboard-period-form .btn,
.dashboard-period-form .icon-link {
    min-height: 42px;
}

.dashboard-region {
    position: relative;
    transition: opacity .18s ease, filter .18s ease;
}

.dashboard-region.is-loading {
    opacity: .72;
    filter: saturate(.85);
    pointer-events: none;
}

.dashboard-region.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .58), transparent),
        rgba(255, 255, 255, .28);
    background-size: 220% 100%, auto;
    animation: tableLoading 1s linear infinite;
}

.quick-list {
    display: grid;
    gap: 11px;
    padding: 16px;
    border: 1px solid rgba(15, 139, 141, .18);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(241, 248, 249, .92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .74), 0 14px 30px rgba(23, 33, 47, .06);
}

.dashboard-chart-card {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.dashboard-chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-chart-head h2 {
    margin-bottom: 0;
}

.chart-badges {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.chart-badge {
    min-width: 150px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid rgba(216, 225, 235, .9);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f6fafc);
    box-shadow: 0 8px 18px rgba(23, 33, 47, .05);
}

.chart-badge .icon {
    width: 18px;
    height: 18px;
    color: var(--teal);
    flex: 0 0 18px;
}

.chart-badge b,
.chart-badge small {
    display: block;
}

.chart-badge b {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.15;
}

.chart-badge small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.chart-badge.accent {
    background: linear-gradient(135deg, rgba(15, 139, 141, .12), rgba(37, 99, 235, .1));
    border-color: rgba(15, 139, 141, .22);
}

.quick-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 4px;
}

.quick-head > span {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #fff;
    box-shadow: 0 12px 22px rgba(15, 139, 141, .2);
}

.quick-head h3 {
    margin: 2px 0 0;
}

.quick-head .eyebrow {
    margin: 0;
}

.quick {
    min-height: 74px;
    padding: 13px;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    border: 1px solid rgba(216, 225, 235, .92);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(23, 33, 47, .05);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.quick:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 139, 141, .38);
    background: linear-gradient(180deg, #fff, #f4fbfb);
    box-shadow: 0 16px 30px rgba(15, 139, 141, .13);
}

.quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--teal-soft);
    color: var(--teal);
    flex: 0 0 42px;
}

.quick b,
.quick small {
    display: block;
}

.quick b {
    color: var(--ink);
    font-size: 14px;
}

.quick small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 18px 16px;
}

.folder-grid.list {
    grid-template-columns: 1fr;
}

.folder-card {
    min-height: 142px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    padding: 10px 8px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    position: relative;
    text-align: center;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.folder-card-main {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-height: 120px;
    width: 100%;
    color: inherit;
    text-align: center;
}

.folder-delete {
    position: absolute;
    right: 4px;
    top: 4px;
    opacity: 0;
    transition: opacity .15s ease;
    z-index: 3;
}

.folder-delete .icon-link {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, .82);
    border-color: rgba(216, 225, 235, .72);
}

.folder-card:hover .folder-delete,
.folder-card.active .folder-delete {
    opacity: 1;
}

.folder-card:hover,
.folder-card.active {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(244, 197, 66, .72);
    box-shadow: 0 16px 30px rgba(176, 127, 0, .12);
    transform: translateY(-2px);
}

.folder-cover {
    width: 98px;
    height: 76px;
    position: relative;
    display: block;
    filter: drop-shadow(0 11px 16px rgba(151, 103, 0, .16));
}

.folder-tab {
    position: absolute;
    left: 8px;
    top: 2px;
    width: 38px;
    height: 18px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #ffc83d, #f6b925);
    z-index: 1;
}

.folder-body {
    position: absolute;
    inset: 12px 0 0;
    display: block;
    border-radius: 6px 6px 8px 8px;
    background:
        linear-gradient(180deg, rgba(255, 245, 194, .92), rgba(255, 221, 105, .18) 24%, transparent 25%),
        linear-gradient(180deg, #ffe47a, #ffd257 56%, #ffc640);
    border: 1px solid rgba(210, 145, 0, .24);
    overflow: hidden;
    z-index: 2;
}

.folder-body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .24), transparent 46%);
    pointer-events: none;
}

.folder-preview {
    position: absolute;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(136, 101, 0, .25);
    border-radius: 4px;
    background: #fff;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    z-index: 1;
}

.folder-preview:nth-child(1) {
    left: 26px;
    top: 7px;
    width: 48px;
    height: 32px;
}

.folder-preview:nth-child(2) {
    right: 8px;
    top: 12px;
    width: 32px;
    height: 26px;
}

.folder-preview:nth-child(3) {
    left: 9px;
    bottom: 7px;
    width: 34px;
    height: 25px;
}

.folder-preview img,
.folder-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folder-preview span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.folder-preview.pdf span {
    background: var(--coral);
}

.folder-preview.word span {
    background: #2d6cdf;
}

.folder-preview.excel span {
    background: #1f9d55;
}

.folder-preview.powerpoint span {
    background: #c85b2b;
}

.folder-preview.archive span {
    background: var(--amber);
    color: #5d4000;
}

.folder-preview.text span,
.folder-preview.other span {
    background: #566173;
}

.folder-icon {
    width: 42px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f7d35d;
    color: #6d4b00;
}

.folder-icon.mini {
    width: 34px;
    height: 30px;
    display: inline-grid;
    margin-right: 8px;
    vertical-align: middle;
}

.folder-icon.mini .icon {
    width: 16px;
    height: 16px;
}

.trash-section {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.trash-section .panel-head {
    margin-bottom: 0;
}

.folder-card strong {
    width: 100%;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.folder-card small {
    color: var(--muted);
    font-size: 12px;
}

.folder-card em {
    color: var(--teal);
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
}

.folder-grid.list .folder-card {
    min-height: 78px;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: stretch;
    text-align: left;
    padding: 10px 14px;
}

.folder-grid.list .folder-card-main {
    min-height: auto;
    grid-template-columns: 70px minmax(0, 1fr) auto auto;
    align-items: center;
    justify-items: start;
    text-align: left;
}

.folder-grid.list > a.folder-card {
    grid-template-columns: 70px minmax(0, 1fr) auto auto;
    align-items: center;
    justify-items: start;
}

.folder-grid.list .folder-card em {
    justify-self: end;
}

.folder-grid.list .folder-cover {
    width: 64px;
    height: 50px;
}

.folder-grid.list .folder-tab {
    width: 26px;
    height: 13px;
    border-radius: 6px 6px 0 0;
}

.folder-grid.list .folder-body {
    inset: 9px 0 0;
}

.folder-grid.list .folder-preview:nth-child(1) {
    left: 17px;
    top: 5px;
    width: 31px;
    height: 21px;
}

.folder-grid.list .folder-preview:nth-child(2) {
    right: 5px;
    top: 8px;
    width: 21px;
    height: 17px;
}

.folder-grid.list .folder-preview:nth-child(3) {
    left: 6px;
    bottom: 5px;
    width: 22px;
    height: 16px;
}

.view-switch {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef4f9;
}

.view-switch a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
}

.view-switch a.active {
    background: #fff;
    color: var(--teal);
    box-shadow: 0 4px 12px rgba(23, 33, 47, .08);
}

.chart-filter {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.chart-filter input,
.chart-filter select {
    width: auto;
    min-width: 160px;
}

.chart-filter-modern {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(248, 250, 252, .86);
    box-shadow: 0 10px 24px rgba(23, 33, 47, .05);
}

.chart-filter-modern label {
    display: grid;
    gap: 4px;
}

.chart-filter-modern label span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--muted);
}

.chart-filter-modern input,
.chart-filter-modern select {
    min-height: 42px;
    border-radius: 8px;
}

.chart-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(75, 190, 189, .1);
    color: var(--muted);
    font-size: 12px;
}

.chart-summary strong {
    color: var(--ink);
}

.filters {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 250, 252, .92));
    box-shadow: 0 10px 24px rgba(23, 33, 47, .04);
    overflow: hidden;
}

.filter-field {
    grid-column: span 2;
    min-width: 0;
    gap: 5px;
}

.filter-search {
    grid-column: 1 / -1;
}

.filter-sort {
    grid-column: span 2;
}

.filter-size {
    grid-column: span 1;
}

.filter-field > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: clamp(10px, .82vw, 12px);
    line-height: 1;
    text-transform: uppercase;
}

.filter-field input,
.filter-field select {
    height: 43px;
    min-width: 0;
    padding: 9px 11px;
    border-radius: 8px;
    font-size: clamp(12px, .96vw, 14px);
    text-overflow: ellipsis;
}

.filter-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 9px;
    align-items: end;
    align-self: end;
}

.filter-actions .btn {
    min-height: 43px;
    min-width: 118px;
    padding-inline: 12px;
    white-space: nowrap;
}

.filter-reset {
    width: 43px;
    height: 43px;
    color: var(--muted);
}

.table-wrap {
    overflow: auto;
    max-width: 100%;
    overscroll-behavior-x: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 33, 47, .04);
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.pagination-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
}

.pagination-info strong {
    color: var(--ink);
    font-size: 16px;
}

.per-page-form,
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.per-page-form label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.per-page-form select {
    width: auto;
    min-width: 82px;
    padding: 8px 10px;
    background: #fff;
}

.pager a,
.pager span,
.pager b {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
}

.pager a {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--teal);
}

.pager a:hover {
    border-color: var(--teal);
    box-shadow: 0 8px 18px rgba(15, 139, 141, .12);
}

.pager b {
    background: var(--teal-soft);
    color: var(--teal);
}

.pager .disabled {
    background: #edf1f6;
    color: #9aa6b5;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    background: #fff;
}

th,
td {
    padding: 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #f4f7fb;
}

tbody tr {
    transition: background-color .15s ease;
}

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

th:last-child,
td:last-child {
    width: 150px;
}

td.actions-cell {
    width: 150px;
}

td.name-cell {
    width: clamp(220px, 34vw, 460px);
    max-width: clamp(220px, 34vw, 460px);
}

.name-cell .doc-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.file-icon {
    min-width: 54px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 0 8px;
}

.file-icon .file-svg {
    width: 16px;
    height: 16px;
}

.file-icon.image {
    background: var(--green);
}

.file-icon.video {
    background: var(--violet);
}

.file-icon.pdf {
    background: var(--coral);
}

.file-icon.word {
    background: #2d6cdf;
}

.file-icon.excel {
    background: #1f9d55;
}

.file-icon.powerpoint {
    background: #c85b2b;
}

.file-icon.text {
    background: var(--teal);
}

.file-icon.office {
    background: #2d6cdf;
}

.file-icon.archive {
    background: var(--amber);
}

.file-icon.other {
    background: #566173;
}

td.preview-cell {
    display: flex;
    align-items: center;
    min-width: 92px;
    white-space: nowrap;
}

.doc-type {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.doc-type-icon {
    width: 16px;
    height: 16px;
    color: var(--teal);
}

.doc-type.pdf .doc-type-icon {
    color: var(--coral);
}

.doc-type.word .doc-type-icon,
.doc-type.excel .doc-type-icon {
    color: var(--blue);
}

.doc-type.image .doc-type-icon {
    color: var(--green);
}

.date-only {
    color: var(--ink);
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(100, 113, 132, .45);
    text-underline-offset: 4px;
}

.doc-thumb {
    width: 74px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #eef3f8;
    border: 1px solid var(--line);
}

.doc-thumb img,
.doc-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.doc-thumb.file {
    background: #f8fafc;
}

.doc-thumb.file .file-icon {
    min-width: 62px;
}

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #edf1f6;
    color: #374151;
}

.status.validated,
.status.active {
    background: #e4f6ec;
    color: #19764a;
}

.status.pending {
    background: #fff3d6;
    color: #9a6500;
}

.status.rejected,
.status.blocked,
.status.trashed {
    background: #ffe5e2;
    color: #b83228;
}

.inline {
    display: inline;
}

.upload-form {
    gap: 12px;
}

.upload-folder-row {
    display: grid;
    grid-template-columns: minmax(180px, 260px);
}

.upload-folder-row > *,
.upload-actions-row > * {
    min-width: 0;
}

.upload-folder-row select {
    min-height: 58px;
}

.upload-form textarea[name="description"] {
    margin-top: 8px;
}

.upload-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
    gap: 12px;
    align-items: stretch;
}

.file-picker input {
    display: none;
}

.file-picker {
    min-width: 0;
}

.file-picker > span {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 11px;
    row-gap: 2px;
    min-height: 58px;
    padding: 9px 12px;
    align-items: center;
    border: 1px dashed rgba(15, 139, 141, .48);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 139, 141, .1), rgba(37, 99, 235, .08)),
        #f8fbfd;
    color: #263445;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.file-picker > span:hover {
    border-color: var(--teal);
    box-shadow: 0 12px 24px rgba(15, 139, 141, .12);
    transform: translateY(-1px);
}

.file-picker-icon {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    box-shadow: 0 10px 18px rgba(15, 139, 141, .2);
}

.file-picker-icon .icon {
    width: 18px;
    height: 18px;
}

.file-picker b {
    min-width: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-picker small {
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-submit {
    min-height: 58px;
    min-width: 150px;
    padding-inline: 18px;
}

.file-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.file-preview-item {
    display: grid;
    grid-template-columns: 52px 1fr 34px;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

.file-preview-thumb {
    width: 52px;
    height: 46px;
    border-radius: 8px;
    background: #e8eef6;
    color: #263445;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: 11px;
    font-weight: 900;
}

.file-preview-item.image .file-preview-thumb {
    background: #e4f6ec;
    color: #19764a;
}

.file-preview-item.pdf .file-preview-thumb {
    background: #ffe5e2;
    color: #a52820;
}

.file-preview-item.excel .file-preview-thumb {
    background: #e4f6ec;
    color: #19764a;
}

.file-preview-item.word .file-preview-thumb {
    background: #e8f0ff;
    color: #2d6cdf;
}

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

.file-preview-info {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.file-preview-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.file-preview-info small {
    color: var(--muted);
    font-size: 12px;
}

.file-preview-remove {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #ffe5e2;
    color: #a52820;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
}

.status-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
}

.status-form select {
    min-width: 132px;
    padding: 8px 10px;
}

.document-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.preview-panel {
    background: linear-gradient(180deg, #fff, #f8fbfd);
}

.messages-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.preview-box {
    min-height: 430px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, #f8fafc, #eef4f9);
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.preview-box img,
.preview-box video,
.preview-box iframe {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: contain;
    border: 0;
}

.generic-preview {
    text-align: center;
    color: var(--muted);
    display: grid;
    gap: 12px;
    justify-items: center;
}

.doc-toolbar {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.meta {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--ink);
}

.meta dt {
    color: var(--muted);
    font-weight: 900;
}

.meta dd {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.stack {
    display: grid;
    gap: 12px;
}

.share-list {
    display: grid;
    gap: 9px;
    margin-top: 16px;
}

.share-list input {
    font-size: 12px;
}

.share-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(15, 139, 141, .24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 139, 141, .08), rgba(45, 108, 223, .05)),
        #fff;
    box-shadow: 0 12px 26px rgba(17, 24, 39, .06);
}

.share-card > div:first-child {
    display: grid;
    gap: 4px;
}

.share-card strong {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.share-card small {
    color: var(--muted);
    font-weight: 800;
}

.share-card label {
    color: var(--muted);
}

.share-card input {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
}

.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.thread {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.thread p {
    margin: 0;
    padding: 11px;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f7f9fc);
    border: 1px solid var(--line);
}

.contacts {
    display: grid;
    gap: 9px;
    align-content: start;
    position: sticky;
    top: 18px;
}

.contacts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.contacts-head h3 {
    margin: 0;
}

.contacts-head span {
    min-width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--teal-soft);
    color: var(--teal);
    font-weight: 900;
}

.contact-search {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
}

.contact-search .icon {
    width: 17px;
    height: 17px;
}

.contact-search input {
    border: 0;
    outline: 0;
    padding: 0;
    background: transparent;
    font-weight: 800;
    min-width: 0;
}

.contact-search:focus-within {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 139, 141, .1);
}

.contacts-empty {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    text-align: center;
    font-weight: 900;
}

.contacts a {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    padding: 11px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    position: relative;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.contacts a:hover {
    border-color: rgba(15, 139, 141, .35);
    box-shadow: 0 10px 22px rgba(17, 24, 39, .08);
    transform: translateY(-1px);
}

.contacts a.active {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: inset 4px 0 0 var(--teal), 0 10px 24px rgba(15, 139, 141, .12);
}

.contact-avatar {
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), #2d6cdf);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    flex: 0 0 auto;
    line-height: 1;
    overflow: hidden;
}

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

.contacts .contact-avatar {
    grid-row: span 3;
    width: 40px;
    height: 40px;
}

.contact-avatar.large {
    width: 52px;
    height: 52px;
    font-size: 20px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(15, 139, 141, .22);
}

.contacts b {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    font-size: 15px;
}

.contacts b > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contacts b small {
    margin-left: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.contacts small {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
}

.contact-state {
    grid-column: 2;
}

.contact-last-login,
.contact-last-logout {
    display: none !important;
}

.online-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(203, 213, 225, .28);
}

.online-dot.on {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(47, 157, 102, .18);
}

.unread-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--coral);
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    box-shadow: 0 8px 16px rgba(232, 93, 79, .24);
}

.unread-badge[hidden] {
    display: none;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.chat-title > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chat-title .eyebrow {
    margin: 0;
}

.chat-title h2 {
    margin: 0;
    line-height: 1.12;
}

.chat-presence {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.chat-presence > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.typing-mini,
.typing-indicator {
    color: var(--teal);
    font-weight: 900;
}

.typing-mini[hidden],
.typing-indicator[hidden] {
    display: none !important;
}

.typing-mini::after,
.typing-indicator::after {
    content: '';
    width: 4px;
    height: 4px;
    margin-left: 3px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
    box-shadow: 7px 0 0 currentColor, 14px 0 0 currentColor;
    animation: typingPulse 1.05s infinite ease-in-out;
}

.conversation-count {
    padding: 7px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.chat {
    min-height: 620px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: linear-gradient(180deg, #ffffff, #f4f8fb);
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
    padding: 16px;
    margin-top: 14px;
    background:
        linear-gradient(180deg, rgba(15, 139, 141, .04), rgba(37, 99, 235, .035)),
        #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--line);
    scroll-behavior: smooth;
}

.chat-box p {
    max-width: 72%;
    margin: 0;
    padding: 11px 13px;
    border-radius: 8px 8px 8px 2px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(17, 24, 39, .06);
    color: var(--ink);
}

.chat-box p span {
    display: block;
    background: transparent !important;
    color: inherit;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-box p small {
    background: transparent !important;
}

.chat-box .me {
    align-self: flex-end;
    border-color: transparent;
    border-radius: 8px 8px 2px 8px;
    background: linear-gradient(135deg, #159895, #2f7ddf);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 139, 141, .22);
}

.chat-box .them {
    background: #ffffff;
    color: var(--ink);
    border-color: #dbe4ee;
}

.chat-box .me small {
    color: rgba(255, 255, 255, .75);
}

.chat-empty {
    margin: auto;
    padding: 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    border: 1px dashed var(--line);
    color: var(--muted);
    font-weight: 900;
    text-align: center;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(17, 24, 39, .06);
}

.chat-form textarea {
    border-color: transparent;
    background: #f3f6fa;
    min-height: 48px;
    max-height: 180px;
    resize: vertical;
    line-height: 1.45;
}

.report-box {
    white-space: pre-wrap;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 16px;
    line-height: 1.6;
}

.report-modern {
    display: grid;
    gap: 14px;
}

.report-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.report-options {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(248, 250, 252, .94));
    box-shadow: 0 10px 24px rgba(23, 33, 47, .05);
}

.report-options label {
    display: grid;
    gap: 6px;
    min-width: 220px;
}

.report-options label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.report-document {
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(17, 24, 39, .09);
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.report-document.preview-focus {
    border-color: rgba(15, 139, 141, .62);
    box-shadow: 0 0 0 5px rgba(15, 139, 141, .12), 0 26px 70px rgba(17, 24, 39, .14);
    transform: translateY(-2px);
}

.report-document-header {
    display: grid;
    justify-items: center;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--line);
    text-align: center;
}

.report-document-header p {
    margin: 0;
    color: var(--teal);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.report-document-header h3 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
}

.report-document-header span,
.report-document-footer {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.report-cover {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid rgba(15, 139, 141, .22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 139, 141, .12), rgba(45, 108, 223, .08)),
        linear-gradient(180deg, #fff, #f8fbfd);
    box-shadow: 0 18px 38px rgba(17, 24, 39, .08);
}

.report-cover h3 {
    margin-bottom: 4px;
    font-size: clamp(22px, 3vw, 32px);
}

.report-cover span {
    color: var(--muted);
    font-weight: 800;
}

.report-cover > strong {
    min-width: 130px;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    box-shadow: 0 14px 26px rgba(15, 139, 141, .24);
}

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

.report-metrics article {
    display: grid;
    gap: 8px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.report-metrics span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--teal-soft);
    color: var(--teal);
}

.report-metrics b {
    font-size: 24px;
    line-height: 1;
}

.report-metrics small,
.report-list small {
    color: var(--muted);
    font-weight: 800;
}

.report-type-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.report-type-strip span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.report-type-strip b {
    color: var(--ink);
}

.report-table-wrap {
    overflow: auto;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.report-table {
    min-width: 920px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.report-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #eef6fb, #e7f0f8);
    color: #44546a;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    text-transform: uppercase;
}

.report-table td {
    border-bottom: 1px solid rgba(216, 225, 235, .72);
    vertical-align: middle;
}

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

.report-row.upload td {
    background: rgba(75, 190, 189, .075);
}

.report-row.delete td {
    background: rgba(232, 93, 79, .08);
}

.report-row:hover td {
    background: rgba(45, 108, 223, .1);
}

.report-doc-name {
    max-width: 360px;
    min-width: 220px;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.report-action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.report-action-pill.upload {
    color: #07696a;
    background: rgba(75, 190, 189, .18);
}

.report-action-pill.delete {
    color: #9f2f27;
    background: rgba(232, 93, 79, .16);
}

.report-document-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

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

.report-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.report-list {
    display: grid;
    gap: 8px;
}

.report-list p {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.report-list b {
    display: grid;
    gap: 3px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-list em {
    color: var(--teal);
    font-style: normal;
    font-weight: 900;
}

.report-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 900;
    text-align: center;
}

.report-raw {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.report-raw summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 15px;
    color: var(--ink);
    font-weight: 900;
}

.report-raw .report-box {
    margin: 0;
    border-width: 1px 0 0;
    border-radius: 0;
}

.uploads-chart,
#uploadsChart {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 7;
    min-height: 230px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 18% 8%, rgba(15, 139, 141, .08), transparent 26%),
        linear-gradient(180deg, #ffffff, #f7fafc);
    border: 1px solid rgba(216, 225, 235, .72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 14px 30px rgba(23, 33, 47, .05);
}

.narrow {
    max-width: 680px;
}

.flash {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: #e4f6ec;
    color: #19764a;
    font-weight: 800;
}

.flash.danger {
    background: #ffe5e2;
    color: #a52820;
}

.notification-highlight {
    position: relative;
    outline: 3px solid rgba(245, 158, 11, .78);
    box-shadow: 0 0 0 7px rgba(245, 158, 11, .16), 0 18px 34px rgba(17, 24, 39, .14);
    transition: outline-color .8s ease, box-shadow .8s ease, background-color .8s ease;
    animation: notificationPulse 1.15s ease-in-out 3;
}

tr.notification-highlight {
    outline: 0;
    box-shadow: none;
}

tr.notification-highlight > td {
    background: #fff5d6;
    box-shadow: inset 0 2px 0 rgba(245, 158, 11, .62), inset 0 -2px 0 rgba(245, 158, 11, .42);
    transition: background-color .8s ease, box-shadow .8s ease;
}

tr.notification-highlight > td:first-child {
    box-shadow: inset 4px 0 0 #f59e0b, inset 0 2px 0 rgba(245, 158, 11, .62), inset 0 -2px 0 rgba(245, 158, 11, .42);
}

.notification-highlight.is-fading {
    outline-color: transparent;
    box-shadow: none;
}

tr.notification-highlight.is-fading > td,
tr.notification-highlight.is-fading > td:first-child {
    background: #fff;
    box-shadow: none;
}

@keyframes notificationPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

@keyframes typingPulse {
    0%, 100% {
        opacity: .35;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(90deg, rgba(16, 24, 39, .94), rgba(16, 24, 39, .68)), url('auth-bg.svg') center / cover no-repeat;
    color: #fff;
}

.login-hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
    align-items: center;
    padding: 48px;
    max-width: 1180px;
    margin: 0 auto;
}

.login-copy h1 {
    max-width: 760px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1;
    margin: 18px 0;
    letter-spacing: 0;
}

.login-copy p {
    color: #c8d2e0;
    font-size: 18px;
    max-width: 620px;
}

.login-card {
    background: #fff;
    color: var(--ink);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .24);
    display: grid;
    gap: 14px;
}

.login-card .btn {
    min-height: 46px;
}

.login-footer {
    align-self: end;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
}

.shared-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.install-prompt {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 70;
    width: min(720px, calc(100vw - 32px));
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto 42px;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(216, 225, 235, .92);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
    backdrop-filter: blur(14px);
}

.install-prompt[hidden] {
    display: none;
}

.install-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--teal), var(--blue));
}

.install-prompt strong {
    display: block;
}

.install-prompt span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    display: grid;
    gap: 10px;
    z-index: 60;
}

.alertify-toast {
    width: min(360px, calc(100vw - 36px));
    border-radius: 8px;
    background: #111827;
    color: #fff;
    padding: 13px 15px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border-left: 4px solid var(--teal);
    animation: alertifyIn .18s ease-out;
}

.alertify-toast.success {
    border-left-color: var(--green);
}

.alertify-toast.error {
    border-left-color: var(--coral);
}

.alertify-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(96, 165, 250, .16);
    color: #93c5fd;
}

.alertify-toast.success .alertify-icon {
    background: #dcfce7;
    color: #16a34a;
}

.alertify-toast.error .alertify-icon {
    background: #fee2e2;
    color: #dc2626;
}

.alertify-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.alertify-content {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.alertify-toast strong {
    color: #9ee7e3;
    font-size: 12px;
    text-transform: uppercase;
}

.alertify-toast.success strong {
    color: #86efac;
}

@keyframes alertifyIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upload-progress {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef5;
}

.upload-progress span {
    display: block;
    width: 0;
    min-width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--violet));
    color: #fff;
    font-size: 9px;
    line-height: 12px;
    text-align: center;
    transition: width .15s ease;
}

.profile-shortcuts {
    display: grid;
    gap: 10px;
    align-content: start;
}

.profile-shortcuts a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border-radius: 8px;
    background: #f7f9fc;
    font-weight: 900;
}

.avatar-form {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    margin: 12px 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.profile-avatar-large {
    width: 84px;
    height: 84px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 30px;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(15, 139, 141, .14);
}

.avatar-picker {
    min-width: 0;
}

.avatar-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.avatar-picker-button {
    width: fit-content;
    max-width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(15, 139, 141, .22);
    transition: transform .16s ease, box-shadow .16s ease;
}

.avatar-picker-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(15, 139, 141, .28);
}

.avatar-picker-button .icon {
    width: 16px;
    height: 16px;
}

.avatar-picker small {
    max-width: 100%;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-settings-form {
    gap: 12px;
}

.admin-subsection {
    display: grid;
    gap: 12px;
    margin: 4px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f8fbfd);
}

.admin-subsection h3 {
    margin-bottom: 0;
}

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

.pwa-settings-grid label:nth-child(3),
.pwa-icon-picker {
    grid-column: 1 / -1;
}

.pwa-icon-picker > span {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.pwa-icon-picker img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #f8fafc;
    box-shadow: var(--soft-shadow);
}

.brand-logo-picker > span {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.admin-file-field {
    position: relative;
    min-height: 54px;
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px dashed rgba(15, 139, 141, .38);
    border-radius: 8px;
    background: rgba(75, 190, 189, .08);
    overflow: hidden;
}

.admin-file-field input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.admin-file-button {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), var(--blue));
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 12px 22px rgba(15, 139, 141, .22);
}

.admin-file-field small {
    min-width: 0;
    color: var(--muted);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-brand-preview {
    width: 72px;
    height: 72px;
    box-shadow: var(--soft-shadow);
}

.admin-brand-preview.has-logo {
    background: #f8fafc;
    border: 1px solid var(--line);
}

.app-footer {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    padding: 10px 0 0;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(17, 24, 39, .45);
    z-index: 80;
}

.modal[hidden] {
    display: none;
}

.modal-card {
    width: min(420px, calc(100vw - 30px));
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.login-toolbar {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 4;
}

.ajax-table-region {
    position: relative;
    min-height: 120px;
    transition: opacity .18s ease, filter .18s ease;
}

.ajax-table-region.is-loading {
    opacity: .62;
    filter: saturate(.8);
    pointer-events: none;
}

.ajax-table-region.is-loading::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 8px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent),
        rgba(255, 255, 255, .36);
    background-size: 220% 100%, auto;
    animation: tableLoading 1s linear infinite;
}

@keyframes tableLoading {
    from { background-position: 200% 0, 0 0; }
    to { background-position: -200% 0, 0 0; }
}

@keyframes storageShine {
    0%, 45% { transform: translateX(-100%); }
    100% { transform: translateX(120%); }
}

:root[data-theme="dark"] .topbar {
    background: rgba(15, 23, 42, .84);
    border-color: rgba(43, 57, 79, .9);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .mobile-menu-button {
    background: #111b2d;
    border-color: var(--line);
    color: #e8edf5;
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .storage-panel,
:root[data-theme="dark"] .login-card,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .modal-card {
    background: var(--panel);
    border-color: var(--line);
}

:root[data-theme="dark"] .btn.subtle,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .profile-chip,
:root[data-theme="dark"] .profile-panel,
:root[data-theme="dark"] .notif-panel,
:root[data-theme="dark"] .filters,
:root[data-theme="dark"] .file-picker > span,
:root[data-theme="dark"] .chat-form,
:root[data-theme="dark"] .contact-search,
:root[data-theme="dark"] .avatar-form,
:root[data-theme="dark"] .meta,
:root[data-theme="dark"] .admin-subsection,
:root[data-theme="dark"] .report-box,
:root[data-theme="dark"] .preview-box,
:root[data-theme="dark"] .doc-thumb,
:root[data-theme="dark"] .doc-thumb.file {
    background: #121c2d;
    border-color: var(--line);
    color: var(--ink);
}

:root[data-theme="dark"] .meta dt {
    color: #b9c4d4;
}

:root[data-theme="dark"] .meta dd {
    color: var(--ink);
}

:root[data-theme="dark"] .profile-panel a,
:root[data-theme="dark"] .icon-link,
:root[data-theme="dark"] .quick,
:root[data-theme="dark"] .profile-shortcuts a,
:root[data-theme="dark"] .folder-card,
:root[data-theme="dark"] .contacts a,
:root[data-theme="dark"] .file-preview-item,
:root[data-theme="dark"] .share-list label,
:root[data-theme="dark"] .share-card {
    background: #0b1220;
    color: var(--ink);
}

:root[data-theme="dark"] .share-card {
    border-color: rgba(94, 234, 212, .26);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
}

:root[data-theme="dark"] .quick-list {
    background: linear-gradient(180deg, #111b2d, #0f172a);
    border-color: rgba(94, 234, 212, .18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 14px 30px rgba(0, 0, 0, .2);
}

:root[data-theme="dark"] .quick {
    border-color: #26364f;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] .quick:hover {
    background: #172338;
    border-color: rgba(94, 234, 212, .34);
}

:root[data-theme="dark"] .quick b {
    color: #f3f7ff;
}

:root[data-theme="dark"] .quick small {
    color: #aebbd0;
}

:root[data-theme="dark"] .storage-meter-card {
    background: #0b1220;
    border-color: #26364f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 12px 26px rgba(0, 0, 0, .2);
}

:root[data-theme="dark"] .storage-meter {
    background: #172338;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .28);
}

:root[data-theme="dark"] .metric {
    background:
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--metric-color, var(--teal)) 22%, transparent) 0 34%, transparent 35%),
        linear-gradient(145deg, #111b2d, #0f172a);
    border-color: #26364f;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .metric::after {
    background: color-mix(in srgb, var(--metric-color, var(--teal)) 18%, transparent);
}

:root[data-theme="dark"] .metric-icon {
    background: color-mix(in srgb, var(--metric-color, var(--teal)) 18%, #0b1220);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--metric-color, var(--teal)) 26%, transparent);
}

:root[data-theme="dark"] .folder-cover {
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .34));
}

:root[data-theme="dark"] .folder-body {
    border-color: rgba(255, 210, 87, .32);
}

:root[data-theme="dark"] .folder-card:hover,
:root[data-theme="dark"] .folder-card.active {
    border-color: rgba(255, 210, 87, .34);
}

:root[data-theme="dark"] .share-card strong {
    color: #f4f8ff;
}

:root[data-theme="dark"] .share-card small,
:root[data-theme="dark"] .share-card label {
    color: #c3ccda;
}

:root[data-theme="dark"] .profile-panel a:hover,
:root[data-theme="dark"] .folder-card:hover,
:root[data-theme="dark"] .folder-card.active,
:root[data-theme="dark"] .quick:hover,
:root[data-theme="dark"] .profile-shortcuts a:hover,
:root[data-theme="dark"] .contacts a:hover {
    background: #172338;
}

:root[data-theme="dark"] .notif-panel {
    background: #101a2b;
    border-color: #2c3b53;
    color: #eef4ff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
}

:root[data-theme="dark"] .notif-panel > strong,
:root[data-theme="dark"] .notif-panel p,
:root[data-theme="dark"] .notif-item strong {
    color: #f4f8ff;
}

:root[data-theme="dark"] .notif-summary span {
    background: #172338;
    border: 1px solid #2f405b;
    color: #c8d3e4;
}

:root[data-theme="dark"] .notif-summary b {
    color: #f8fbff;
}

:root[data-theme="dark"] .notif-panel a {
    background: linear-gradient(180deg, #182338, #101a2b);
    border-color: #2f405b;
    color: #eef4ff;
}

:root[data-theme="dark"] .notif-panel a:hover {
    background: #1d2a42;
    border-color: rgba(94, 234, 212, .45);
}

:root[data-theme="dark"] .notif-panel small {
    color: #bac7d9;
}

:root[data-theme="dark"] .notif-badge {
    background: rgba(56, 184, 176, .2);
    color: #7ff3e8;
}

:root[data-theme="dark"] .notif-item.message .notif-badge {
    background: rgba(139, 146, 255, .22);
    color: #c7cbff;
}

:root[data-theme="dark"] .notif-item.other .notif-badge {
    background: rgba(251, 191, 36, .2);
    color: #fde68a;
}

:root[data-theme="dark"] .contacts a {
    border-color: #243149;
}

:root[data-theme="dark"] .contacts a.active {
    background: rgba(20, 184, 166, .16);
    border-color: rgba(45, 212, 191, .76);
    box-shadow: inset 4px 0 0 var(--teal), 0 12px 26px rgba(20, 184, 166, .12);
}

:root[data-theme="dark"] .contacts a.active b,
:root[data-theme="dark"] .contacts a.active small {
    color: var(--ink);
}

:root[data-theme="dark"] table {
    background: #111827;
    color: var(--ink);
}

:root[data-theme="dark"] th {
    background: #162135;
    color: #b9c4d4;
}

:root[data-theme="dark"] td {
    border-color: var(--line);
    color: #e8edf5;
}

:root[data-theme="dark"] td small,
:root[data-theme="dark"] .doc-name,
:root[data-theme="dark"] .preview-cell small,
:root[data-theme="dark"] .table-wrap a {
    color: #eef4ff;
}

:root[data-theme="dark"] tbody tr:hover td,
:root[data-theme="dark"] tr.notification-highlight.is-fading > td,
:root[data-theme="dark"] tr.notification-highlight.is-fading > td:first-child {
    background: #142033;
}

:root[data-theme="dark"] .chat-box,
:root[data-theme="dark"] .chat-form textarea,
:root[data-theme="dark"] .upload-progress,
:root[data-theme="dark"] .pagination-bar,
:root[data-theme="dark"] .uploads-chart,
:root[data-theme="dark"] #uploadsChart {
    background:
        radial-gradient(circle at 18% 8%, rgba(56, 184, 176, .12), transparent 28%),
        linear-gradient(180deg, #111b2d, #0b1220);
    border-color: #26364f;
}

:root[data-theme="dark"] .chart-badge {
    background: linear-gradient(180deg, #111b2d, #0b1220);
    border-color: #26364f;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] .chart-badge.accent {
    background: linear-gradient(135deg, rgba(56, 184, 176, .18), rgba(96, 165, 250, .12));
    border-color: rgba(94, 234, 212, .22);
}

:root[data-theme="dark"] .chart-badge b {
    color: #f4f8ff;
}

:root[data-theme="dark"] .chart-badge small {
    color: #b9c4d4;
}

:root[data-theme="dark"] .chat {
    background: linear-gradient(180deg, #111827, #0f172a);
}

:root[data-theme="dark"] .chat-box {
    background:
        linear-gradient(180deg, rgba(56, 184, 176, .055), rgba(96, 165, 250, .04)),
        #0b1220;
}

:root[data-theme="dark"] .chat-empty,
:root[data-theme="dark"] .empty {
    background: #121c2d;
    color: var(--ink);
    border-color: var(--line);
}

:root[data-theme="dark"] .chat-box .them {
    background: #182235;
    color: var(--ink);
    border-color: #2b394f;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}

:root[data-theme="dark"] .chat-box .them small {
    color: #9aa7ba;
}

:root[data-theme="dark"] .chat-box .me {
    background: linear-gradient(135deg, #22a7a6, #2d75d6);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(45, 117, 214, .24);
}

:root[data-theme="dark"] .chat-box p span,
:root[data-theme="dark"] .chat-box p small {
    background: transparent !important;
}

:root[data-theme="dark"] .chat-form {
    background: #101a2b;
    border-color: #26364f;
}

:root[data-theme="dark"] .chat-form textarea {
    color: var(--ink);
    background: #0b1220;
    border-color: transparent;
}

:root[data-theme="dark"] .conversation-count {
    background: #0b1220;
    color: #b9c4d4;
}

:root[data-theme="dark"] .chart-filter-modern,
:root[data-theme="dark"] .chart-summary,
:root[data-theme="dark"] .view-switch {
    background: #101a2b;
    border-color: var(--line);
    color: var(--ink);
}

:root[data-theme="dark"] .chart-summary strong,
:root[data-theme="dark"] .chart-filter-modern label span,
:root[data-theme="dark"] .view-switch a.active {
    color: #e8edf5;
}

:root[data-theme="dark"] .view-switch a {
    color: #b9c4d4;
}

:root[data-theme="dark"] .report-cover,
:root[data-theme="dark"] .report-options,
:root[data-theme="dark"] .report-document,
:root[data-theme="dark"] .report-table-wrap,
:root[data-theme="dark"] .report-metrics article,
:root[data-theme="dark"] .report-card,
:root[data-theme="dark"] .report-raw,
:root[data-theme="dark"] .report-list p,
:root[data-theme="dark"] .report-type-strip span,
:root[data-theme="dark"] .admin-file-field {
    background: #111b2d;
    border-color: var(--line);
    color: var(--ink);
}

:root[data-theme="dark"] .report-document,
:root[data-theme="dark"] .report-document h3,
:root[data-theme="dark"] .report-document b,
:root[data-theme="dark"] .report-document strong,
:root[data-theme="dark"] .report-table td,
:root[data-theme="dark"] .report-doc-name,
:root[data-theme="dark"] .report-metrics b,
:root[data-theme="dark"] .report-type-strip b,
:root[data-theme="dark"] .report-raw summary,
:root[data-theme="dark"] .report-box {
    color: #edf4ff;
}

:root[data-theme="dark"] .report-document-header p {
    color: #5eead4;
}

:root[data-theme="dark"] .report-document-header span,
:root[data-theme="dark"] .report-document-footer,
:root[data-theme="dark"] .report-options label span,
:root[data-theme="dark"] .report-metrics small,
:root[data-theme="dark"] .report-type-strip span,
:root[data-theme="dark"] .report-list small {
    color: #c3ccda;
}

:root[data-theme="dark"] .report-table th {
    background: #162135;
    color: #f1f5fb;
}

:root[data-theme="dark"] .report-row.upload td {
    background: rgba(20, 184, 166, .16);
}

:root[data-theme="dark"] .report-row.delete td {
    background: rgba(248, 113, 113, .15);
}

:root[data-theme="dark"] .report-row:hover td {
    background: rgba(96, 165, 250, .13);
}

:root[data-theme="dark"] .report-action-pill.upload {
    color: #b8fff6;
    background: rgba(20, 184, 166, .28);
}

:root[data-theme="dark"] .report-action-pill.delete {
    color: #ffd0cc;
    background: rgba(248, 113, 113, .24);
}

:root[data-theme="dark"] .report-cover {
    background:
        linear-gradient(135deg, rgba(20, 184, 166, .18), rgba(96, 165, 250, .08)),
        #111b2d;
}

:root[data-theme="dark"] .login-page {
    background:
        linear-gradient(90deg, rgba(8, 13, 24, .95), rgba(15, 23, 42, .8)),
        url('auth-bg.svg') center / cover no-repeat;
}

:root[data-theme="dark"] tr.notification-highlight > td {
    background: #2a220f;
}

:root[data-theme="dark"] .ajax-table-region.is-loading::after {
    background:
        linear-gradient(90deg, transparent, rgba(56, 184, 176, .22), transparent),
        rgba(11, 18, 32, .45);
}

:root[data-theme="dark"] .dashboard-region.is-loading::after {
    background:
        linear-gradient(90deg, transparent, rgba(56, 184, 176, .22), transparent),
        rgba(11, 18, 32, .45);
}

h1,
h2,
.topbar h1,
.dashboard-hero h2,
.login-copy h1 {
    font-family: var(--font-display);
    font-weight: 800;
}

h3,
.panel h3,
.login-card h2,
.panel-head h2 {
    font-family: var(--font-display);
    font-weight: 700;
}

strong,
b {
    font-weight: 600;
}

label,
.eyebrow,
.sidebar nav a,
.btn,
.icon-link,
.profile-chip b,
.profile-panel a,
.notif-item strong,
.notif-summary span,
.storage-panel span,
.quick,
.folder-card strong,
.folder-card small,
.folder-card em,
.view-switch a,
.filter-field > span,
th,
.status,
.pagination-info,
.pagination-info strong,
.pager a,
.pager span,
.pager b,
.file-picker b,
.file-picker small,
.file-preview-info strong,
.contact-search input,
.contacts a,
.contacts-head span,
.conversation-count,
.meta dt,
.meta dd,
.install-prompt strong,
.install-prompt span,
.avatar-picker-button,
.avatar-picker small,
.admin-file-button,
.admin-file-field small {
    font-weight: 500;
}

.btn,
.icon-link,
.avatar-picker-button,
.upload-submit,
.filter-actions .btn,
.login-card .btn {
    font-weight: 600;
}

@media (max-width: 980px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 318px);
        min-height: 100vh;
        z-index: 40;
        transform: translateX(-104%);
        transition: transform .22s ease;
        padding: 18px 16px;
        overflow-y: auto;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sidebar nav a {
        min-height: 48px;
    }

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

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .app-shell {
        margin-left: 0;
        padding: 14px;
        max-width: 100vw;
    }

    .mobile-menu-button {
        display: grid;
        flex: 0 0 42px;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        margin-bottom: 16px;
        padding: 12px;
    }

    .topbar-title {
        flex: 1 1 auto;
    }

    .topbar h1 {
        font-size: clamp(24px, 4.2vw, 30px);
    }

    .top-actions {
        flex: 0 0 auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .notif-panel {
        position: fixed;
        top: 82px;
        right: 14px;
        left: auto;
        width: min(420px, calc(100vw - 28px));
        max-height: calc(100vh - 104px);
        overflow: auto;
        z-index: 75;
    }

    .two,
    .split,
    .document-layout,
    .messages-layout,
    .storage-panel,
    .dashboard-period-panel,
    .login-hero {
        grid-template-columns: 1fr;
    }

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

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

    .dashboard-chart-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-chart-card {
        min-width: 0;
        overflow: hidden;
    }

    .uploads-chart,
    #uploadsChart {
        aspect-ratio: 4 / 3;
        min-height: 260px;
    }

    .chart-badges {
        justify-content: flex-start;
    }

    .contacts {
        position: static;
    }

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

    .filter-search {
        grid-column: 1 / -1;
    }

    .filter-field {
        grid-column: span 2;
    }

    .filter-size {
        grid-column: span 2;
    }

    .filter-sort {
        grid-column: span 2;
    }

    .filter-actions {
        grid-column: span 2;
    }

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

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

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

    .report-type-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-options {
        align-items: stretch;
        flex-direction: column;
    }

    .report-options label {
        min-width: 0;
    }

    .upload-submit {
        width: 100%;
    }

}

@media (max-width: 620px) {
    .filters,
    .row,
    .pwa-settings-grid,
    .upload-folder-row,
    .upload-actions-row,
    .dashboard-period-form,
    .avatar-form,
    .chat-form,
    .report-metrics,
    .report-type-strip,
    .brand-logo-picker > span,
    .pwa-icon-picker > span {
        grid-template-columns: 1fr;
    }

    .report-cover {
        align-items: stretch;
        flex-direction: column;
    }

    .report-actions {
        justify-content: stretch;
    }

    .report-actions .btn {
        width: 100%;
    }

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

    .admin-file-field {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-field,
    .filter-search,
    .filter-sort,
    .filter-actions,
    .upload-submit {
        grid-column: 1 / -1;
    }

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

    .chart-badges,
    .chart-badge {
        width: 100%;
    }

    .uploads-chart,
    #uploadsChart {
        aspect-ratio: 1 / 1;
        min-height: 280px;
    }

    .filter-actions .btn,
    .filter-actions a {
        width: 100%;
    }

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

    .topbar-title {
        align-items: center;
    }

    .topbar .eyebrow {
        font-size: 10px;
    }

    .top-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: nowrap;
        padding-left: 54px;
    }

    .top-actions .icon-button {
        width: 40px;
        height: 40px;
    }

    .profile-chip {
        min-width: 0;
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .profile-chip b {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .notif-panel {
        top: 118px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 136px);
        border-radius: 8px;
    }

    .profile-panel {
        right: 0;
        width: min(86vw, 230px);
    }

    .pagination-bar,
    .per-page-form,
    .pager {
        align-items: stretch;
        flex-direction: column;
    }

    .install-prompt {
        grid-template-columns: 42px minmax(0, 1fr) 38px;
    }

    .install-prompt .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .install-prompt [data-install-dismiss] {
        grid-column: 3;
        grid-row: 1;
    }

    .per-page-form label,
    .pager a,
    .pager span,
    .pager b {
        width: 100%;
    }

    .chat-box p {
        max-width: 88%;
    }

    .login-hero {
        padding: 22px;
    }

    .login-copy h1 {
        font-size: 38px;
    }
}

@media print {
    .sidebar,
    .topbar,
    .filters,
    .report-options,
    .report-actions,
    .chart-panel,
    .report-raw,
    .btn,
    .icon-link,
    .toast-stack {
        display: none !important;
    }

    .app-shell {
        margin: 0;
        padding: 0;
    }

    .panel {
        box-shadow: none;
        border: 0;
    }

    .report-document {
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .report-table-wrap {
        overflow: visible;
        border-color: #cfd8e3;
    }

    .report-table {
        min-width: 0;
        font-size: 11px;
    }

    .report-table th {
        position: static;
    }

    .report-row.upload td,
    .report-row.delete td {
        background: #fff !important;
    }
}
