:root {
    --font-head: "Montserrat", sans-serif;
    --font-body: "Montserrat", sans-serif;
    --font-data: "Montserrat", sans-serif;

    /* Colors */
    --red: #e53935;
    --red2: #ff5252;
    --red-bg: #fff5f5;
    --red-border: #fecaca;
    --red-dark: #b71c1c;
    --green: #10b981;
    --green-bg: #f0fdf4;
    --green-border: #a7f3d0;
    --blue: #3b82f6;
    --blue-bg: #eff6ff;
    --blue-border: #bfdbfe;
    --amber: #f59e0b;
    --amber-bg: #fffbeb;
    --amber-border: #fde68a;
    --purple: #8b5cf6;
    --purple-bg: #f5f3ff;
    --purple-border: #ddd6fe;
    --cyan: #06b6d4;
    --cyan-bg: #ecfeff;

    /* Neutral */
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface2: #f8f9fc;
    --border: #e8eaf2;
    --border2: #d1d5e6;
    --text1: #111827;
    --text2: #4b5563;
    --text3: #9ca3af;

    /* Sidebar (WHITE) */
    --sb-bg: #ffffff;
    --sb-border: #eef0f7;
    --sb-text: #6b7280;
    --sb-head: #b0b7c9;
    --sb-hover: #f5f6fb;
    --sb-active-bg: #fff5f5;
    --sb-active-text: #e53935;
    --sb-active-border: #e53935;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.18);

    --sb-w: 248px;
    --sb-col: 64px;
    --topbar-h: 58px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 13.5px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text1);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── PORTAL SWITCHER ── */
#switcher {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 44px;
    background: #1a1f2e;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ps-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 18px;
}

.ps-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 13px;
    color: #fff;
}

.ps-logo-text {
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    letter-spacing: -0.3px;
}

.ps-logo-text span {
    color: var(--red);
}

.ps-portal-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--font-body);
}

.ps-portal-pill i {
    color: #fff;
}

.ps-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

.ps-user {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-body);
}

/* ── APP SHELL ── */
.app {
    display: flex;
    min-height: 100vh;
    padding-top: 44px;
}

/* .portal-view {
    display: none;
    width: 100%;
}

.portal-view.active {
    display: flex;
} */

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 44px;
    left: 0;
    bottom: 0;
    z-index: 400;
    width: var(--sb-w);
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sb-col);
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .sb-footer-info,
.sidebar.collapsed .nav-badge {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
    border-left: none;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
    width: auto;
}

.sidebar.collapsed .sb-collapse-btn i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sb-logo-text {
    display: none;
}

.sb-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sb-inner::-webkit-scrollbar {
    width: 3px;
}

.sb-inner::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sb-top {
    padding: 16px 16px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}

.sb-logo {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sb-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--red);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.sb-logo-text {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 800;
    color: var(--text1);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.sb-logo-text span {
    color: var(--red);
}

.sb-collapse-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--text3);
    transition: all 0.15s;
    flex-shrink: 0;
}

.sb-collapse-btn:hover {
    background: var(--sb-hover);
    color: var(--text2);
}

.sb-collapse-btn i {
    font-size: 9px;
    transition: transform 0.25s;
}

.nav-group {
    padding: 12px 0 4px;
}

.nav-group-label {
    padding: 0 16px 6px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-head);
    white-space: nowrap;
    font-family: var(--font-head);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px 8px 16px;
    color: var(--sb-text);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    border-left: 3px solid transparent;
    position: relative;
    text-decoration: none;
    font-family: var(--font-body);
}

.nav-item:hover {
    background: var(--sb-hover);
    color: var(--text2);
}

.nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-text);
    border-left-color: var(--sb-active-border);
}

.nav-item.active i {
    color: var(--red);
}

.nav-item-action {
    margin: 6px 12px 4px;
    border-radius: 12px;
    border-left: 0;
    background: linear-gradient(135deg, var(--red), var(--red2));
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.nav-item-action:hover,
.nav-item-action i {
    color: #fff;
}

.nav-item-action:hover {
    background: linear-gradient(135deg, #d93025, #ff6b57);
}

.nav-item i {
    font-size: 13.5px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text3);
    transition: color 0.15s;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    font-family: var(--font-head);
}

.sb-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--sb-border);
    flex-shrink: 0;
}

.sb-footer-card {
    background: var(--sb-hover);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid var(--border);
}

.sb-footer-card:hover {
    background: var(--surface2);
}

.sb-footer-av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    font-family: var(--font-head);
}

.sb-footer-info .name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text1);
    white-space: nowrap;
    font-family: var(--font-body);
}

.sb-footer-info .role {
    font-size: 10px;
    color: var(--text3);
    white-space: nowrap;
}

.sb-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sb-footer-meta i {
    color: var(--text3);
    font-size: 10px;
}

