:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --line: #e4ebf4;
    --text: #1c2b3a;
    --muted: #5d7084;
    --navy: #16324f;
    --blue: #1f6fbf;
    --blue-soft: #e8f1fb;
    --teal: #0f766e;
    --amber: #b45309;
    --danger: #b42318;
    --shadow: 0 18px 40px rgba(22, 50, 79, 0.08);
    --radius: 16px;
    --sidebar: 208px;
    --sidebar-bg: #fbfdff;
    --font-size: 14px;
    --font-family: "Segoe UI", "Inter", system-ui, sans-serif;
}
html[data-theme="ocean"] {
    --bg: #eef8fb;
    --surface: #ffffff;
    --line: #cfe7ef;
    --text: #134155;
    --muted: #4b7382;
    --navy: #0c4a6e;
    --blue: #0284c7;
    --blue-soft: #e0f2fe;
    --teal: #0e7490;
    --sidebar-bg: #f4fbfd;
    --shadow: 0 18px 40px rgba(12, 74, 110, 0.08);
}
html[data-theme="forest"] {
    --bg: #f2f7f3;
    --line: #d5e4d8;
    --text: #1d3324;
    --muted: #5b7262;
    --navy: #14532d;
    --blue: #15803d;
    --blue-soft: #dcfce7;
    --teal: #166534;
    --sidebar-bg: #f7fbf8;
    --shadow: 0 18px 40px rgba(20, 83, 45, 0.08);
}
html[data-theme="sunset"] {
    --bg: #fff7ed;
    --line: #f3d5b3;
    --text: #431407;
    --muted: #9a6b4a;
    --navy: #9a3412;
    --blue: #ea580c;
    --blue-soft: #ffedd5;
    --teal: #c2410c;
    --amber: #c2410c;
    --sidebar-bg: #fffaf3;
    --shadow: 0 18px 40px rgba(154, 52, 18, 0.08);
}
html[data-theme="grape"] {
    --bg: #f5f3ff;
    --line: #ddd6fe;
    --text: #2e1065;
    --muted: #6d5b92;
    --navy: #5b21b6;
    --blue: #7c3aed;
    --blue-soft: #ede9fe;
    --teal: #6d28d9;
    --sidebar-bg: #faf8ff;
    --shadow: 0 18px 40px rgba(91, 33, 182, 0.08);
}
html[data-theme="rose"] {
    --bg: #fff1f2;
    --line: #fecdd3;
    --text: #4c0519;
    --muted: #9f6170;
    --navy: #9f1239;
    --blue: #e11d48;
    --blue-soft: #ffe4e6;
    --teal: #be123c;
    --sidebar-bg: #fff7f8;
    --shadow: 0 18px 40px rgba(159, 18, 57, 0.08);
}
html[data-theme="slate"] {
    --bg: #f1f5f9;
    --line: #d0d7e2;
    --text: #0f172a;
    --muted: #64748b;
    --navy: #1e293b;
    --blue: #475569;
    --blue-soft: #e2e8f0;
    --teal: #334155;
    --sidebar-bg: #f8fafc;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
html[data-theme="midnight"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --line: #334155;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --navy: #f8fafc;
    --blue: #38bdf8;
    --blue-soft: #163247;
    --teal: #2dd4bf;
    --amber: #fbbf24;
    --danger: #fb7185;
    --sidebar-bg: #111827;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
html[data-theme="sand"] {
    --bg: #f8f1e3;
    --line: #e6d6b8;
    --text: #3f2e14;
    --muted: #8a7349;
    --navy: #6b4f1d;
    --blue: #b45309;
    --blue-soft: #f3e6c8;
    --teal: #92400e;
    --sidebar-bg: #fbf6ec;
    --shadow: 0 18px 40px rgba(107, 79, 29, 0.08);
}
html[data-theme="midnight"] input,
html[data-theme="midnight"] select,
html[data-theme="midnight"] textarea,
html[data-theme="midnight"] .search-select-toggle,
html[data-theme="midnight"] .search-select-menu,
html[data-theme="midnight"] .search-select-search,
html[data-theme="midnight"] .data-table,
html[data-theme="midnight"] .main,
html[data-theme="midnight"] .topbar {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
}
html[data-theme="crimson"] {
    --bg: #f8eef0;
    --line: #efc9d0;
    --text: #3f0d15;
    --muted: #8a4a56;
    --navy: #7f1d1d;
    --blue: #b91c1c;
    --blue-soft: #fee2e2;
    --teal: #991b1b;
    --sidebar-bg: #fcf5f6;
    --shadow: 0 18px 40px rgba(127, 29, 29, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: var(--font-size); }
body {
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

.app-body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) 1fr;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.logo-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 8px 10px 12px;
}
.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    flex: 1;
    padding: 0;
}
.logo-img {
    display: block;
    max-width: 100%;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
}
.logo strong {
    display: block;
    font-size: 0.857rem;
    line-height: 1.25;
    color: var(--navy);
}
.logo small {
    color: var(--muted);
    font-size: 0.714rem;
    line-height: 1.3;
}
.sidebar-toggle {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #fff;
    color: #5d7084;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}
.sidebar-toggle:hover { background: #eef4fb; color: var(--navy); }
.sidebar-toggle .icon { width: 16px; height: 16px; }

.nav {
    padding: 6px 8px 16px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    min-height: 32px;
    border-radius: 10px;
    color: #3d5166;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.857rem;
    text-align: left;
    cursor: pointer;
}
.nav-link:hover { background: #eef4fb; }
.nav-link.is-active {
    background: var(--blue-soft);
    color: var(--navy);
    font-weight: 600;
}
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.nav-row {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 10px;
    min-height: 32px;
}
.nav-row:hover,
.nav-parent.is-current {
    background: #eef4fb;
}
.nav-parent-link {
    flex: 1;
    min-width: 0;
}
.nav-parent.is-current,
.nav-row.is-current .nav-parent-link {
    color: var(--navy);
    font-weight: 600;
}
.nav-chevron {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #7b8c9e;
    cursor: pointer;
    border-radius: 8px;
    padding: 0;
}
.nav-row > .nav-chevron {
    width: 28px;
    height: 28px;
}
.nav-chevron .icon,
.nav-parent .nav-chevron .icon {
    width: 16px;
    height: 16px;
    transition: transform .18s ease;
}
.nav-link.nav-parent {
    justify-content: flex-start;
}
.nav-link.nav-parent > span:not(.nav-chevron) {
    flex: 1;
    text-align: left;
}
.nav-link.nav-parent > .nav-chevron {
    margin-left: auto;
}
.nav-group.is-open > .nav-row .nav-chevron .icon,
.nav-group.is-open > .nav-parent > .nav-chevron .icon {
    transform: rotate(180deg);
}
.nav-children {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding: 0;
}
.nav-group.is-open > .nav-children {
    display: flex;
}
.nav-child {
    padding: 6px 10px 6px 26px;
    font-size: 0.857rem;
}
.nav-children .nav-group > .nav-parent,
.nav-children .nav-group > .nav-row .nav-parent-link {
    padding-left: 26px;
    font-size: 0.857rem;
}
.nav-children .nav-children .nav-child {
    padding-left: 42px;
}
.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b7c5d4;
    flex: 0 0 auto;
}
.nav-child.is-active .nav-dot {
    background: var(--blue);
}

.sidebar-foot {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--line);
}
.who { display: flex; gap: 10px; align-items: center; }
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.who strong { display: block; font-size: 0.929rem; }
.who small { color: var(--muted); font-size: 0.857rem; }

.main { min-width: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 10px 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
}
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 560px;
    min-width: 0;
    background: #f4f7fb;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 16px;
    color: var(--muted);
}
.search:focus-within {
    background: #fff;
    border-color: #d7e3f0;
}
.search input {
    border: 0;
    outline: 0;
    width: 100%;
    padding: 9px 0;
    background: transparent;
    font-size: 0.929rem;
}
.top-actions { display: flex; align-items: center; gap: 12px; }

/* Notifications Menu & Dropdown */
.notifications-menu { position: relative; }
.notifications-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border: none;
    background: #eef3f8;
    border-radius: 50%;
    color: var(--navy);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    transition: background 0.15s ease;
}
.notifications-btn:hover {
    background: #e2eaf2;
}
.notifications-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #008080;
    color: #ffffff;
    font-size: 0.786rem;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.notifications-drop {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 340px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    z-index: 50;
    overflow: hidden;
    display: none;
}
.notifications-drop:not([hidden]) {
    display: block;
}
.notifications-drop[hidden] {
    display: none !important;
}
.notifications-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px 22px;
    border-bottom: 1px solid #edf2f7;
}
.notifications-title {
    margin: 0;
    font-size: 1.143rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}
