:root {
    --bg: #f7f8fb;
    --surface: rgba(255, 255, 255, .96);
    --panel: #ffffff;
    --panel-soft: #f4f6fa;
    --text: #24252f;
    --muted: #667085;
    --line: rgba(36, 37, 47, .11);
    --brand: #e52e67;
    --brand-strong: #c91f58;
    --brand-soft: #fff1f6;
    --purple: #5b3ea6;
    --purple-deep: #232136;
    --violet: #7c6bb0;
    --accent: #65d7c4;
    --accent-soft: #ecfffb;
    --danger: #d92d5c;
    --success: #157a66;
    --warning: #9b6a20;
    --shadow: 0 18px 45px rgba(36, 37, 47, .08);
    --shadow-strong: 0 28px 80px rgba(36, 37, 47, .14);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #ffffff 0, #fbfcfe 34%, #f7f8fb 100%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

a {
    color: var(--brand-strong);
    text-decoration: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(125deg, rgba(229, 46, 103, .08), transparent 38%),
        linear-gradient(180deg, #ffffff 0, #f7f8fb 100%);
}

.login-card {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(36, 37, 47, .08);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(36, 37, 47, .12);
    padding: 32px;
}

.brand-logo {
    display: block;
    object-fit: contain;
}

.brand-logo-login {
    width: 78px;
    height: auto;
    margin: 0;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.login-brand span {
    color: var(--purple-deep);
    font-size: 34px;
    font-weight: 950;
    letter-spacing: 0;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    transition: grid-template-columns .34s cubic-bezier(.2, .8, .2, 1);
}

body.nav-collapsed .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
    background: rgba(255, 255, 255, .96);
    color: var(--muted);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    box-shadow: 14px 0 38px rgba(36, 37, 47, .05);
    min-width: 0;
    overflow: visible;
    z-index: 4;
    transition:
        padding .34s cubic-bezier(.2, .8, .2, 1),
        box-shadow .26s ease;
}

body.nav-collapsed .sidebar {
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    min-width: 0;
}

body.nav-collapsed .sidebar-head {
    display: grid;
    justify-items: center;
    gap: 9px;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 900;
    color: var(--text);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.sidebar .logo img {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 0 0 auto;
}

.sidebar .logo span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.nav-collapsed .sidebar .logo span {
    display: none;
}

.nav a,
.nav-group-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #596074;
    padding: 10px 12px;
    border-radius: 13px;
    margin: 3px 0;
    font-weight: 820;
    position: relative;
    white-space: nowrap;
}

.nav-group {
    position: relative;
    margin: 3px 0;
}

.nav-group-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.nav-caret {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .7;
}

.nav-submenu {
    display: grid;
    gap: 3px;
    max-height: 0;
    margin: 0 0 0 16px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: max-height .22s ease, opacity .18s ease, visibility .18s ease;
}

.nav-group.is-open .nav-submenu,
.nav-group.is-pinned .nav-submenu {
    max-height: 360px;
    opacity: 1;
    visibility: visible;
}

.nav-submenu-title {
    display: none;
}

.nav-submenu a {
    min-height: 36px;
    margin: 1px 0;
    padding: 8px 10px;
    font-size: 13px;
}

.nav-submenu .nav-icon {
    width: 18px;
    height: 18px;
}

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

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.nav-collapsed .nav a,
body.nav-collapsed .nav-group-trigger {
    width: 50px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    margin: 5px auto;
}

body.nav-collapsed .nav-group {
    width: 50px;
    margin: 5px auto;
}

body.nav-collapsed .nav-label {
    display: none;
}

body.nav-collapsed .nav-caret {
    display: none;
}

body.nav-collapsed .nav-submenu {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    width: 230px;
    max-height: none;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(36, 37, 47, .16);
    opacity: 0;
    visibility: hidden;
    overflow: visible;
    pointer-events: none;
    transform: translateX(-4px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    z-index: 20;
}

body.nav-collapsed .nav-group.is-open .nav-submenu,
body.nav-collapsed .nav-group.is-pinned .nav-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

body.nav-collapsed .nav-submenu-title {
    display: block;
    padding: 5px 8px 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

body.nav-collapsed .nav-submenu a {
    width: auto;
    min-height: 38px;
    justify-content: flex-start;
    padding: 8px 10px;
    margin: 1px 0;
}

body.nav-collapsed .nav-submenu .nav-label {
    display: inline;
}

.nav a.active,
.nav a:hover,
.nav-group-trigger.active,
.nav-group-trigger:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.nav a.active::before,
.nav-group-trigger.active::before {
    content: "";
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: var(--brand);
    position: absolute;
    left: 0;
}

.main {
    min-width: 0;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 28px rgba(36, 37, 47, .04);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 3;
}

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

.nav-toggle {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(36, 37, 47, .05);
    flex: 0 0 auto;
}

body.nav-collapsed .nav-toggle {
    width: 42px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
}

.nav-toggle-icon {
    display: block;
    width: 18px;
    height: 18px;
    position: relative;
    background:
        linear-gradient(var(--brand), var(--brand)) 1px 3px / 16px 2px no-repeat,
        linear-gradient(var(--brand), var(--brand)) 1px 8px / 16px 2px no-repeat,
        linear-gradient(var(--brand), var(--brand)) 1px 13px / 16px 2px no-repeat;
}

body:not(.nav-collapsed) .nav-toggle-icon {
    background: none;
}

body:not(.nav-collapsed) .nav-toggle-icon::before {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    left: 6px;
    top: 5px;
    border-left: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(45deg);
}

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

.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(480px, 32vw, 620px);
    min-height: calc(100vh - 72px);
    transition: grid-template-columns .34s cubic-bezier(.2, .8, .2, 1);
}

body.ai-hidden .workbench {
    grid-template-columns: minmax(0, 1fr) 0;
}

.content {
    min-width: 0;
    padding: 26px 30px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(247, 248, 251, .92)),
        var(--bg);
}

.content > .grid,
.content > .panel,
.content > .page-hero,
.content > h1,
.content > p,
.content > .tabs {
    width: min(100%, 1180px);
    margin-left: auto;
    margin-right: auto;
}

.ai-panel {
    min-width: 0;
    overflow: hidden;
    border-left: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(229, 46, 103, .045), transparent 34%),
        linear-gradient(180deg, #ffffff 0, #fbfcfe 100%);
    color: var(--text);
    display: grid;
    grid-template-rows: 3px auto 1fr auto;
    max-height: calc(100vh - 72px);
    position: sticky;
    top: 72px;
    box-shadow: -20px 0 52px rgba(36, 37, 47, .08);
    opacity: 1;
    transform: translateX(0);
    transition:
        opacity .28s ease,
        transform .34s cubic-bezier(.2, .8, .2, 1),
        box-shadow .34s ease;
    will-change: transform, opacity;
}

.ai-panel::before {
    content: "";
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand));
    background-size: 180% 100%;
    animation: aiSweep 5.5s linear infinite;
}

