@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #171717;
    --bg-soft: #1b1f24;
    --surface: #20252b;
    --surface-strong: #232a31;
    --surface-raised: rgba(35, 42, 49, 0.88);
    --line: rgba(0, 210, 183, 0.14);
    --line-strong: rgba(0, 210, 183, 0.34);
    --line-soft: rgba(255, 255, 255, 0.08);
    --grid: rgba(255, 255, 255, 0.03);
    --text: #f4fbf9;
    --soft: #c5d2d0;
    --muted: #8fa4a0;
    --accent: #00d2b7;
    --accent-dark: #00796b;
    --accent-soft: rgba(0, 210, 183, 0.14);
    --success: #3ce7c9;
    --warning: #f3c969;
    --danger: #ff7d7d;
    --shadow-xl: 0 28px 80px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 56px rgba(0, 0, 0, 0.34);
    --shadow-glow: 0 0 0 1px rgba(0, 210, 183, 0.16), 0 0 24px rgba(0, 210, 183, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --radius-pill: 999px;
    --font-body: "Manrope", "Segoe UI Variable Text", "Segoe UI", sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    background:
        radial-gradient(circle at top left, rgba(0, 210, 183, 0.14), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(0, 121, 107, 0.16), transparent 20%),
        linear-gradient(180deg, #0e1012 0%, #14171a 46%, #171717 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 88%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 16%, rgba(0, 210, 183, 0.08), transparent 22%),
        radial-gradient(circle at 86% 10%, rgba(0, 210, 183, 0.06), transparent 20%),
        radial-gradient(circle at 50% 100%, rgba(0, 121, 107, 0.08), transparent 28%);
}

body.auth-pending {
    visibility: hidden;
}

body,
body * {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 183, 0.52) rgba(255, 255, 255, 0.04);
}

body::-webkit-scrollbar,
body *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body::-webkit-scrollbar-track,
body *::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
    border-radius: var(--radius-pill);
}

body::-webkit-scrollbar-thumb,
body *::-webkit-scrollbar-thumb {
    border: 2px solid rgba(10, 17, 20, 0.88);
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, rgba(0, 210, 183, 0.72), rgba(0, 121, 107, 0.58));
}

h1,
h2 {
    margin: 0;
    font-weight: 850;
    letter-spacing: -0.045em;
    line-height: 1;
}

h1 {
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(1.45rem, 2.2vw, 2rem);
}

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