.notifications-count {
    font-size: 0.964rem;
    font-weight: 400;
    color: #64748b;
}
.notifications-list {
    display: flex;
    flex-direction: column;
}
.notifications-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px 22px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    transition: background 0.15s ease;
}
.notifications-item:hover {
    background: #f8fafc;
}
.notifications-item:last-child {
    border-bottom: none;
    padding-bottom: 18px;
}
.notifications-item-title {
    font-size: 1.071rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}
.notifications-item-desc {
    font-size: 0.929rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.35;
}

/* Account Menu */
.account-menu { position: relative; }
.account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 2px 8px 2px 2px;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.account-btn:hover {
    background: #edf3f8;
}
.account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ccfbf1;
    color: #0f766e;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 0;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid #99f6e4;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.account-info-name {
    font-size: 0.929rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-info-role {
    font-size: 0.786rem;
    color: var(--muted);
    line-height: 1.25;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-drop {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(22, 50, 79, .12);
    padding: 8px;
    z-index: 40;
    display: none;
    grid-template-columns: 1fr;
    gap: 4px;
}
.account-drop:not([hidden]) {
    display: grid;
}
.account-drop[hidden] {
    display: none !important;
}
a.notifications-btn { text-decoration: none; }
.account-drop a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: #3d5166;
    font-size: 0.929rem;
}
.account-drop a:hover { background: #eef4fb; }
.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    color: var(--navy);
    cursor: pointer;
}
.db-pill {
    font-size: 0.857rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
}
.db-pill.ok { color: var(--teal); }
.db-pill.warn { color: var(--amber); }

.content { padding: 24px 28px 32px; min-width: 0; }
.page-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.page-head > div:first-child { flex: 1 1 220px; min-width: 0; }
.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 0.857rem;
    font-weight: 700;
    letter-spacing: .04em;
}
h1 { margin: 0; font-size: 1.714rem; letter-spacing: -.03em; }
.lede { margin: 4px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; }