body.ai-hidden .ai-panel {
    border-left: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(36px);
    box-shadow: none;
}

.ai-head {
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(135deg, rgba(229, 46, 103, .08), rgba(101, 215, 196, .12)),
        #fff;
}

.ai-head h2 {
    font-size: 24px;
    letter-spacing: 0;
}

.ai-log {
    overflow-y: auto;
    padding: 28px;
    display: grid;
    align-content: start;
    gap: 16px;
    background-image:
        linear-gradient(rgba(36, 37, 47, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 37, 47, .035) 1px, transparent 1px);
    background-size: 28px 28px;
    background-position: -1px -1px;
}

.ai-message {
    padding: 18px 20px;
    border-radius: 20px;
    line-height: 1.45;
    animation: messageIn .26s ease both;
}

.ai-message strong {
    display: block;
    margin-bottom: 6px;
}

.ai-message.assistant {
    background: linear-gradient(145deg, #ffffff, #f6f8fb);
    border: 1px solid var(--line);
    box-shadow: 0 18px 42px rgba(36, 37, 47, .08);
    position: relative;
}

.ai-message.assistant::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
}

.ai-message.loading {
    color: var(--muted);
}

.thinking-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--brand);
    animation: typingPulse 1.05s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: .16s;
}

.typing-dots i:nth-child(3) {
    animation-delay: .32s;
}

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

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

@keyframes aiSweep {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 180% 0;
    }
}