button {
    border: 0;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:hover,
button:focus-visible {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.92rem 1rem;
    color: var(--text);
    background: rgba(10, 14, 18, 0.82);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input,
select {
    min-height: 54px;
}

input::placeholder,
textarea::placeholder {
    color: rgba(197, 210, 208, 0.58);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--line-strong);
    background: rgba(9, 16, 19, 0.94);
    box-shadow: var(--shadow-glow);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

select option {
    color: var(--text);
    background: #20252b;
}

select option:checked,
select option:hover,
select option:focus {
    color: var(--text);
    background: #171d22;
}

input[type="file"] {
    padding: 0.72rem 0.8rem;
    line-height: 1.35;
    color: var(--soft);
    cursor: pointer;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
    margin-right: 14px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 210, 183, 0.42);
    background:
        linear-gradient(135deg, rgba(0, 210, 183, 0.14), rgba(0, 121, 107, 0.12)),
        rgba(0, 210, 183, 0.08);
    box-shadow: 0 0 0 1px rgba(0, 210, 183, 0.12), 0 0 18px rgba(0, 210, 183, 0.08);
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"] {
    color-scheme: dark;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    position: relative;
    padding-right: 3.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Crect x='0.75' y='0.75' width='20.5' height='20.5' rx='10.25' fill='%230f181b' stroke='rgba(0,210,183,0.22)'/%3E%3Crect x='5.25' y='6.25' width='11.5' height='10.5' rx='2' stroke='%2300D2B7' stroke-width='1.5'/%3E%3Cpath d='M8 4.75V7.25M14 4.75V7.25M5.75 9.25H16.25' stroke='%2300D2B7' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M8.5 12H8.507M11 12H11.007M13.5 12H13.507M8.5 14.5H8.507M11 14.5H11.007M13.5 14.5H13.507' stroke='%2300D2B7' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 22px 22px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    opacity: 0.01;
    cursor: pointer;
    transform: translateY(-50%);
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

label {
    display: grid;
    gap: 0.55rem;
}

label span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.page-shell {
    position: relative;
    z-index: 1;
    max-width: 1640px;
    margin: 0 auto;
    padding: 28px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    margin-bottom: 18px;
}

.hero-card,
.panel,
.login-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(36, 42, 49, 0.94), rgba(27, 31, 36, 0.94)),
        var(--surface);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.hero-title,
.hero-card,
.panel,
.login-card {
    padding: 24px;
}

.hero-title {
    display: grid;
    align-content: center;
    gap: 10px;
    min-height: 160px;
}

.eyebrow,
.meta-label {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.session-user {
    margin: 14px 0 8px;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.workspace-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-button {
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--soft);
    background: rgba(9, 18, 20, 0.72);
    font-weight: 850;
    letter-spacing: -0.01em;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.tab-button:hover,
.tab-button:focus-visible {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}

.tab-button.is-active {
    border-color: rgba(0, 210, 183, 0.32);
    color: #032924;
    background: linear-gradient(135deg, #10f0d0 0%, #00d2b7 50%, #00bda4 100%);
    box-shadow: 0 16px 40px rgba(0, 210, 183, 0.24);
}

.workspace-tabs .inline-status {
    margin-left: auto;
    min-width: 240px;
}

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

.workspace-layout[data-active-tab="directory"],
.workspace-layout[data-active-tab="accounting"],
.workspace-layout[data-active-tab="statistics"],
.workspace-layout[data-active-tab="audit"],
.sales-minimal .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
}

.sales-minimal .workspace-sidebar,
.sales-minimal .panel[data-section="filters"],
.sales-minimal #filters-form {
    display: none !important;
}

.workspace-sidebar {
    position: sticky;
    top: 24px;
}

.workspace-main,
.tab-panel-stack,
.admin-stack {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.panel {
    z-index: 1;
    animation: rise 0.36s ease both;
}

.panel.has-open-select,
.modal-card.has-open-select,
.hero-card.has-open-select,
.login-card.has-open-select {
    z-index: 120;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

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

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

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

.editor-grid-span {
    grid-column: span 2;
}

.editor-grid-compact {
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: 12px;
}

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

.primary,
.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    font-weight: 850;
    letter-spacing: -0.01em;
}

.primary {
    color: #032924;
    background: linear-gradient(135deg, #10f0d0 0%, #00d2b7 50%, #00bda4 100%);
    box-shadow: 0 16px 40px rgba(0, 210, 183, 0.24);
}

.ghost {
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--soft);
    background: rgba(255, 255, 255, 0.04);
}

.ghost:hover,
.ghost:focus-visible {
    border-color: var(--line-strong);
    background: rgba(0, 210, 183, 0.08);
}

.small-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.feed-list,
.seller-list,
.webhook-list {
    display: grid;
    gap: 12px;
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filter-chip-row .ghost.is-active {
    border-color: rgba(0, 210, 183, 0.34);
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(0, 210, 183, 0.18), rgba(33, 211, 194, 0.08)),
        rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 28px rgba(0, 210, 183, 0.12);
}

.compact-user-list {
    display: grid;
    gap: 10px;
}

.feed-item,
.seller-item,
.webhook-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    padding: 14px 16px;
    color: var(--soft);
}

.activity-log-item {
    gap: 10px;
}

.seller-finance-item {
    gap: 10px;
}

.compact-directory-block {
    display: grid;
    gap: 12px;
}

.compact-directory-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.seller-finance-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
}

.seller-finance-controls {
    display: flex;
    align-items: end;
    gap: 10px;
}

.seller-finance-controls label {
    min-width: 150px;
}

.compact-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
}

.compact-user-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.compact-user-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.compact-user-toggle input {
    width: auto;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.compact-user-controls {
    display: flex;
    align-items: end;
    gap: 10px;
}

.compact-user-controls label {
    min-width: 118px;
}

.compact-save-button {
    min-height: 42px;
    padding: 0 14px;
}

.compact-seller-list {
    max-height: 620px;
    gap: 8px;
}

.compact-seller-list .seller-item {
    border-radius: var(--radius-sm);
}

.compact-seller-list input[type="number"] {
    padding: 0.72rem 0.9rem;
}

.mentor-group-list {
    gap: 12px;
}

.mentor-group-item {
    display: grid;
    gap: 14px;
}

.mentor-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 220px auto;
    align-items: end;
    gap: 12px;
}

.mentor-group-members {
    display: grid;
    gap: 10px;
}