.sb-logout {
    margin-top: 10px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.sb-logout:hover {
    border-color: var(--red-border);
    background: var(--red-bg);
    color: var(--red);
}

/* ── MAIN ── */
.main {
    flex: 1;
    margin-left: var(--sb-w);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 44px);
}

.main.expanded {
    margin-left: var(--sb-col);
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 44px;
    z-index: 100;
    box-shadow: 0 1px 0 var(--border);
}

.tb-left {
    flex: 1;
}

.tb-title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 800;
    color: var(--text1);
    letter-spacing: -0.3px;
}

.tb-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 1px;
    font-family: var(--font-body);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text3);
}

.breadcrumb a {
    color: var(--text3);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--red);
}

.breadcrumb .sep {
    color: var(--border2);
    font-size: 10px;
}

.breadcrumb .cur {
    color: var(--text2);
    font-weight: 500;
}

.tb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    font-family: var(--font-body);
}

.tb-btn:hover {
    border-color: var(--border2);
    background: var(--surface2);
}

.tb-btn.primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.tb-btn.primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.tb-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.tb-icon:hover {
    background: var(--surface2);
    border-color: var(--border2);
}

.notif-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background: var(--red);
    border-radius: 50%;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    font-family: var(--font-head);
}

/* ── PAGE ── */
.page {
    flex: 1;
    padding: 60px 24px 88px 24px;
    display: block;
}

.portal-footer {
    position: fixed;
    bottom: 0;
    left: var(--sb-w);
    right: 0;
    z-index: 90;
    margin-top: auto;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text3);
    font-size: 11.5px;
    font-family: var(--font-body);
}

.main.expanded .portal-footer {
    left: var(--sb-col);
}

.portal-footer__credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.portal-footer__credit a {
    color: var(--red);
    font-weight: 700;
    text-decoration: none;
}

.portal-footer__credit a:hover {
    text-decoration: underline;
}

.password-gate {
    position: fixed;
    inset: 0;
    z-index: 1600;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.password-gate__card {
    width: min(560px, 100%);
    background: var(--surface);
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    padding: 28px;
    display: grid;
    gap: 16px;
}

.password-gate__eyebrow {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--red-bg);
    color: var(--red);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.password-gate__card h2 {
    font-family: var(--font-head);
    font-size: 24px;
    line-height: 1.1;
}

.password-gate__card p {
    color: var(--text2);
    line-height: 1.7;
}

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

.password-gate__form .fi[readonly] {
    background: var(--surface2);
    color: var(--text2);
}

.password-gate__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}

/* .page.active {
    display: block;
} */

/* ── KPI CARDS ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-grid.cols3 {
    grid-template-columns: repeat(3, 1fr);
}

.kpi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px 20px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.kpi-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.kpi-card.red::after {
    background: var(--red);
}

.kpi-card.green::after {
    background: var(--green);
}

.kpi-card.blue::after {
    background: var(--blue);
}

.kpi-card.amber::after {
    background: var(--amber);
}

.kpi-card.purple::after {
    background: var(--purple);
}

.kpi-card.cyan::after {
    background: var(--cyan);
}

.kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.kpi-icon-circle.red {
    background: var(--red-bg);
    color: var(--red);
}

.kpi-icon-circle.green {
    background: var(--green-bg);
    color: var(--green);
}

.kpi-icon-circle.blue {
    background: var(--blue-bg);
    color: var(--blue);
}

.kpi-icon-circle.amber {
    background: var(--amber-bg);
    color: var(--amber);
}

.kpi-icon-circle.purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.kpi-icon-circle.cyan {
    background: var(--cyan-bg);
    color: var(--cyan);
}

.kpi-trend {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    font-family: var(--font-head);
}

.kpi-trend.up {
    background: var(--green-bg);
    color: #047857;
}

.kpi-trend.down {
    background: var(--red-bg);
    color: var(--red);
}

.kpi-trend.neutral {
    background: var(--surface2);
    color: var(--text3);
}

.kpi-value {
    font-family: var(--font-data);
    font-size: 28px;
    font-weight: 800;
    color: var(--text1);
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text3);
    font-weight: 500;
    font-family: var(--font-body);
}

.kpi-foot {
    font-size: 10.5px;
    color: var(--text3);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-family: var(--font-body);
}

/* ── CARDS ── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-head);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text1);
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-title i {
    font-size: 13px;
    color: var(--red);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.card-body {
    padding: 0;
}

.card-body.p {
    padding: 18px;
}

/* ── TABLE ── */
.tbl-wrap {
    overflow-x: auto;
}

.table-toolbar {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, #fff 0%, #fcfcfe 100%);
}

.table-toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-toolbar-search .fi {
    min-width: min(100%, 420px);
    flex: 1 1 320px;
}

.table-toolbar-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

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