@keyframes aiButtonSweep {
    0%, 55% {
        transform: translateX(-120%);
    }
    76%, 100% {
        transform: translateX(120%);
    }
}

.ai-message.user {
    background: var(--brand-soft);
    color: var(--text);
    border: 1px solid rgba(229, 46, 103, .15);
}

.ai-actions {
    margin: 10px 0 0;
    padding-left: 18px;
}

.ai-compose {
    padding: 22px 24px;
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fafbfe);
}

.ai-compose textarea {
    min-height: 126px;
    background: #fff;
    border-color: rgba(229, 46, 103, .26);
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(36, 37, 47, .06);
}

h1, h2, h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.12;
}

h2 {
    font-size: 16px;
}

h3 {
    font-size: 14px;
}

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

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

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

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

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

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(14px);
}

.panel.has-open-help {
    overflow: visible;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-help {
    position: relative;
    flex: 0 0 auto;
}

.section-help-button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(91, 62, 166, .22);
    border-radius: 50%;
    background: #fff;
    color: var(--purple);
    font: inherit;
    font-weight: 950;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(36, 37, 47, .06);
}

.section-help-button:hover,
.section-help-button:focus-visible,
.section-help.is-open .section-help-button {
    border-color: rgba(229, 46, 103, .38);
    color: var(--brand-strong);
    background: var(--brand-soft);
    outline: none;
}

.section-help-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(330px, calc(100vw - 48px));
    padding: 14px 16px;
    border: 1px solid rgba(36, 37, 47, .12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(36, 37, 47, .16);
    z-index: 95;
}

.section-help-popover strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.section-help-popover ul {
    margin: 0;
    padding-left: 18px;
    color: #3e3e3c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.section-help-popover li + li {
    margin-top: 6px;
}

.panel-body {
    padding: 18px 20px;
}

.kpi {
    padding: 18px 20px;
    min-height: 96px;
    background:
        linear-gradient(145deg, #ffffff, #f8fafc),
        var(--panel);
    position: relative;
}

.kpi::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 0;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.kpi .value {
    font-size: 28px;
    font-weight: 900;
    margin-top: 8px;
    color: var(--text);
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-weight: 880;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(36, 37, 47, .05);
}

.btn-small {
    min-height: 34px;
    padding: 7px 13px;
    font-size: 12px;
}

.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: .72;
}

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

.btn-primary,
.ai-toggle {
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 14px 30px rgba(229, 46, 103, .2);
}

.ai-toggle {
    position: relative;
    overflow: hidden;
    padding-inline: 22px;
}

.ai-toggle::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(101, 215, 196, .18);
    margin-right: 9px;
}

.ai-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, .32) 48%, transparent 62% 100%);
    transform: translateX(-120%);
    animation: aiButtonSweep 4.6s ease-in-out infinite;
    pointer-events: none;
}

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

.btn-danger-soft {
    background: #fff1f6;
    border-color: rgba(217, 45, 92, .22);
    color: var(--danger);
}

.btn-secondary-soft {
    background: #f5f2ff;
    border-color: rgba(91, 62, 166, .24);
    color: var(--purple);
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(36, 37, 47, .06);
}

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

form.stack {
    display: grid;
    gap: 14px;
}

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

.user-management-list {
    display: grid;
    gap: 16px;
}

.user-editor {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(145deg, #ffffff, #f8fafc),
        #fff;
    box-shadow: 0 14px 34px rgba(36, 37, 47, .05);
}

.user-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 2px;
}