.mentor-group-members-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mentor-member-list {
    display: grid;
    gap: 10px;
}

.mentor-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.feed-item.unassigned {
    border-color: rgba(243, 201, 105, 0.28);
    box-shadow: inset 0 0 0 1px rgba(243, 201, 105, 0.08);
}

.feed-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    font-weight: 850;
}

.webhook-url-input {
    min-height: 86px;
    line-height: 1.35;
}

.webhook-url-preview,
.webhook-events-preview {
    margin-top: 2px;
    line-height: 1.25;
}

.webhook-url-preview {
    max-height: 2.6em;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-family: var(--font-mono);
    color: var(--success);
}

.webhook-target-preview {
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: rgba(6, 10, 12, 0.66);
    padding: 0.72rem 0.85rem;
    overflow-wrap: anywhere;
    font-family: var(--font-mono);
    color: var(--success);
}

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

.small {
    font-size: 0.84rem;
}

.table-wrap {
    overflow-x: auto;
    margin-inline: -6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(9, 14, 17, 0.42);
}

table {
    width: 100%;
    min-width: 1240px;
    border-collapse: collapse;
}

col.col-time {
    width: 172px;
}

col.col-order {
    width: 250px;
}

col.col-customer {
    width: 350px;
}

col.col-payment {
    width: 176px;
}

col.col-seller {
    width: 190px;
}

col.col-comment {
    width: 290px;
}

col.col-actions {
    width: 86px;
}

table.list-readonly .col-actions,
table.list-readonly th:last-child,
table.list-readonly td:last-child {
    display: none;
}

th,
td {
    padding: 22px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    text-align: left;
    vertical-align: top;
}

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