.list-tools { display: flex; align-items: center; gap: 8px; }
.tool-group {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 40px;
    padding: 8px 11px;
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    color: var(--navy);
    cursor: pointer;
}
.tool-group .column-picker { position: relative; }
.tool-group .column-picker .tool-btn { border-right: 0; height: 100%; }
.tool-btn .icon { width: 16px; height: 16px; }
.tool-btn:hover { background: var(--blue-soft); }
.xls-mark {
    position: relative;
    display: inline-flex;
    width: 20px;
    height: 18px;
    align-items: center;
    justify-content: center;
}
.xls-mark .icon { width: 18px; height: 18px; }
.xls-mark span {
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%);
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: -.06em;
    line-height: 1;
    color: var(--navy);
    font-family: Arial, sans-serif;
}
.page-size {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 0 8px 0 4px;
    color: var(--navy);
    cursor: pointer;
}
.page-size select {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 8px 4px 8px 10px;
    font-weight: 700;
    color: inherit;
    cursor: pointer;
    outline: none;
    min-width: 4.2rem;
}
.page-size .icon { width: 14px; height: 14px; pointer-events: none; }
.list-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.929rem;
}
.list-pager p { margin: 0; }
.list-pager-nav { display: flex; gap: 8px; }
.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    background: var(--navy);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: .2s ease;
}
.app-toast.is-on { opacity: 1; transform: none; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary, .btn-ghost {
    background: var(--surface);
    border-color: var(--line);
    color: var(--navy);
}
.btn-block { width: 100%; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    min-width: 0;
    max-width: 100%;
}
.card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.card-head h3 { margin: 0; font-size: 1.143rem; }
.card-head span { color: var(--muted); font-size: 0.929rem; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.kpi h2 { margin: 8px 0 6px; font-size: 2rem; }
.kpi p, .kpi span { margin: 0; color: var(--muted); font-size: 0.929rem; }
.kpi-blue { border-top: 3px solid var(--blue); }
.kpi-teal { border-top: 3px solid var(--teal); }
.kpi-amber { border-top: 3px solid var(--amber); }
.kpi-navy { border-top: 3px solid var(--navy); }
.kpi-danger { border-top: 3px solid var(--danger); }

.split {
    display: grid;
    grid-template-columns: 1.4fr .9fr;
    gap: 16px;
}
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.shortcut {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    background: #f8fbff;
    font-size: 0.929rem;
    font-weight: 600;
}
.shortcut:hover { border-color: #c9d9ec; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline strong { display: block; }
.timeline small { color: var(--muted); }

.empty-state { text-align: center; padding: 36px 20px; }
.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 auto; max-width: 520px; color: var(--muted); }

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, #dceaf8, transparent 35%),
        radial-gradient(circle at 90% 90%, #e8f4ef, transparent 30%),
        var(--bg);
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-shell {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.auth-brand {
    background: linear-gradient(180deg, #16324f, #1f6fbf);
    color: #fff;
    padding: 44px 36px;
}
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,.14);
    display: grid;
    place-items: center;
    font-weight: 700;
    margin-bottom: 24px;
}
.auth-brand h1 { font-size: 2.286rem; margin: 0 0 12px; }
.auth-brand p { opacity: .88; line-height: 1.5; }
.auth-points { padding-left: 18px; opacity: .9; }
.auth-card { padding: 44px 36px; }
.auth-card h2 { margin: 0 0 18px; }
.stack { display: grid; gap: 14px; }
.stack label { display: grid; gap: 6px; font-size: 0.929rem; font-weight: 600; color: var(--navy); }
.stack input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
}
.stack input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 1rem;
}
.alert-error { background: #fef3f2; color: var(--danger); }
.alert-ok { background: #ecfdf5; color: var(--teal); }
.alert-info { background: #eff6ff; color: #1e3a8a; }
.alert-info a { color: inherit; font-weight: 700; }
.portal-address-list { display: grid; gap: 10px; padding: 0 4px 8px; }
.portal-address {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
}
.portal-address header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 4px;
    font-size: 0.929rem;
}
.portal-address header span { color: var(--muted); }
.portal-address p { margin: 0; color: #334155; }
.hint { color: var(--muted); font-size: 0.929rem; margin-top: 16px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 12px;
}
.form-grid-1 { grid-template-columns: minmax(0, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.account-balance { font-weight: 600; }
.account-balance.is-credit { color: #0f7a3f; }
.account-balance.is-debit { color: #b42318; }
.settings-stack .form-grid,
.settings-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid label, .inline-label {
    display: grid;
    gap: 4px;
    font-size: 0.857rem;
    font-weight: 600;
    color: var(--navy);
}
.form-grid input, .form-grid select, .form-grid textarea, .inline-label select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
    background: #fff;
    width: 100%;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .inline-label select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.period-combo {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.period-combo input,
.period-combo select {
    width: auto;
}
.period-combo input { flex: 1 1 auto; min-width: 0; }
.period-combo select { flex: 0 0 110px; }
.form-grid [data-subscription-name-preview]:empty { display: none; }
.search-select { position: relative; width: 100%; }
.search-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.search-select-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.search-select-toggle:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.search-select.is-open .search-select-toggle {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.search-select.is-disabled .search-select-toggle {
    background: #f4f7fb;
    color: var(--muted);
    cursor: not-allowed;
}
.search-select-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-select-label.is-placeholder { color: var(--muted); font-weight: 500; }
.search-select-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    margin-top: -4px;
    flex: 0 0 auto;
}
.search-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    display: none;
}
.search-select.is-open .search-select-menu { display: grid; gap: 8px; }
.search-select-search {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 11px;
    outline: none;
    background: #fff;
}
.search-select-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.search-select-options {
    max-height: 240px;
    overflow: auto;
    display: grid;
    gap: 2px;
}
.search-select-option {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}
.search-select-meta {
    color: #9aa6b5 !important;
    font-weight: 500 !important;
}
.search-select-strong {
    color: #1f2a37 !important;
    font-weight: 700 !important;
}
.search-select-label .search-select-meta,
.search-select-option .search-select-meta {
    color: #9aa6b5 !important;
    font-weight: 500 !important;
}
.search-select-label .search-select-strong,
.search-select-option .search-select-strong {
    color: #1f2a37 !important;
    font-weight: 700 !important;
}
.search-select-option:hover,
.search-select-option.is-active { background: var(--blue-soft); color: var(--navy); }
.search-select-option:hover .search-select-meta,
.search-select-option.is-active .search-select-meta { color: #7f8c9c !important; }
.search-select-option.is-selected { font-weight: inherit; }
.search-select-option.is-selected .search-select-strong { font-weight: 700 !important; }
.search-select-empty {
    padding: 10px 8px;
    color: var(--muted);
    font-size: 0.929rem;
    font-weight: 600;
}
.form-grid input[readonly] {
    background: #f4f7fb;
    color: var(--muted);
    cursor: default;
}
.span-2 { grid-column: 1 / -1; }
.span-cols-2 { grid-column: span 2; }

.invoice-recurring-extra {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
}
.invoice-recurring-extra.is-on { display: grid; }
.invoice-recurring-hint {
    display: none;
    grid-column: 1 / -1;
    margin: -4px 0 0;
    font-size: 0.857rem;
}
.invoice-recurring-hint.is-on { display: block; }
.invoice-blocks { display: grid; gap: 14px; }
.invoice-block {
    display: grid;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf2f7;
}
.invoice-block:last-child { padding-bottom: 0; border-bottom: 0; }
.invoice-items-wrap {
    overflow: visible;
    max-width: 100%;
    min-height: 160px;
}
.invoice-items-table,
.data-table.invoice-items-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.invoice-items-table .search-select.is-open { z-index: 50; }
.invoice-items-table td:nth-child(2) { position: relative; z-index: 2; }
.invoice-items-table tr:focus-within td:nth-child(2) { z-index: 6; }
.invoice-items-table td:nth-child(2) .search-select-menu {
    min-width: 100%;
    width: max(100%, 280px);
    max-width: min(420px, 70vw);
    right: auto;
}
.invoice-items-table th, .invoice-items-table td {
    vertical-align: middle;
    word-break: normal;
    overflow: visible;
}
.invoice-items-table td { padding: 8px 6px; }
.invoice-items-table input,
.invoice-items-table select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    box-sizing: border-box;
}
.invoice-items-table input:focus,
.invoice-items-table select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.invoice-items-table input[readonly] {
    background: #f4f7fb;
    color: var(--muted);
    cursor: default;
}
.invoice-items-table td:nth-child(3) input,
.invoice-items-table td:nth-child(5) input,
.invoice-items-table td:nth-child(7) input {
    text-align: right;
}
.invoice-items-table th:nth-child(1),
.invoice-items-table td:nth-child(1) { width: 11%; }
.invoice-items-table th:nth-child(2),
.invoice-items-table td:nth-child(2) { width: 30%; }
.invoice-items-table th:nth-child(3),
.invoice-items-table td:nth-child(3),
.invoice-items-table th:nth-child(4),
.invoice-items-table td:nth-child(4),
.invoice-items-table th:nth-child(5),
.invoice-items-table td:nth-child(5),
.invoice-items-table th:nth-child(6),
.invoice-items-table td:nth-child(6),
.invoice-items-table th:nth-child(7),
.invoice-items-table td:nth-child(7) { text-align: right; }
.invoice-items-table th:nth-child(3),
.invoice-items-table td:nth-child(3) { width: 8%; }
.invoice-items-table th:nth-child(4),
.invoice-items-table td:nth-child(4) { width: 10%; }
.invoice-items-table th:nth-child(5),
.invoice-items-table td:nth-child(5) { width: 10%; }
.invoice-items-table th:nth-child(6),
.invoice-items-table td:nth-child(6) { width: 12%; }
.invoice-items-table th:nth-child(7),
.invoice-items-table td:nth-child(7) { width: 12%; }
.invoice-items-table th:nth-child(8),
.invoice-items-table td:nth-child(8),
.invoice-item-actions {
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    text-align: center;
    padding-left: 4px;
    padding-right: 4px;
}
.invoice-item-actions .btn {
    min-width: 32px;
    padding: 4px 6px;
}
.invoice-totals-card { overflow: hidden; }
.invoice-totals-card .card-head h3 { font-size: 1rem; }
.invoice-totals-card .invoice-totals {
    width: min(420px, 100%);
    margin-left: auto;
    display: grid;
    gap: 2px;
    padding: 4px 4px 2px 0;
    box-sizing: border-box;
}
.invoice-total-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #edf2f7;
    color: var(--navy);
    font-size: 0.857rem;
}
.invoice-total-row.invoice-total-input {
    grid-template-columns: minmax(90px, 1fr) auto auto;
}
.invoice-total-row span { color: #334155; }
.invoice-total-row strong { font-weight: 600; min-width: 80px; text-align: right; white-space: nowrap; }
.invoice-total-grand {
    border-bottom: 0;
    font-size: 0.929rem;
}
.invoice-total-grand strong { font-weight: 700; }
.list-totals-card { margin-top: 14px; }
.list-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 4px 4px 8px;
}
.list-totals span {
    display: block;
    color: #64748b;
    font-size: 0.857rem;
    margin-bottom: 4px;
}
.list-totals strong {
    font-size: 1.143rem;
    font-weight: 700;
    color: var(--navy);
}
@media (max-width: 720px) {
    .list-totals { grid-template-columns: 1fr; }
}
.invoice-total-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
}
.invoice-total-controls input {
    width: 88px;
    border: 1px solid var(--line);
    border-radius: 8px 0 0 8px;
    padding: 5px 8px;
    text-align: left;
    background: #fff;
    font-size: 0.857rem;
}
.invoice-total-controls select {
    width: 110px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    padding: 5px 8px;
    background: #fff;
    font-size: 0.857rem;
}
.invoice-total-controls input:only-child {
    border-radius: 8px;
    width: 160px;
}
.invoice-total-words {
    margin: 2px 0 0;
    text-align: right;
    color: var(--muted);
    font-size: 0.786rem;
}
.invoice-payments-card .invoice-payment-composer {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.invoice-payment-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 8px 12px;
    align-items: end;
}
.invoice-payment-fields label {
    display: grid;
    gap: 4px;
    font-size: 0.857rem;
    font-weight: 600;
    color: var(--navy);
}
.invoice-payment-fields input,
.invoice-payment-fields select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-size: 0.857rem;
    box-sizing: border-box;
}
.invoice-payment-fields input:focus,
.invoice-payment-fields select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.invoice-payment-fields input[type="date"] {
    min-height: 0;
}
.invoice-payment-fields .invoice-payment-notes {
    grid-column: span 2;
}
.invoice-payment-notify-field {
    grid-column: 1 / -1;
    margin: 0;
    min-height: 0;
    padding-bottom: 2px;
    font-size: 0.857rem;
}
.invoice-payment-notify-field input {
    width: 14px;
    min-width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
}
.invoice-payment-notify-field span {
    line-height: 1.25;
    font-size: 0.857rem;
    font-weight: 600;
}
.invoice-payment-actions {
    display: flex;
    justify-content: flex-end;
}
.btn-payment-add {
    background: var(--teal);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 0.857rem;
    padding: 7px 12px;
}
.btn-payment-add:hover {
    filter: brightness(1.06);
}
.invoice-payments-wrap { overflow: visible; }
.invoice-payments-empty {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.857rem;
}
.invoice-payments-table,
.data-table.invoice-payments-table {
    width: 100%;
    table-layout: auto;
}
.invoice-payments-table th,
.invoice-payments-table td {
    padding: 6px;
    vertical-align: middle;
    font-size: 0.857rem;
}
.invoice-payments-table input,
.invoice-payments-table select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    outline: none;
    background: #fff;
    color: var(--text);
    font-size: 0.857rem;
    box-sizing: border-box;
}
.invoice-payments-table input:focus,
.invoice-payments-table select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.invoice-payments-table td:nth-child(2) input {
    text-align: right;
}
.invoice-payments-table th:nth-child(1),
.invoice-payments-table td:nth-child(1) { width: 14%; }
.invoice-payments-table th:nth-child(2),
.invoice-payments-table td:nth-child(2) { width: 12%; text-align: right; }
.invoice-payments-table th:nth-child(3),
.invoice-payments-table td:nth-child(3) { width: 16%; }
.invoice-payments-table th:nth-child(4),
.invoice-payments-table td:nth-child(4) { width: 16%; }
.invoice-payments-table th:nth-child(6),
.invoice-payments-table td:nth-child(6) { width: 110px; }
.invoice-payment-notify { margin: 0; font-size: 0.857rem; }
.invoice-payment-sent {
    color: #15803d;
    font-size: 0.857rem;
    font-weight: 600;
}
.invoice-payment-summary {
    width: min(320px, 100%);
    margin-left: auto;
    margin-top: 10px;
}
.invoice-payment-composer input.is-invalid {
    border-color: #dc2626;
}
.address-composer-fields {
    grid-template-columns: minmax(140px, 1fr) minmax(120px, 0.9fr) minmax(130px, 1fr) minmax(110px, 0.85fr) minmax(110px, 0.85fr) minmax(130px, 1fr);
}
.address-composer-fields .address-composer-line {
    grid-column: 1 / -1;
}
.address-table th:nth-child(1),
.address-table td:nth-child(1) { width: 12%; }
.address-table th:nth-child(2),
.address-table td:nth-child(2) { width: 10%; }
.address-table th:nth-child(3),
.address-table td:nth-child(3),
.address-table td.address-table-line { width: 24%; }
.address-table th:nth-child(4),
.address-table td:nth-child(4) { width: 12%; }
.address-table th:nth-child(5),
.address-table td:nth-child(5) { width: 10%; }
.address-table th:nth-child(6),
.address-table td:nth-child(6) { width: 10%; }
.address-table th:nth-child(7),
.address-table td:nth-child(7) { width: 12%; }
.address-table th:last-child,
.address-table td:last-child { width: 44px; }
.address-table .search-select {
    width: 100%;
    min-width: 0;
}
@media (max-width: 1080px) {
    .address-composer-fields {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .address-composer-fields .address-composer-line {
        grid-column: 1 / -1;
    }
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.form-actions .btn { margin: 0; }
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, .45);
}
.app-modal.is-on { display: grid; }
.app-modal-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    padding: 22px 22px 18px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}
.app-modal-card h3 { margin: 0 0 8px; font-size: 1.286rem; }
.app-modal-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.log-table { table-layout: auto; }
.log-table td { vertical-align: top; }
.log-detail { font-size: 0.857rem; line-height: 1.45; color: var(--text); }
.log-summary { margin: 0 0 8px; font-weight: 600; }
.log-changes, .log-fields { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.log-changes li, .log-fields li {
    display: grid;
    grid-template-columns: minmax(90px, 140px) minmax(80px, 1fr) auto minmax(80px, 1fr);
    gap: 6px;
    align-items: start;
}
.log-fields li { grid-template-columns: minmax(90px, 140px) 1fr; }
.log-field { color: var(--muted); font-weight: 600; }
.log-old { color: #9a3412; text-decoration: line-through; text-decoration-thickness: 1px; }
.log-new { color: #166534; font-weight: 600; }
.log-arrow { color: var(--muted); }
.sticky-actions {
    position: sticky;
    bottom: 12px;
    background: rgba(243, 246, 251, .92);
    padding: 12px;
    border-radius: 14px;
    margin-top: 8px;
}
.stack-page { display: grid; gap: 10px; min-width: 0; max-width: 100%; }
.repeater-list { display: grid; gap: 8px; margin-bottom: 10px; }
.subcard {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #f8fbff;
}
.subcard-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 8px;
}
.subcard-head h4 { margin: 0; font-size: 1rem; }
.filter-card .form-grid { margin-top: 4px; }
.table-card { padding: 0; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table.invoice-items-table { table-layout: fixed; }
.data-table th, .data-table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    vertical-align: top;
    word-break: break-word;
}
.data-table th {
    font-size: 0.857rem;
    color: var(--muted);
    font-weight: 700;
    position: relative;
    user-select: none;
    cursor: grab;
}
.data-table th[data-col-locked] { cursor: default; width: 88px; min-width: 88px; }
.data-table tr:last-child td { border-bottom: 0; }
.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 2;
}
.col-resizer:hover, .is-col-resizing .col-resizer { background: rgba(31, 111, 191, .25); }
body.is-col-resizing { cursor: col-resize; user-select: none; }
.is-col-dragging { opacity: .45; }
.picker-hint {
    margin: 0 0 8px;
    font-size: 0.786rem;
    line-height: 1.4;
    color: var(--muted);
}
.picker-actions {
    position: sticky;
    bottom: -10px;
    z-index: 1;
    background: #fff;
    padding: 10px 0 2px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}
.picker-actions .btn { width: 100%; }
.col-item { display: flex; align-items: center; gap: 8px; cursor: grab; }
.col-grip {
    width: 10px;
    height: 12px;
    flex: 0 0 auto;
    background: radial-gradient(circle, var(--muted) 1.1px, transparent 1.2px);
    background-size: 5px 5px;
    opacity: .7;
}
.nowrap { white-space: nowrap; }
.btn-sm { padding: 7px 10px; font-size: 0.929rem; }
.btn-icon {
    padding: 7px 8px;
    line-height: 0;
}
.btn-icon svg {
    width: 14px;
    height: 14px;
}
.inline-action { display: inline; margin: 0; }
.table-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.data-table td.row-actions-cell,
.data-table th[data-col-locked] {
    width: auto;
    min-width: 200px;
    white-space: nowrap;
}
.perm-fieldset {
    border: 1px dashed var(--line);
    border-radius: 12px;
    margin: 0;
    padding: 12px;
}
.perm-fieldset legend { padding: 0 6px; font-size: 0.929rem; font-weight: 700; color: var(--navy); }
.perm-grid { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.929rem;
}
.check input { width: auto; }

.query-shell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}
.query-shell-bar { position: relative; }
.query-card { padding: 12px 16px; width: 100%; align-self: stretch; }
.query-card[hidden] { display: none !important; }
.query-save-head { margin-bottom: 10px; }
.query-save-head input {
    width: 100%;
    max-width: 360px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    background: #fff;
}
.query-save-head input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.saved-filters-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 24;
    width: 320px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}
.saved-filters-menu[hidden] { display: none !important; }
.saved-filters-new {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--blue);
    font-weight: 700;
    font-size: 1rem;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}
.saved-filters-new:hover { background: var(--blue-soft); }
.saved-filters-empty {
    margin: 0;
    padding: 18px 16px 22px;
    color: var(--muted);
    font-size: 0.929rem;
    line-height: 1.45;
    text-align: center;
}
.saved-filters-empty[hidden] { display: none !important; }
.saved-filter-item {
    display: flex;
    align-items: center;
    gap: 2px;
    border-radius: 10px;
}
.saved-filter-item:hover,
.saved-filter-item.is-active { background: var(--blue-soft); }
.saved-filter-apply {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.saved-filter-tools { display: flex; flex-shrink: 0; }
.saved-filter-tools .btn {
    padding: 6px;
    min-width: 0;
    color: var(--muted);
}
.saved-filter-tools .btn:hover { color: var(--navy); }
.btn.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}
.query-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.query-rows { display: grid; gap: 8px; flex: 1; min-width: min(100%, 640px); }
.query-row {
    display: grid;
    grid-template-columns: 160px minmax(158px, 190px) minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.query-row.is-between {
    grid-template-columns: 160px minmax(158px, 190px) minmax(110px, 1fr) minmax(110px, 1fr) auto;
}
.query-row select, .query-row input[type="search"] {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    background: #fff;
    width: 100%;
}
.query-row select:focus, .query-row input[type="search"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
}
.picker-menu-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.picker-menu-tools .btn { flex: 1; justify-content: center; font-size: 0.857rem; padding: 6px 8px; }
.field-picker { position: relative; }
.picker-toggle { width: 100%; justify-content: space-between; }
.picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 260px;
    max-height: 420px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}
.picker-menu[hidden] { display: none !important; }
.picker-menu-end { left: auto; right: 0; }
.picker-title { margin: 8px 0 2px; font-size: 0.857rem; font-weight: 700; color: var(--muted); }
.picker-title:first-child { margin-top: 0; }
.column-picker .btn { gap: 8px; }
.column-picker .tool-btn { gap: 2px; }
th.is-col-hidden, td.is-col-hidden { display: none !important; }

.content.is-record { padding: 0; }
.content.is-record > .alert { margin: 16px 20px 0; }

.record-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: calc(100vh - 73px);
    background: #fff;
}
.record-nav {
    border-right: 1px solid var(--line);
    background: #f8fbfe;
    padding: 18px 12px 28px;
}
.record-back {
    display: inline-block;
    margin: 0 12px 10px;
    color: var(--blue);
    font-size: 0.857rem;
    font-weight: 700;
}
.record-title {
    margin: 0 8px 16px;
    font-size: 1.286rem;
    letter-spacing: -.03em;
    line-height: 1.3;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}