.user-editor-head h3,
.user-editor-head p {
    margin: 0;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.list-toolbar {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.list-toolbar .btn {
    min-height: 40px;
}

.search-box {
    min-width: min(300px, 100%);
}

.search-box input {
    padding-left: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236f607d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px 16px;
}

.user-match-count {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.user-selected-count {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    color: var(--brand-strong);
    white-space: nowrap;
}

.table-check {
    width: 44px;
    text-align: center;
}

.table-check input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    accent-color: var(--brand);
    cursor: pointer;
}

.object-table th:last-child,
.object-table td:last-child {
    text-align: right;
}

.table-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.table-actions form {
    margin: 0;
}

.object-row:hover {
    background: rgba(229, 46, 103, .035);
}

.user-edit-row > td {
    padding: 0;
    background: #fbfcfe;
}

.user-edit-panel {
    display: grid;
    gap: 16px;
    padding: 20px 24px 24px;
    border-top: 1px solid var(--line);
    box-shadow: inset 0 14px 24px rgba(36, 37, 47, .035);
}

.user-password-form {
    max-width: 620px;
}

.modal {
    width: min(860px, calc(100vw - 32px));
    border: 0;
    border-radius: 22px;
    padding: 0;
    color: var(--text);
    background: transparent;
    box-shadow: var(--shadow-strong);
}

.modal::backdrop {
    background:
        radial-gradient(circle at 74% 20%, rgba(101, 215, 196, .20), transparent 30%),
        rgba(20, 18, 33, .38);
    backdrop-filter: blur(8px);
}

.modal-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(255, 247, 250, .96)),
        #fff;
    border: 1px solid rgba(36, 37, 47, .10);
    border-radius: 22px;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.modal-head h2,
.modal-head p {
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.import-callout {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(36, 37, 47, .10);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(229, 46, 103, .08), rgba(101, 215, 196, .10)),
        #fff;
    color: var(--muted);
}

.import-callout strong {
    color: var(--text);
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

input, select, textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(36, 37, 47, .14);
    border-radius: 14px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    font: inherit;
    outline: none;
}

select {
    appearance: none;
    padding-right: 42px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--purple) 50%),
        linear-gradient(135deg, var(--purple) 50%, transparent 50%),
        linear-gradient(to right, rgba(36, 37, 47, .10), rgba(36, 37, 47, .10));
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%,
        calc(100% - 36px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 22px;
    background-repeat: no-repeat;
    cursor: pointer;
}

select:hover {
    border-color: rgba(91, 62, 166, .35);
    box-shadow: 0 6px 16px rgba(36, 37, 47, .05);
}

select:disabled {
    cursor: not-allowed;
}

select::-ms-expand {
    display: none;
}

select.enhanced-select-native,
.sf-panel select.enhanced-select-native,
.record-edit-panel select.enhanced-select-native {
    position: absolute !important;
    width: 1px !important;
    min-width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.select-combobox {
    position: relative;
    width: 100%;
    color: var(--text);
}

.select-combobox-trigger {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(36, 37, 47, .14);
    border-radius: 14px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-weight: 800;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    outline: none;
}

.sf-panel .select-combobox-trigger,
.record-edit-panel .select-combobox-trigger {
    min-height: 32px;
    border-color: #747474;
    border-radius: 4px;
    padding: 6px 8px;
}

.select-combobox-trigger:hover {
    border-color: rgba(91, 62, 166, .35);
    box-shadow: 0 6px 16px rgba(36, 37, 47, .05);
}

.select-combobox.is-open .select-combobox-trigger,
.select-combobox-trigger:focus-visible {
    border-color: rgba(229, 46, 103, .56);
    box-shadow: 0 0 0 4px rgba(229, 46, 103, .11);
}

.select-combobox.is-disabled .select-combobox-trigger {
    background: #f5f6f8;
    color: var(--muted);
    cursor: not-allowed;
    box-shadow: none;
}

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

.select-combobox.is-placeholder .select-combobox-value {
    color: #777;
    font-style: italic;
    font-weight: 650;
}

.select-combobox-caret {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--purple);
    border-bottom: 2px solid var(--purple);
    transform: rotate(45deg);
    flex: 0 0 auto;
}

.select-combobox.is-open .select-combobox-caret {
    transform: rotate(225deg);
}

.select-combobox-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: min(340px, calc(100vw - 48px));
    padding: 8px;
    border: 1px solid rgba(36, 37, 47, .14);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(36, 37, 47, .16);
    z-index: 80;
}

.sf-panel .select-combobox-menu,
.record-edit-panel .select-combobox-menu {
    border-radius: 6px;
}

.select-combobox-search {
    width: 100%;
    min-height: 34px;
    border-radius: 7px;
    margin-bottom: 8px;
}

.select-combobox-options {
    max-height: 250px;
    overflow: auto;
    display: grid;
    gap: 2px;
}

.select-combobox-group {
    display: grid;
    gap: 2px;
}

.select-combobox-group + .select-combobox-group {
    margin-top: 4px;
}