.agent-drawer-shell {
    display: none;
    position: fixed;
    inset: 44px 0 0 0;
    z-index: 700;
    pointer-events: none;
}

.agent-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.42);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.agent-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: min(100%, 780px);
    height: 100%;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    overflow-y: auto;
}

.agent-drawer--wide {
    width: min(100%, 860px);
}

.agent-drawer--modal {
    position: relative;
    width: min(100%, 760px);
    max-height: calc(100% - 72px);
    margin: 36px auto;
    right: auto;
    top: auto;
    height: auto;
    transform: translateY(18px);
    border-radius: 22px;
    overflow: hidden;
}

.agent-drawer-shell:target {
    display: block;
    pointer-events: auto;
}

.agent-drawer-shell.is-open {
    display: block;
    pointer-events: auto;
}

.agent-drawer-shell:target .agent-drawer-backdrop {
    opacity: 1;
}

.agent-drawer-shell.is-open .agent-drawer-backdrop {
    opacity: 1;
}

.agent-drawer-shell:target .agent-drawer {
    transform: translateX(0);
}

.agent-drawer-shell.is-open .agent-drawer {
    transform: translateX(0);
}

.agent-drawer-shell--modal.is-open .agent-drawer,
.agent-drawer-shell--modal:target .agent-drawer {
    transform: translateY(0);
}

@media (max-width: 900px) {
    .agent-drawer {
        width: 100%;
    }
}

table.t {
    width: 100%;
    border-collapse: collapse;
}

.t thead tr {
    background: #fafbfe;
}

.t th {
    padding: 10px 15px;
    font-size: 10px;
    font-weight: 700;
    color: #8892a8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-family: var(--font-head);
}

.t th.sr {
    width: 38px;
    color: var(--border2);
}

.t td {
    padding: 11px 15px;
    font-size: 12.5px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-family: var(--font-body);
}

.t tr:last-child td {
    border-bottom: none;
}

.t tbody tr:hover td {
    background: #fafbfe;
}

.t .srn {
    font-size: 11px;
    color: var(--text3);
    font-weight: 600;
    font-family: var(--font-data);
}

.t .mono {
    font-family: var(--font-data);
    font-weight: 600;
    color: var(--red);
}

.table-actions {
    min-width: 210px;
    position: relative;
}

.table-action-menu {
    display: flex;
    justify-content: flex-end;
}

.table-action-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
}

.table-action-menu[open] summary,
.table-action-menu summary:hover {
    background: var(--surface2);
    border-color: var(--border2);
}

.table-action-menu summary::-webkit-details-marker {
    display: none;
}

.table-action-stack {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 40;
    display: grid;
    gap: 10px;
}

.table-action-stack--soft {
    min-width: 198px;
    padding: 8px 0;
    border-radius: 18px;
}

.table-action-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text2);
    text-decoration: none;
    font-weight: 600;
}

button.table-action-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.table-action-link:hover {
    background: var(--surface2);
    color: var(--text1);
}

.table-action-link + .table-action-link {
    border-top: 1px solid var(--border);
}

.table-action-menu--compact summary {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
}

.drawer-helper-copy {
    grid-column: 1 / -1;
    color: var(--text3);
    font-size: 12px;
}

.agents-table-card {
    overflow: visible;
}

.agents-table-head {
    gap: 16px;
    flex-wrap: wrap;
}

.agents-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.agents-toolbar__search {
    width: min(100%, 230px);
}

.agents-toolbar__select {
    min-width: 130px;
}

.agents-toolbar__create {
    min-width: 132px;
    justify-content: center;
}

.admin-inline-progress {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.admin-inline-progress .prog {
    width: 80px;
}

.admin-inline-progress span {
    font-size: 12px;
    color: var(--text3);
}

.admin-member-progress-list {
    display: grid;
    gap: 14px;
}

.admin-member-progress {
    display: grid;
    gap: 8px;
}

.admin-member-progress__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text3);
    font-size: 12px;
}

.admin-member-progress__person {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text1);
}

.admin-mini-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green-bg);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-head);
}

.agents-table .t td,
.agents-table td {
    padding-top: 16px;
    padding-bottom: 16px;
}

.agents-table__actions-col {
    width: 54px;
    min-width: 54px;
}

.agents-person-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agents-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff1f2, #fef3c7);
    color: var(--red);
    font-weight: 800;
    font-family: var(--font-head);
}

.agents-person-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text1);
}