.record-title span { color: var(--muted); font-weight: 700; }
.record-menu { display: grid; gap: 2px; }
.record-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #3d5166;
    font-size: 1rem;
}
.record-link:hover { background: #eef4fb; }
.record-link.is-active {
    background: #fff;
    color: var(--blue);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--line);
}
.record-link em {
    margin-left: auto;
    font-style: normal;
    color: var(--muted);
    font-size: 0.929rem;
    font-weight: 600;
}
.record-menu .record-parent {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.record-menu .record-parent .nav-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    color: var(--muted);
}
.record-menu .nav-children .record-link {
    padding-left: 28px;
    font-size: 0.929rem;
}
.record-stage {
    padding: 28px 36px 48px 48px;
    min-width: 0;
}
.record-stage .page-head { margin-bottom: 18px; }
.record-stage .query-shell { width: 100%; }
.record-stage textarea {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
    width: 100%;
    min-height: 96px;
    resize: vertical;
}
.record-stage h1 { font-size: 2rem; margin-bottom: 8px; }
.record-tabs {
    display: flex;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    margin: 8px 0 18px;
}
.record-tab {
    padding: 10px 2px 12px;
    color: var(--muted);
    font-weight: 600;
    font-size: 1rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}
.record-tab.is-active {
    color: var(--navy);
    box-shadow: inset 0 -2px 0 var(--blue);
}