.select-combobox-group-header {
    padding: 8px 9px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.select-combobox-option {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--text);
    background: transparent;
    font: inherit;
    font-weight: 720;
    text-align: left;
    cursor: pointer;
}

.select-combobox-option:hover,
.select-combobox-option:focus {
    color: var(--brand-strong);
    background: var(--brand-soft);
    outline: none;
}

.select-combobox-option.is-selected {
    color: var(--brand-strong);
    background: rgba(229, 46, 103, .10);
    box-shadow: inset 3px 0 0 var(--brand);
    font-weight: 900;
}

.select-combobox-option:disabled {
    color: #9aa0aa;
    cursor: not-allowed;
}

.select-combobox-empty {
    padding: 10px;
    color: var(--muted);
    font-weight: 750;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(229, 46, 103, .56);
    box-shadow: 0 0 0 4px rgba(229, 46, 103, .11);
}

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

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

th, td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

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

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

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.badge-neutral {
    background: #eef1f7;
    color: var(--text);
}

.badge-success {
    background: rgba(101, 215, 196, .22);
    color: var(--success);
}

.badge-warning {
    background: rgba(91, 62, 166, .1);
    color: var(--purple);
}

.badge-danger {
    background: rgba(216, 63, 135, .14);
    color: var(--danger);
}

.flash {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash.success {
    border-color: rgba(101, 215, 196, .38);
    background: var(--accent-soft);
}

.flash.error {
    border-color: rgba(229, 46, 103, .32);
    background: rgba(216, 63, 135, .08);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tabs a {
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    color: var(--text);
    font-weight: 850;
}

.tabs a.active {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}

.org-workspace {
    align-content: start;
}

.org-kpis small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 760;
}

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

.org-nav a {
    display: grid;
    gap: 4px;
    min-height: 74px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--text);
    box-shadow: 0 12px 28px rgba(36, 37, 47, .05);
    position: relative;
    overflow: hidden;
}

.org-nav a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: transparent;
}

.org-nav a span {
    font-weight: 920;
}

.org-nav a small {
    color: var(--muted);
    font-weight: 760;
}

.org-nav a.active {
    border-color: rgba(229, 46, 103, .20);
    background:
        linear-gradient(135deg, rgba(229, 46, 103, .10), rgba(101, 215, 196, .06)),
        #fff;
}

.org-nav a.active::before {
    background: var(--brand);
}

.org-setup-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.org-step-card {
    min-height: 188px;
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 14px 34px rgba(36, 37, 47, .06);
}

.org-step-card > span {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: #fff;
    font-weight: 950;
}

.org-step-card strong {
    font-size: 18px;
}

.org-step-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.org-step-card small {
    margin-top: auto;
    color: var(--brand-strong);
    font-weight: 850;
}

.permission-matrix {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.permission-matrix-head,
.permission-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.4fr) repeat(4, minmax(86px, .7fr));
    gap: 0;
    align-items: center;
}

.permission-matrix-head {
    background: #fbfcfe;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.permission-matrix-head span,
.permission-row > strong,
.matrix-check {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
}

.permission-row:last-child > strong,
.permission-row:last-child .matrix-check {
    border-bottom: 0;
}

.permission-row > strong {
    color: var(--text);
}

.matrix-check {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.matrix-check input {
    width: 17px;
    height: 17px;
    min-height: 17px;
    accent-color: var(--brand);
}

.advanced-json {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
}

.advanced-json summary {
    cursor: pointer;
    color: var(--brand-strong);
    font-weight: 900;
}

.formula-preview {
    padding: 14px 16px;
    border: 1px solid rgba(101, 215, 196, .30);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(101, 215, 196, .10), rgba(229, 46, 103, .06));
    color: var(--text);
    font-weight: 880;
}

.formula-token-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.formula-token-grid span {
    padding: 8px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.page-hero {
    padding: 18px 22px;
    border-radius: 18px;
    background:
        linear-gradient(90deg, #ffffff 0, #ffffff 58%, rgba(229, 46, 103, .08) 100%),
        #fff;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.ai-screen {
    margin-bottom: 20px;
}

.content.ai-result-enter .ai-screen,
.content.ai-result-enter .panel {
    animation: aiResultIn .42s ease both;
}

.content.ai-result-enter .panel:nth-of-type(2) {
    animation-delay: .04s;
}

.content.ai-result-enter .panel:nth-of-type(3) {
    animation-delay: .08s;
}

.content.ai-result-enter .panel:nth-of-type(4) {
    animation-delay: .12s;
}

@keyframes aiResultIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.985);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.ai-screen-hero {
    padding: 18px 22px;
}

.ai-metric small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 750;
}

.page-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 100%;
    right: 0;
    top: 0;
    background: linear-gradient(135deg, rgba(229, 46, 103, .16), rgba(101, 215, 196, .18));
    clip-path: polygon(42% 0, 100% 0, 100% 100%, 0 100%);
}

