:root {
    --ss-purple-700: #6d28d9;
    --ss-purple-600: #7c3aed;
    --ss-purple-500: #8b5cf6;
    --ss-indigo-600: #4f46e5;
    --ss-ink: #1e1b2e;
    --ss-muted: #6b7280;
    --ss-border: #eef0f4;
    --ss-bg: #f6f5fb;
    --ss-green: #16a34a;
    --ss-green-bg: #e9f9ee;
    --ss-orange: #d97706;
    --ss-orange-bg: #fef3e2;
    --ss-red: #dc2626;
    --ss-red-bg: #fdecec;
}

html, body {
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: #bbb transparent;
}

body.ss-body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--ss-purple-600) 0%, var(--ss-purple-700) 45%, #4c1d95 100%);
    min-height: 100vh;
    padding: 8px;
}

.ss-shell {
/*    max-width: 1500px;*/
    margin: 0 auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(45, 12, 90, 0.35);
    display: flex;
    min-height: calc(100vh - 8px);
    overflow: hidden;
}

.ss-sidebar {
    width: 250px;
    flex-shrink: 0;
    padding: 28px 18px;
    border-right: 1px solid var(--ss-border);
    display: flex;
    flex-direction: column;
}

.ss-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 24px 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--ss-ink);
}

.ss-logo-img { height: 32px; width: auto; display: block; }
.ss-logo-dot { color: var(--ss-purple-600); }

.ss-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.ss-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #4b4a58;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.ss-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }

.ss-nav a:hover { background: #f4f1fc; color: var(--ss-purple-700); }

.ss-nav a.active {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    color: #fff;
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.28);
}

.ss-nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9a97ab;
    font-weight: 700;
    padding: 14px 14px 4px;
}

.ss-nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: #4b4a58;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    transition: background .15s ease, color .15s ease;
}
.ss-nav-toggle:hover { background: #f4f1fc; color: var(--ss-purple-700); }
.ss-nav-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.ss-nav-toggle .ss-nav-label { flex: 1; text-align: left; }
.ss-nav-toggle .ss-chevron { width: 14px; height: 14px; transition: transform .2s ease; }
.ss-nav-toggle[aria-expanded="true"] .ss-chevron { transform: rotate(180deg); }
.ss-nav-toggle.active {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    color: #fff;
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.28);
}

.ss-subnav {
    list-style: none;
    margin: 2px 0 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ss-subnav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: #6b6a78;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.ss-subnav a::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c7c5d6;
    flex-shrink: 0;
    transition: background .15s ease, box-shadow .15s ease;
}
.ss-subnav a:hover { background: #f4f1fc; color: var(--ss-purple-700); }
.ss-subnav a:hover::before { background: var(--ss-purple-500); }
.ss-subnav a.active { background: #f4f1fc; color: var(--ss-purple-700); font-weight: 700; }
.ss-subnav a.active::before {
    background: var(--ss-purple-600);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}

.ss-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ss-main {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: 30px;
    background: var(--ss-bg);
    overflow-x: hidden;
}

.ss-hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--ss-border);
    background: #fff;
    color: #6b6a78;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: auto;
}
.ss-hamburger-btn svg { width: 18px; height: 18px; }
.ss-hamburger-btn:hover { background: #f6f4fc; color: var(--ss-purple-700); }

.ss-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 50, .45);
    z-index: 1040;
    opacity: 0;
    transition: opacity .2s ease;
}
.ss-sidebar-backdrop.show { display: block; opacity: 1; }

/* Desktop: the shell fills the window and the sidebar and the page content scroll on their own
   (the menu stays put while a long page scrolls, and a long menu scrolls by itself). */
@media (min-width: 901px) {
    body.ss-body { height: 100vh; overflow: hidden; }
    .ss-shell { height: calc(100vh - 16px); min-height: 0; }
    .ss-sidebar, .ss-main { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d4d0e2 transparent; }
    .ss-sidebar::-webkit-scrollbar, .ss-main::-webkit-scrollbar { width: 8px; }
    .ss-sidebar::-webkit-scrollbar-thumb, .ss-main::-webkit-scrollbar-thumb { background: #d4d0e2; border-radius: 8px; }
    .ss-sidebar::-webkit-scrollbar-track, .ss-main::-webkit-scrollbar-track { background: transparent; }
}

@media (max-width: 900px) {
    body.ss-body { padding: 0; }
    .ss-shell { flex-direction: column; border-radius: 0; min-height: 100vh; }
    .ss-hamburger-btn { display: flex; }

    .ss-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 250px;
        z-index: 1050;
        background: #fff;
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
    }
    .ss-sidebar.ss-sidebar-open { transform: translateX(0); }

    .ss-main { padding: 20px 16px; }
}

.ss-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
    align-items: center;
}

.ss-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--ss-ink);
    margin: 0 0 4px;
}

.ss-header p {
    color: var(--ss-muted);
    margin: 0;
    font-size: 14px;
}

.ss-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ss-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ss-topbar-icon-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--ss-border);
    background: #fff;
    color: #6b6a78;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ss-topbar-icon-btn svg { width: 18px; height: 18px; }
.ss-topbar-icon-btn:hover { background: #f6f4fc; color: var(--ss-purple-700); }

.ss-profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ss-border);
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
}
.ss-profile-chip:hover { background: #faf9fd; }

.ss-avatar-sm { width: 32px; height: 32px; font-size: 12.5px; }

.ss-profile-text { text-align: left; line-height: 1.25; }
.ss-profile-name { font-size: 13.5px; font-weight: 700; color: var(--ss-ink); }
.ss-profile-role { font-size: 11.5px; color: var(--ss-muted); text-transform: capitalize; }

.ss-profile-chip .chevron { width: 14px; height: 14px; color: #9a97ab; transition: transform .15s ease; flex-shrink: 0; }
.ss-profile-chip[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.ss-profile-menu {
    border-radius: 14px;
    border: 1px solid var(--ss-border);
    box-shadow: 0 20px 40px rgba(20, 10, 50, 0.14);
    padding: 8px;
    min-width: 230px;
}
.ss-profile-menu .dropdown-header { font-size: 12px; color: var(--ss-muted); padding: 8px 10px 6px; }
.ss-profile-menu-header { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px 12px; }
.ss-profile-menu-header .ss-avatar { width: 42px; height: 42px; font-size: 15px; }
.ss-profile-menu-text { min-width: 0; }
.ss-profile-menu-name {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ss-ink);
    text-transform: uppercase;
    letter-spacing: .02em;
    overflow-wrap: break-word;
}
.ss-profile-menu-role { font-size: 12px; font-weight: 600; color: var(--ss-purple-600); text-transform: capitalize; margin-top: 2px; }
.ss-profile-menu-email { font-size: 12px; color: var(--ss-muted); margin-top: 2px; overflow-wrap: anywhere; }
.ss-profile-menu .dropdown-item {
    border-radius: 9px;
    padding: 9px 10px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ss-profile-menu .dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.ss-profile-menu .dropdown-item:hover { background: #f6f4fc; }
.ss-logout-item { color: var(--ss-red); width: 100%; background: none; border: none; text-align: left; }
.ss-logout-item svg { width: 16px; height: 16px; }
.ss-logout-item:hover { background: var(--ss-red-bg) !important; color: var(--ss-red) !important; }

@media (max-width: 560px) {
    .ss-profile-text { display: none; }
    .ss-profile-chip { padding: 6px; }
}

.btn-ss-primary, .btn-ss-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-ss-primary svg, .btn-ss-outline svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-ss-primary {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    border: none;
    color: #fff !important;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
}
.btn-ss-primary:hover { color: #fff; opacity: .92; }
.btn-ss-primary:disabled, .btn-ss-primary.ss-btn-busy { opacity: .65; cursor: not-allowed; pointer-events: none; }

.btn-ss-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ef4444, var(--ss-red));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.28);
    transition: opacity .15s ease, transform .15s ease;
}
.btn-ss-danger svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-ss-danger:hover { color: #fff; opacity: .92; }
.btn-ss-danger:active { transform: translateY(1px); }
.btn-ss-danger:disabled, .btn-ss-danger.ss-btn-busy { opacity: .65; cursor: not-allowed; pointer-events: none; }

/* Drawn in the button's own text colour, so it shows on purple (white) and on white
   icon buttons (green / red) alike. */
.ss-btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: ss-spin .6s linear infinite;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) { .ss-btn-spinner { animation: none; } }

.btn-ss-outline {
    background: #fff;
    border: 1px solid #e3e1ee;
    color: var(--ss-ink);
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
}
.btn-ss-outline:hover { background: #faf9fd; }

.ss-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--ss-border);
    padding: 16px;
    box-shadow: 0 2px 10px rgba(20, 10, 50, 0.03);
}

.ss-stat-label { font-size: 13px; color: var(--ss-muted); font-weight: 600; }
.ss-stat-value { font-size: 30px; font-weight: 800; color: var(--ss-ink); }
.ss-stat-sub { font-size: 12.5px; color: var(--ss-muted); }

/* All four cards in one row. Payment Mode Wise keeps its modes compact
   (two small columns) so it stays as short as the other cards. */
.ss-coll-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 16px; }
.ss-coll-card { height: 100%; }
.ss-coll-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ss-coll-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ss-coll-icon svg { width: 18px; height: 18px; }
.ss-coll-icon-purple { background: #f1ebfe; color: #6d28d9; }
.ss-coll-icon-green { background: #e9f9ee; color: #15803d; }
.ss-coll-icon-red { background: #fdecec; color: #dc2626; }
.ss-coll-icon-blue { background: #e8f1fe; color: #1d4ed8; }
.ss-coll-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ss-coll-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.ss-coll-mode { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ss-coll-mode .ss-badge { font-size: 11px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ss-coll-mode-count { font-size: 11px; color: var(--ss-muted); white-space: nowrap; }
.ss-coll-mode-amt { margin-left: auto; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1199.98px) { .ss-coll-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .ss-coll-stats { grid-template-columns: minmax(0, 1fr); } }

.ss-profile-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--ss-border);
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.08);
    overflow: hidden;
}
.ss-profile-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 26px;
    background: linear-gradient(135deg, #f6f4fc, #fff);
    border-bottom: 1px solid var(--ss-border);
}
.ss-profile-avatar-lg {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 26px;
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.28);
}
.ss-profile-card-name { font-size: 22px; font-weight: 800; color: var(--ss-ink); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .01em; }

.ss-profile-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 32px;
    padding: 40px;
}
@media (max-width: 900px) {
    .ss-profile-info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ss-profile-info-grid { grid-template-columns: 1fr; }
}
.ss-profile-info-item { display: flex; align-items: flex-start; gap: 14px; }
.ss-profile-info-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    background: #f0ecfb;
    color: var(--ss-purple-600);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ss-profile-info-icon svg { width: 19px; height: 19px; }
.ss-profile-info-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ss-muted); font-weight: 700; margin-bottom: 3px; }
.ss-profile-info-value { font-size: 14.5px; font-weight: 700; color: var(--ss-ink); overflow-wrap: anywhere; }