.settings-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    min-height: calc(100vh - 73px);
    padding: 24px 28px 40px;
    background: var(--bg);
}
.settings-nav {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px 12px 24px;
    align-self: start;
}
.settings-nav h2 {
    margin: 0 10px 18px;
    font-size: 1.571rem;
    letter-spacing: -.03em;
}
.settings-group {
    margin: 16px 10px 8px;
    font-size: 0.857rem;
    color: var(--muted);
}
.settings-nav .settings-group:first-of-type { margin-top: 0; }
.settings-tree { display: flex; flex-direction: column; gap: 2px; }
.settings-tree .nav-parent { color: #3d5166; }
.settings-tree .nav-children .settings-link { padding-left: 22px; }
.settings-tree .nav-children .nav-parent { padding-left: 22px; }
.settings-tree .nav-children .nav-children .settings-link { padding-left: 36px; }
.settings-nav nav { display: grid; gap: 2px; margin-bottom: 4px; }
.nav-row .nav-link { width: auto; flex: 1; }
.nav-row .nav-link:hover { background: transparent; }
.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 1rem;
}
.settings-link:hover { background: var(--blue-soft); }
.settings-link.is-active {
    background: var(--blue-soft);
    color: var(--navy);
    font-weight: 600;
}
.settings-stage { min-width: 0; }
.settings-stage h1 {
    margin: 6px 0 18px;
    font-size: 1.571rem;
    letter-spacing: -.03em;
}
.settings-stack { display: grid; gap: 16px; }
.settings-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
}
.settings-file {
    display: grid;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}