.money-text {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

tbody tr {
    transition: background 140ms ease;
}

tbody tr:hover {
    background: rgba(0, 210, 183, 0.04);
}

.sale-meta {
    display: grid;
    gap: 6px;
    line-height: 1.38;
}

.micro {
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}

.sale-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.7rem;
    border: 1px solid rgba(60, 231, 201, 0.2);
    border-radius: var(--radius-pill);
    color: var(--success);
    background: rgba(60, 231, 201, 0.12);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sale-status.unknown {
    border-color: rgba(243, 201, 105, 0.18);
    color: var(--warning);
    background: rgba(243, 201, 105, 0.12);
}

.sale-status.failed {
    border-color: rgba(255, 125, 125, 0.18);
    color: var(--danger);
    background: rgba(255, 125, 125, 0.12);
}

.payment-meta {
    align-content: start;
}

.sale-editor {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.sale-actions {
    display: grid;
    gap: 8px;
    justify-content: end;
    padding-top: 2px;
}

.seller-claim-button {
    width: 100%;
}

.table-comment {
    min-height: 82px;
    padding: 0.9rem 0.95rem;
    line-height: 1.5;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(7, 11, 13, 0.66);
}

.table-comment.is-saving {
    border-color: var(--line-strong);
    background: rgba(0, 210, 183, 0.08);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 60%),
        rgba(255, 255, 255, 0.035);
    color: var(--soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.icon-button-large {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
}

.danger-icon-button {
    color: var(--danger);
}

.danger-icon-button:hover {
    border-color: rgba(255, 125, 125, 0.26);
    background: rgba(255, 125, 125, 0.1);
}

.action-icon {
    display: block;
    width: 20px;
    height: 20px;
}

.meta-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.34rem 0.62rem;
    border: 1px solid rgba(0, 210, 183, 0.13);
    border-radius: var(--radius-pill);
    color: var(--soft);
    background: rgba(0, 210, 183, 0.06);
    font-size: 0.78rem;
    line-height: 1.2;
}

.small-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(0, 210, 183, 0.45);
    text-underline-offset: 0.18em;
}

.small-link:hover {
    text-decoration-color: rgba(0, 210, 183, 0.9);
}

.kind-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.64rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kind-sale {
    color: var(--success);
    background: rgba(60, 231, 201, 0.12);
    border: 1px solid rgba(60, 231, 201, 0.2);
}

.kind-refund {
    color: var(--danger);
    background: rgba(255, 125, 125, 0.12);
    border: 1px solid rgba(255, 125, 125, 0.2);
}

.kind-referral {
    color: var(--warning);
    background: rgba(243, 201, 105, 0.12);
    border: 1px solid rgba(243, 201, 105, 0.18);
}

.verified-pill {
    border-color: rgba(60, 231, 201, 0.2);
    color: var(--success);
    background: rgba(60, 231, 201, 0.12);
}

.unverified-pill {
    border-color: rgba(255, 255, 255, 0.09);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
}

.line-clamp-2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modal-dialog {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
}

.modal-dialog::backdrop {
    background: rgba(3, 7, 9, 0.66);
    backdrop-filter: blur(10px);
}

.modal-card {
    display: grid;
    gap: 22px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(180deg, rgba(36, 42, 49, 0.98), rgba(27, 31, 36, 0.98)),
        var(--surface);
    box-shadow: var(--shadow-xl);
}

.modal-head {
    margin-bottom: 0;
}

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

.modal-card textarea {
    min-height: 110px;
}

.status {
    min-height: 1.2rem;
    color: var(--danger);
}

.inline-status {
    color: var(--muted);
    text-align: right;
}

.paging {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.compact-form {
    margin-bottom: 18px;
}

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

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-line span {
    color: var(--soft);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.checkbox-line input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
    flex: 0 0 auto;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(14, 20, 24, 0.96), rgba(9, 14, 18, 0.96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

input[type="checkbox"] {
    border-radius: 7px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
    border-color: rgba(0, 210, 183, 0.32);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: var(--shadow-glow);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    border-color: rgba(0, 210, 183, 0.42);
    background:
        linear-gradient(135deg, rgba(0, 210, 183, 0.92), rgba(0, 121, 107, 0.92));
    box-shadow:
        0 0 0 1px rgba(0, 210, 183, 0.14),
        0 0 18px rgba(0, 210, 183, 0.12);
}

input[type="checkbox"]:checked {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.25L6.5 11.25L12.5 4.75' stroke='%23031914' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
        linear-gradient(135deg, rgba(0, 210, 183, 0.92), rgba(0, 121, 107, 0.92));
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    background-size: 12px 12px, auto;
}

.select-shell {
    position: relative;
    min-width: 0;
}

.select-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.select-trigger {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0.92rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(10, 14, 18, 0.82);
    color: var(--text);
    font: inherit;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.select-trigger:hover {
    border-color: rgba(0, 210, 183, 0.24);
}

.select-shell.is-open .select-trigger,
.select-trigger:focus-visible {
    outline: none;
    border-color: var(--line-strong);
    background: rgba(9, 16, 19, 0.94);
    box-shadow: var(--shadow-glow);
}

.select-shell.is-disabled .select-trigger {
    opacity: 0.55;
    cursor: default;
}

.select-trigger-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-trigger-icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: transform 140ms ease, color 140ms ease;
}

.select-shell.is-open .select-trigger-icon {
    color: var(--accent);
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background:
        linear-gradient(180deg, rgba(36, 42, 49, 0.98), rgba(27, 31, 36, 0.98)),
        var(--surface);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    backdrop-filter: blur(18px);
}

.select-shell.is-open .select-dropdown {
    display: grid;
    gap: 6px;
}

.select-option {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.select-option:hover,
.select-option:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(0, 210, 183, 0.16);
    background: rgba(0, 210, 183, 0.08);
}

.select-option.is-selected {
    border-color: rgba(0, 210, 183, 0.18);
    background:
        linear-gradient(135deg, rgba(0, 210, 183, 0.14), rgba(0, 121, 107, 0.12)),
        rgba(0, 210, 183, 0.08);
    box-shadow: 0 0 0 1px rgba(0, 210, 183, 0.12), 0 0 18px rgba(0, 210, 183, 0.08);
}

input[type="radio"]:checked {
    background-image:
        radial-gradient(circle at center, #031914 0 34%, transparent 38%),
        linear-gradient(135deg, rgba(0, 210, 183, 0.92), rgba(0, 121, 107, 0.92));
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    background-size: 100% 100%, auto;
}

.settings-note {
    margin-top: -2px;
    line-height: 1.6;
}

.webhook-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.accounting-import-result {
    white-space: pre-wrap;
}

.payroll-sheet-list {
    display: grid;
    gap: 16px;
}

.paging-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.payroll-sheet-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(7, 11, 13, 0.42);
}

.compact-head {
    margin-bottom: 0;
}

.sheet-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sheet-details[hidden] {
    display: none !important;
}

.compact-inline-field {
    min-width: 120px;
}

.compact-inline-field input,
.compact-inline-field select,
.statistics-table input {
    min-height: 44px;
}

.statistics-chart {
    display: grid;
    gap: 10px;
}

.statistics-chart-list {
    display: grid;
    gap: 10px;
}

.statistics-dual-chart {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 16px 18px 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 18% 15%, rgba(91, 141, 239, 0.18), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(255, 126, 182, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(12, 18, 22, 0.72), rgba(7, 11, 13, 0.48));
}

.statistics-dual-chart svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 980 / 310;
    min-height: 230px;
}

.statistics-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    color: var(--soft);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.statistics-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.statistics-chart-legend i {
    width: 18px;
    height: 4px;
    border-radius: var(--radius-pill);
}

.statistics-tooltip-dock {
    min-height: 124px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(139, 92, 246, 0.08), rgba(56, 189, 248, 0.045), rgba(244, 63, 94, 0.06)),
        rgba(255, 255, 255, 0.025);
}

.statistics-tooltip-placeholder {
    display: grid;
    min-height: 98px;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 850;
}

.statistics-dual-chart.has-tooltip .statistics-tooltip-placeholder {
    display: none;
}

.statistics-tooltip-card {
    display: none;
    grid-template-columns: minmax(120px, 0.5fr) minmax(0, 2.4fr);
    align-items: start;
    gap: 18px 24px;
    min-height: 98px;
}

.statistics-tooltip-card.is-visible {
    display: grid;
    animation: tooltipDockIn 140ms ease both;
}

.statistics-tooltip-date {
    display: grid;
    gap: 3px;
    align-content: start;
}

.statistics-tooltip-card strong {
    display: block;
    margin-bottom: 3px;
    font-size: 1rem;
}

.statistics-tooltip-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.statistics-tooltip-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.statistics-tooltip-group {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.statistics-tooltip-group:first-child {
    padding-left: 0;
    border-left: 0;
}

.statistics-tooltip-group-title {
    color: var(--soft);
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.statistics-tooltip-group dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    margin: 0;
}

.statistics-tooltip-group dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.statistics-tooltip-group dd {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.legend-leads-plan {
    background: #8b5cf6;
}

.legend-leads-fact {
    background: #38bdf8;
}

.legend-revenue-plan {
    background: #f59e0b;
}

.legend-revenue-fact {
    background: #f43f5e;
}

.statistics-axis-grid {
    stroke: rgba(255, 255, 255, 0.07);
    stroke-width: 1;
}

.statistics-axis-title {
    fill: var(--soft);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.statistics-axis-label {
    fill: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.statistics-area {
    stroke: none;
}

.revenue-plan-area {
    fill: url("#statisticsRevenueGradient");
}

.revenue-fact-area {
    fill: url("#statisticsFactGradient");
}

.statistics-line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.leads-plan-line {
    stroke: #8b5cf6;
    stroke-dasharray: 8 7;
}

.leads-fact-line {
    stroke: #38bdf8;
}

.revenue-plan-line {
    stroke: #f59e0b;
    stroke-dasharray: 10 8;
}

.revenue-fact-line {
    stroke: #f43f5e;
}

.statistics-point {
    stroke: rgba(7, 11, 13, 0.95);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.statistics-hover-point {
    fill: transparent;
    outline: none;
    cursor: crosshair;
    pointer-events: all;
}

.statistics-hover-point:focus {
    fill: rgba(255, 255, 255, 0.08);
}

.leads-fact-point {
    fill: #38bdf8;
}

.revenue-fact-point {
    fill: #f43f5e;
}

.statistics-tooltip {
    position: absolute;
    z-index: 3;
    width: max-content;
    min-width: 220px;
    max-width: 280px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(31, 37, 45, 0.98), rgba(15, 20, 26, 0.98));
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.38);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 16px)) scale(0.98);
    transition: opacity 120ms ease, transform 120ms ease;
}

.statistics-tooltip.is-below {
    transform: translate(-50%, 18px) scale(0.98);
}

.statistics-tooltip.is-left-edge {
    transform: translate(0, calc(-100% - 16px)) scale(0.98);
}

.statistics-tooltip.is-right-edge {
    transform: translate(-100%, calc(-100% - 16px)) scale(0.98);
}

.statistics-tooltip.is-below.is-left-edge {
    transform: translate(0, 18px) scale(0.98);
}

.statistics-tooltip.is-below.is-right-edge {
    transform: translate(-100%, 18px) scale(0.98);
}

.statistics-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 20, 26, 0.98);
    transform: translateX(-50%) rotate(45deg);
}

.statistics-tooltip.is-below::after {
    top: -7px;
    bottom: auto;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.statistics-tooltip.is-left-edge::after {
    left: 24px;
}

.statistics-tooltip.is-right-edge::after {
    left: auto;
    right: 18px;
}

.statistics-tooltip strong {
    display: block;
    margin-bottom: 3px;
    font-size: 1rem;
}

.statistics-tooltip > span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.statistics-tooltip dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 14px;
    margin: 0;
}

.statistics-tooltip dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.statistics-tooltip dd {
    margin: 0;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.statistics-tooltip.is-visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 12px)) scale(1);
}