.agents-person-email {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.agent-profile-drawer {
    min-height: 100%;
    background: #fff;
}

.agent-profile-drawer__crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 18px 24px 14px;
    color: #98a2b3;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.agent-profile-drawer__crumbs strong,
.agent-profile-drawer__crumbs span:first-child {
    color: var(--red);
}

.agent-profile-drawer__hero {
    padding: 32px 28px;
    background:
        radial-gradient(circle at 88% 22%, rgba(127, 29, 29, 0.32), transparent 20%),
        linear-gradient(135deg, #141620 0%, #241015 100%);
    color: #fff;
}

.agent-profile-drawer__hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.agent-profile-drawer__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    color: var(--red);
    font-size: 30px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    flex-shrink: 0;
}

.agent-profile-drawer__hero-copy {
    flex: 1;
}

.agent-profile-drawer__hero-copy h2 {
    font-family: var(--font-head);
    font-size: 32px;
    line-height: 1.05;
    margin-bottom: 8px;
}

.agent-profile-drawer__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
}

.agent-profile-drawer__meta i {
    margin-right: 5px;
}

.agent-profile-drawer__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.agent-profile-drawer__close {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.agent-profile-drawer__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.agent-profile-stat {
    padding: 18px 22px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.agent-profile-stat:last-child {
    border-right: none;
}

.agent-profile-stat__value {
    font-family: var(--font-data);
    font-size: 24px;
    font-weight: 800;
    color: var(--text1);
}

.agent-profile-stat__label {
    margin-top: 3px;
    color: var(--text3);
    font-size: 12px;
}

.agent-profile-stat--money .agent-profile-stat__value {
    color: var(--green);
}

.agent-profile-stat--warning .agent-profile-stat__value {
    color: var(--amber);
}

.agent-profile-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.agent-profile-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: #98a2b3;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.agent-profile-tabs__item span {
    min-width: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface2);
    font-size: 11px;
    color: #98a2b3;
}

.agent-profile-tabs__item.is-active,
.agent-profile-tabs__item:hover {
    color: var(--red);
}

.agent-profile-drawer__body {
    padding: 0 20px 24px;
    background: #fff;
}

.agent-profile-section {
    padding-top: 22px;
}

.agent-profile-section[hidden] {
    display: none !important;
}

.proof-eye-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.proof-eye-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tag-green-soft {
    background: #e9fbf2;
    color: #087443;
    border: 1px solid #b7efd0;
}

.proof-modal-card {
    background: #fff;
}

.proof-modal-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
}

.proof-modal-card__meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text3);
}

.proof-modal-card__body {
    padding: 22px;
    background: #f8fafc;
}

.proof-modal-card__body img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
}

.invoice-preview-card {
    margin: 24px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
}

.invoice-preview-card__top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 3px solid var(--red);
}

.invoice-preview-card__top h2 {
    font-family: var(--font-head);
    color: var(--red);
    margin-bottom: 8px;
}

.invoice-preview-card__top p,
.invoice-preview-card__top span {
    color: var(--text2);
}

.invoice-preview-card__code {
    text-align: right;
}

.invoice-preview-card__code strong {
    display: block;
    font-size: 28px;
    font-family: var(--font-head);
}

.invoice-preview-card__code span {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

.invoice-preview-summary {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    display: grid;
    gap: 12px;
}

.invoice-preview-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.invoice-preview-summary__total strong {
    color: var(--red);
    font-size: 28px;
    font-family: var(--font-head);
}

.mark-paid-panel {
    padding: 24px;
}

.mark-paid-panel__summary {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

.mark-paid-form {
    align-items: start;
}

.auto-expense-note {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid #b7efd0;
    background: #f1fdf6;
    display: grid;
    gap: 8px;
}

.auto-expense-note p {
    color: #087443;
    font-weight: 600;
}

.agent-profile-section__title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text1);
    font-family: var(--font-head);
}

.agent-profile-section__rows {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
}

.agent-profile-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.agent-profile-row:last-child {
    border-bottom: none;
}

.agent-profile-row span {
    color: #98a2b3;
    font-weight: 700;
}

.agent-profile-row strong {
    color: var(--text1);
    font-size: 13px;
}

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

.agent-kyc-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: grid;
    gap: 4px;
}

.agent-kyc-card strong {
    font-size: 24px;
    font-family: var(--font-data);
}

.agent-kyc-card span {
    color: var(--text3);
}

.agent-profile-drawer__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--border);
}

.tb-btn.text-only {
    border-color: transparent;
    background: transparent;
}

.table-action-menu:not([open]) .table-action-stack {
    display: none;
}

.table-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text2);
}

.table-footer-meta {
    color: var(--text2);
}

.table-footer-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.table-per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.table-per-page-form label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
    font-family: var(--font-head);
}

.table-per-page-form .fsel {
    min-width: 82px;
}