.settings-file input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
}
.logo-preview {
    position: relative;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.logo-preview img {
    display: block;
    max-width: min(420px, 100%);
    max-height: 140px;
    object-fit: contain;
}
.logo-remove {
    position: absolute;
    top: 12px;
    right: 0;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.server-info { margin: 0; display: grid; gap: 0; }
.server-info > div {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.server-info > div:last-child { border-bottom: 0; }
.server-info dt { margin: 0; color: var(--muted); font-weight: 600; }
.server-info dd { margin: 0; font-weight: 600; color: var(--navy); }
.settings-fields { margin-top: 18px; }
.field-help { display: block; margin-top: 6px; font-size: 0.857rem; font-weight: 500; color: var(--muted); }
.settings-help { margin: 0 0 14px; color: var(--muted); font-size: 0.929rem; line-height: 1.5; }
.settings-card h3 { margin: 0 0 12px; font-size: 1.143rem; }
.mail-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-actions.inner { margin-top: 12px; }
.settings-table { width: 100%; border-collapse: collapse; font-size: 0.929rem; }
.settings-table th, .settings-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    word-break: break-word;
}
.settings-table th { color: var(--muted); font-size: 0.857rem; }
.inline-action { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.perm-ok { color: var(--teal); font-weight: 700; }
.perm-bad { color: var(--danger); font-weight: 700; }

.staff-pane { display: none; }
.staff-pane.is-on { display: block; }
.staff-form .card { padding: 8px 18px 18px; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.perm-table th { color: var(--muted); font-size: 0.857rem; font-weight: 700; }
.perm-table td:first-child { width: 280px; font-weight: 600; color: var(--navy); }
.perm-caps { display: grid; gap: 8px; }
.perm-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #3d5166;
}
.perm-check input { width: 16px; height: 16px; }
.welcome-mail { margin-top: 8px; }
.staff-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--navy);
    font-size: 0.857rem;
    font-weight: 700;
}

.nav-open-btn,
.nav-scrim { display: none; }

html.is-sidebar-min {
    --sidebar: 72px;
}
html.is-sidebar-min .app-body { grid-template-columns: var(--sidebar) 1fr; }
html.is-sidebar-min .logo,
html.is-sidebar-min .nav-link > span:not(.nav-chevron),
html.is-sidebar-min .nav-chevron,
html.is-sidebar-min .sidebar-foot { display: none; }
html.is-sidebar-min .logo-row { justify-content: center; padding: 12px 8px 10px; }
html.is-sidebar-min .nav-link { justify-content: center; padding-left: 8px; padding-right: 8px; }
html.is-sidebar-min .nav-child { padding-left: 8px; padding-right: 8px; }
html.is-sidebar-min .sidebar-toggle .icon { transform: rotate(180deg); }
html.is-sidebar-min .sidebar,
html.is-sidebar-min .nav { overflow: visible; }
html.is-sidebar-min .nav-group { position: relative; }
html.is-sidebar-min .nav-children {
    display: none;
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 40;
    gap: 2px;
}
html.is-sidebar-min .nav-group.is-open > .nav-children,
html.is-sidebar-min .nav-group:hover > .nav-children,
html.is-sidebar-min .nav-group:focus-within > .nav-children {
    display: flex;
}
html.is-sidebar-min .nav-group.is-open > .nav-children .nav-link > span:not(.nav-chevron),
html.is-sidebar-min .nav-group:hover > .nav-children .nav-link > span:not(.nav-chevron),
html.is-sidebar-min .nav-group:focus-within > .nav-children .nav-link > span:not(.nav-chevron) {
    display: inline;
}
html.is-sidebar-min .nav-children .nav-link {
    justify-content: flex-start;
    padding: 8px 10px;
}
html.is-sidebar-min .nav-children .nav-child {
    padding-left: 10px;
}

@media (max-width: 860px) {
    html.is-sidebar-min { --sidebar: 0px; }
    html.is-sidebar-min .app-body { grid-template-columns: 1fr; }
    html.is-sidebar-min .logo,
    html.is-sidebar-min .nav-link > span:not(.nav-chevron),
    html.is-sidebar-min .nav-chevron,
    html.is-sidebar-min .sidebar-foot { display: revert; }
    html.is-sidebar-min .logo { display: flex; }
    html.is-sidebar-min .nav-link > span:not(.nav-chevron),
    html.is-sidebar-min .nav-chevron { display: grid; }
    html.is-sidebar-min .nav-link > span:not(.nav-chevron) { display: inline; }
    html.is-sidebar-min .nav-children {
        position: static;
        left: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        display: none;
    }
    html.is-sidebar-min .nav-group:hover > .nav-children,
    html.is-sidebar-min .nav-group:focus-within > .nav-children {
        display: none;
    }
    html.is-sidebar-min .nav-group.is-open > .nav-children { display: flex; }
    html.is-sidebar-min .nav-link,
    html.is-sidebar-min .nav-child {
        justify-content: flex-start;
        padding-left: 8px;
        padding-right: 8px;
    }
    html.is-sidebar-min .nav-child { padding-left: 26px; }
    html.is-sidebar-min .logo-row { justify-content: flex-start; padding: 12px 8px 10px 12px; }
    html.is-sidebar-min .sidebar-toggle { display: none; }

    .app-body { grid-template-columns: 1fr; }
    .nav-open-btn {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        border: 0;
        border-radius: 12px;
        background: #eef3f8;
        color: var(--navy);
        cursor: pointer;
        padding: 0;
    }
    .nav-open-btn:hover { background: #e2eaf2; }
    .topbar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }
    .topbar .nav-open-btn { order: 1; }
    .portal-body .topbar-start { order: 2; min-width: 0; }
    .portal-body .topbar-end { order: 3; }
    .topbar .search {
        order: 2;
        flex: 1 1 auto;
        max-width: none;
        padding: 0 12px;
    }
    .topbar .top-actions {
        order: 3;
        flex: 0 0 auto;
        gap: 6px;
    }
    .topbar .account-menu { order: 4; flex: 0 0 auto; }
    .topbar .account-info { display: none; }
    .topbar .account-btn { padding: 0; }
    .topbar .account-drop { left: auto; right: 0; }
    .topbar .notifications-btn { width: 38px; height: 38px; }
    .topbar .notifications-drop {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        width: min(340px, calc(100vw - 24px));
    }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 88vw);
        z-index: 50;
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: none;
        min-height: 100vh;
        overflow: auto;
    }
    html.is-nav-open .sidebar {
        transform: none;
        box-shadow: var(--shadow);
    }
    .nav-scrim {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 45;
        border: 0;
        padding: 0;
        background: rgba(22, 50, 79, 0.42);
        cursor: pointer;
    }
    html.is-nav-open .nav-scrim { display: block; }
    html.is-nav-open { overflow: hidden; }
    .topbar { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 1080px) {
    .kpi-grid, .split, .shortcut-grid, .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
    .invoice-payment-fields { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 720px) {
    .record-shell, .settings-shell { grid-template-columns: 1fr; }
    .record-nav { border-right: 0; border-bottom: 1px solid var(--line); }
    .server-info > div { grid-template-columns: 1fr; gap: 4px; }
    .auth-shell, .page-head, .kpi-grid, .split, .shortcut-grid, .form-grid, .form-grid-3, .form-grid-4, .query-row,
    .invoice-payment-fields { grid-template-columns: 1fr; }
    .topbar { flex-direction: row; align-items: center; }
    .span-2, .span-cols-2 { grid-column: auto; }
    .task-status-row { grid-template-columns: 1fr; }
}

.view-switch { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.opp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
.opp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--navy);
    font-size: 0.929rem;
    font-weight: 700;
    text-decoration: none;
}
.opp-chip strong { font-weight: 800; }
.opp-chip.is-on { box-shadow: 0 0 0 2px var(--blue-soft); border-color: var(--blue); }
.opp-chip.is-static { cursor: default; }
.opp-chip.tone-navy { background: #eef2f7; color: #1e3a5f; }
.opp-chip.tone-olive { background: #eef3d8; color: #5b6b16; }
.opp-chip.tone-lime { background: #f4f7c8; color: #6a7312; }
.opp-chip.tone-blue { background: #e8f1ff; color: #1f6fbf; }
.opp-chip.tone-green { background: #e7f8ee; color: #0f7a3f; }
.opp-chip.tone-purple { background: #f3e8ff; color: #6d28d9; }
.opp-chip.tone-slate { background: #eef2f6; color: #475569; }
.opp-chip.tone-amber { background: #fff4db; color: #9a6700; }
.opp-chip.tone-lost { background: #fff1f2; color: #be123c; border-color: #fecdd3; }

.kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: 12px;
    overflow-x: auto;
    align-items: stretch;
    min-height: 58vh;
    padding-bottom: 8px;
}
.kanban-col {
    display: flex;
    flex-direction: column;
    min-width: 280px;
    background: #e8eef5;
    border-radius: 12px;
    overflow: hidden;
}
.kanban-col-head {
    padding: 10px 12px;
    color: #fff;
    font-size: 0.929rem;
    font-weight: 700;
}
.kanban-col-head.tone-navy { background: #c2410c; }
.kanban-col-head.tone-olive { background: #9a9b12; }
.kanban-col-head.tone-lime { background: #c5c40a; color: #1f2937; }
.kanban-col-head.tone-blue { background: #2563eb; }
.kanban-col-head.tone-green { background: #16a34a; }
.kanban-col-head.tone-purple { background: #7c3aed; }
.kanban-col-head.tone-slate { background: #64748b; }
.kanban-col-head.tone-amber { background: #d97706; }
.kanban-col-head.tone-lost { background: #be123c; }
.kanban-col-body {
    padding: 10px;
    display: grid;
    gap: 10px;
    align-content: start;
    flex: 1;
    min-height: 220px;
}
.kanban-empty {
    margin: 48px 0 0;
    text-align: center;
    color: #64748b;
    font-weight: 600;
}
.kanban-card {
    background: #fff;
    border: 1px solid #d7e3f0;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(15, 40, 70, .06);
    cursor: grab;
}
.kanban-card.is-dragging { opacity: .55; }
.kanban-col.is-over { outline: 2px dashed var(--blue); }
.kanban-card-title {
    display: block;
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 10px;
}
.kanban-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    font-size: 0.857rem;
    color: var(--muted);
}
.kanban-card-grid strong { color: var(--navy); font-weight: 700; }
.kanban-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kanban-tags span {
    background: #eef2f7;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.786rem;
    font-weight: 700;
    color: var(--navy);
}

.task-row-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #1d4ed8;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}
.task-row-link:hover { text-decoration: underline; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.task-window[hidden] { display: none; }
.task-window {
    position: fixed;
    inset: 0;
    z-index: 90;
}
.task-window-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
}
.task-window-card {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.task-window-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 8px;
}
.task-window-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.task-title-field { flex: 1; min-width: 0; }
.task-title-field input {
    width: 100%;
    border: 0;
    min-height: 46px;
    padding: 10px 0;
    font-size: 1.143rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--navy);
    background: transparent;
}
.task-title-field input::placeholder { color: #94a3b8; }
.task-status-pill {
    border: 1px solid #dbe7f3;
    background: #f8fafc;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.857rem;
    color: var(--muted);
}
.task-window-x {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}
.task-window-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 8px 28px;
    padding: 0 24px;
    overflow: auto;
}
.task-window-main { padding-bottom: 16px; }
.task-meta-line { margin: 0 0 6px; }
.task-visibility {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.929rem;
    cursor: pointer;
}
.task-visibility-action {
    color: var(--blue);
    font-weight: 600;
}
.task-created {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.929rem;
}
.task-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}
.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    font-size: 0.929rem;
    font-weight: 600;
}
.task-chip.is-done {
    width: 34px;
    padding: 0;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}
.task-chip.is-timer {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.task-block { margin: 0 0 22px; }
.task-block h3,
.task-info h3 {
    margin: 0 0 10px;
    font-size: 1.071rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.task-plus {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.571rem;
    line-height: 1;
    cursor: pointer;
}
.task-plus:disabled { cursor: default; }
.task-check-list { display: grid; gap: 8px; }
.task-check-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 0 28px 28px;
    gap: 8px;
    align-items: center;
    padding: 4px 0 10px;
    border-bottom: 1px solid var(--line);
}
.task-check-row.is-assign {
    grid-template-columns: 22px minmax(0, 1fr) minmax(120px, 180px) 28px 28px;
}
.task-check-mark {
    width: 18px;
    height: 18px;
    position: relative;
}
.task-check-mark input {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.task-check-mark input:checked {
    border-color: #16a34a;
    background: #16a34a;
}
.task-check-row input[data-check-title] {
    border: 0;
    padding: 6px 0;
    background: transparent;
}
.task-check-row select[data-check-staff] {
    display: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 6px;
}
.task-check-row.is-assign select[data-check-staff] { display: block; }
.task-check-icon {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 2px;
    cursor: pointer;
}
.task-comments-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--navy);
    font-size: 1.071rem;
    font-weight: 700;
    cursor: pointer;
}
.task-comments { margin-top: 12px; display: grid; gap: 12px; }
.task-comment-editor {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.task-comment-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.929rem;
}
.task-comment-editor textarea {
    min-height: 110px;
    padding: 12px;
    border: 0;
    font-weight: 400;
    letter-spacing: 0;
}
.task-comment-drop { min-height: 96px; }
.task-comment-actions { display: flex; justify-content: flex-end; }
.task-comment-list { display: grid; gap: 8px; }
.task-comment-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.929rem;
    color: var(--navy);
}
.task-sheet[hidden] { display: none; }
.task-sheet {
    position: absolute;
    inset: 0;
    z-index: 2;
}
.task-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .28);
}
.task-sheet-card {
    position: relative;
    width: min(420px, calc(100% - 32px));
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
    padding: 18px 18px 14px;
}
.task-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.task-sheet-head h3 { margin: 0; font-size: 1.214rem; }
.task-sheet-body { display: grid; gap: 12px; }
.task-sheet-body label { display: grid; gap: 6px; font-size: 0.929rem; font-weight: 600; color: var(--muted); }
.task-sheet-body input,
.task-sheet-body select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
    color: var(--navy);
    font-weight: 500;
}
.task-sheet-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.task-block textarea,
.task-info input,
.task-info select {
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    resize: vertical;
}
.task-block textarea {
    min-height: 72px;
    color: var(--navy);
    font-weight: 600;
    letter-spacing: .02em;
}
.task-empty-line {
    margin: 0;
    padding: 10px 0 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.929rem;
}
.task-window-side { padding: 8px 0 20px; }
.task-info { margin-bottom: 22px; }
.task-info-list { margin: 0; display: grid; gap: 12px; }
.task-info-list > div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}
.task-info-list dt {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.929rem;
}
.task-info-list dd {
    margin: 0;
    text-align: right;
    font-size: 0.929rem;
    color: var(--navy);
    min-width: 120px;
}
.task-info-list dd.is-ok { color: #16a34a; font-weight: 600; }
.task-info-list dd input,
.task-info-list dd select {
    text-align: right;
    border: 0;
    background: transparent;
}
.task-billable {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.857rem;
}
.task-assign select { width: 100%; }
.task-avatar-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.task-avatar-row img,
.task-avatar-row span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #1e293b;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.929rem;
    font-weight: 700;
}
.task-follow-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.929rem;
}
.task-drop {
    border: 1px dashed #d4deea;
    border-radius: 16px;
    min-height: 140px;
    display: grid;
    place-items: center;
    padding: 20px;
    color: #94a3b8;
    text-align: center;
    font-size: 0.929rem;
}
.task-window-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 24px 16px;
    border-top: 1px solid var(--line);
}
.task-reminder-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
}
.task-reminder-extra[hidden] {
    display: none !important;
}
.field-label {
    display: block;
    font-size: 0.929rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}
.task-status-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 1.5fr);
    gap: 8px 12px;
    align-items: start;
}
.task-assignee-field {
    display: grid;
    gap: 4px;
    align-content: start;
}
.task-assignee-field .field-label {
    font-size: 0.857rem;
    margin-bottom: 0;
}
.task-assignee-row {
    display: grid;
    gap: 6px;
}
.task-assignee-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
    margin-bottom: 0;
}
.task-assignee-chips:empty {
    display: none;
}
.task-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 12px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--navy);
    font-size: 0.929rem;
}
.task-assignee-x {
    border: 0;
    background: transparent;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
}
.task-assignee-x .icon { width: 14px; height: 14px; }
.task-assignee-add {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}
.task-note-composer {
    display: grid;
    gap: 8px;
}
.task-note-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.task-note-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}
.task-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.857rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.task-note-item textarea {
    width: 100%;
}
@media (max-width: 900px) {
    .task-window-body { grid-template-columns: 1fr; }
}

