:root {
    --bg: #070a0d;
    --bg-soft: #0b1015;
    --sidebar: #080c10;
    --topbar: #090d11;
    --panel: #0e141a;
    --panel-2: #111922;
    --panel-3: #141d27;
    --border: #27323e;
    --border-soft: #1d2630;
    --text: #edf4fb;
    --muted: #8996a6;
    --muted-2: #657282;
    --cyan: #13c8f5;
    --pink: #f03673;
    --blue: #3577ff;
    --green: #36c96f;
    --yellow: #f4b633;
    --orange: #ff7a30;
    --red: #f2524b;
    --shadow: 0 20px 60px rgba(0,0,0,.35);
    --radius: 14px;
    --sidebar-width: 274px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 80% -10%, rgba(19, 200, 245, .11), transparent 28%),
        radial-gradient(circle at 15% 0%, rgba(240, 54, 115, .12), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #090d11 0%, #070a0d 100%);
    border-right: 1px solid var(--border-soft);
    padding: 18px 16px;
    overflow-y: auto;
    z-index: 30;
}
.brand-block { margin-bottom: 24px; }
.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-glyph {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--pink), #ff85a9 48%, var(--cyan));
    box-shadow: 0 0 28px rgba(240, 54, 115, .28);
}
.brand-mark strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand-mark small { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
.side-nav { display: grid; gap: 7px; }
.side-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 0 13px;
    color: #d4dce6;
    border-radius: 28px;
    border: 1px solid transparent;
    transition: .18s ease;
}
.side-link:hover { background: rgba(255,255,255,.045); border-color: var(--border-soft); }
.side-link.active {
    background: linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
    border-color: rgba(255,255,255,.08);
    color: #fff;
}
.icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    flex: 0 0 auto;
}
.icon::before { font-weight: 700; color: #fff; }
.icon-grid::before { content: "▦"; }
.icon-plus::before { content: "+"; font-size: 22px; }
.icon-users::before { content: "◉"; }
.icon-layers::before { content: "▱"; }
.icon-payment::before { content: "£"; }
.icon-marketing::before { content: "↗"; font-size: 18px; }
.icon-customer::before { content: "◌"; }
.icon-supplier::before { content: "▰"; }
.icon-settings::before { content: "⚙"; }
.icon-shield::before { content: "◇"; }
.sidebar-panel {
    margin-top: 26px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: rgba(255,255,255,.035);
}
.sidebar-panel strong { display: block; margin: 7px 0 8px; }
.sidebar-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.main-area { width: 100%; margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    height: 70px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: rgba(9,13,17,.92);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
    z-index: 20;
}
.menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 8px;
    display: none;
    cursor: pointer;
}
.search-box {
    flex: 1;
    height: 42px;
    max-width: 920px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #05080b;
    color: var(--muted);
}
.search-box input { width: 100%; background: transparent; border: 0; outline: 0; color: var(--text); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.company-switcher { color: #dbe6f2; font-weight: 600; }
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f0dc, #b98b5b);
    color: #17110b;
    font-weight: 900;
}
.content-wrap { padding: 26px; }
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.eyebrow { display: block; color: var(--cyan); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; line-height: 1.05; }
h2 { margin-bottom: 0; font-size: 17px; letter-spacing: -.02em; }
.page-heading p, .panel-header p, .body-copy { margin: 0; color: var(--muted); line-height: 1.6; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    background: transparent;
}
.btn-primary { border-color: rgba(19,200,245,.55); background: linear-gradient(135deg, var(--cyan), #097ef1); box-shadow: 0 10px 24px rgba(19,200,245,.16); }
.btn-secondary { border-color: rgba(255,255,255,.12); background: var(--panel-3); }
.btn-ghost { color: var(--muted); background: transparent; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}
.metric-card, .panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)), var(--panel);
    box-shadow: var(--shadow);
}
.metric-card {
    min-height: 98px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
}
.metric-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-weight: 900;
    transform: rotate(-43deg);
}
.metric-icon::first-letter { transform: rotate(43deg); }
.metric-card small { color: var(--muted); display: block; margin-bottom: 4px; }
.metric-card strong { display: block; font-size: 24px; letter-spacing: -.03em; }
.accent-pink .metric-icon { background: linear-gradient(135deg, var(--pink), #ff7a9d); }
.accent-blue .metric-icon { background: linear-gradient(135deg, #145cff, #2fb7ff); }
.accent-green .metric-icon { background: linear-gradient(135deg, #13a03c, #3fd77e); }
.accent-yellow .metric-icon { background: linear-gradient(135deg, #d99900, #ffe06a); color: #1b1200; }
.panel { padding: 18px; min-width: 0; }
.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.panel-header.compact { align-items: center; }
.record-count, .pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255,255,255,.035);
    font-size: 12px;
    font-weight: 700;
}
.pill-cyan { color: #071012; background: var(--cyan); border-color: var(--cyan); }
.pill-pink { color: #fff; background: var(--pink); border-color: var(--pink); }
.tiny-label { color: var(--muted-2); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
.filter-panel { margin-bottom: 18px; }
.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
    gap: 12px;
    align-items: end;
}
label span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; font-weight: 700; }
input, select {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #080d12;
    color: var(--text);
    outline: 0;
    padding: 0 11px;
}
input:focus, select:focus { border-color: rgba(19,200,245,.8); box-shadow: 0 0 0 3px rgba(19,200,245,.10); }
.dashboard-grid, .form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); text-align: center; vertical-align: middle; }
table th:first-child, table td:first-child { text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
td { color: #dce6f2; }
td small { color: var(--muted); }
.num { text-align: center; white-space: nowrap; }
.muted { color: var(--muted); }
.good { color: #52e28d; }
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
}
.status-open { color: #d7bcff; background: rgba(131, 87, 255, .14); border-color: rgba(131, 87, 255, .28); }
.status-pending { color: #ffd092; background: rgba(255, 151, 51, .14); border-color: rgba(255, 151, 51, .28); }
.status-partially-closed { color: #9ee8ff; background: rgba(19, 200, 245, .13); border-color: rgba(19, 200, 245, .28); }
.status-closed { color: #a5ffc9; background: rgba(54, 201, 111, .13); border-color: rgba(54, 201, 111, .28); }
.status-cancelled { color: #ffb8b5; background: rgba(242, 82, 75, .13); border-color: rgba(242, 82, 75, .28); }
.status-stack { display: grid; gap: 10px; }
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--border-soft);
}
.status-row span { display: flex; align-items: center; gap: 9px; color: #dfe9f3; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-open { background: #8f63ff; }
.dot-pending { background: var(--orange); }
.dot-partially-closed { background: var(--cyan); }
.dot-closed { background: var(--green); }
.dot-cancelled { background: var(--red); }
.closing-callout {
    margin-top: 16px;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(19,200,245,.24);
    background: rgba(19,200,245,.07);
}
.closing-callout strong { display: block; margin: 8px 0; }
.closing-callout p { margin: 0; color: var(--muted); line-height: 1.5; }
.lower-grid { margin-top: 0; }
.progress { display: inline-block; width: 110px; height: 7px; background: rgba(255,255,255,.10); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.service-breakdown { display: grid; gap: 10px; }
.service-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}
.service-line span { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.empty-state { color: var(--muted); margin: 0; }
.stacked-form { display: grid; gap: 14px; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-card { display: flex; flex-direction: column; gap: 16px; }
.summary-amounts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.summary-amounts div { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border-soft); }
.summary-amounts small { color: var(--muted); display: block; margin-bottom: 7px; }
.summary-amounts strong { font-size: 20px; }
.summary-card p { margin: auto 0 0; color: var(--muted); line-height: 1.5; }
.editable-table input, .editable-table select { height: 36px; min-width: 150px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.rule-list { display: grid; gap: 11px; }
.rule-list div { padding: 13px; border: 1px solid var(--border-soft); border-radius: 12px; background: rgba(255,255,255,.035); }
.rule-list strong { display: block; margin-bottom: 5px; }
.rule-list span { color: var(--muted); line-height: 1.45; }
.mini-stat { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--border-soft); }
.mini-stat span { color: var(--muted); }
.mini-stat strong { font-size: 22px; }
.permission-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.permission-grid span { padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); color: #dbe6f2; font-size: 12px; }
@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-105%); transition: .22s ease; }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 999px rgba(0,0,0,.55); }
    .main-area { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .topbar { padding: 0 14px; }
    .search-box { display: none; }
    .content-wrap { padding: 18px 14px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .filters { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr; }
    .field-grid.two, .summary-amounts { grid-template-columns: 1fr; }
    .topbar-actions .pill { display: none; }
}
@media (max-width: 520px) {
    .company-switcher { display: none; }
    .panel, .metric-card { padding: 14px; }
    h1 { font-size: 28px; }
}
.heading-left { min-width: 0; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.back-link { margin-bottom: 12px; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.span-12 { grid-column: span 12; }
.agent-filters { grid-template-columns: minmax(240px, 1.4fr) minmax(150px, .7fr) minmax(210px, 1fr) auto auto; }
.agent-table { min-width: 1120px; }
.actions-col { text-align: center; white-space: nowrap; }
.row-actions { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.danger-link { color: #ffb8b5; border-color: rgba(242,82,75,.22); }
@media (max-width: 1180px) {
    .span-12 { grid-column: span 12; }
    .agent-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .heading-actions { width: 100%; justify-content: flex-start; }
    .agent-filters { grid-template-columns: 1fr; }
}
.service-filters { grid-template-columns: minmax(230px, 1.3fr) minmax(150px, .7fr) minmax(170px, .8fr) minmax(190px, .9fr) auto auto; }
.service-table { min-width: 1180px; }
.subsection-table { min-width: 980px; }
.transport-table { min-width: 1080px; }
.service-table small, .subsection-table small { color: var(--muted); }
@media (max-width: 1180px) {
    .service-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .service-filters { grid-template-columns: 1fr; }
}
.service-routing-grid { align-items: stretch; }
.section-nav-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    transition: .18s ease;
}
.section-nav-card:hover {
    border-color: rgba(19,200,245,.42);
    transform: translateY(-1px);
}
.route-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.route-card-footer span { color: var(--muted); }
.route-card-footer strong { color: var(--cyan); white-space: nowrap; }
.name-link {
    color: var(--text);
    font-weight: 800;
    border-bottom: 1px solid rgba(19,200,245,.35);
}
.name-link:hover { color: var(--cyan); }
.service-subpage-filters { grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .65fr) minmax(240px, 1fr) auto auto; }
.visa-page-table { min-width: 1080px; }
.transport-page-table { min-width: 1160px; }
@media (max-width: 1180px) {
    .service-subpage-filters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .service-subpage-filters { grid-template-columns: 1fr; }
    .route-card-footer { align-items: flex-start; flex-direction: column; }
}

.payment-table { min-width: 1620px; }
.marketing-table { min-width: 1240px; }
.center-first th:first-child, .center-first td:first-child { text-align: center; }
.payment-filters { grid-template-columns: minmax(180px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(150px, .8fr) auto auto; }
.marketing-filters { grid-template-columns: minmax(220px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) auto auto; }
@media (max-width: 1180px) { .payment-filters, .marketing-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .payment-filters, .marketing-filters { grid-template-columns: 1fr; } }
.payment-action-panel { margin-bottom: 18px; }
.setup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.payment-master-table { min-width: 860px; }
.payment-type-table { min-width: 1120px; }
@media (max-width: 860px) {
    .setup-actions { justify-content: flex-start; width: 100%; }
    .payment-action-panel .panel-header { flex-direction: column; }
}

/* v15 payment register: no horizontal scroll. Wide payment fields are grouped inside compact cells so actions remain visible. */
.no-scroll-table-wrap { overflow-x: visible; }
.compact-payment-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}
.compact-payment-table th,
.compact-payment-table td {
    padding: 12px 9px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.compact-payment-table th:first-child,
.compact-payment-table td:first-child,
.compact-payment-table .payment-invoice-cell {
    text-align: left;
}
.compact-payment-table th:nth-child(1) { width: 14%; }
.compact-payment-table th:nth-child(2) { width: 17%; }
.compact-payment-table th:nth-child(3) { width: 13%; }
.compact-payment-table th:nth-child(4) { width: 13%; }
.compact-payment-table th:nth-child(5) { width: 12%; }
.compact-payment-table th:nth-child(6) { width: 10%; }
.compact-payment-table th:nth-child(7) { width: 13%; }
.compact-payment-table th:nth-child(8) { width: 8%; }
.payment-amount-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
}
.payment-amount-stack span {
    display: grid;
    gap: 4px;
    padding: 7px 6px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: rgba(255,255,255,.035);
}
.payment-amount-stack small,
.payment-date-stack small,
.subline {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}
.payment-amount-stack strong { font-size: 12px; white-space: nowrap; }
.subline { display: block; margin-top: 7px; }
.payment-date-stack {
    display: grid;
    gap: 5px;
}
.payment-date-stack span {
    display: grid;
    gap: 3px;
}
.payment-type-cell small { line-height: 1.35; }
.payment-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 7px;
}
.payment-row-actions .btn-small { min-width: 66px; }
.payment-master-table,
.payment-type-table {
    min-width: 0 !important;
    table-layout: fixed;
}
.payment-master-table th,
.payment-master-table td,
.payment-type-table th,
.payment-type-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 1180px) {
    .compact-payment-table th:nth-child(2) { width: 19%; }
    .payment-amount-stack { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .no-scroll-table-wrap { overflow: visible; }
    .compact-payment-table,
    .compact-payment-table thead,
    .compact-payment-table tbody,
    .compact-payment-table th,
    .compact-payment-table td,
    .compact-payment-table tr {
        display: block;
        width: 100%;
    }
    .compact-payment-table thead { display: none; }
    .compact-payment-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--border-soft);
    }
    .compact-payment-table td {
        border-bottom: 0;
        padding: 8px 0;
        text-align: left;
    }
    .compact-payment-table td:not(:first-child) { text-align: left; }
    .payment-row-actions { grid-template-columns: repeat(2, minmax(0, 110px)); justify-content: start; }
}

/* v16 compact portal density: keep single-row registers visible without horizontal scrolling. */
body { font-size: 13px; }
:root { --radius: 12px; }
.sidebar { padding: 15px 14px; }
.brand-block { margin-bottom: 18px; }
.brand-glyph { width: 40px; height: 40px; border-radius: 11px; }
.brand-mark strong { font-size: 15px; }
.brand-mark small { font-size: 11px; }
.side-nav { gap: 5px; }
.side-link { min-height: 42px; padding: 0 11px; gap: 11px; border-radius: 24px; font-size: 13px; }
.icon { width: 21px; height: 21px; }
.sidebar-panel { margin-top: 20px; padding: 13px; }
.topbar { height: 62px; padding: 0 20px; }
.search-box { height: 36px; }
.avatar { width: 34px; height: 34px; border-radius: 9px; }
.content-wrap { padding: 22px; }
.page-heading { margin-bottom: 18px; }
.eyebrow { font-size: 11px; margin-bottom: 6px; }
h1 { font-size: clamp(24px, 2.5vw, 34px); margin-bottom: 6px; }
h2 { font-size: 15px; }
.page-heading p, .panel-header p, .body-copy { line-height: 1.48; }
.btn { min-height: 34px; padding: 0 12px; border-radius: 7px; font-size: 12px; }
.btn-small { min-height: 28px; padding: 0 9px; font-size: 11px; }
.metric-grid { gap: 12px; margin-bottom: 14px; }
.metric-card { min-height: 82px; gap: 12px; padding: 14px; }
.metric-icon { width: 43px; height: 43px; border-radius: 12px; }
.metric-card small { font-size: 11px; }
.metric-card strong { font-size: 20px; }
.panel { padding: 14px; }
.panel-header { gap: 14px; margin-bottom: 12px; }
.record-count, .pill { min-height: 22px; padding: 0 8px; font-size: 11px; }
.filters { gap: 10px; }
label span { font-size: 11px; margin-bottom: 5px; }
input, select { height: 36px; padding: 0 9px; border-radius: 7px; font-size: 12px; }
.dashboard-grid, .form-grid { gap: 14px; margin-bottom: 14px; }
.table-wrap { overflow-x: visible; }
table,
.agent-table,
.service-table,
.subsection-table,
.transport-table,
.visa-page-table,
.transport-page-table,
.payment-table,
.marketing-table,
.payment-master-table,
.payment-type-table { min-width: 0 !important; table-layout: fixed; }
th, td { padding: 9px 7px; font-size: 12px; }
th { font-size: 10px; letter-spacing: .035em; }
td small { font-size: 10.5px; }
.status { min-height: 22px; padding: 0 7px; font-size: 10.5px; }
.row-actions { gap: 5px; }
.actions-col { width: 82px; }
.progress { width: 82px; height: 6px; }
.service-line, .status-row, .rule-list div { padding: 10px; }
.summary-amounts div, .mini-stat { padding: 11px; }
.permission-grid span { padding: 6px 8px; font-size: 11px; }
.editable-table input, .editable-table select { height: 32px; min-width: 0; }
.setup-actions { gap: 7px; }

/* v16 payment register: single-line compact columns, no grouped amount boxes. */
.no-scroll-table-wrap { overflow-x: visible; }
.compact-single-row-table { width: 100%; min-width: 0 !important; table-layout: fixed; }
.compact-single-row-table th,
.compact-single-row-table td { padding: 8px 5px; font-size: 11.2px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
.compact-single-row-table th { font-size: 9.4px; }
.compact-single-row-table td:first-child,
.compact-single-row-table th:first-child,
.compact-single-row-table .payment-invoice-cell { text-align: left; }
.compact-single-row-table th:nth-child(1) { width: 10.5%; }
.compact-single-row-table th:nth-child(2) { width: 7.2%; }
.compact-single-row-table th:nth-child(3) { width: 8.4%; }
.compact-single-row-table th:nth-child(4) { width: 7.8%; }
.compact-single-row-table th:nth-child(5) { width: 7.7%; }
.compact-single-row-table th:nth-child(6) { width: 7.7%; }
.compact-single-row-table th:nth-child(7) { width: 9.5%; }
.compact-single-row-table th:nth-child(8) { width: 7.6%; }
.compact-single-row-table th:nth-child(9) { width: 7.7%; }
.compact-single-row-table th:nth-child(10) { width: 8%; }
.compact-single-row-table th:nth-child(11) { width: 9.8%; }
.compact-single-row-table th:nth-child(12) { width: 8.1%; }
.compact-money { white-space: nowrap; }
.compact-single-row-table .status { min-height: 20px; padding: 0 6px; font-size: 9.8px; }
.payment-row-actions { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.payment-row-actions .btn-small { min-width: 54px; min-height: 24px; padding: 0 6px; font-size: 10px; }

@media (max-width: 1180px) {
    th, td { padding: 8px 5px; font-size: 11px; }
    th { font-size: 9.4px; }
    .btn { min-height: 31px; padding: 0 9px; font-size: 11px; }
    .btn-small { min-height: 25px; padding: 0 6px; font-size: 10px; }
    .compact-single-row-table th,
    .compact-single-row-table td { font-size: 10px; padding: 7px 4px; }
    .compact-single-row-table th { font-size: 8.4px; }
    .compact-single-row-table td small { font-size: 9px; }
}

@media (max-width: 860px) {
    .content-wrap { padding: 16px 12px; }
    .panel, .metric-card { padding: 12px; }
    .compact-single-row-table th,
    .compact-single-row-table td { font-size: 9px; padding: 6px 3px; }
    .compact-single-row-table th { font-size: 7.8px; }
    .compact-single-row-table .status { font-size: 8.4px; padding: 0 4px; }
    .payment-row-actions .btn-small { min-width: 45px; font-size: 8.8px; padding: 0 4px; }
}

/* v17 corrections: readable action buttons and vertical master sections. */
.btn,
.btn-small {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1;
}
.btn-small {
    min-height: 30px;
    min-width: 62px;
    padding: 0 10px;
    font-size: 11px;
}
.actions-col {
    width: 132px;
}
.row-actions,
.payment-row-actions {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.payment-row-actions .btn-small {
    min-width: 54px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 10.5px;
}
.payment-master-table .actions-col,
.payment-type-table .actions-col {
    width: 142px;
}
.payment-master-table th,
.payment-master-table td,
.payment-type-table th,
.payment-type-table td {
    overflow-wrap: normal;
    word-break: normal;
}
.payment-master-table td:first-child,
.payment-type-table td:first-child {
    text-align: left;
}
.compact-single-row-table th:nth-child(1) { width: 10.3%; }
.compact-single-row-table th:nth-child(2) { width: 7%; }
.compact-single-row-table th:nth-child(3) { width: 8.1%; }
.compact-single-row-table th:nth-child(4) { width: 7.4%; }
.compact-single-row-table th:nth-child(5) { width: 7.2%; }
.compact-single-row-table th:nth-child(6) { width: 7.2%; }
.compact-single-row-table th:nth-child(7) { width: 8.6%; }
.compact-single-row-table th:nth-child(8) { width: 7%; }
.compact-single-row-table th:nth-child(9) { width: 7%; }
.compact-single-row-table th:nth-child(10) { width: 7.4%; }
.compact-single-row-table th:nth-child(11) { width: 9.3%; }
.compact-single-row-table th:nth-child(12) { width: 13.5%; }
@media (max-width: 1180px) {
    .btn-small {
        min-width: 58px;
        min-height: 28px;
        padding: 0 8px;
        font-size: 10.5px;
    }
    .actions-col { width: 124px; }
    .payment-row-actions .btn-small { min-width: 50px; font-size: 10px; }
}
@media (max-width: 860px) {
    .payment-row-actions {
        justify-content: flex-start;
    }
    .payment-row-actions .btn-small,
    .btn-small {
        min-width: 58px;
        min-height: 28px;
        font-size: 10px;
    }
}

/* v18 customers: compact customer register and customer invoice detail pages. */
.customer-filters {
    grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .7fr) minmax(210px, 1fr) auto auto;
}
.compact-register-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}
.compact-register-table th,
.compact-register-table td {
    padding: 8px 5px;
    font-size: 11.2px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}
.compact-register-table th { font-size: 9.4px; }
.compact-register-table td:first-child,
.compact-register-table th:first-child { text-align: left; }
.customer-table th:nth-child(1) { width: 12.5%; }
.customer-table th:nth-child(2) { width: 8%; }
.customer-table th:nth-child(3) { width: 8%; }
.customer-table th:nth-child(4) { width: 12%; }
.customer-table th:nth-child(5) { width: 18%; }
.customer-table th:nth-child(6) { width: 8%; }
.customer-table th:nth-child(7) { width: 7.5%; }
.customer-table th:nth-child(8) { width: 5%; }
.customer-table th:nth-child(9) { width: 7%; }
.customer-table th:nth-child(10) { width: 6%; }
.customer-table th:nth-child(11) { width: 8%; }
.customer-invoice-table th:nth-child(1) { width: 13%; }
.customer-invoice-table th:nth-child(2) { width: 9%; }
.customer-invoice-table th:nth-child(3) { width: 8%; }
.customer-invoice-table th:nth-child(4) { width: 9%; }
.customer-invoice-table th:nth-child(5) { width: 5%; }
.customer-invoice-table th:nth-child(6) { width: 9%; }
.customer-invoice-table th:nth-child(7) { width: 12%; }
.customer-invoice-table th:nth-child(8) { width: 8%; }
.customer-invoice-table th:nth-child(9) { width: 8%; }
.customer-invoice-table th:nth-child(10) { width: 10%; }
.customer-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.customer-profile-grid div {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
}
.customer-profile-grid strong {
    display: block;
    margin-top: 6px;
    line-height: 1.35;
}
.add-invoice-grid {
    grid-template-columns: minmax(190px, 1fr) minmax(170px, 1fr) minmax(160px, .8fr) minmax(160px, .8fr) auto;
    align-items: end;
}
.inline-form-action {
    margin-top: 0;
    align-items: end;
    white-space: nowrap;
}
@media (max-width: 1180px) {
    .customer-filters { grid-template-columns: 1fr 1fr; }
    .customer-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .add-invoice-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .customer-filters,
    .add-invoice-grid { grid-template-columns: 1fr; }
    .customer-profile-grid { grid-template-columns: 1fr; }
    .compact-register-table th,
    .compact-register-table td { font-size: 9.4px; padding: 6px 3px; }
    .compact-register-table th { font-size: 7.8px; }
}


/* v19 customers: clickable names replace View action; delete anonymises PII while retaining ledger. */
.customer-actions .btn-small { min-width: 62px; }
.compliance-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.compliance-rule-grid div,
.profile-danger-strip {
    border: 1px solid var(--border-soft);
    background: rgba(255,255,255,.035);
    border-radius: 12px;
    padding: 13px;
}
.compliance-rule-grid strong {
    display: block;
    margin-top: 6px;
    line-height: 1.35;
}
.profile-danger-strip {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.profile-danger-strip strong,
.profile-danger-strip span { display: block; }
.profile-danger-strip span { margin-top: 4px; color: var(--muted); line-height: 1.4; }
@media (max-width: 900px) {
    .compliance-rule-grid { grid-template-columns: 1fr; }
    .profile-danger-strip { align-items: flex-start; flex-direction: column; }
}

/* v20 suppliers: stacked supplier sections, profile contacts/banks, and no horizontal-scroll register layout. */
.supplier-filters {
    grid-template-columns: minmax(230px, 1.3fr) minmax(150px, .8fr) minmax(140px, .7fr) minmax(210px, 1fr) auto auto;
}
.no-scroll-wrap { overflow-x: visible; }
.entity-link,
.supplier-register-table a.entity-link {
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(19,200,245,.35);
}
.entity-link:hover { color: var(--cyan); }
.supplier-register-table th,
.supplier-register-table td,
.supplier-category-table th,
.supplier-category-table td,
.supplier-bank-table th,
.supplier-bank-table td,
.supplier-invoice-table th,
.supplier-invoice-table td,
.supplier-payment-table th,
.supplier-payment-table td {
    padding: 9px 6px;
    font-size: 11px;
    overflow-wrap: anywhere;
}
.supplier-register-table th { font-size: 9px; }
.supplier-register-table th:nth-child(1) { width: 16%; }
.supplier-register-table th:nth-child(2) { width: 9%; }
.supplier-register-table th:nth-child(3) { width: 10%; }
.supplier-register-table th:nth-child(4) { width: 10%; }
.supplier-register-table th:nth-child(5) { width: 11%; }
.supplier-register-table th:nth-child(6) { width: 9%; }
.supplier-register-table th:nth-child(7) { width: 17%; }
.supplier-register-table th:nth-child(8) { width: 8%; }
.supplier-register-table th:nth-child(9) { width: 10%; }
.mini-progress {
    display: block;
    height: 5px;
    width: 72px;
    max-width: 100%;
    margin: 5px auto 0;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,.10);
}
.mini-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), var(--green));
}
.supplier-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.supplier-rule-grid div {
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}
.supplier-rule-grid strong,
.supplier-rule-grid span { display: block; }
.supplier-rule-grid span { margin-top: 6px; color: var(--muted); line-height: 1.45; }
.supplier-profile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.supplier-profile-grid > div {
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}
.supplier-profile-grid small,
.contact-card span { color: var(--muted); }
.supplier-profile-grid strong {
    display: block;
    margin-top: 7px;
    line-height: 1.35;
}
.span-profile-wide { grid-column: span 2; }
.supplier-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.supplier-contact-grid h3 {
    margin: 0 0 10px;
    font-size: 13px;
}
.contact-stack { display: grid; gap: 9px; }
.contact-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
}
.supplier-bank-table th:nth-child(1) { width: 16%; }
.supplier-bank-table th:nth-child(2) { width: 10%; }
.supplier-bank-table th:nth-child(3) { width: 9%; }
.supplier-bank-table th:nth-child(4) { width: 10%; }
.supplier-bank-table th:nth-child(5) { width: 20%; }
.supplier-bank-table th:nth-child(6) { width: 7%; }
.supplier-bank-table th:nth-child(7) { width: 16%; }
.supplier-bank-table th:nth-child(8) { width: 12%; }
@media (max-width: 1180px) {
    .supplier-filters { grid-template-columns: 1fr 1fr; }
    .supplier-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-profile-wide { grid-column: span 2; }
    .supplier-rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .supplier-filters,
    .supplier-profile-grid,
    .supplier-contact-grid { grid-template-columns: 1fr; }
    .span-profile-wide { grid-column: span 1; }
    .contact-card { flex-direction: column; }
    .supplier-register-table th,
    .supplier-register-table td,
    .supplier-category-table th,
    .supplier-category-table td,
    .supplier-bank-table th,
    .supplier-bank-table td,
    .supplier-invoice-table th,
    .supplier-invoice-table td,
    .supplier-payment-table th,
    .supplier-payment-table td {
        font-size: 9.2px;
        padding: 6px 3px;
    }
    .supplier-register-table th { font-size: 7.6px; }
}

/* v21 marketing: stacked marketing sections, brand allocation and readable no-scroll tables. */
.marketing-setup-panel { margin-bottom: 14px; }
.marketing-filters {
    grid-template-columns: minmax(230px, 1.4fr) minmax(145px, .8fr) minmax(165px, .9fr) minmax(140px, .7fr) auto auto;
}
.marketing-register-table th,
.marketing-register-table td,
.marketing-platform-table th,
.marketing-platform-table td,
.marketing-brand-table th,
.marketing-brand-table td {
    padding: 8px 5px;
    font-size: 10.8px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.marketing-register-table th,
.marketing-platform-table th,
.marketing-brand-table th { font-size: 8.8px; }
.marketing-register-table td:first-child,
.marketing-register-table th:first-child,
.marketing-platform-table td:first-child,
.marketing-platform-table th:first-child,
.marketing-brand-table td:first-child,
.marketing-brand-table th:first-child { text-align: left; }
.marketing-register-table th:nth-child(1) { width: 17%; }
.marketing-register-table th:nth-child(2) { width: 9%; }
.marketing-register-table th:nth-child(3) { width: 7%; }
.marketing-register-table th:nth-child(4) { width: 8.5%; }
.marketing-register-table th:nth-child(5) { width: 8.5%; }
.marketing-register-table th:nth-child(6) { width: 11.5%; }
.marketing-register-table th:nth-child(7) { width: 5%; }
.marketing-register-table th:nth-child(8) { width: 6%; }
.marketing-register-table th:nth-child(9) { width: 8%; }
.marketing-register-table th:nth-child(10) { width: 5%; }
.marketing-register-table th:nth-child(11) { width: 6%; }
.marketing-register-table th:nth-child(12) { width: 8.5%; }
.marketing-platform-table th:nth-child(1) { width: 14%; }
.marketing-platform-table th:nth-child(2) { width: 12%; }
.marketing-platform-table th:nth-child(3) { width: 17%; }
.marketing-platform-table th:nth-child(4) { width: 13%; }
.marketing-platform-table th:nth-child(5) { width: 25%; }
.marketing-platform-table th:nth-child(6) { width: 8%; }
.marketing-platform-table th:nth-child(7) { width: 11%; }
.marketing-brand-table th:nth-child(1) { width: 18%; }
.marketing-brand-table th:nth-child(2) { width: 9%; }
.marketing-brand-table th:nth-child(3) { width: 9%; }
.marketing-brand-table th:nth-child(4) { width: 6%; }
.marketing-brand-table th:nth-child(5) { width: 7%; }
.marketing-brand-table th:nth-child(6) { width: 10%; }
.marketing-brand-table th:nth-child(7) { width: 11%; }
.marketing-brand-table th:nth-child(8) { width: 6%; }
.marketing-brand-table th:nth-child(9) { width: 8%; }
.marketing-brand-table th:nth-child(10) { width: 16%; }
.marketing-add-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}
.marketing-add-grid .inline-form-action { justify-content: flex-start; }
.marketing-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.marketing-rule-grid div {
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}
.marketing-rule-grid span,
.marketing-rule-grid strong { display: block; }
.marketing-rule-grid span { color: var(--muted); margin-bottom: 6px; }
.marketing-rule-grid strong { line-height: 1.4; }
@media (max-width: 1180px) {
    .marketing-filters,
    .marketing-add-grid { grid-template-columns: 1fr 1fr; }
    .marketing-rule-grid { grid-template-columns: 1fr; }
    .marketing-register-table th,
    .marketing-register-table td,
    .marketing-platform-table th,
    .marketing-platform-table td,
    .marketing-brand-table th,
    .marketing-brand-table td { font-size: 9.6px; padding: 6px 3px; }
    .marketing-register-table th,
    .marketing-platform-table th,
    .marketing-brand-table th { font-size: 7.7px; }
}
@media (max-width: 860px) {
    .marketing-filters,
    .marketing-add-grid { grid-template-columns: 1fr; }
    .marketing-register-table th,
    .marketing-register-table td,
    .marketing-platform-table th,
    .marketing-platform-table td,
    .marketing-brand-table th,
    .marketing-brand-table td { font-size: 8.8px; padding: 5px 2px; }
    .marketing-register-table th,
    .marketing-platform-table th,
    .marketing-brand-table th { font-size: 7px; }
}