.page-hero h1,
.page-hero .muted {
    position: relative;
    z-index: 1;
}

.page-hero .muted {
    color: var(--muted);
    margin-bottom: 0;
}

.eyebrow {
    display: inline-flex;
    position: relative;
    z-index: 1;
    margin-bottom: 6px;
    color: var(--brand-strong);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 900;
}

.panel,
.login-card,
.modal-card,
.page-hero,
.org-nav a,
.org-step-card,
.user-editor,
.advanced-json,
.import-callout,
.formula-preview {
    border-radius: 8px;
}

.btn,
.tabs a,
input,
select,
textarea,
.badge,
.icon-button,
.nav a,
.nav-group-trigger,
.nav-toggle {
    border-radius: 8px;
}

.btn-primary,
.ai-toggle {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 10px 22px rgba(229, 46, 103, .18);
}

.btn-danger-soft {
    background: #fff5f7;
    border-color: rgba(194, 65, 91, .22);
}

.tabs a.active {
    background: var(--brand);
}

.content > .page-heading,
.content > .module-summary {
    width: min(100%, 1180px);
    margin-left: auto;
    margin-right: auto;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-heading h1 {
    margin-top: 2px;
}

.page-heading p {
    margin: 6px 0 0;
}

.module-summary {
    margin-bottom: 18px;
}

.metric-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metric-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--text);
    font-size: 24px;
    line-height: 1;
}

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

.record-table th:last-child,
.record-table td:last-child {
    text-align: right;
}

.record-table td strong {
    color: var(--text);
}

.record-edit-row > td {
    padding: 0;
    background: #f8fafc;
    text-align: left;
}

.record-edit-panel {
    display: grid;
    gap: 16px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--line);
}

.required-field > span,
.quota-required > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.required-field > span::after,
.quota-required.is-required > span::after {
    content: "*";
    color: var(--danger);
    font-weight: 950;
}

.business-rule-list {
    display: grid;
    gap: 10px;
}

.business-rule-list span {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-weight: 780;
}

.rule-card .panel-body {
    background: #fbfcfe;
}

.quota-required:not(.is-required) > span::after {
    content: "";
}

.content {
    background: var(--bg);
}

.content > .sf-page-header,
.content > .sf-highlights,
.content > .sf-tabs,
.content > .sf-workspace {
    width: min(100%, 1180px);
    margin-left: auto;
    margin-right: auto;
}

.sf-page-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border: 1px solid #dddbda;
    border-radius: 8px 8px 0 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 24, 24, .05);
}

.sf-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
    flex: 1 1 auto;
}

.sf-title-wrap h1 {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    color: #181818;
}

.sf-title-wrap p {
    margin: 5px 0 0;
    max-width: 760px;
}

.sf-object-icon {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    color: #fff;
    box-shadow: inset 0 -10px 18px rgba(35, 33, 54, .20);
}

.sf-object-icon .nav-icon {
    width: 27px;
    height: 27px;
    stroke-width: 1.9;
}

.sf-object-icon-green {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    box-shadow: inset 0 -10px 18px rgba(35, 33, 54, .18);
}

.sf-kicker {
    display: block;
    color: #706e6b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.sf-page-header .btn,
.sf-panel .btn,
.record-table .btn {
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 4px;
    box-shadow: none;
}

.sf-page-header .actions {
    align-items: flex-start;
}

.sf-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
    padding: 0;
    border: 1px solid #dddbda;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(24, 24, 24, .04);
}

.sf-highlights div {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 11px 18px;
    border-right: 1px solid #dddbda;
}

.sf-highlights div:last-child {
    border-right: 0;
}

.sf-highlights span {
    color: #706e6b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
}