.portal-body .sidebar { background: #f7fbfb; }
.topbar-start { min-width: 0; flex: 1 1 auto; }
.topbar-start .eyebrow { margin: 0 0 2px; }
.topbar-start strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.file-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 0.929rem;
    color: var(--muted);
}
.file-crumbs a { color: var(--blue); }
.file-crumbs strong { color: var(--navy); }
.file-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}
.file-search input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
}
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}
.file-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 132px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdff;
}
.file-tile:hover {
    border-color: #bcd3ea;
    background: var(--blue-soft);
}
.file-tile-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff7ed;
    color: var(--amber);
}
.file-tile-icon .icon { width: 22px; height: 22px; }
.file-tile-name {
    font-weight: 600;
    color: var(--navy);
    word-break: break-word;
}
.file-tile-meta { font-size: 0.857rem; color: var(--muted); }
.file-upload { padding: 0; }
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    border: 1px dashed #bcd3ea;
    border-radius: 12px;
    background: #f8fbff;
    color: var(--muted);
    cursor: pointer;
    padding: 16px;
}
.file-drop.is-over { border-color: var(--blue); background: var(--blue-soft); }
.file-drop input[type="file"] { max-width: 100%; }

.card:has(.rich-editor),
.form-grid:has(.rich-editor),
.rich-field {
    overflow: visible;
}
.rich-field {
    display: grid;
    gap: 4px;
    font-size: 0.857rem;
    font-weight: 600;
    color: var(--navy);
}
.rich-editor {
    display: block;
    border: 1px solid #d7e3ef;
    border-radius: 12px;
    background: #fff;
    overflow: visible;
    position: relative;
}
.rich-editor.is-fullscreen {
    position: fixed;
    inset: 16px;
    z-index: 80;
    margin: 0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    background: #fff;
}
.rich-editor.is-fullscreen .rich-surface,
.rich-editor.is-fullscreen .rich-source { flex: 1; min-height: 0; }
.rich-editor svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}
.rich-menubar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 10px 2px;
    color: #334155;
}
.rich-menu { position: relative; }
.rich-menubar > .rich-menu > button {
    border: 0;
    background: transparent;
    color: #334155;
    font: inherit;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.rich-menubar > .rich-menu > button:hover,
.rich-menubar > .rich-menu > button.is-open { background: #eef2f7; }
.rich-editor.is-visual-off .rich-toolbar { display: none; }
.rich-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 10px;
    overflow: visible;
}
.form-grid .rich-toolbar select,
.rich-toolbar select {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    border: 1px solid #d7e3ef;
    background: #fff;
    border-radius: 8px;
    min-height: 32px;
    height: 32px;
    padding: 0 8px;
    color: #1c2b3a;
}
.rich-toolbar select[data-rich-cmd="fontName"] { width: 168px; }
.rich-toolbar select[data-rich-cmd="fontSize"] { width: 78px; }
.rich-toolbar .rich-tool,
.rich-toolbar .rich-color,
.rich-toolbar .rich-split,
.rich-toolbar .rich-caret { flex: 0 0 auto; }
.rich-tool,
.rich-color,
.rich-caret {
    border: 0;
    background: transparent;
    color: #1c2b3a;
    min-width: 30px;
    min-height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 6px;
}
.rich-tool:hover,
.rich-color:hover,
.rich-caret:hover { background: #eef2f7; }
.rich-color {
    position: relative;
    flex-direction: column;
    gap: 0;
    padding: 2px 6px 0;
}
.rich-color-a {
    font-weight: 700;
    line-height: 1;
    border-bottom: 2px solid #222f3e;
}
.rich-color-mark svg { width: 15px; height: 15px; }
.rich-color input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.rich-split { position: relative; display: inline-flex; align-items: center; }
.rich-caret {
    min-width: 16px;
    padding: 0;
}
.rich-caret:after {
    content: '';
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid #334155;
}
.rich-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
    padding: 6px;
}
.rich-dropdown-sm { min-width: 170px; }
.rich-dropdown-scroll { max-height: 360px; overflow: auto; }
.rich-dropdown.is-open { display: grid; }
.rich-dropdown.is-open,
.rich-subwrap.is-open > .rich-sub {
    position: fixed;
    z-index: 90;
}
.rich-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    color: #1f2937;
    cursor: pointer;
    font: inherit;
}
.rich-dropdown button:hover { background: #eef4fb; }
.rich-dropdown kbd {
    margin-left: auto;
    color: #94a3b8;
    font: 12px/1 inherit;
}
.rich-dropdown hr {
    border: 0;
    border-top: 1px solid #eef2f6;
    margin: 4px 6px;
}
.rich-dropdown .rich-indent { padding-left: 26px; }
.rich-check { display: none; margin-left: auto; }
.rich-dropdown button.is-checked .rich-check { display: inline-flex; }
.rich-subwrap { position: relative; }
.rich-subwrap > .has-sub { width: 100%; }
.rich-subwrap .has-sub svg:last-child { margin-left: auto; width: 14px; height: 14px; }
.rich-sub {
    display: none;
    position: absolute;
    left: calc(100% - 6px);
    top: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
    padding: 6px;
    z-index: 31;
}
.rich-subwrap.is-open > .rich-sub { display: grid; }
.rich-sub-scroll { max-height: 320px; overflow: auto; min-width: 230px; }
.rich-block-h1 { font-size: 1.571rem; font-weight: 700; }
.rich-block-h2 { font-size: 1.429rem; font-weight: 700; }
.rich-block-h3 { font-size: 1.286rem; font-weight: 700; }
.rich-block-h4 { font-size: 1.143rem; font-weight: 700; }
.rich-block-h5 { font-size: 1rem; font-weight: 700; }
.rich-block-h6 { font-size: 0.929rem; font-weight: 700; }
.rich-dropdown button:has(kbd) .rich-check { margin-left: 0; }
.rich-swatches {
    display: grid;
    grid-template-columns: repeat(8, 18px);
    gap: 5px;
    padding: 8px;
}
.rich-swatches button {
    width: 18px;
    min-width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}
.rich-swatch-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 8px;
    font-weight: 500;
    color: #475569;
}
.rich-swatch-custom input { width: 28px; height: 22px; padding: 0; border: 0; background: transparent; }
.rich-table-picker {
    display: grid;
    grid-template-columns: repeat(5, 16px);
    gap: 3px;
    padding: 8px;
}
.rich-table-picker span {
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background: #fff;
}
.rich-table-picker span.is-on { background: #dbeafe; border-color: #60a5fa; }
.rich-source {
    width: 100%;
    min-height: 220px;
    border: 0;
    border-top: 1px solid #edf2f7;
    padding: 16px 18px;
    font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical;
}
.rich-surface {
    min-height: 220px;
    padding: 16px 18px;
    outline: none;
    line-height: 1.55;
}
.rich-editor.is-source .rich-surface { display: none; }
.rich-surface:empty:before {
    content: 'Açıklamayı yazın…';
    color: var(--muted);
}
.rich-surface.is-blocks p,
.rich-surface.is-blocks h1,
.rich-surface.is-blocks h2,
.rich-surface.is-blocks h3,
.rich-surface.is-blocks h4,
.rich-surface.is-blocks pre,
.rich-surface.is-blocks blockquote,
.rich-surface.is-blocks li,
.rich-surface.is-blocks td {
    outline: 1px dashed #93c5fd;
}
.rich-surface table,
.rich-preview table { border-collapse: collapse; width: 100%; }
.rich-surface td,
.rich-surface th,
.rich-preview td { border: 1px solid #d7e3ef; padding: 6px; }
.rich-surface pre,
.rich-preview pre {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    overflow: auto;
}
.rich-surface code,
.rich-preview code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
}
.rich-preview { padding: 16px 18px; line-height: 1.55; }

.ticket-thread {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.ticket-msg {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.ticket-msg-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    padding: 8px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.929rem;
}
.ticket-msg-head time { margin-left: auto; color: var(--muted); }
.ticket-msg-head span { color: var(--muted); }
.ticket-msg .rich-preview { padding: 12px 14px; }
.ticket-compose-foot { padding: 4px 18px 18px; }
.ticket-file-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    gap: 6px;
}
.ticket-file-list a { font-weight: 600; }
.ticket-file-list span { color: var(--muted); margin-left: 8px; font-size: 0.857rem; }
.ticket-compose-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.ticket-files-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.929rem;
    color: #334155;
}
.ticket-file-rows { display: grid; gap: 8px; }
.ticket-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ticket-file-pick { position: relative; display: inline-flex; }
.ticket-file-pick input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.ticket-file-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: 1px solid #111827;
    border-radius: 8px;
    background: #fff;
    font-size: 0.929rem;
    white-space: nowrap;
}
.ticket-file-name { color: #64748b; font-size: 0.929rem; }
.ticket-file-add {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    font-size: 1.571rem;
    line-height: 1;
    cursor: pointer;
    color: #0f172a;
}

.portal-invoice-form .invoice-items-wrap {
    overflow: visible;
    min-height: 0;
    max-width: 100%;
}
.portal-invoice-form .invoice-items-wrap:has(.search-select.is-open) {
    padding-bottom: 200px;
}
.portal-invoice-form .invoice-items-table,
.portal-invoice-form .data-table.invoice-items-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}
.portal-invoice-form .invoice-items-table th,
.portal-invoice-form .invoice-items-table td {
    min-width: 0;
}
.portal-invoice-form .invoice-items-table .search-select,
.portal-invoice-form .invoice-items-table input {
    max-width: 100%;
}
.portal-invoice-form .invoice-items-table .search-select.is-open { z-index: 80; }
.portal-invoice-form article.card > [data-add-repeater] {
    margin-top: 10px;
}
.portal-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    font-weight: 700;
    font-size: 0.929rem;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 860px) {
    .portal-body .topbar {
        padding-left: 14px;
        padding-right: 14px;
        gap: 8px;
    }
    .portal-body .topbar-end .hint { display: none; }
    .portal-body .topbar-end .btn {
        padding: 8px 10px;
        white-space: nowrap;
    }
    .portal-invoice-form .invoice-total-input {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .portal-invoice-form .invoice-total-controls { width: 100%; }
}

/* —— Bayi paneli —— */
.dealer-body {
    --dealer-accent: #0f766e;
    --dealer-accent-soft: #ecfdf8;
    --dealer-ink: #134e4a;
    --dealer-wash: linear-gradient(165deg, #f0fdfa 0%, #f8fafc 42%, #eef2ff 100%);
}
.dealer-body .sidebar {
    background: linear-gradient(180deg, #0f766e 0%, #115e59 48%, #134e4a 100%);
    color: #ecfdf8;
    border-right: 0;
    box-shadow: 8px 0 32px rgba(15, 118, 110, 0.18);
}
.dealer-body .sidebar .logo strong,
.dealer-body .sidebar .logo small { color: #fff; }
.dealer-body .sidebar .logo small { opacity: 0.78; }
.dealer-body .sidebar .nav-link {
    color: rgba(236, 253, 248, 0.88);
    border-radius: 12px;
}
.dealer-body .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.dealer-body .sidebar .nav-link.is-active,
.dealer-body .sidebar .nav-child.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.dealer-body .sidebar .nav-parent.is-current {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.dealer-body .sidebar .nav-chevron,
.dealer-body .sidebar .icon { color: inherit; opacity: 0.95; }
.dealer-body .sidebar-toggle {
    color: #ecfdf8;
    border-color: rgba(255, 255, 255, 0.22);
}
.dealer-body .main {
    background: var(--dealer-wash);
}
.dealer-body .dealer-topbar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}
.dealer-body .dealer-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--dealer-accent-soft);
    color: var(--dealer-ink);
    font-size: 0.786rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.dealer-body .content .card {
    border: 1px solid rgba(15, 118, 110, 0.1);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
.dealer-body .page-head h1 {
    letter-spacing: -0.02em;
}
.dealer-body .dealer-hero {
    padding: 4px 0 8px;
}
.dealer-body .dealer-kpi .kpi {
    position: relative;
    overflow: hidden;
}
.dealer-body .dealer-kpi .kpi::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(15, 118, 110, 0.08);
}
.dealer-body .dealer-shortcut-card .shortcut {
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    background: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dealer-body .dealer-shortcut-card .shortcut:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.1);
}
.dealer-body .dealer-empty {
    text-align: center;
    padding: 40px 24px;
}
.dealer-body .dealer-table-card .data-table a strong {
    color: var(--dealer-accent);
}
.dealer-body .btn-primary {
    background: var(--dealer-accent);
    border-color: var(--dealer-accent);
}
.dealer-body .btn-primary:hover {
    filter: brightness(1.05);
}
@media (max-width: 860px) {
    .dealer-body .dealer-chip { display: none; }
}