.table-pager {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.table-inline-form {
    display: grid;
    gap: 8px;
}

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

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

.table-action-plain {
    display: grid;
    gap: 8px;
}

/* ── TAGS / BADGES ── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    font-family: var(--font-head);
    letter-spacing: 0.02em;
}

.tag i {
    font-size: 8px;
}

.tag-green {
    background: #064e3b;
    color: #6ee7b7;
}

.tag-red {
    background: #7f1d1d;
    color: #fca5a5;
}

.tag-amber {
    background: #78350f;
    color: #fcd34d;
}

.tag-blue {
    background: #1e3a8a;
    color: #93c5fd;
}

.tag-purple {
    background: #3b0764;
    color: #c4b5fd;
}

.tag-gray {
    background: #1f2937;
    color: #9ca3af;
}

.tag-cyan {
    background: #164e63;
    color: #67e8f9;
}

.tag-light-green {
    background: var(--green-bg);
    color: #065f46;
    border: 1px solid var(--green-border);
}

.tag-light-red {
    background: var(--red-bg);
    color: #991b1b;
    border: 1px solid var(--red-border);
}

.tag-light-amber {
    background: var(--amber-bg);
    color: #78350f;
    border: 1px solid var(--amber-border);
}

.tag-light-blue {
    background: var(--blue-bg);
    color: #1e3a8a;
    border: 1px solid var(--blue-border);
}

.tag-light-purple {
    background: var(--purple-bg);
    color: #4c1d95;
    border: 1px solid var(--purple-border);
}

/* ── PAGINATION ── */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    border-top: 1px solid var(--border);
    background: #fafbfe;
}

.pager-info {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--font-body);
}

.pager-btns {
    display: flex;
    gap: 3px;
}

.pager-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    transition: all 0.15s;
    font-family: var(--font-head);
}

.pager-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.pager-btn.on {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

/* ── TAB BAR ── */
.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--border);
    padding: 0 18px;
    background: var(--surface);
    overflow-x: auto;
}

.tab-bar::-webkit-scrollbar {
    height: 0;
}

.tab-btn {
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
}

.tab-btn:hover {
    color: var(--text2);
}

.tab-btn.on {
    color: var(--red);
    border-bottom-color: var(--red);
}

.tab-cnt {
    background: var(--border);
    color: var(--text2);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 10px;
    font-family: var(--font-head);
}

.tab-btn.on .tab-cnt {
    background: var(--red-border);
    color: var(--red-dark);
}

.tab-pane {
    display: none;
    padding: 18px;
}

.tab-pane.on {
    display: block;
}

/* ── FORMS ── */
.fg label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 5px;
    font-family: var(--font-body);
}

.fg label .req {
    color: var(--red);
}

.fi,
.fsel,
.fta {
    width: 100%;
    padding: 8px 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-family: var(--font-body);
    color: var(--text1);
    background: var(--surface);
    transition: border 0.15s;
    outline: none;
}

.fi:focus,
.fsel:focus,
.fta:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.07);
}

.fta {
    resize: vertical;
    min-height: 76px;
}

.upload-z {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface2);
}

.upload-z:hover {
    border-color: var(--red);
    background: var(--red-bg);
}

.upload-z i {
    font-size: 22px;
    color: var(--text3);
    margin-bottom: 6px;
    display: block;
}

.upload-z p {
    font-size: 11.5px;
    color: var(--text3);
}

.upload-z .hl {
    color: var(--red);
    font-weight: 600;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    font-family: var(--font-body);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 10.5px;
}

.btn-pr {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

.btn-pr:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.btn-out {
    background: transparent;
    color: var(--text2);
    border-color: var(--border2);
}

.btn-out:hover {
    background: var(--surface2);
}

.btn-ok {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.btn-ok:hover {
    background: #059669;
}

.btn-err {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}

.btn-err:hover {
    background: var(--red-border);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text2);
}

.btn-ghost:hover {
    background: var(--surface2);
}

/* ── OFF-CANVAS ── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, 0.5);
    z-index: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(2px);
}

.overlay.on {
    opacity: 1;
    pointer-events: all;
}

.oc {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    width: 540px;
    background: var(--surface);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.oc.wide {
    width: 700px;
}

.oc.on {
    transform: translateX(0);
}

.oc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
}

.oc-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.oc-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.oc-head-text .oc-title {
    font-family: var(--font-head);
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text1);
}

.oc-head-text .oc-sub {
    font-size: 10.5px;
    color: var(--text3);
    margin-top: 1px;
    font-family: var(--font-body);
}

.oc-close {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--text3);
    transition: all 0.15s;
}

.oc-close:hover {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}

.oc-bc {
    padding: 8px 20px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    font-size: 10.5px;
    color: var(--text3);
    font-family: var(--font-body);
}

.oc-bc a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
}

.oc-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.oc-body::-webkit-scrollbar {
    width: 4px;
}

.oc-body::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 2px;
}

.oc-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: var(--surface2);
}

/* ── 3-DOT MENU ── */
.amenu {
    position: relative;
}

.atrig {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text3);
    border: 1.5px solid transparent;
    transition: all 0.15s;
}