.sf-highlights strong {
    color: #181818;
    font-size: 20px;
    line-height: 1;
    font-weight: 800;
}

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

.tabs.sf-tabs {
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #dddbda;
}

.tabs.sf-tabs a {
    padding: 10px 16px 9px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #3e3e3c;
    box-shadow: none;
    min-height: 38px;
}

.tabs.sf-tabs a.active {
    background: transparent;
    border-bottom-color: var(--brand);
    color: var(--brand-strong);
}

.sf-workspace {
    display: grid;
    gap: 14px;
}

.sf-panel,
.sf-workspace > .panel {
    border: 1px solid #dddbda;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(24, 24, 24, .05);
}

.sf-panel .panel-header,
.sf-workspace > .panel .panel-header {
    padding: 12px 18px;
    background: #f3f3f3;
}

.sf-panel .panel-header h2,
.sf-workspace > .panel .panel-header h2 {
    font-size: 16px;
    font-weight: 800;
}

.sf-panel .panel-body {
    padding: 18px;
}

.sf-panel .form-grid,
.record-edit-panel .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
}

.sf-panel label,
.record-edit-panel label {
    color: #3e3e3c;
    font-size: 12px;
    font-weight: 800;
}

.sf-panel input,
.sf-panel select,
.sf-panel textarea,
.record-edit-panel input,
.record-edit-panel select,
.record-edit-panel textarea {
    min-height: 32px;
    border-color: #747474;
    border-radius: 4px;
    padding: 6px 8px;
}

.sf-panel select,
.record-edit-panel select {
    padding-right: 34px;
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%,
        calc(100% - 32px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 20px;
}

.sf-panel input:focus,
.sf-panel select:focus,
.sf-panel textarea:focus,
.record-edit-panel input:focus,
.record-edit-panel select:focus,
.record-edit-panel textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(229, 46, 103, .12);
}

.sf-panel textarea,
.record-edit-panel textarea {
    min-height: 86px;
}

.sf-guidance {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.sf-guidance span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #dddbda;
    border-left: 3px solid var(--brand);
    border-radius: 4px;
    background: #f9f9f9;
    color: #3e3e3c;
    font-size: 12px;
    font-weight: 700;
}

.quota-assignment-form {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.quota-assignment-header {
    padding: 0 0 10px;
    border-bottom: 0;
}

.quota-assignment-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
}

.quota-dynamic-note {
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 760;
}

.optional-fields {
    border: 1px solid #dddbda;
    border-radius: 8px;
    background: #fff;
    padding: 0;
}

.optional-fields summary {
    cursor: pointer;
    padding: 10px 12px;
    color: var(--brand-strong);
    font-weight: 850;
}

.optional-fields[open] {
    padding-bottom: 12px;
}

.optional-fields[open] > .form-grid,
.optional-fields[open] > label {
    padding-left: 12px;
    padding-right: 12px;
}

.optional-fields[open] > label {
    margin-top: 12px;
}

.quota-breakdown-card {
    border: 1px solid #dddbda;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.quota-section-title {
    padding: 11px 14px;
    background: #f7f8fb;
    border-bottom: 1px solid #dddbda;
    color: var(--text);
    font-size: 15px;
    font-weight: 850;
}

.quota-edit-details {
    padding: 0;
}

.quota-edit-details > summary {
    cursor: pointer;
    list-style: none;
}

.quota-edit-details > summary::-webkit-details-marker {
    display: none;
}

.quota-edit-details > summary::marker {
    content: "";
}

.quota-edit-details > summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.quota-edit-details[open] > summary::after {
    transform: rotate(225deg);
}

.quota-edit-details > summary:focus {
    outline: 0;
    box-shadow: inset 0 0 0 3px rgba(229, 46, 103, .12);
}

.quota-breakdown-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quota-breakdown-title .btn {
    border-color: rgba(91, 62, 166, .24);
    background: #fff;
    color: var(--purple);
    margin-left: auto;
}

.quota-breakdown-content {
    border-top: 1px solid #dddbda;
}

.quota-breakdown-table th,
.quota-breakdown-table td {
    padding: 9px 12px;
}

.quota-breakdown-table tbody th {
    color: var(--text);
    font-weight: 800;
}