.statistics-tooltip.is-visible.is-below {
    transform: translate(-50%, 14px) scale(1);
}

.statistics-tooltip.is-visible.is-left-edge {
    transform: translate(0, calc(-100% - 12px)) scale(1);
}

.statistics-tooltip.is-visible.is-right-edge {
    transform: translate(-100%, calc(-100% - 12px)) scale(1);
}

.statistics-tooltip.is-visible.is-below.is-left-edge {
    transform: translate(0, 14px) scale(1);
}

.statistics-tooltip.is-visible.is-below.is-right-edge {
    transform: translate(-100%, 14px) scale(1);
}

.loading-card,
.statistics-loading-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 150px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(110deg, rgba(139, 92, 246, 0.09), rgba(56, 189, 248, 0.06), rgba(244, 63, 94, 0.08)),
        rgba(7, 11, 13, 0.42);
    overflow: hidden;
    position: relative;
}

.loading-card::after,
.statistics-loading-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
    transform: translateX(-100%);
    animation: loadingSweep 1.2s ease-in-out infinite;
}

.loading-card strong,
.statistics-loading-card strong {
    display: block;
    font-size: 1.05rem;
}

.loading-card span,
.statistics-loading-card span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.loading-orbit,
.statistics-loading-orbit {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #38bdf8;
    border-right-color: #f43f5e;
    animation: loadingOrbit 0.9s linear infinite;
}