.atrig:hover {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text1);
}

.adrop {
    position: absolute;
    right: 0;
    top: 32px;
    z-index: 200;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 165px;
    overflow: hidden;
    display: none;
}

.adrop.on {
    display: block;
}

.ai {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 12px;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.1s;
    font-family: var(--font-body);
}

.ai:hover {
    background: var(--surface2);
}

.ai i {
    width: 13px;
    font-size: 12px;
    color: var(--text3);
}

.ai.danger {
    color: var(--red);
}

.ai.danger i {
    color: var(--red);
}

.a-sep {
    height: 1px;
    background: var(--border);
    margin: 3px 0;
}

/* ── MISC ── */
.row-grid {
    display: grid;
    gap: 16px;
}

.row-grid.c2 {
    grid-template-columns: 1fr 1fr;
}

.row-grid.c3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.row-grid.c31 {
    grid-template-columns: 2fr 1fr;
}

.row-grid.c13 {
    grid-template-columns: 1fr 2fr;
}

.mb16 {
    margin-bottom: 16px;
}

.mb20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.ac {
    align-items: center;
}

.jb {
    justify-content: space-between;
}

.g8 {
    gap: 8px;
}

.g12 {
    gap: 12px;
}

.g16 {
    gap: 16px;
}

.f1 {
    flex: 1;
}

.av {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-family: var(--font-head);
}

.av-s {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.av-m {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.av-l {
    width: 48px;
    height: 48px;
    font-size: 17px;
}

.av-xl {
    width: 60px;
    height: 60px;
    font-size: 21px;
}

.av-r {
    background: var(--red-bg);
    color: var(--red);
}

.av-b {
    background: var(--blue-bg);
    color: var(--blue);
}

.av-g {
    background: var(--green-bg);
    color: var(--green);
}

.av-a {
    background: var(--amber-bg);
    color: var(--amber);
}

.av-p {
    background: var(--purple-bg);
    color: var(--purple);
}

.prog {
    height: 5px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}

.prog-f {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--red), var(--red2));
}

.prog-f.g {
    background: linear-gradient(90deg, var(--green), #34d399);
}

.prog-f.b {
    background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.ir {
    display: flex;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.ir:last-child {
    border-bottom: none;
}

.il {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text3);
    min-width: 110px;
    font-family: var(--font-body);
}

.iv {
    font-size: 12.5px;
    color: var(--text1);
    font-family: var(--font-body);
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
}

.section-divider span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text3);
    white-space: nowrap;
    font-family: var(--font-head);
}

.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 7px;
    transition: all 0.15s;
}

.file-item:hover {
    border-color: var(--border2);
    background: var(--surface2);
}

.file-ic {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.comment-item {
    display: flex;
    gap: 9px;
    margin-bottom: 11px;
}

.comment-bubble {
    flex: 1;
    background: var(--surface2);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 9px 13px;
    border: 1px solid var(--border);
}

.comment-meta {
    font-size: 10.5px;
    color: var(--text3);
    margin-bottom: 3px;
    font-family: var(--font-body);
}

.comment-meta strong {
    color: var(--text2);
}

.comment-text {
    font-size: 12.5px;
    color: var(--text2);
    line-height: 1.5;
    font-family: var(--font-body);
}

.kyc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 9px;
    transition: all 0.15s;
}

.kyc-item:hover {
    border-color: var(--border2);
}

.kyc-item.ver {
    border-color: var(--green-border);
    background: var(--green-bg);
}

.kyc-item.pend {
    border-color: var(--amber-border);
    background: var(--amber-bg);
}

.kyc-item.miss {
    border-color: var(--red-border);
    background: var(--red-bg);
}

.kyc-ic {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

/* Chart containers */
.chart-wrap {
    position: relative;
    height: 200px;
}

.chart-wrap.tall {
    height: 240px;
}

.chart-wrap.short {
    height: 160px;
}

/* Profile hero (agent) */
.prof-hero {
    background: linear-gradient(135deg, #111827 0%, #1f0a0a 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.prof-hero::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.12);
}

.prof-hero::after {
    content: "";
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(229, 57, 53, 0.07);
}

.prof-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.ph-name {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.ph-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ph-meta i {
    font-size: 10px;
}

/* Notifications */
.notif-panel {
    position: absolute;
    right: 0;
    top: 42px;
    z-index: 300;
    width: 320px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none;
}

.notif-panel.on {
    display: block;
}

.np-head {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.np-head h4 {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
}

.ni {
    display: flex;
    gap: 9px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    cursor: pointer;
}

.ni:hover {
    background: var(--surface2);
}

.ni:last-child {
    border-bottom: none;
}

.ni-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
    margin-top: 4px;
}

.ni p {
    font-size: 11.5px;
    color: var(--text2);
    line-height: 1.4;
    font-family: var(--font-body);
}

.ni span {
    font-size: 10px;
    color: var(--text3);
}

/* Search in topbar */
.tb-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface2);
}

.tb-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    font-family: var(--font-body);
    color: var(--text1);
    width: 150px;
}