.quota-breakdown-table .breakdown-quarter th {
    padding-left: 28px;
    color: var(--purple);
}

.quota-breakdown-table .breakdown-month th {
    padding-left: 46px;
    color: var(--muted);
    font-weight: 760;
}

.quota-breakdown-table td:last-child,
.quota-breakdown-table th:last-child {
    text-align: right;
}

.quota-breakdown-input {
    width: min(150px, 100%);
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #747474;
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 760;
    text-align: right;
}

.quota-breakdown-input:focus {
    border-color: var(--brand);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(229, 46, 103, .12);
}

.quota-breakdown-table tfoot th {
    background: #fbfcfe;
    color: var(--text);
    font-weight: 900;
}

.rule-builder-panel .panel-header h2 {
    margin-top: 3px;
    font-size: 22px;
}

.credit-rule-form {
    gap: 12px;
}

.rule-card {
    border: 0;
    border-radius: 0;
    background: #fff;
    overflow: visible;
}

.rule-card + .rule-card {
    border-top: 8px solid #f4f6f9;
}

.rule-card .panel-body {
    background: #fff;
}

.rule-section-title {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    border-bottom: 1px solid #dddbda;
    background: #fff;
    color: var(--text);
    font-weight: 850;
}

.rule-section-title .nav-icon {
    width: 18px;
    height: 18px;
    color: #2f92ad;
}

.rule-detail-grid,
.rule-condition-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 54px;
    padding: 28px 20px 24px;
}

.rule-detail-grid textarea {
    min-height: 78px;
}

.inline-check {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 650;
}

.inline-check input {
    width: 16px;
    min-height: 16px;
}

.rule-link-button {
    margin: 0 0 18px 20px;
    border: 0;
    background: transparent;
    color: #007a99;
    box-shadow: none;
}

.rule-results-grid {
    display: grid;
    grid-template-columns: minmax(160px, .55fr) minmax(260px, .85fr) minmax(260px, .85fr);
    gap: 54px;
    min-height: 260px;
    padding: 38px 20px 26px;
}

.rule-result-spacer {
    border-right: 1px solid #dddbda;
}

.rule-result-fields {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 9px;
}

.rule-result-fields label {
    gap: 3px;
}

.record-table th {
    background: #f3f3f3;
    color: #514f4d;
}

.record-table tr:hover td {
    background: #f7fbff;
}

.record-edit-panel {
    box-shadow: none;
}

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

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

    .workbench,
    body.ai-hidden .workbench {
        grid-template-columns: 1fr;
    }

    .ai-panel {
        position: fixed;
        top: 70px;
        right: 0;
        bottom: 0;
        width: min(560px, 100vw);
        max-height: none;
        z-index: 4;
        box-shadow: -18px 0 50px rgba(36, 37, 47, .14);
    }

    body.ai-hidden .ai-panel {
        display: grid;
        opacity: 0;
        pointer-events: none;
        transform: translateX(100%);
    }
}

@media (max-width: 980px) {
    .app-shell,
    body.nav-collapsed .app-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        width: auto;
        height: 100vh;
        z-index: 3;
    }

    .nav {
        display: block;
    }

    .grid-2, .grid-3, .grid-4, .form-grid, .inline-form {
        grid-template-columns: 1fr;
    }

    .rule-detail-grid,
    .rule-condition-grid,
    .rule-results-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rule-result-spacer {
        display: none;
    }

    .org-nav,
    .org-setup-grid {
        grid-template-columns: 1fr;
    }

    .permission-matrix {
        overflow-x: auto;
    }

    .permission-matrix-head,
    .permission-row {
        min-width: 640px;
    }

    .user-editor-head {
        display: grid;
    }

    .page-heading {
        display: grid;
        align-items: start;
    }

    .sf-page-header {
        display: grid;
        align-items: start;
    }

    .sf-title-wrap {
        align-items: flex-start;
    }

    .sf-highlights {
        grid-template-columns: 1fr;
    }

    .sf-highlights div {
        border-right: 0;
        border-bottom: 1px solid #dddbda;
    }

    .sf-highlights div:last-child {
        border-bottom: 0;
    }

    .tabs.sf-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .sf-panel .form-grid,
    .record-edit-panel .form-grid {
        grid-template-columns: 1fr;
    }

    .content, .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }
}