.loading-copy {
    position: relative;
    z-index: 1;
}

.table-loading-row td {
    padding: 0;
}

.table-loading-row .loading-card {
    margin: 12px;
    min-height: 132px;
}

.feed-list .loading-card,
.payroll-sheet-list .loading-card {
    min-height: 118px;
}

.statistics-warning {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 125, 125, 0.42);
    border-radius: var(--radius-md);
    color: #ffecec;
    background:
        linear-gradient(135deg, rgba(255, 125, 125, 0.22), rgba(160, 34, 34, 0.16)),
        rgba(46, 14, 18, 0.76);
    box-shadow:
        0 0 0 1px rgba(255, 125, 125, 0.08),
        0 18px 42px rgba(120, 24, 32, 0.18);
}

.statistics-warning strong {
    color: #fff7f7;
    font-size: 1rem;
}

.statistics-warning span {
    color: rgba(255, 236, 236, 0.82);
    font-size: 0.9rem;
    font-weight: 750;
}

.plan-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}

.plan-tools .checkbox-line {
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
}

.auto-week-tools {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.auto-week-tools .status {
    grid-column: 1 / -1;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.statistics-day-card,
.statistics-week-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(7, 11, 13, 0.42);
}

.statistics-day-card {
    grid-template-columns: minmax(135px, 0.78fr) minmax(200px, 1.1fr) minmax(200px, 1.1fr) minmax(250px, 1.4fr) minmax(120px, 0.55fr);
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
}

.statistics-day-head,
.statistics-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.statistics-day-head {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.statistics-bars {
    display: grid;
    gap: 10px;
}

.statistics-metric-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.statistics-metric-title {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.statistics-bar-row {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) minmax(90px, 1.2fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.statistics-inline-row {
    display: grid;
    grid-template-columns: 44px minmax(100px, 1fr) minmax(82px, max-content);
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
}

.statistics-inline-row strong,
.statistics-kpi strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.statistics-bar-track {
    height: 9px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
}

.statistics-bar {
    height: 100%;
    border-radius: inherit;
    background: #8b5cf6;
}

.statistics-bar.plan {
    background: #8b5cf6;
}

.statistics-bar.sales-plan {
    background: #94a3b8;
}

.statistics-bar.sales-fact {
    background: #e879f9;
}

.statistics-bar.fact,
.statistics-bar.revenue-fact {
    background: #38bdf8;
}

.statistics-bar.revenue-plan {
    background: #f59e0b;
}

.statistics-bar.revenue-fact {
    background: #f43f5e;
}

.statistics-kpi {
    display: grid;
    gap: 4px;
    align-content: center;
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.statistics-kpi span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.statistics-kpi strong {
    font-size: 1.05rem;
}

.statistics-week-grid {
    display: grid;
    gap: 16px;
}

.statistics-table th:first-child,
.statistics-table td:first-child {
    min-width: 150px;
}

.th-with-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-height: 30px;
    cursor: help;
}

.th-with-info::before,
.th-with-info::after {
    position: absolute;
    right: 0;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
    pointer-events: none;
}

.th-with-info::before {
    content: attr(data-tooltip);
    top: calc(100% + 12px);
    width: max-content;
    max-width: 320px;
    padding: 12px 14px;
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 14px;
    color: rgba(244, 255, 252, 0.94);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(7, 25, 28, 0.98));
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 24px rgba(45, 212, 191, 0.14);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-align: left;
    text-transform: none;
    transform: translateY(6px);
}

.th-with-info::after {
    content: "";
    top: calc(100% + 5px);
    width: 12px;
    height: 12px;
    border-left: 1px solid rgba(56, 189, 248, 0.34);
    border-top: 1px solid rgba(56, 189, 248, 0.34);
    background: rgba(7, 25, 28, 0.98);
    transform: translate(-16px, 6px) rotate(45deg);
}

.th-with-info:hover::before,
.th-with-info:focus-visible::before,
.th-with-info:hover::after,
.th-with-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.th-with-info:hover::after,
.th-with-info:focus-visible::after {
    transform: translate(-16px, 0) rotate(45deg);
}

.compact-inline-field .th-with-info {
    justify-content: flex-start;
}

.metric-info {
    justify-content: flex-start;
}

.metric-info::before,
.compact-inline-field .th-with-info::before {
    right: auto;
    left: 0;
}

.metric-info::after,
.compact-inline-field .th-with-info::after {
    right: auto;
    left: 18px;
    transform: translateY(6px) rotate(45deg);
}

.metric-info:hover::after,
.metric-info:focus-visible::after,
.compact-inline-field .th-with-info:hover::after,
.compact-inline-field .th-with-info:focus-visible::after {
    transform: translateY(0) rotate(45deg);
}

.info-dot {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, 0.38);
    border-radius: 50%;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    font-size: 0.7rem;
    font-weight: 950;
    line-height: 1;
    text-transform: none;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
}

.unit-input {
    position: relative;
    display: block;
}

.unit-input input {
    padding-right: 3.2rem;
}

.unit-input span {
    position: absolute;
    top: 50%;
    right: 1rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    transform: translateY(-50%);
    pointer-events: none;
}

.statistics-group-row td {
    padding: 10px 18px;
    color: #fbbf24;
    background:
        linear-gradient(90deg, rgba(245, 158, 11, 0.14), rgba(139, 92, 246, 0.06), transparent);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.webhook-actions .ghost {
    min-height: 42px;
    padding: 0 14px;
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(500px, 100%);
}

.login-card p {
    line-height: 1.65;
}

.page-shell .panel[data-section="list"] {
    padding-inline: 28px;
}

.workspace-layout .panel[data-section="filters"] {
    padding: 22px;
}

.admin-stack {
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    align-items: start;
}

.admin-stack > .panel[data-section="sales-list-settings"] {
    grid-column: 1 / -1;
}

.seller-list {
    max-height: 780px;
    overflow: auto;
}

strong {
    color: var(--text);
}

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

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

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

@keyframes loadingSweep {
    to {
        transform: translateX(100%);
    }
}

@media (max-width: 1080px) {
    .hero,
    .filters-grid,
    .editor-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .workspace-layout,
    .admin-stack {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        position: static;
    }

    .editor-grid-span {
        grid-column: span 1;
    }

    .panel-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .page-shell {
        padding: 20px;
    }

    .page-shell .panel[data-section="list"] {
        padding-inline: 20px;
    }

    .modal-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .modal-card {
        padding: 20px;
    }

    .workspace-tabs {
        flex-wrap: wrap;
    }

    .workspace-tabs .inline-status {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    :root {
        --radius-lg: 18px;
        --radius-md: 16px;
        --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.32);
    }

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

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.22rem;
    }

    input,
    select,
    textarea {
        padding: 0.78rem 0.86rem;
        border-radius: var(--radius-sm);
        font-size: 0.92rem;
    }

    .page-shell {
        width: 100%;
        padding: 14px;
        overflow-x: hidden;
    }

    .hero {
        gap: 10px;
        margin-bottom: 12px;
    }

    .hero-title,
    .hero-card,
    .panel,
    .login-card {
        padding: 16px;
    }

    .hero-title {
        min-height: 0;
    }

    .hero-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 4px;
    }

    .hero-card .meta-label,
    .hero-card .muted {
        grid-column: 1;
    }

    .hero-card .ghost {
        grid-column: 2;
        grid-row: 1 / span 3;
        min-height: 38px;
        padding: 0 13px;
    }

    .session-user {
        margin: 0;
        font-size: 1rem;
    }

    .eyebrow,
    .meta-label {
        font-size: 0.66rem;
        letter-spacing: 0.1em;
    }

    .workspace-tabs {
        max-width: 100%;
        gap: 8px;
        margin-bottom: 12px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .tab-button {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0 14px;
        white-space: nowrap;
        font-size: 0.84rem;
    }

    .workspace-layout,
    .workspace-main,
    .tab-panel-stack,
    .admin-stack {
        gap: 12px;
    }

    .workspace-layout .panel[data-section="filters"],
    .page-shell .panel[data-section="list"] {
        padding: 14px;
    }

    .panel-head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
    }

    .panel-head-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }

    .statistics-day-card {
        grid-template-columns: 1fr;
    }

    .statistics-tooltip-card,
    .statistics-tooltip-groups,
    .statistics-tooltip-group dl {
        grid-template-columns: 1fr;
    }

    .statistics-tooltip-group {
        padding-left: 0;
        border-left: 0;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .statistics-tooltip-group:first-child {
        padding-top: 0;
        border-top: 0;
    }

    .plan-tools,
    .auto-week-tools {
        grid-template-columns: 1fr;
    }

    .primary,
    .ghost {
        min-height: 44px;
        padding: 0 15px;
    }

    .filters-stack,
    .stack {
        gap: 10px;
    }

    .filter-actions {
        gap: 8px;
    }

    .table-wrap {
        max-width: 100%;
        margin-inline: 0;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    table {
        min-width: 0;
    }

    thead,
    colgroup {
        display: none;
    }

    tbody {
        display: grid;
        gap: 10px;
    }

    tr {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.035);
    }

    td {
        display: grid;
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        word-break: break-word;
    }

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

    td::before {
        content: attr(data-label);
        padding-top: 2px;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 850;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    table.list-readonly td:last-child {
        display: none;
    }

    .sale-meta {
        gap: 4px;
    }

    .sale-editor {
        gap: 8px;
    }

    .seller-claim-button {
        width: auto;
        min-width: 0;
        justify-self: start;
    }

    .table-comment {
        min-height: 66px;
        padding: 0.72rem 0.8rem;
    }

    .sale-actions {
        display: flex;
        justify-content: flex-start;
    }

    .icon-button {
        width: 38px;
        height: 38px;
    }

    .paging {
        gap: 10px;
        margin-top: 12px;
    }

    .paging .ghost {
        min-width: 82px;
    }

    .paging-status {
        order: -1;
        width: 100%;
        text-align: center;
    }

    .feed-list,
    .seller-list,
    .webhook-list {
        gap: 10px;
    }

    .feed-item,
    .seller-item,
    .webhook-item {
        padding: 12px;
        border-radius: var(--radius-sm);
    }

.seller-finance-head,
    .seller-finance-controls {
        display: grid;
        gap: 10px;
    }

    .seller-finance-controls label {
        min-width: 0;
    }

    .compact-directory-head,
    .compact-user-item,
    .compact-user-controls,
    .mentor-group-item,
    .mentor-group-head,
    .mentor-member-row {
        display: grid;
        gap: 10px;
    }

    .compact-user-controls label {
        min-width: 0;
    }

    .feed-title {
        align-items: flex-start;
    }

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

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

    .webhook-url-input {
        min-height: 92px;
    }

    .webhook-url-preview {
        max-height: none;
        white-space: normal;
        word-break: break-all;
    }

    .modal-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .modal-card {
        gap: 14px;
        padding: 14px;
        border-radius: var(--radius-md);
    }

    .editor-grid-compact {
        grid-template-columns: 1fr;
    }
}