.tb-search i {
    color: var(--text3);
    font-size: 11px;
}

.filter-sel {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-body);
    color: var(--text2);
    background: var(--surface);
    outline: none;
    cursor: pointer;
}

.filter-sel:focus {
    border-color: var(--red);
}

/* Invoice preview */
.inv-preview {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 28px;
}

.inv-h {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--red);
}

.inv-company {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 900;
    color: var(--red);
}

.inv-num {
    font-family: var(--font-data);
    font-size: 22px;
    font-weight: 800;
    color: var(--text1);
}

/* Agent profile stats strip */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--border);
}

.stat-strip-item {
    padding: 12px;
    text-align: center;
    border-right: 1px solid var(--border);
}

.stat-strip-item:last-child {
    border-right: none;
}

.ssv {
    font-family: var(--font-data);
    font-size: 20px;
    font-weight: 800;
    color: var(--text1);
}

.ssl {
    font-size: 10px;
    color: var(--text3);
    font-family: var(--font-body);
    margin-top: 1px;
}

@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .row-grid.c31 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .row-grid.c2 {
        grid-template-columns: 1fr;
    }

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

    .table-toolbar-filters {
        grid-template-columns: 1fr;
    }

    .table-toolbar-filter-actions,
    .table-footer-controls {
        justify-content: flex-start;
    }

    .password-gate__form {
        grid-template-columns: 1fr;
    }

    .agents-toolbar {
        justify-content: flex-start;
    }

    .agents-toolbar__search {
        width: 100%;
    }

    .agent-profile-drawer__hero-inner,
    .agent-profile-drawer__stats,
    .agent-kyc-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .agent-profile-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.notif-dot.is-hidden {
    display: none;
}

.ni.is-empty {
    justify-content: center;
}

.crm-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2500;
    display: grid;
    gap: 12px;
    width: min(360px, calc(100vw - 32px));
}

.crm-toast {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    animation: crm-toast-in 0.18s ease forwards;
}

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

.crm-toast--error {
    border-color: var(--red-border);
}

.crm-toast--info {
    border-color: var(--blue-border);
}

.crm-toast__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 13px;
}

.crm-toast__body {
    color: var(--text2);
    font-size: 12px;
    line-height: 1.5;
}

.btn.is-loading,
.tb-btn.is-loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn__loader,
.tb-btn__loader {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: crm-spin 0.75s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

.portal-message-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 26%),
        linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
}