.ss-chart-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.ss-chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ss-muted); }
.ss-chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ss-chart-body { padding: 6px 22px 20px; }
.ss-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ss-chart-grid { stroke: var(--ss-border); stroke-width: 1; }
.ss-chart-axis-label { font-size: 10.5px; fill: var(--ss-muted); font-weight: 600; }
.ss-chart-value-label { font-size: 10.5px; fill: var(--ss-ink); font-weight: 700; }
.ss-chart-bar { transition: opacity .15s ease; cursor: pointer; }
.ss-chart-bar:hover { opacity: .82; }
.ss-chart-bar-square { pointer-events: none; }
.ss-chart-bar-purchases { fill: var(--ss-indigo-600); }
.ss-chart-bar-challans { fill: var(--ss-green); }

.ss-alerts-card { display: flex; flex-direction: column; }
.ss-alerts-card .ss-table-head { flex-shrink: 0; }
.ss-alerts-scroll {
    flex: 1;
    min-height: 0;
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color .2s ease;
}
.ss-alerts-scroll:hover { scrollbar-color: #c7c5d6 transparent; }
.ss-alerts-scroll::-webkit-scrollbar { width: 6px; }
.ss-alerts-scroll::-webkit-scrollbar-track { background: transparent; }
.ss-alerts-scroll::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 10px;
    transition: background-color .2s ease;
}
.ss-alerts-scroll:hover::-webkit-scrollbar-thumb { background-color: #c7c5d6; }

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #c7c5d6 transparent;
}
.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }
.table-responsive::-webkit-scrollbar-thumb {
    background-color: #c7c5d6;
    border-radius: 10px;
}
.table-responsive::-webkit-scrollbar-thumb:hover { background-color: #a8a4c0; }

.ss-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
}
.ss-badge-green { background: var(--ss-green-bg); color: var(--ss-green); }
.ss-badge-orange { background: var(--ss-orange-bg); color: var(--ss-orange); }
.ss-badge-red { background: var(--ss-red-bg); color: var(--ss-red); }
.ss-badge-purple { background: #f4f1fc; color: var(--ss-purple-700); }
.ss-badge-gray { background: #f1f0f5; color: #6b6a78; }
table.ss-table tfoot.ss-report-total td {
    padding: 8px 16px;
    background: linear-gradient(180deg, #f8f5ff, #f1ebfe);
    border-top: 2px solid #ddd3fb;
    font-weight: 800;
/*    color: var(--ss-purple-700);*/
    white-space: nowrap;
    text-align: right;
}
table.ss-table tfoot.ss-report-total .ss-total-label { text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; }
table.ss-table tfoot.ss-report-total .ss-total-count { margin-left: 8px; font-weight: 600; color: var(--ss-muted); text-transform: none; letter-spacing: 0; }
table.ss-table tfoot.ss-report-total .ss-amt { font-size: 15px; }
.ss-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.ss-amt-in { color: var(--ss-green, #16a34a); }
.ss-amt-out { color: var(--ss-red, #dc2626); }
.ss-amt-nil { color: #c4c2d0; font-weight: 400; }
.ss-pm-green { background: #e9f9ee; color: #15803d; }
.ss-pm-blue { background: #e8f1fe; color: #1d4ed8; }
.ss-pm-purple { background: #f1ebfe; color: #6d28d9; }
.ss-pm-orange { background: #fef3e2; color: #c2410c; }
.ss-pm-teal { background: #e6f7f6; color: #0f766e; }
.ss-pm-pink { background: #fdebf3; color: #be185d; }
.ss-badge-upper { text-transform: uppercase; letter-spacing: 0.3px; }

.ss-cancelled-value { color: var(--ss-red); text-decoration: line-through; opacity: 0.7; }
/* A whole row for something on a cancelled challan (e.g. a payment taken before cancelling). */
.ss-cancelled-row > td { color: var(--ss-red) !important; text-decoration: line-through; opacity: .75; }
.ss-cancelled-row > td .ss-badge { text-decoration: none; }

.ss-badge-verified-icon { width: 13px; height: 13px; flex-shrink: 0; }

.ss-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.ss-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.ss-switch-slider {
    position: absolute;
    inset: 0;
    background: #d9d6e8;
    transition: background-color .2s ease;
    border-radius: 999px;
    cursor: pointer;
}
.ss-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    transition: transform .2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.ss-switch input:checked + .ss-switch-slider {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
}
.ss-switch input:checked + .ss-switch-slider::before {
    transform: translateX(18px);
}
.ss-switch input:disabled + .ss-switch-slider {
    opacity: .55;
    cursor: not-allowed;
}
.ss-switch input:focus-visible + .ss-switch-slider {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
}

/* Page tabs (icon + label + count) on a white card bar. The active tab gets
   a tinted background and a gradient bar underneath. */
.ss-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.08);
    overflow-x: auto;
    scrollbar-width: none;
}
.ss-tabs::-webkit-scrollbar { display: none; }
.ss-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px 13px;
    border-radius: 12px;
    color: var(--ss-muted);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.ss-tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.ss-tab:hover { color: var(--ss-purple-700); background: #faf8ff; }
.ss-tab.active {
    color: var(--ss-purple-700);
    background: linear-gradient(135deg, #f5f0ff 0%, #eeeafe 100%);
    box-shadow: inset 0 0 0 1px #e3ddfb;
}
.ss-tab.active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 5px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ss-purple-600), var(--ss-indigo-600));
}
.ss-tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #ece9f8; color: var(--ss-muted); font-size: 12px; font-weight: 700; text-align: center; }
.ss-tab.active .ss-tab-count { background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600)); color: #fff; box-shadow: 0 3px 8px rgba(124, 58, 237, .3); }

/* Tinted table header for request lists (title on the left, status filter on the right). */
.ss-table-head.ss-table-head-tinted {
    justify-content: space-between;
    background: linear-gradient(180deg, #faf8ff 0%, #fff 100%);
    border-bottom: 1px solid var(--ss-border);
}

.ss-table-wrap { background: #fff; border-radius: 18px; border: 1px solid var(--ss-border); overflow: hidden; box-shadow: 0 8px 24px rgba(109, 40, 217, 0.18); }
.ss-table-head { display: flex; /*justify-content: space-between;*/ align-items: center; padding: 20px 22px; gap: 12px; flex-wrap: wrap; }
.ss-table-head h2 { font-size: 18px; font-weight: 800; margin: 0; color: var(--ss-ink); }

.ss-search {
    border: 1px solid #c5c2d2;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    min-width: 240px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ss-search:focus { outline: none; border-color: var(--ss-purple-600); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }

.ss-search-wrap { position: relative; display: inline-flex; align-items: center; }
.ss-search-wrap .ss-search { padding-left: 36px; padding-right: 32px; min-width: 260px; }

.ss-search-icon, .ss-search-spinner {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9a97ab;
    pointer-events: none;
    transition: color .15s ease, opacity .15s ease;
}
.ss-search-wrap .ss-search:focus ~ .ss-search-icon { color: var(--ss-purple-600); }

.ss-search-spinner { opacity: 0; color: var(--ss-purple-600); animation: ss-search-spin .7s linear infinite; }
.ss-search-wrap.is-loading .ss-search-icon { opacity: 0; }
.ss-search-wrap.is-loading .ss-search-spinner { opacity: 1; }
@keyframes ss-search-spin { to { transform: translateY(-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ss-search-spinner { animation: none; } }

.ss-filter-select {
    border: 1px solid #e6e4ee;
    border-radius: 10px;
    padding: 8px 32px 8px 14px;
    font-size: 13.5px;
    color: var(--ss-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ss-filter-select:hover, .ss-filter-select:focus {
    outline: none;
    border-color: var(--ss-purple-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.ss-segmented {
    display: inline-flex;
    align-items: center;
    background: #f1f0f6;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
/* Buttons (client-side filters) or links (server filters, e.g. Pending /
   Approved / Rejected) — same look either way. */
.ss-segmented button,
.ss-segmented a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--ss-muted);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.ss-segmented button:hover:not(.active),
.ss-segmented a:hover:not(.active) { color: var(--ss-ink); }
.ss-segmented button.active,
.ss-segmented a.active {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    color: #fff;
    box-shadow: 0 4px 10px rgba(124, 58, 237, .25);
}
/* Small count inside a segment, e.g. Pending 3. */
.ss-seg-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e4e1f2; color: var(--ss-muted); font-size: 11.5px; line-height: 18px; text-align: center; }
.ss-segmented .active .ss-seg-count { background: rgba(255, 255, 255, .25); color: #fff; }

/* GitHub-style diff of an edit request (on .ss-line-items): "−" rows are what the entry
   has now, "+" rows what was asked for, the changed value highlighted. */
.ss-diff .ss-diff-sign { width: 34px; text-align: center; font-weight: 800; font-size: 15px; padding-left: 8px; padding-right: 8px; }
.ss-line-items.ss-diff tbody tr.ss-diff-del td { background: var(--ss-red-bg); color: var(--ss-red); }
.ss-line-items.ss-diff tbody tr.ss-diff-add td { background: var(--ss-green-bg); color: var(--ss-green); }
.ss-line-items.ss-diff tbody tr.ss-diff-del:hover,
.ss-line-items.ss-diff tbody tr.ss-diff-add:hover { background: transparent; }
/* Left accent bar on changed rows. */
.ss-line-items.ss-diff tbody tr.ss-diff-del td:first-child { box-shadow: inset 3px 0 0 var(--ss-red); }
.ss-line-items.ss-diff tbody tr.ss-diff-add td:first-child { box-shadow: inset 3px 0 0 var(--ss-green); }
/* The exact value that changed inside a row: a solid pill so a small edit stands out. */
.ss-diff-hl { display: inline-block; border-radius: 6px; padding: 1px 8px; font-weight: 800; color: #fff; }
.ss-diff-del .ss-diff-hl { background: var(--ss-red); text-decoration: line-through; }
.ss-diff-add .ss-diff-hl { background: var(--ss-green); }
.ss-diff-section + .ss-diff-section { margin-top: 18px; }
.ss-diff-section .ss-form-section-title { justify-content: space-between; margin-bottom: 4px; }
.ss-diff-stats { display: flex; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ss-muted); }
.ss-diff-stats .ss-diff-plus { color: var(--ss-green); font-weight: 800; }
.ss-diff-stats .ss-diff-minus { color: var(--ss-red); font-weight: 800; }
/* Detail drawer: sections as raised cards on a tinted body. */
.ss-drawer.ss-drawer-detail .offcanvas-body { background: var(--ss-bg); padding-top: 20px; }
.ss-detail-card {
    background: #fff;
    border: 1px solid var(--ss-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(30, 27, 46, .04), 0 8px 24px rgba(30, 27, 46, .07);
    overflow: hidden;
    flex-shrink: 0;
}
.ss-detail-card + .ss-detail-card { margin-top: 18px; }
.ss-detail-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #fbfaff 0%, #f6f4fc 100%);
    border-bottom: 1px solid var(--ss-border);
}
.ss-detail-card-title { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 800; color: var(--ss-ink); }
.ss-detail-card-icon {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600));
    color: #fff;
    box-shadow: 0 4px 10px rgba(124, 58, 237, .28);
}
.ss-detail-card-icon svg { width: 16px; height: 16px; }
.ss-detail-card-body { padding: 16px 18px; }
.ss-detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { .ss-detail-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 768px) { .ss-detail-fields.ss-detail-fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ss-detail-note { margin-top: 12px; padding: 11px 13px; border-radius: 10px; background: var(--ss-red-bg); border: 1px solid color-mix(in srgb, var(--ss-red) 25%, transparent); color: var(--ss-red); font-size: 13.5px; font-weight: 600; }
.ss-detail-note .ss-view-label { color: var(--ss-red); }
.ss-detail-field { padding: 11px 13px; border-radius: 10px; background: #faf9fe; border: 1px solid var(--ss-border); min-width: 0; }
.ss-detail-field .ss-view-value { overflow-wrap: anywhere; }
.ss-detail-card .ss-line-items thead th { background: #fff; border-bottom: 1px solid var(--ss-border); }
.ss-detail-card .ss-line-items tbody tr:first-child td { border-top: 0; }

/* App user permissions (Admin → App Users drawers). */
.ss-perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ss-perm-option[hidden] { display: none !important; }
.ss-perm-option { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--ss-border); border-radius: 10px; background: #fbfaff; font-size: 13.5px; font-weight: 600; color: var(--ss-ink); cursor: pointer; margin: 0; }
.ss-perm-option input { width: 16px; height: 16px; accent-color: var(--ss-purple-600); }
.ss-perm-option:has(input:checked) { border-color: var(--ss-purple-500); background: #f4f1fc; color: var(--ss-purple-700); }

/* Category-wise sales (Business Report → By Salesman drawer). */
.ss-share { display: flex; align-items: center; gap: 8px; }
.ss-share-bar { flex: 1; height: 7px; border-radius: 999px; background: #efedf7; overflow: hidden; min-width: 50px; }
.ss-share-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ss-purple-500), var(--ss-indigo-600)); }
.ss-share-pct { font-size: 12px; font-weight: 700; color: var(--ss-purple-700); min-width: 42px; text-align: right; }
.ss-category-sales tfoot td { padding: 9px 14px; font-size: 13.5px; font-weight: 700; color: var(--ss-ink); border-top: 1px solid var(--ss-border); background: #fbfaff; }
.ss-category-sales tfoot tr.ss-category-other td { font-weight: 500; color: var(--ss-muted); }
.ss-category-sales tfoot tr.ss-category-grand td { background: #f6f4fc; color: var(--ss-purple-700); font-size: 14.5px; font-weight: 800; }

/* Text fields (Entry Details): old struck in red → new in green. */
.ss-diff-old { display: inline-block; background: var(--ss-red-bg); color: var(--ss-red); text-decoration: line-through; border-radius: 6px; padding: 1px 7px; }
.ss-diff-new { display: inline-block; background: var(--ss-green-bg); color: var(--ss-green); border-radius: 6px; padding: 1px 7px; }
.ss-diff-arrow { color: var(--ss-muted); margin: 0 6px; }

.ss-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #9a97ab;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.ss-search-clear svg { width: 12px; height: 12px; }
.ss-search-clear:hover { background: #f6f4fc; color: var(--ss-purple-600); }

table.ss-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ss-table thead th {
    background: #f6f4fc;
    color: var(--ss-purple-700);
    text-align: left;
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 12px 16px;
    white-space: nowrap;
}
table.ss-table tbody td {
    padding: 8px 16px;
    border-top: 1px solid var(--ss-border);
    color: #33313f;
    vertical-align: middle;
}
table.ss-table tbody tr:hover { background: #fbfaff; }

.ss-truncate {
    display: block;
    max-width: clamp(140px, 18vw, 320px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-wh-tooltip {
    position: relative;
    display: inline-block;
    cursor: default;
    border-bottom: 1px dashed var(--ss-muted);
}
.ss-wh-tooltip-content {
    display: none;
    position: fixed;
    transform: translate(-50%, -100%);
    background: #241f38;
    color: #fff;
    padding: 8px 12px;
    border-radius: 9px;
    box-shadow: 0 14px 28px rgba(20, 10, 50, 0.28);
    white-space: nowrap;
    z-index: 1080;
    font-size: 12.5px;
    text-align: left;
}
.ss-wh-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #241f38;
}
.ss-wh-tooltip-row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.ss-wh-tooltip-row span { color: #c7c2db; }
.ss-wh-tooltip-row strong { color: #fff; margin-left: 16px; }
.ss-wh-tooltip-row + .ss-wh-tooltip-row { margin-top: 2px; padding-top: 2px; border-top: 1px dashed rgba(255,255,255,.15); }
.ss-wh-tooltip-row.is-pending span, .ss-wh-tooltip-row.is-pending strong { color: #fbbf24; }
.ss-wh-tooltip-row.is-pending-by { border-top: none !important; margin-top: 0 !important; padding: 1px 0 1px 10px; font-size: 11.5px; }
.ss-wh-tooltip-row.is-pending-by span { color: #fde68a; opacity: .85; }
.ss-wh-tooltip-row.is-pending-by strong { color: #fde68a; font-weight: 600; }

@media (max-width: 900px) {
    table.ss-table { min-width: 720px; }
}

.ss-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 14px 22px;
    border-top: 1px solid var(--ss-border);
    transition: opacity .15s ease;
}
.ss-pagination.is-loading { opacity: .55; pointer-events: none; cursor: wait; }

.ss-table-loading { position: relative; pointer-events: none; }
.ss-table-loading > * { opacity: .35; transition: opacity .15s ease; }
.ss-table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--ss-purple-100, #ece9fb);
    border-top-color: var(--ss-purple-600);
    border-radius: 50%;
    animation: ss-spin .7s linear infinite;
    z-index: 5;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ss-table-loading::after { animation: none; } }

.ss-pager-total { font-size: 13px; color: var(--ss-muted); white-space: nowrap; }
.ss-pager-total strong { color: var(--ss-ink); font-weight: 700; }

.ss-pager-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: auto; }

.ss-pager-arrow {
    min-width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #606266;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s ease, background-color .15s ease;
}
.ss-pager-arrow svg { width: 15px; height: 15px; }
.ss-pager-arrow:hover:not(:disabled) { color: var(--ss-purple-600); background: #f6f4fc; }
.ss-pager-arrow:disabled, .ss-pager-arrow.disabled { opacity: .35; pointer-events: none; }

.ss-pager-numbers { display: flex; align-items: center; gap: 4px; }

.ss-pager-number, .ss-pager-ellipsis {
    min-width: 28px;
    height: 28px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #606266;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.ss-pager-number:hover { color: var(--ss-purple-600); background: #f6f4fc; }
.ss-pager-number.active {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    border-color: var(--ss-purple-600);
    color: #fff;
    font-weight: 700;
}
.ss-pager-ellipsis { color: #97989c; cursor: pointer; }
.ss-pager-ellipsis:hover { color: var(--ss-purple-600); background: #f6f4fc; }
.ss-pager-ellipsis svg { width: 14px; height: 14px; }

.ss-page-size-wrap { position: relative; display: inline-flex; }

.ss-page-size-select {
    height: 28px;
    border: 1px solid #e6e4ee;
    border-radius: 6px;
    padding: 0 24px 0 8px;
    font-size: 13px;
    color: var(--ss-ink);
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color .15s ease;
}
.ss-page-size-select:hover, .ss-page-size-select:focus { border-color: var(--ss-purple-500); outline: none; }

.ss-page-size-arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #606266;
    pointer-events: none;
}
.ss-page-size-wrap:hover .ss-page-size-arrow,
.ss-page-size-wrap:has(.ss-page-size-select:focus) .ss-page-size-arrow { color: var(--ss-purple-500); }

@media (max-width: 640px) {
    .ss-pagination { justify-content: center; }
    .ss-pager-controls { margin-left: 0; justify-content: center; }
}

.ss-empty { padding: 64px 24px; text-align: center; color: var(--ss-muted); }

.ss-empty-icon { width: clamp(100px, 30vw, 150px); margin: 18px auto; }
.ss-empty-illustration { width: 100%; height: auto; display: block; animation: ss-empty-float 3s ease-in-out infinite; }

.ss-empty-title { font-size: 17px; font-weight: 700; color: var(--ss-ink); margin-bottom: 6px; }

@keyframes ss-empty-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
    .ss-empty-illustration { animation: none; }
}

@media (max-width: 900px) {
    .ss-empty { padding: 40px 18px; }
}

.ss-icon-btn {
    border: 1px solid #e6e4ee;
    background: #fff;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ss-ink);
}
.ss-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 30px; }
/* An unsized inline SVG collapses to nothing inside the button — give icons a size. */
.ss-icon-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.ss-icon-btn:hover { background: #f6f4fc; }
.ss-icon-btn.danger { color: var(--ss-red); border-color: #f6d3d3; }
.ss-icon-btn.danger:hover { background: var(--ss-red-bg); }
.ss-icon-btn.ss-btn-busy { cursor: progress; pointer-events: none; background: #f6f4fc; }
.ss-icon-btn.danger.ss-btn-busy { background: var(--ss-red-bg); }

.ss-receipt-btn { color: var(--ss-purple-600); background: #f6f4fc; border-color: #e3ddfb; }
.ss-receipt-btn:hover { background: var(--ss-purple-600); color: #fff; border-color: var(--ss-purple-600); }
.amount-col { text-align: right; }
.ss-pd-dash { color: var(--ss-muted); }

.ss-return-customer-card { background: #f8f7fd; border: 1px solid #ece9f8; border-radius: 12px; padding: 14px 16px; height: 100%; }

.ss-return-customer-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ss-return-customer-profile { display: flex; align-items: center; gap: 10px; flex: 1 1 180px; min-width: 0; }
.ss-return-customer-text { min-width: 0; }
.ss-return-customer-name { font-weight: 800; font-size: 15px; color: var(--ss-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-return-customer-mobile { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ss-muted); margin-top: 2px; }
.ss-return-customer-mobile svg { width: 13px; height: 13px; flex-shrink: 0; }
.ss-return-date-field { flex: 0 0 150px; }
@media (max-width: 420px) {
    .ss-return-date-field { flex-basis: 100%; }
}

.ss-print-btn:hover { color: var(--ss-purple-700); }
.ss-print-paper {
    transform-box: fill-box;
    transform-origin: 50% 0%;
}
.ss-print-btn:hover .ss-print-paper {
    animation: ss-print-eject 0.85s ease-in-out infinite;
}
.ss-print-btn:hover .ss-print-body {
    animation: ss-print-flash 0.85s ease-in-out infinite;
}
@keyframes ss-print-eject {
    0%, 15% { transform: translateY(0); opacity: 1; }
    55% { transform: translateY(5px); opacity: 0.6; }
    85%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes ss-print-flash {
    0%, 40% { opacity: 1; }
    55% { opacity: 0.5; }
    70%, 100% { opacity: 1; }
}

.ss-row-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #8b899b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.ss-row-menu-btn svg { width: 16px; height: 16px; }
.ss-row-menu-btn:hover, .ss-row-menu-btn[aria-expanded="true"] { background: #f6f4fc; color: var(--ss-purple-700); }
.ss-row-menu {
    border-radius: 12px;
    border: 1px solid var(--ss-border);
    box-shadow: 0 14px 30px rgba(20, 10, 50, 0.14);
    padding: 6px;
    min-width: 150px;
}
.ss-row-menu .dropdown-item {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: var(--ss-ink);
}
.ss-row-menu .dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; color: #8b899b; }
.ss-row-menu .dropdown-item:hover { background: #f6f4fc; }
.ss-row-menu .ss-row-menu-danger, .ss-row-menu .ss-row-menu-danger svg { color: var(--ss-red); }
.ss-row-menu .ss-row-menu-danger:hover { background: var(--ss-red-bg); }

.ss-view-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--ss-muted); font-weight: 700; margin-bottom: 3px; }
.ss-view-value { font-size: 14.5px; font-weight: 700; color: var(--ss-ink); }

.ss-pay-summary { display: flex; align-items: stretch; background: #f6f4fc; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; gap: 14px; }
.ss-pay-summary-item { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.ss-pay-summary-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--ss-purple-600); flex-shrink: 0; }
.ss-pay-summary-icon svg { width: 18px; height: 18px; }
.ss-pay-summary-icon.due { color: var(--ss-red); }
.ss-pay-summary-divider { width: 1px; align-self: stretch; background: var(--ss-border); }
.ss-pay-summary .ss-view-value.due { color: var(--ss-red); }

.ss-modal .modal-content { border-radius: 18px; border: none; }
.ss-modal .modal-header { border-bottom: 1px solid var(--ss-border); padding: 18px 24px; }
.ss-modal .modal-title { font-weight: 800; color: var(--ss-ink); }
.ss-modal .modal-body { padding: 22px 24px; }
.ss-modal .modal-footer { border-top: 1px solid var(--ss-border); padding: 16px 24px; }
.ss-modal .form-label { font-weight: 600; font-size: 13.5px; color: #43414f; }
.ss-modal .form-control, .ss-modal .form-select { border-radius: 9px; border-color: #e6e4ee; font-size: 14px; }

.ss-modal-drawer .modal-header {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    padding: 20px 24px;
    border-bottom: none;
    border-radius: 18px 18px 0 0;
}
.ss-modal-drawer .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #fff;
    font-size: 17px;
}
.ss-modal-drawer .modal-title svg { width: 20px; height: 20px; flex-shrink: 0; }
.ss-modal-drawer .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: .8;
    box-shadow: none;
}
.ss-modal-drawer .modal-header .btn-close:hover { opacity: 1; }

/* Shared confirm popup: a toned icon in a soft halo, centred text, two equal buttons.
   .is-danger (delete), .is-success (approve), .is-warning (reject). */
.ss-confirm-modal { --ss-tone: var(--ss-red); --ss-tone-bg: var(--ss-red-bg); --ss-tone-dark: #b91c1c; }
.ss-confirm-modal.is-success { --ss-tone: #16a34a; --ss-tone-bg: #dcfce7; --ss-tone-dark: #15803d; }
.ss-confirm-modal.is-warning { --ss-tone: #ea580c; --ss-tone-bg: #ffedd5; --ss-tone-dark: #c2410c; }
.ss-confirm-modal .modal-dialog { max-width: 400px; }
.ss-confirm-modal .modal-content,
.ss-choice-modal .modal-content {
    position: relative; overflow: hidden; border-radius: 20px;
    box-shadow: 0 30px 70px rgba(20, 10, 50, .28);
}
.ss-confirm-modal .modal-content::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 110px;
    background: linear-gradient(180deg, var(--ss-tone-bg) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}
.ss-confirm-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 10px; height: 10px; opacity: .5; }
.ss-confirm-close:hover { opacity: .9; }
.ss-confirm-body { position: relative; padding: 34px 30px 6px; text-align: center; }
.ss-confirm-icon {
    width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--ss-tone); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 8px var(--ss-tone-bg), 0 10px 22px color-mix(in srgb, var(--ss-tone) 35%, transparent);
}
.ss-confirm-icon svg { width: 26px; height: 26px; }
.ss-confirm-title { font-size: 18px; font-weight: 800; color: var(--ss-ink); margin: 0 0 8px; }
.ss-confirm-message { font-size: 14px; color: var(--ss-muted); margin: 0; line-height: 1.55; }
.ss-confirm-footer { position: relative; border-top: none; padding: 22px 30px 28px; justify-content: center; gap: 10px; flex-wrap: nowrap; }
.ss-confirm-footer > * { margin: 0; }
.ss-confirm-footer .btn-ss-outline, .ss-confirm-action-btn { flex: 1; justify-content: center; height: 44px; border-radius: 12px; white-space: nowrap; }
.ss-confirm-action-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--ss-tone); border: none; color: #fff;
    font-weight: 700; font-size: 14px; padding: 0 16px; cursor: pointer;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--ss-tone) 35%, transparent);
    transition: background .15s, transform .15s, box-shadow .15s;
}
.ss-confirm-action-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.ss-confirm-action-btn:hover { background: var(--ss-tone-dark); transform: translateY(-1px); }
.ss-confirm-action-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ss-tone); }

/* A popup asking to pick one of a few ways forward (e.g. "Approve by Store Keeper?"):
   a header with an icon, then full-width option cards. */
.ss-choice-modal .modal-dialog { max-width: 460px; }
.ss-choice-head {
    position: relative; text-align: center; padding: 30px 30px 18px;
    background: linear-gradient(180deg, #f1ecff 0%, rgba(255, 255, 255, 0) 100%);
}
.ss-choice-head-icon {
    width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 24px rgba(109, 40, 217, .32);
}
.ss-choice-head-icon svg { width: 28px; height: 28px; }
.ss-choice-title { font-size: 18px; font-weight: 800; color: var(--ss-ink); margin: 0 0 6px; }
.ss-choice-sub { font-size: 13.5px; color: var(--ss-muted); margin: 0; line-height: 1.5; }
.ss-choice-list { display: flex; flex-direction: column; gap: 10px; padding: 6px 22px 24px; }
.ss-choice-option {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    padding: 14px 16px; border-radius: 14px; cursor: pointer;
    background: #fff; border: 1.5px solid var(--ss-border);
    transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.ss-choice-option:hover { border-color: var(--ss-purple-500); box-shadow: 0 8px 20px rgba(109, 40, 217, .12); transform: translateY(-1px); }
.ss-choice-option:focus-visible { outline: none; border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); }
/* Option picked with the arrow keys (or under the mouse). */
.ss-choice-option.is-active { outline: none; border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); }
.ss-choice-option.is-active .ss-choice-option-arrow { opacity: 1; transform: translateX(3px); }
.ss-choice-option-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #f4f1fc; color: var(--ss-purple-700);
}
.ss-choice-option-icon svg { width: 21px; height: 21px; }
.ss-choice-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ss-choice-option-text strong { font-size: 14.5px; font-weight: 800; color: var(--ss-ink); }
.ss-choice-option-text small { font-size: 12.5px; color: var(--ss-muted); line-height: 1.45; }
.ss-choice-option-text b { color: #c2410c; font-weight: 700; }
.ss-choice-option-arrow {
    width: 22px; height: 22px; flex-shrink: 0; opacity: .45; transition: transform .15s, opacity .15s;
    background: currentColor; color: var(--ss-purple-700);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ss-choice-option:hover .ss-choice-option-arrow { opacity: 1; transform: translateX(3px); }
.ss-choice-option.is-primary { border-color: rgba(124, 58, 237, .45); background: linear-gradient(135deg, #faf7ff 0%, #f3eeff 100%); }
.ss-choice-option.is-primary .ss-choice-option-icon { background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff; box-shadow: 0 6px 14px rgba(109, 40, 217, .3); }

.ss-line-items-wrap {
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 6px;
}
.ss-line-items { width: 100%; margin: 0; border-collapse: collapse; }
.ss-line-items thead th {
    background: #f6f4fc;
    color: var(--ss-purple-700);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 700;
    padding: 11px 14px;
    white-space: nowrap;
}
.ss-line-items tbody td {
    padding: 8px 14px;
    border-top: 1px solid var(--ss-border);
    color: #33313f;
    font-size: 13.5px;
    vertical-align: middle;
}
.ss-line-items tbody tr:hover { background: #fbfaff; }
.ss-line-warehouse { font-size: 10px; font-style: italic; color: var(--ss-muted); line-height: 1; }
.ss-line-item-name { font-weight: 600; }
.ss-line-items tfoot td { padding: 10px 14px; font-weight: 800; border-top: 1px solid var(--ss-border); color: var(--ss-ink); }
.ss-line-items .ss-subtotal-label { text-align: right; text-transform: none; font-weight: 600; color: var(--ss-muted); }
.ss-line-items .remove-line {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

@media (max-width: 900px) {
    .ss-line-items { min-width: 620px; }
}

.ss-line-item-meta { display: block; font-size: 11.5px; color: var(--ss-muted); margin-top: 1px; font-weight: 500; }

.ss-gst-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #f1f0f6; color: #6b6a78; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

.ss-order-summary {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.ss-order-summary > div {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f6f4fc;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 800;
    color: var(--ss-ink);
}
.ss-order-summary > div span:first-child {
    font-weight: 600;
    color: var(--ss-muted);
    text-transform: uppercase;
    font-size: 11.5px;
    letter-spacing: .03em;
}
.ss-order-summary > div span:last-child { font-size: 16px; color: var(--ss-purple-700); }

.ss-order-summary-plain {
    background: #f8f7fc;
    border: 1px solid var(--ss-border);
    border-radius: 10px;
    padding: 12px 18px;
    margin-top: 12px;
}
.ss-order-summary-plain > div {
    display: grid;
    grid-template-columns: 1fr 150px;
    justify-items: end;
    align-items: center;
    gap: 20px;
    padding: 2px;
    color: var(--ss-ink);
}
.ss-order-summary-plain-total {
    border-top: 1px solid var(--ss-border);
    margin-top: 4px;
    padding-top: 10px !important;
    font-weight: 800;
    font-size: 15px;
}
.ss-order-summary-plain-total span:last-child { color: var(--ss-purple-700); }

.ss-freight-field {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--ss-border);
    border-radius: 8px;
    border-color: #d7d3e8;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
/*.ss-freight-field:hover { border-color: #d7d3e8; }*/
.ss-freight-field:focus-within {
    border-color: var(--ss-purple-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.ss-freight-currency {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: #f8f7fc;
    border-right: 1px solid var(--ss-border);
    color: var(--ss-muted);
    font-size: 13px;
    font-weight: 700;
    transition: color .15s ease;
}
.ss-freight-field:focus-within .ss-freight-currency { color: var(--ss-purple-600); }
.ss-freight-input {
    width: 84px;
    border: none;
    outline: none;
    padding: 6px 10px 6px 6px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: var(--ss-ink);
    background: transparent;
}
.ss-freight-input::-webkit-outer-spin-button,
.ss-freight-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ss-freight-input { -moz-appearance: textfield; }

.ss-line-entry {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    border-radius: 14px;
    padding: 8px 12px 12px;
    margin-bottom: 14px;
}
.ss-line-entry label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 700;
    color: rgba(255, 255, 255, .82);
    margin-bottom: 4px;
    display: block;
}
.ss-line-entry .form-control, .ss-line-entry .form-select {
    border-radius: 9px;
    border: none;
    font-size: 14px;
}
.ss-line-entry .form-control[readonly] { background: #f1f0fb; color: #6b6584; }
.ss-line-entry .choices__inner { border: none; border-radius: 9px; min-height: 40px; padding: 6.5px 10px; }
/* Choices squares the corners (and greys the box) while open / flipped — e.g. right after
   Add Item, when focus goes back to Item. Keep it a rounded white field in every state. */
.ss-line-entry .choices .choices__inner,
.ss-line-entry .choices.is-open .choices__inner,
.ss-line-entry .choices.is-focused .choices__inner,
.ss-line-entry .choices.is-flipped.is-open .choices__inner {
    border-radius: 9px;
    background-color: #fff;
}
.ss-line-entry .choices__list--dropdown { border-radius: 9px; }

.ss-line-entry .choices { position: relative; }
.ss-line-entry .choices .choices__list--dropdown {
    width: max(100%, 455px) !important;
    max-width: min(480px, 90vw) !important;
}
.ss-line-entry .choices .choices__list--dropdown .choices__list {
    max-height: 45vh;
}
.ss-line-entry .d-flex.gap-2 > .choices { flex: 1 1 auto; min-width: 0; }

.ss-line-entry-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ss-entry-field { flex: 1 1 76px; min-width: 68px; }
.ss-entry-item { flex: 2.4 1 190px; }
.ss-entry-taxtype { flex: 1.6 1 108px; }
.ss-entry-warehouse { flex: 1.8 1 160px; }
.ss-line-entry-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}
/* Challan line entry: warehouse picked from frosted-glass chips (name + stock count);
   the picked one turns solid white with a green tick. */
.ss-wh-picker { flex: 1 1 auto; min-width: 0; }
.ss-wh-picker > label { display: block; }
.ss-wh-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.ss-wh-chips-empty.is-out {
    display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
    background: rgba(254, 226, 226, .92); color: var(--ss-red); font-size: 12.5px; font-weight: 700;
}
.ss-wh-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 6px 0 8px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .38);
    background: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px rgba(20, 10, 50, .12);
    color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.ss-wh-chip:hover { background: rgba(255, 255, 255, .24); border-color: rgba(255, 255, 255, .6); }
.ss-wh-chip-qty {
    min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .22); color: #fff; font-size: 11px; font-weight: 800;
}
.ss-wh-chip-check { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .85); flex-shrink: 0; box-sizing: border-box; }
.ss-wh-chip.active {
    background: rgba(255, 255, 255, .95); border-color: #fff; color: var(--ss-ink);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, .55), 0 4px 12px rgba(20, 10, 50, .22);
}
.ss-wh-chip.active .ss-wh-chip-check {
    border-color: var(--ss-green);
    background: var(--ss-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 9px 9px no-repeat;
}
.ss-wh-chip.active .ss-wh-chip-qty { background: var(--ss-green-bg); color: var(--ss-green); }
.ss-line-entry-actions:has(.ss-wh-picker) { align-items: flex-end; }

/* Focus inside the purple entry box: a white + amber ring so the field Enter moved to is
   obvious against the background. */
.ss-line-entry .form-control:focus,
.ss-line-entry .form-select:focus,
.ss-line-entry .choices.is-focused .choices__inner,
.ss-line-entry .choices:focus .choices__inner,
.ss-line-entry .choices.is-open .choices__inner,
.ss-line-entry .ss-wh-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(251, 191, 36, .9) !important;
}
.ss-line-entry .form-control:focus,
.ss-line-entry .form-select:focus { background-color: #fffdf3; }

/* Add Item: raised white pill, a purple "+" disc in front (a pencil while updating a line). */
.ss-line-entry .ss-line-entry-add.ss-line-entry-add-icon { border-radius: 999px; padding: 0 12px 0 6px; gap: 4px; }
.ss-line-entry-add-icon::before {
    content: ''; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 14px 14px no-repeat,
        linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600));
    box-shadow: 0 3px 8px rgba(109, 40, 217, .35);
    transition: transform .2s ease;
}
.ss-line-entry-add-icon:hover::before { transform: rotate(90deg); }
.ss-line-entry-add-icon.is-update::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / 13px 13px no-repeat,
        linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 3px 8px rgba(217, 119, 6, .35); }
.ss-line-entry-add-icon.is-update:hover::before { transform: none; }

/* + Add Item: raised white button with a clear hover / press / focus state. */
.ss-line-entry .ss-line-entry-add {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 40px; padding: 0 20px; border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f2eeff 100%);
    color: var(--ss-purple-700); font-size: 14px; font-weight: 800; letter-spacing: .01em;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 6px 16px rgba(20, 10, 50, .28), inset 0 -2px 0 rgba(109, 40, 217, .14);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ss-line-entry .ss-line-entry-add:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(20, 10, 50, .32), inset 0 -2px 0 rgba(109, 40, 217, .14); }
.ss-line-entry .ss-line-entry-add:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(20, 10, 50, .25); }
.ss-line-entry .ss-line-entry-add:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(251, 191, 36, .9); }

/* Optional line description (Challan), next to + Add Item. */
.ss-line-entry-actions { gap: 10px; align-items: center; }
.ss-line-entry .ss-line-entry-desc { flex: 1 1 auto; min-width: 0; }
.ss-line-desc { font-size: 11.5px; color: var(--ss-muted); line-height: 1.35; margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }
/* Under a line's item name: warehouse | size | description. */
.ss-line-meta { font-size: 11px; color: var(--ss-muted); line-height: 1; white-space: normal; overflow-wrap: anywhere; }
.ss-line-meta-sep { margin: 0 5px; opacity: .55; }
.ss-line-unit { font-size: 11px; font-weight: 600; color: var(--ss-muted); }
.ss-line-entry-add {
    background: #fff;
    color: var(--ss-purple-700);
    border: none;
    border-radius: 9px;
    font-weight: 700;
    font-size: 14px;
    padding: 9px 14px;
    white-space: nowrap;
}

.ss-quick-add-btn {
    flex-shrink: 0;
    align-self: flex-start;
    width: 40px;
    height: calc(2.8rem + 2px);
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.32);
    transition: box-shadow .15s ease, opacity .15s ease;
}
.ss-quick-add-btn svg { width: 18px; height: 18px; }
.ss-quick-add-btn:hover { opacity: .92; box-shadow: 0 6px 16px rgba(109, 40, 217, 0.4); }
.ss-quick-add-btn-light {
    background: #fff;
    color: var(--ss-purple-700);
    height: 40px;
    box-shadow: 0 2px 8px rgba(20, 10, 50, 0.16);
}
.ss-quick-add-btn-light:hover { background: #f4f1ff; box-shadow: 0 3px 10px rgba(20, 10, 50, 0.2); }
.ss-line-entry-add:hover { background: #f4f1ff; }

.ss-form-section {
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    padding: 8px 16px 16px;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(20, 10, 50, 0.06);
}
.ss-form-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14.5px;
    font-weight: 800;
    color: var(--ss-ink);
    margin-bottom: 2px;
}
.ss-form-section-title svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--ss-purple-600);
}
.ss-form-section .ss-line-entry { margin-bottom: 16px; }
.ss-form-section .ss-line-items { margin-bottom: 0; }

.ss-drawer.offcanvas {
    width: 620px;
    max-width: 94vw;
    border: none;
    border-radius: 22px 0 0 22px;
    box-shadow: -24px 0 60px rgba(20, 10, 50, 0.28);
}

.ss-drawer .offcanvas-header {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    padding: 16px 24px;
    border-bottom: none;
    border-radius: 22px 0 0 0;
    flex-shrink: 0;
}

.ss-drawer .offcanvas-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #fff;
    font-size: 18px;
}
.ss-drawer .offcanvas-title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ss-drawer .offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: .8;
    box-shadow: none;
}
.ss-drawer .offcanvas-header .btn-close:hover { opacity: 1; }
.ss-drawer .offcanvas-header .btn-close:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }

.ss-drawer .offcanvas-body {
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0 0 0 22px;
}
.ss-drawer .form-label { font-weight: 600; font-size: 13.5px; color: #43414f; }
.ss-drawer .form-control, .ss-drawer .form-select { border-radius: 9px; border-color: #e6e4ee; font-size: 14px; min-height: 40px; }

.ss-drawer-footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid var(--ss-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.ss-drawer-wide.offcanvas { width: 1200px; max-width: 96vw; }
.ss-drawer-medium.offcanvas { width: 900px; max-width: 95vw; }

.offcanvas-backdrop.show { background-color: rgba(45, 12, 90, 0.45); }

@media (max-width: 560px) {
    .ss-drawer.offcanvas { width: 100%; border-radius: 0; }
    .ss-drawer .offcanvas-header, .ss-drawer .offcanvas-body { border-radius: 0; }
}

.form-control, .form-select { font-weight: 600; }

.form-floating { position: relative; }

.form-floating > .form-control {
    height: calc(2.8rem + 2px);
    min-height: calc(2.8rem + 2px);
    line-height: 1.25;
    padding: 0.5rem 0.9rem;
    border: 1.6px solid #d9d6e8;
    border-radius: 10px;
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.form-floating > .form-control::placeholder { color: transparent; }

.form-floating > .form-control:focus {
    border-color: var(--ss-purple-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.form-floating > .form-control[readonly] {
    background-color: var(--ss-bg);
    color: var(--ss-muted);
    cursor: default;
}
/* Generate Challan date: calendar-only (readonly) but keeps the normal white field. */
.ss-date-pick-only > input.ss-datepicker-alt.form-control[readonly] { background-color: #fff; }

/* Generate Challan payment rows: + / × icon buttons beside Deposit Amount. */
.ss-deposit-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}
.ss-deposit-btn svg { width: 16px; height: 16px; }
/* One button slot per row (+ on the last row, × on the others), fixed width so fields line up. */
.ss-deposit-action { width: calc(38px + var(--bs-gutter-x)); display: flex; justify-content: center; }
.ss-deposit-add { color: var(--ss-purple-700); background: #f6f4fc; border-color: #e3ddfb; }
.ss-deposit-add:hover { background: var(--ss-purple-600); color: #fff; border-color: var(--ss-purple-600); }

.form-floating > .form-control[readonly]:focus {
    border-color: #d9d6e8;
    box-shadow: none;
}

.form-floating > label {
    position: absolute;
    top: 23.4px;
    left: 0.9rem;
    right: auto;
    height: auto;
    width: auto;
    max-width: calc(100% - 2rem);
    margin: 0;
    padding: 0 5px;
    overflow: visible;
    white-space: nowrap;
    background: transparent;
    color: var(--ss-muted);
    font-size: 15px;
    font-weight: 500;
    pointer-events: none;
    opacity: 1;
    transform: translateY(-50%);
    transform-origin: left top;
    transition: transform .15s ease, color .15s ease;
}

    .form-floating > .form-control:focus ~ label,
    .form-floating > .form-control:not(:placeholder-shown) ~ label {
        transform: translateY(calc(-50% - 23.4px)) scale(0.82);
        background: #fff;
        color: var(--ss-purple-700);
        font-weight: 600;
        border-radius: 6px;
    }

.form-floating > label::after { display: none; }

.form-floating > .form-control:invalid,
.form-floating > .form-control:valid {
    background-image: none;
}

.was-validated .form-floating > .form-control:valid,
.form-floating > .form-control.is-valid {
    border-color: #d9d6e8;
}

.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: #d9d6e8;
    padding-right: .75rem;
    background-image: none;
}
textarea.form-control.is-valid,
.was-validated textarea.form-control:valid {
    padding-right: .75rem;
}
.was-validated .form-floating > .form-control:valid:focus,
.form-floating > .form-control.is-valid:focus {
    border-color: var(--ss-purple-600);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.was-validated .form-floating > .form-control:invalid,
.form-floating > .form-control.is-invalid {
    border-color: var(--ss-red);
}
.was-validated .form-floating > .form-control:invalid:focus,
.form-floating > .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}
.was-validated .form-floating > .form-control:invalid ~ label,
.form-floating > .form-control.is-invalid ~ label {
    color: var(--ss-red);
}

.invalid-feedback, .ss-select-feedback {
    display: none;
    color: var(--ss-red);
    font-size: 12.5px;
    margin-top: 5px;
}
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.choices.is-invalid .choices__inner { border-color: var(--ss-red) !important; }
.choices.is-invalid ~ .ss-select-feedback { display: block; }

input.ss-datepicker-alt.is-invalid.form-control { border-color: var(--ss-red) !important; }

.choices { font-size: 14px; border-radius: 9px; }
/* Pages focus the wrapper itself (ssFocus / Enter-to-next); without this the browser draws
   a square outline round it. The field's own focus style shows instead. */
.choices:focus, .choices:focus-visible { outline: none; }
.choices__inner {
    border-radius: 9px !important;
    border-color: #e6e4ee !important;
    min-height: 46px;
    background: #fff !important;
    padding: 6px 10px 4px !important;
}
.choices__list--single .choices__item { /*padding-top: 3px;*/ font-weight:500; }
.choices { position: relative; }
.choices.is-open { z-index: 5; }
/* Always open searchable dropdowns downward. Choices flips them up when the window
   looks short below, but inside a drawer / modal the flipped list gets cut off under
   the header — the drawer body scrolls instead. */
.choices.is-flipped .choices__list--dropdown,
.choices.is-flipped .choices__list[aria-expanded] {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
}
.choices__list--dropdown, .choices__list[aria-expanded] {
    border-radius: 10px !important;
    border-color: #e6e4ee !important;
    box-shadow: 0 16px 32px rgba(20, 10, 50, 0.14);
    overflow: hidden;
}
.choices__list--dropdown .choices__item--selectable { border-left: 3px solid transparent; }
.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: #f4f1fc !important;
    color: var(--ss-purple-700) !important;
    border-left-color: var(--ss-purple-600);
}
.choices__input { background: #fff; font-size: 14px; font-weight: 500; }
.choices.is-focused .choices__inner { border-color: var(--ss-purple-500) !important; }

.choices[data-type*="select-one"]::after {
    content: '';
    height: 14px;
    width: 14px;
    border-style: none;
    border-width: 0;
    background-color: var(--ss-muted, #9a97ab);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    position: absolute;
    right: 12px;
    top: 50%;
    margin-top: -7px;
    pointer-events: none;
    transition: transform .15s ease, background-color .15s ease;
}
.choices[data-type*="select-one"].is-open::after { transform: rotate(180deg); }
.choices[data-type*="select-one"].is-focused::after { background-color: var(--ss-purple-500); }

.form-floating > .choices {
    height: calc(2.8rem + 2px);
    margin-bottom: 0;
}
.form-floating > .choices .choices__inner {
    height: 100%;
    min-height: unset !important;
    display: flex;
    align-items: center;
    border: 1.6px solid #d9d6e8 !important;
    border-radius: 10px !important;
    padding: 0 2.2rem 0 0.9rem !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-floating > .choices .choices__list--single { padding: 0; }
.form-floating > .choices .choices__list--single .choices__item { padding-top: 0; }
/* Closed: the floating label stands in for the placeholder. Open: the label moves up and the
   placeholder (e.g. "Select client...") shows in the box. */
.form-floating > .choices .choices__placeholder { opacity: 0 !important; }
.form-floating > .choices.is-focused .choices__list--single .choices__placeholder,
.form-floating > .choices.is-open .choices__list--single .choices__placeholder { opacity: .55 !important; }
/* No value (e.g. the blank option picked again when a form is reset or loaded for edit): Choices
   then shows the blank option's text as a normal item, which ran into the label. Treat it like
   the placeholder: hidden while closed, faded while open. */
.form-floating > .choices:not(.choices-has-value) .choices__list--single .choices__item { opacity: 0 !important; }
.form-floating > .choices:not(.choices-has-value).is-focused .choices__list--single .choices__item,
.form-floating > .choices:not(.choices-has-value).is-open .choices__list--single .choices__item { opacity: .55 !important; }
.form-floating > .choices.is-focused .choices__inner {
    border-color: var(--ss-purple-600) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.form-floating > .choices.is-invalid .choices__inner { border-color: var(--ss-red) !important; }

.form-floating:has(> .choices) { position: relative; z-index: 1; }
.form-floating:has(> .choices.is-open) { z-index: 30; }
.form-floating > .choices ~ label { z-index: 31; }
.form-floating > .choices.is-open ~ label,
.form-floating > .choices.is-focused ~ label,
.form-floating > .choices.choices-has-value ~ label {
    transform: translateY(calc(-50% - 23.4px)) scale(0.82);
    background: #fff;
    color: var(--ss-purple-700);
    font-weight: 600;
}

.ss-field-icon { position: relative; }
.ss-field-icon-svg {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9a97ab;
    pointer-events: none;
    z-index: 2;
    transition: color .15s ease;
}
.ss-field-icon > .choices .choices__inner { padding-left: 2.5rem !important; }
.ss-field-icon > input.form-control { padding-left: 2.5rem; }
.ss-field-icon > label { left: 2.5rem; }
.ss-field-icon:has(.choices.is-focused) .ss-field-icon-svg,
.ss-field-icon:has(.choices.choices-has-value) .ss-field-icon-svg { color: var(--ss-purple-600); }
.ss-field-icon:has(input.form-control:focus) .ss-field-icon-svg,
.ss-field-icon:has(input.form-control:not(:placeholder-shown)) .ss-field-icon-svg { color: var(--ss-purple-600); }

.ss-field-icon-svg.ss-field-icon-text { display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }

.ss-refund-max { font-size: 11.5px; color: var(--ss-muted); margin: 5px 2px 0; }

.ss-refund-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 12px; background: #f6f4fc; border: 1px solid #ece9f8; border-radius: 10px; font-size: 12.5px; color: var(--ss-muted); line-height: 1.45; }
.ss-refund-note svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--ss-purple-600); margin-top: 1px; }

.ss-required {
    display: inline-block;
    margin-right: 4px;
    color: #ff4d4f;
    font-size: 16px;
    font-family: SimSun, sans-serif;
    transform-origin: left center;
}

.form-floating > .form-control:focus ~ label .ss-required,
.form-floating > .form-control:not(:placeholder-shown) ~ label .ss-required,
.form-floating > .choices.is-open ~ label .ss-required,
.form-floating > .choices.is-focused ~ label .ss-required,
.form-floating > .choices.choices-has-value ~ label .ss-required {
    transform: scale(1.2195);
    font-weight: 500;
}

.ss-rich-option { display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; }
.ss-rich-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.ss-rich-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ss-rich-name { font-weight: 700; color: var(--ss-ink); font-size: 14px; }
.ss-rich-meta { font-size: 12px; color: var(--ss-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ss-item-stock {
    margin-left: auto;
    align-self: center;
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #eafbe9;
    color: #1a8f4c;
    white-space: nowrap;
}
.ss-item-stock-out {
    background: #fdeaea;
    color: var(--ss-red);
}
.ss-item-stock-zero {
    background: #f1f0f6;
    color: var(--ss-muted);
}

input.ss-datepicker { display: none; }
input.ss-datepicker-alt.form-control {
    border-radius: 9px;
    border-color: #e6e4ee;
    font-size: 14px;
    cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-floating > input.ss-datepicker-alt.form-control:focus,
.form-floating > input.ss-datepicker-alt.form-control:not(:placeholder-shown) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.flatpickr-calendar {
    width: 330px !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
    border-radius: 14px !important;
    border: 1px solid var(--ss-border) !important;
    box-shadow: 0 16px 32px rgba(20, 10, 50, 0.16) !important;
    padding: 10px;
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after { display: none; }
.flatpickr-months { padding: 2px 0 6px; }
.flatpickr-current-month { font-weight: 700; color: var(--ss-ink); font-size: 14.5px; }
.flatpickr-current-month .numInputWrapper:hover,
.flatpickr-current-month .flatpickr-monthDropdown-months:hover { background: #f4f1fc; border-radius: 6px; }
.flatpickr-weekdays { margin-bottom: 2px; }
span.flatpickr-weekday {
    background: #fff;
    fill: var(--ss-ink);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--ss-muted);
}
.flatpickr-months .flatpickr-month { background: #fff; }
.flatpickr-prev-month svg, .flatpickr-next-month svg { fill: #9a97ab; transition: fill .15s ease; }
.flatpickr-prev-month:hover svg, .flatpickr-next-month:hover svg { fill: var(--ss-purple-600); }
.flatpickr-day {
    border-radius: 8px;
    font-size: 13.5px;
    color: #33313f;
}
.flatpickr-day.today {
    border-color: var(--ss-purple-500);
    font-weight: 700;
    color: var(--ss-purple-700);
}
.flatpickr-day:hover { background: #f4f1fc; border-color: transparent; }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus {
    background: var(--ss-purple-600);
    border-color: var(--ss-purple-600);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(124, 58, 237, .35);
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #cac8d6; }

.ss-auth-body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; }
.ss-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ss-purple-600) 0%, var(--ss-purple-700) 45%, #4c1d95 100%);
    padding: 24px;
}
.ss-auth-shell {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 1040px;
    box-shadow: 0 30px 80px rgba(45, 12, 90, 0.35);
    display: flex;
    overflow: hidden;
    min-height: 620px;
}

.ss-auth-brand {
    flex: 1 1 50%;
    min-width: 0;
    background: linear-gradient(160deg, #f6f4fc, #ede9fe);
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
}
.ss-auth-brand .ss-logo { padding: 0; margin-bottom: 28px; font-size: 27px; }
.ss-auth-brand .ss-logo-img { height: 42px; }
.ss-auth-brand-title { font-size: 28px; font-weight: 800; line-height: 1.25; color: var(--ss-ink); margin: 0 0 14px; }
.ss-auth-brand-title span { color: var(--ss-purple-600); }
.ss-auth-brand-desc { font-size: 14.5px; color: var(--ss-muted); line-height: 1.6; margin: 0 0 26px; max-width: 380px; }

.ss-auth-features { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ss-auth-features li { display: flex; align-items: center; gap: 12px; }
.ss-auth-features li span:last-child { display: flex; flex-direction: column; font-size: 13px; color: var(--ss-muted); }
.ss-auth-features li strong { font-size: 14px; color: var(--ss-ink); font-weight: 700; }
.ss-auth-feature-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    background: #fff;
    color: var(--ss-purple-600);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(109, 40, 217, 0.12);
}
.ss-auth-feature-icon svg { width: 18px; height: 18px; }

.ss-auth-illustration { margin-top: auto; }
.ss-auth-illustration svg { width: 100%; height: auto; display: block; }

.ss-auth-panel {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 40px;
}
.ss-auth-panel-inner { width: 100%; max-width: 360px; }
.ss-auth-title { font-size: 25px; font-weight: 800; color: var(--ss-ink); margin: 0 0 6px; }
.ss-auth-sub { color: var(--ss-muted); font-size: 14px; margin-bottom: 26px; }
.ss-auth-label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ss-ink); margin-bottom: 6px; }

.ss-auth-input-icon { position: relative; }
.ss-auth-input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9a97ab; pointer-events: none; }
.ss-auth-input-icon .form-control { padding-left: 42px; height: 48px; border-radius: 10px; border-color: #e3e1ee; }
.ss-auth-input-icon .form-control:focus { border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }

.ss-otp-label { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ss-ink); margin-bottom: 14px; }
.ss-otp-label svg { width: 18px; height: 18px; color: var(--ss-purple-600); flex-shrink: 0; }
.ss-otp-boxes { display: flex; gap: 12px; }
.ss-otp-box {
    width: 100%;
    max-width: 48px;
    height: 48px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--ss-ink);
    border: 1.6px solid #e3e1ee;
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ss-otp-box:focus { outline: none; border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }

.ss-otp-box-wrap { position: relative; width: 100%; max-width: 48px; height: 48px; }
.ss-otp-box-wrap .ss-otp-box { max-width: none; color: transparent; caret-color: var(--ss-purple-600); }
.ss-otp-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: transparent;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
    transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background-color .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.ss-otp-box-wrap.ss-otp-filled .ss-otp-dot { background: var(--ss-purple-600); transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 3px 10px rgba(124, 58, 237, 0.4); }
.ss-otp-box-wrap.ss-otp-filled .ss-otp-box { border-color: var(--ss-purple-500); background: #f6f4fc; }

.ss-auth-submit { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; font-weight: 700; }
.ss-auth-submit svg { width: 17px; height: 17px; }

.ss-auth-footer-text { text-align: center; font-size: 13.5px; color: var(--ss-muted); margin: 22px 0 0; }
.ss-auth-footer-text strong { color: var(--ss-purple-600); font-weight: 700; }
.ss-auth-back-link { display: block; text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--ss-muted); text-decoration: none; }
.ss-auth-back-link:hover { color: var(--ss-purple-600); }

@media (max-width: 860px) {
    .ss-auth-brand { display: none; }
    .ss-auth-shell { max-width: 440px; min-height: 0; }
    .ss-auth-panel { padding: 40px 30px; }
}

.ss-page-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .55);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}
.ss-page-loader-overlay.is-active { opacity: 1; pointer-events: auto; }

.ss-spinner-svg {
    width: 40px;
    height: 40px;
    animation: ss-spinner-rotate 2s linear infinite;
}
.ss-spinner-circle {
    stroke: var(--ss-purple-600);
    stroke-linecap: round;
    animation: ss-spinner-dash 1.5s ease-in-out infinite;
}
@keyframes ss-spinner-rotate { 100% { transform: rotate(360deg); } }
@keyframes ss-spinner-dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}
@media (prefers-reduced-motion: reduce) {
    .ss-spinner-svg, .ss-spinner-circle { animation: none; }
}

.ss-toast-wrap {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.ss-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(20, 10, 50, 0.22);
    padding: 14px 16px;
    min-width: 300px;
    max-width: 440px;
    border-left: 4px solid transparent;
}

.ss-toast-success {
    border-left-color: var(--ss-green);
    animation: ss-toast-bounce-in .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

.ss-toast-error {
    border-left-color: var(--ss-red);
    animation: ss-toast-bounce-in .5s cubic-bezier(.34, 1.56, .64, 1) both,
               ss-toast-shake .5s ease .5s both;
}

.ss-toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.ss-toast-icon svg { width: 16px; height: 16px; }
.ss-toast-success .ss-toast-icon { background: linear-gradient(135deg, var(--ss-green), #0f8a3d); }
.ss-toast-error .ss-toast-icon { background: linear-gradient(135deg, var(--ss-red), #a91d1d); }

.ss-toast-msg { font-size: 14px; color: var(--ss-ink); flex: 1; line-height: 1.35; }

.ss-toast-close {
    border: none;
    background: none;
    color: #9a97ab;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}
.ss-toast-close:hover { color: var(--ss-ink); }

.ss-toast.ss-toast-hide { animation: ss-toast-fade-out .25s ease forwards; }

@keyframes ss-toast-bounce-in {
    0% { transform: translateY(-70px) scale(.9); opacity: 0; }
    55% { transform: translateY(10px) scale(1.02); opacity: 1; }
    75% { transform: translateY(-5px) scale(1); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes ss-toast-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@keyframes ss-toast-fade-out {
    to { opacity: 0; transform: translateY(-16px); }
}

@media (max-width: 480px) {
    .ss-toast { min-width: 0; width: calc(100vw - 32px); }
}

/* Info strip at the top of a drawer form (e.g. "Generating a challan from estimate EST-0003"). */
.ss-form-notice {
    gap: 10px; align-items: flex-start; margin-bottom: 16px; padding: 12px 14px; border-radius: 10px;
    background: #f4f1fc; border: 1px solid #ddd3fb; color: var(--ss-purple-700); font-size: 13.5px;
}
.ss-form-notice > svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.ss-form-notice a { color: inherit; font-weight: 700; }

/* Notes card in a drawer (e.g. Add Estimate), beside the totals panel: same tint and border
   as .ss-order-summary-plain, a titled header with a character count, a borderless textarea. */
.ss-notes-card {
    flex: 1 1 auto; display: flex; flex-direction: column; margin-top: 12px;
    background: #fff; border: 1px solid var(--ss-border); border-radius: 12px;
    box-shadow: 0 4px 14px rgba(20, 10, 50, .05); overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.ss-notes-card:focus-within { border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.ss-notes-card-head {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: #f8f7fc; border-bottom: 1px solid var(--ss-border);
}
.ss-notes-card-head label { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--ss-ink); }
.ss-notes-card-icon {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f1ecff; color: var(--ss-purple-700);
}
.ss-notes-card-icon svg { width: 15px; height: 15px; }
.ss-notes-card-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ss-muted); }
.ss-notes-card-input {
    flex: 1 1 auto; width: 100%; min-height: 110px; padding: 12px 14px; resize: vertical;
    border: none; outline: none; background: transparent;
    font-size: 13.5px; line-height: 1.55; color: var(--ss-ink);
}
.ss-notes-card-input::placeholder { color: #a8a4ba; }
.ss-notes-card-hint { padding: 6px 14px 9px; font-size: 11.5px; color: var(--ss-muted); border-top: 1px dashed var(--ss-border); }

/* SweetAlert2 in the app's theme (all ssShowToast messages and server messages). */
.swal2-container { z-index: 2000; }
.swal2-container.swal2-backdrop-show { background: rgba(20, 10, 50, .38); }
.ss-swal {
    width: min(400px, calc(100vw - 32px)); padding: 26px 26px 22px;
    border-radius: 20px; font-family: inherit;
    box-shadow: 0 30px 70px rgba(20, 10, 50, .28);
}
.ss-swal .swal2-icon { margin: 6px auto 12px; transform: scale(.82); }
.ss-swal-success .swal2-icon.swal2-success { border-color: rgba(22, 163, 74, .3); color: var(--ss-green); }
.ss-swal-success .swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--ss-green); }
.ss-swal-success .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(22, 163, 74, .3); }
.ss-swal-error .swal2-icon.swal2-error { border-color: var(--ss-red); color: var(--ss-red); }
.ss-swal-error .swal2-icon.swal2-error [class^='swal2-x-mark-line'] { background-color: var(--ss-red); }
.ss-swal-warning .swal2-icon.swal2-warning { border-color: #ea580c; color: #ea580c; }
.ss-swal-info .swal2-icon.swal2-info { border-color: var(--ss-purple-500); color: var(--ss-purple-500); }
.ss-swal-title { padding: 0; font-size: 18px; font-weight: 800; color: var(--ss-ink); }
.ss-swal-text { margin: 8px 0 0; padding: 0; font-size: 14px; line-height: 1.55; color: var(--ss-muted); }
.ss-swal .swal2-actions { margin-top: 20px; width: 100%; }
.ss-swal-confirm {
    min-width: 120px; height: 42px; padding: 0 22px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff;
    font-size: 14px; font-weight: 700; cursor: pointer;
    box-shadow: 0 8px 18px rgba(109, 40, 217, .3);
    transition: transform .15s, box-shadow .15s;
}
.ss-swal-confirm:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(109, 40, 217, .36); }
.ss-swal-confirm:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ss-purple-500); }
.ss-swal-error .ss-swal-confirm { background: var(--ss-red); box-shadow: 0 8px 18px rgba(220, 38, 38, .28); }
.ss-swal-progress { background: linear-gradient(90deg, var(--ss-purple-500), var(--ss-indigo-600)); height: 3px; }
.ss-swal-success .ss-swal-progress { background: var(--ss-green); }

/* Pending count on a menu item (Admin → Approvals). */
.ss-nav a .ss-nav-label { flex: 1; }
.ss-nav-badge {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ss-red); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .35);
}
.ss-nav-badge[hidden] { display: none; }
.ss-nav a.active .ss-nav-badge { background: #fff; color: var(--ss-red); box-shadow: none; }
.ss-nav-badge-pop { animation: ss-nav-badge-pop .45s ease; }
@keyframes ss-nav-badge-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Top-bar global search: a round button that opens into a search box on click (or Ctrl+K / "/"), in the
   app's purple theme; grouped results drop down under it. */
.ss-gsearch {
    position: relative; display: flex; align-items: center;
    height: 40px; border-radius: 40px;
    background: #fff; border: 1px solid var(--ss-border);
    transition: box-shadow .3s ease, border-color .3s ease;
}
.ss-gsearch-input {
    width: 0; padding: 0; border: none; outline: none; background: none;
    font-size: 14px; color: var(--ss-ink); line-height: 38px; font-weight: 600;
    transition: width .4s ease, padding .4s ease;
}
.ss-gsearch-input::placeholder { color: #a5a3b5; }
.ss-gsearch-kbd {
    display: none; margin-right: 6px; padding: 2px 6px; border-radius: 6px;
    border: 1px solid var(--ss-border); background: #f6f4fc; color: var(--ss-muted);
    font-family: inherit; font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
/* Clear (×): only while there is text in the box. */
.ss-gsearch-close {
    display: none; width: 26px; height: 26px; flex-shrink: 0; margin-right: 6px; padding: 0;
    border: none; border-radius: 50%; background: #f1eff7; color: #6b6a78; cursor: pointer;
    align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.ss-gsearch-close svg { width: 13px; height: 13px; }
.ss-gsearch-close:hover { background: #fde8e8; color: var(--ss-red); }
.ss-gsearch.has-text .ss-gsearch-close { display: flex; }
.ss-gsearch-btn {
    width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: #6b6a78; cursor: pointer;
    transition: background .4s ease, color .4s ease, box-shadow .4s ease;
}
.ss-gsearch-btn svg { width: 18px; height: 18px; }
.ss-gsearch:hover { border-color: rgba(124, 58, 237, .45); }
.ss-gsearch.is-active, .ss-gsearch.has-text {
    border-color: rgba(124, 58, 237, .45); box-shadow: 0 6px 18px rgba(109, 40, 217, .14);
}
.ss-gsearch.is-active .ss-gsearch-input, .ss-gsearch.has-text .ss-gsearch-input {
    width: min(260px, calc(100vw - 210px)); padding: 0 8px 0 16px;
}
.ss-gsearch.is-active:not(.has-text) .ss-gsearch-kbd { display: inline-block; }
.ss-gsearch:hover .ss-gsearch-btn { color: var(--ss-purple-700); }
.ss-gsearch.is-active .ss-gsearch-btn, .ss-gsearch.has-text .ss-gsearch-btn {
    background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff;
    box-shadow: 0 4px 10px rgba(109, 40, 217, .3);
}
.ss-gsearch.is-loading .ss-gsearch-btn svg { animation: ss-gsearch-pulse .8s ease-in-out infinite; }
@keyframes ss-gsearch-pulse { 50% { transform: scale(.8); opacity: .6; } }

.ss-gsearch-results {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 1050;
    width: min(420px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
    padding: 8px; background: #fff; border: 1px solid var(--ss-border); border-radius: 16px;
    box-shadow: 0 24px 50px rgba(20, 10, 50, .18);
}
.ss-gsearch-group + .ss-gsearch-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid #f0eef6; }
.ss-gsearch-group-title {
    padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: #9a97ab;
}
.ss-gsearch-hit {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    color: var(--ss-ink); text-decoration: none;
}
.ss-gsearch-hit.active { background: #f4f1fc; }
.ss-gsearch-hit-icon {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: #f1ecfd; color: var(--ss-purple-700);
}
.ss-gsearch-hit-icon svg { width: 16px; height: 16px; }
.ss-gsearch-hit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ss-gsearch-hit-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-gsearch-hit-sub { font-size: 12px; color: var(--ss-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-gsearch-hit mark { padding: 0; background: #ede5ff; color: var(--ss-purple-700); border-radius: 3px; }
.ss-gsearch-hit-go { width: 14px; height: 14px; flex-shrink: 0; color: #c4c1d4; }
.ss-gsearch-hit.active .ss-gsearch-hit-go { color: var(--ss-purple-600); }
.ss-gsearch-tag {
    margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #fdecec; color: var(--ss-red);
    font-size: 10.5px; font-weight: 700; vertical-align: 1px;
}
.ss-gsearch-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: var(--ss-muted); }
@media (max-width: 575.98px) {
    .ss-gsearch.is-active .ss-gsearch-input, .ss-gsearch.has-text .ss-gsearch-input { width: calc(100vw - 230px); }
    .ss-gsearch-results { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; }
}

/* Client Statement: client list, and the wide drawer with one client's ledger. */
.ss-stmt-client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ss-stmt-client-text { display: flex; flex-direction: column; min-width: 0; }
.ss-stmt-avatar {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f1ebfe; color: var(--ss-purple-700); font-size: 13.5px; font-weight: 700;
}
.ss-stmt-avatar-light { width: 44px; height: 44px; background: rgba(255, 255, 255, .22); color: #fff; }
.ss-drawer.ss-stmt-drawer.offcanvas { width: 1100px; max-width: 96vw; }
.ss-drawer .offcanvas-header.ss-stmt-header { gap: 16px; }
.ss-stmt-header .offcanvas-title { margin: 0; }
.ss-stmt-meta { font-size: 12.5px; color: rgba(255, 255, 255, .88); overflow-wrap: anywhere; }
.ss-stmt-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.ss-stmt-action {
    height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .18); color: #fff; font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
    transition: background .15s;
}
.ss-stmt-action svg { width: 15px; height: 15px; }
.ss-stmt-action:hover { background: rgba(255, 255, 255, .32); color: #fff; }
.ss-stmt-actions .btn-close { margin: 0 0 0 4px; }
.ss-stmt-section { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ss-muted); margin-bottom: 8px; }
.ss-stmt-section .ss-stat-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ss-stmt-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; font-size: 12px; color: var(--ss-muted); }
.ss-statement-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ss-statement-stats .ss-coll-value { margin-top: 4px; font-size: 21px; }
.ss-statement-balance-row td { font-weight: 700; background: #f6f4fc; }
@media (max-width: 991.98px) { .ss-statement-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
    .ss-statement-stats { grid-template-columns: minmax(0, 1fr); }
    .ss-drawer .offcanvas-header.ss-stmt-header { flex-wrap: wrap; }
    .ss-stmt-actions { margin-left: 0; width: 100%; }
}

/* Closing Stock Value: ten columns, kept tight. */
.ss-closing-table th, .ss-closing-table td { padding-left: 8px; padding-right: 8px; }
.ss-closing-table th:first-child, .ss-closing-table td:first-child { padding-left: 16px; }
.ss-closing-table .ss-truncate { max-width: 200px; }

/* A drawer opened from inside another drawer (e.g. Add Client from Generate Challan). */
.ss-drawer.ss-drawer-stacked.offcanvas { z-index: 1065; width: 460px; max-width: 92vw; }
.offcanvas-backdrop ~ .offcanvas-backdrop { z-index: 1060; }

/* Filter button: how many filters are set (besides the dates). */
.ss-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ss-purple-600); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
/* "Reset filters" link inside a filter drawer. */
.ss-link-reset { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ss-muted); text-decoration: none; }
.ss-link-reset svg { width: 14px; height: 14px; }
.ss-link-reset:hover { color: var(--ss-purple-600); }

/* Generate Challan → B2B: the picked client's details in one slim line. */
.ss-client-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 7px 12px; border: 1px solid #e9e3fb; border-radius: 10px; background: #faf8ff; font-size: 13px; }
.ss-client-strip-avatar { flex: 0 0 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-right: -8px; }
.ss-client-strip-name { font-weight: 800; color: var(--ss-ink); text-transform: uppercase; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-client-strip-item { display: inline-flex; align-items: center; gap: 5px; color: var(--ss-ink); font-weight: 600; min-width: 0; }
.ss-client-strip-item svg { flex: 0 0 14px; width: 14px; height: 14px; color: var(--ss-purple-600); }
.ss-client-strip-item.is-missing { color: #a8a5b8; font-weight: 500; font-style: italic; }
.ss-client-strip-item.is-missing svg { color: #c4c0d6; }
.ss-client-strip-address { flex: 1 1 160px; }
.ss-client-strip-address > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Generate Challan: the date as a chip beside B2C / B2B (opens the calendar). */
.ss-date-chip { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 4px 12px 4px 4px; border: 1px solid #e9e3fb; border-radius: 12px; background: #faf8ff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ss-date-chip:hover, .ss-date-chip:focus-within { border-color: var(--ss-purple-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.ss-date-chip-icon { flex: 0 0 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--ss-purple-500), var(--ss-indigo-600)); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.ss-date-chip-icon svg { width: 16px; height: 16px; }
.ss-date-chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.ss-date-chip-text small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ss-muted); }
.ss-date-chip input.ss-datepicker-alt.form-control { border: 0; background: transparent; padding: 0; height: auto; min-height: 0; width: 98px; font-size: 14px; font-weight: 800; color: var(--ss-ink); box-shadow: none; cursor: pointer; }
.ss-date-chip-caret { width: 14px; height: 14px; color: var(--ss-purple-600); }
@media (max-width: 575.98px) {
    /* Phones: keep the date chip beside B2C / B2B. */
    .ss-date-chip { gap: 7px; padding-right: 10px; }
    .ss-date-chip-caret { display: none; }
    .ss-date-chip input.ss-datepicker-alt.form-control { width: 94px; }
}

/* Icon fields: keep the icon on top of an open dropdown (.choices.is-open is z-index 5). */
.ss-field-icon:has(.choices.is-open) .ss-field-icon-svg { z-index: 6; color: var(--ss-purple-600); }

/* Dropdown with nothing to pick / no match: a small empty state. */
/* A list holding only the blank placeholder (the select has no data): hide that blank row and
   show the same empty state through ::after. */
/* The blank placeholder row (and the item pickers' blank row) is never shown in the open list. */
.choices__list--dropdown .choices__item--choice.choices__placeholder,
.choices__list--dropdown .choices__item--choice.ss-choice-blank { display: none; }
.choices__list--dropdown .choices__item.has-no-choices,
.choices__list--dropdown .choices__item.has-no-results {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 12px 14px !important; text-align: center;
    font-size: 13px; font-weight: 600; color: var(--ss-muted); cursor: default;
}
.choices__list--dropdown .choices__item.has-no-choices::before,
.choices__list--dropdown .choices__item.has-no-results::before {
    content: ''; width: 38px; height: 38px; border-radius: 12px; background: #f4f1fc no-repeat center / 20px;
}
.choices__list--dropdown .choices__item.has-no-choices::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E");
}
.choices__list--dropdown .choices__item.has-no-results::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3M8 11h6'/%3E%3C/svg%3E");
}

/* Generate Challan: "New" client button beside the Client dropdown. */
.ss-add-party-btn {
    flex-shrink: 0; align-self: center;
    height: calc(2.2rem + 2px); padding: 0 12px;
    display: inline-flex; align-items: center; gap: 6px;
    border: 1.5px dashed #c4b5fd; border-radius: 10px;
    background: #f7f4ff; color: var(--ss-purple-700);
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ss-add-party-btn svg { width: 18px; height: 18px; }
.ss-add-party-btn:hover,
.ss-add-party-btn:focus-visible {
    outline: none; border-style: solid; border-color: transparent; color: #fff;
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    box-shadow: 0 6px 16px rgba(109, 40, 217, .32); transform: translateY(-1px);
}
.ss-add-party-btn:active { transform: none; }
.choices__list--dropdown > .choices__list:not(:has(> .choices__item--choice:not(.choices__placeholder):not(.ss-choice-blank)))::after {
    content: "No data found"; display: block; padding: 62px 12px 14px; text-align: center;
    font-size: 13px; font-weight: 600; color: var(--ss-muted);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 38 38'%3E%3Crect width='38' height='38' rx='12' fill='%23f4f1fc'/%3E%3Cg transform='translate(9 9)' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10h-5l-2 3H7l-2-3H0'/%3E%3Cpath d='M3.45 3.11 0 10v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 14.76 2H5.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center 16px / 38px 38px;
}

/* Closing Stock Value: a day's quantity that lists its document numbers on hover. */
.ss-qty-tip { cursor: help; border-bottom: 1px dashed currentColor; padding-bottom: 1px; }
.ss-qty-tip:hover, .ss-qty-tip:focus-visible { color: var(--ss-purple-700); outline: none; }

/* Floating tooltip (ss-controls.js, data-ss-tip-title / data-ss-tip). It takes the mouse, so its
   numbers can be selected or copied. */
.ss-tip {
    position: fixed; z-index: 2000; min-width: 150px; max-width: 280px;
    padding: 9px 12px 10px; border-radius: 10px;
    background: #1f1537; color: #fff; font-size: 12px; line-height: 1.55; text-align: left;
    box-shadow: 0 10px 28px rgba(31, 21, 55, .28);
    opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none;
    user-select: text; -webkit-user-select: text; cursor: auto;
    transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
.ss-tip.below { transform: translateY(-4px); }
.ss-tip.show { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .12s ease, transform .12s ease; }
/* An invisible bridge over the gap to the cell, so moving onto the tooltip doesn't close it. */
.ss-tip::before { content: ""; position: absolute; left: 0; right: 0; height: 10px; top: 100%; }
.ss-tip.below::before { top: auto; bottom: 100%; }
.ss-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.ss-tip-title { font-weight: 700; color: #ddd6fe; user-select: none; -webkit-user-select: none; }
/* Long lists scroll inside the box (the box itself must not scroll: its hover bridge sits outside it). */
.ss-tip-body { max-height: 220px; overflow-y: auto; }
.ss-tip-line { color: rgba(255, 255, 255, .92); font-weight: 600; letter-spacing: .2px; }
.ss-tip-line::selection { background: #7c3aed; color: #fff; }
.ss-tip-copy {
    display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
    padding: 2px 7px; border: 1px solid rgba(221, 214, 254, .35); border-radius: 6px;
    background: transparent; color: #ddd6fe; font-size: 11px; font-weight: 600; line-height: 1.4; cursor: pointer;
}
.ss-tip-copy svg { width: 12px; height: 12px; }
.ss-tip-copy:hover { background: rgba(221, 214, 254, .14); }
.ss-tip-copy:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 1px; }
.ss-tip-copy.copied { border-color: #4ade80; color: #4ade80; }