.portal-message-card {
    width: min(680px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(209, 213, 230, 0.8);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    display: grid;
    gap: 16px;
}

.portal-message-card h1 {
    font-family: var(--font-head);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
}

.portal-message-card p {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.7;
}

.portal-message-eyebrow {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--blue-bg);
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@keyframes crm-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes crm-toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .crm-toast-stack {
        left: 16px;
        right: 16px;
        width: auto;
    }

    .portal-message-card {
        padding: 24px;
    }

    .portal-message-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* <------ Auth split layout -----> */
.crm-auth-screen {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: linear-gradient(135deg, #f7f8fc 0%, #ffffff 100%);
}

.crm-auth-shell {
    width: 100%;
    min-height: 100vh;
    display: flex;
    background: #fff;
    overflow: hidden;
}

.crm-auth-hero {
    flex: 1 1 58%;
    position: relative;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

.crm-auth-hero__media,
.crm-auth-hero__overlay {
    position: absolute;
    inset: 0;
}

.crm-auth-hero__media {
    background:
        linear-gradient(180deg, rgba(12, 18, 30, 0.08), rgba(12, 18, 30, 0.24)),
        url("../assets/images/about-image.webp") center center / cover no-repeat;
    transform: scale(1.02);
}

.crm-auth-hero__overlay {
    background:
        linear-gradient(90deg, rgba(9, 14, 24, 0.64) 0%, rgba(9, 14, 24, 0.26) 48%, rgba(9, 14, 24, 0.08) 100%),
        linear-gradient(180deg, rgba(9, 14, 24, 0.1) 0%, rgba(9, 14, 24, 0.4) 100%);
}

.crm-auth-hero__content {
    position: relative;
    z-index: 1;
    min-height: 100%;
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.crm-auth-hero__copy {
    max-width: 520px;
}

.crm-auth-hero__copy h1 {
    margin: 0;
    font-family: var(--font-head);
    font-size: clamp(42px, 4vw, 62px);
    line-height: 1;
    letter-spacing: -0.05em;
}

.crm-auth-hero__copy p {
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 16px;
    line-height: 1.8;
}

.crm-auth-hero__caption {
    max-width: 540px;
}

.crm-auth-hero__caption strong {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-head);
    font-size: clamp(24px, 2vw, 38px);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.crm-auth-hero__caption span {
    display: block;
    color: rgba(255, 255, 255, 0.84);
    font-size: 16px;
    line-height: 1.8;
}

.crm-auth-card-wrap {
    flex: 1 1 42%;
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    background:
        radial-gradient(circle at top left, rgba(229, 57, 53, 0.08), transparent 18%),
        linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
    border-left: 1px solid rgba(229, 232, 242, 0.9);
}

.crm-auth-card {
    width: 100%;
    max-width: 520px;
    padding: 0;
}

.crm-auth-brand {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 32px;
}

.crm-auth-brand img {
    max-width: 172px;
    width: 100%;
    height: auto;
}

.crm-auth-card__head {
    margin-bottom: 20px;
}

.crm-auth-card__head h2 {
    margin: 0;
    font-family: var(--font-head);
    font-size: clamp(34px, 3vw, 44px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    color: #202633;
}

.crm-auth-card__head h2 span {
    color: #e53935;
}

.crm-auth-card__accent {
    width: 76px;
    height: 4px;
    margin: 14px 0 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e53935 0%, #ff6b57 100%);
}

.crm-auth-card__head p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.7;
}

.crm-auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    background: #fde8ea;
    border: 1px solid #f7c3ca;
    color: #7f1d1d;
    font-size: 13px;
}

.crm-auth-alert--soft {
    background: #fff5f5;
    border-color: #fecaca;
    color: #b91c1c;
}

.crm-auth-form {
    display: grid;
    gap: 16px;
    padding: 28px;
    border-radius: 22px;
    border: 1px solid #e3e8f3;
    background: #fff;
    box-shadow: 0 24px 54px rgba(18, 29, 53, 0.08);
}

.crm-auth-form .fg label {
    display: inline-block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
}

.crm-auth-input {
    min-height: 56px;
    display: flex;
    align-items: center;
    border: 1px solid #d7deeb;
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crm-auth-input:focus-within {
    border-color: #e53935;
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.12);
}

.crm-auth-input__icon,
.crm-auth-input__toggle {
    flex: 0 0 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e53935;
    font-size: 16px;
}

.crm-auth-input__icon--lock {
    color: #e53935;
}

.crm-auth-input__toggle {
    color: #6b7280;
}

.crm-auth-input .fi {
    border: 0;
    box-shadow: none;
    min-height: 54px;
    padding: 0 8px 0 0;
    background: transparent;
    font-size: 14px;
    color: #202633;
}

.crm-auth-input .fi:focus {
    border: 0;
    box-shadow: none;
}

.crm-auth-input .fi::placeholder {
    color: #9ca3af;
}

.crm-auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6b7280;
    font-size: 12px;
}

.crm-auth-check input {
    width: 16px;
    height: 16px;
    accent-color: #e53935;
}

.crm-auth-submit {
    width: 100%;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, #cf2f2b 0%, #e53935 55%, #ff5a4a 100%);
    box-shadow: 0 16px 30px rgba(229, 57, 53, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.crm-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(229, 57, 53, 0.28);
}

.crm-auth-submit i,
.crm-auth-submit span {
    line-height: 1;
}

.crm-auth-footnote {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
}

.crm-auth-footnote i {
    color: #e53935;
}

.crm-auth-credit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.crm-auth-credit a {
    color: #e53935;
    font-weight: 700;
    text-decoration: none;
}

.crm-auth-credit a:hover {
    text-decoration: underline;
}

@media (max-width: 1120px) {
    .crm-auth-shell {
        flex-direction: column;
    }

    .crm-auth-hero,
    .crm-auth-card-wrap {
        min-height: auto;
    }

    .crm-auth-hero__content {
        min-height: 460px;
        padding: 34px 26px;
        gap: 90px;
    }

    .crm-auth-card-wrap {
        padding: 30px 20px 42px;
        border-left: 0;
    }

    .crm-auth-brand {
        justify-content: flex-start;
        margin-bottom: 30px;
    }
}

@media (max-width: 640px) {
    .crm-auth-screen {
        background: #fff;
    }

    .crm-auth-hero__content {
        padding: 26px 20px;
        min-height: 360px;
        gap: 56px;
    }

    .crm-auth-hero__copy h1 {
        font-size: 34px;
    }

    .crm-auth-hero__caption strong {
        font-size: 24px;
    }

    .crm-auth-card-wrap {
        padding: 20px 14px 32px;
    }

    .crm-auth-card {
        max-width: 100%;
    }

    .crm-auth-brand img {
        max-width: 148px;
    }

    .crm-auth-card__head h2 {
        font-size: 30px;
    }

    .crm-auth-form {
        padding: 22px 18px;
        border-radius: 20px;
    }
}
