: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: 10px;
}

.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 - 20px);
    overflow: hidden;
}

/* Sidebar */
.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 .ss-logo-dot { color: var(--ss-purple-600); }

.ss-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    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;
}

/* Collapsible nav group (e.g. Sales > New Sale / Generate Challan / Current Stock / Returns) */
.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;
}

/* Main content */
.ss-main {
    flex: 1;
    min-width: 0;
    padding: 30px 36px;
    background: var(--ss-bg);
    overflow-x: hidden;
}

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

.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; }

/* Top bar */
.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;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
}
.btn-ss-primary:hover { color: #fff; opacity: .92; }

.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; }

/* Cards */
.ss-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--ss-border);
    padding: 22px;
    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); margin-top: 4px; }
.ss-stat-sub { font-size: 12.5px; color: var(--ss-muted); margin-top: 8px; }

/* Company Profile — header (avatar + name + tagline + subscription badge)
   over an icon-labelled info grid, themed with the app's own purple/indigo
   palette instead of copying a reference design's colors. */
.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; }

/* Dashboard trend chart (Purchases vs Challans, last 6 months) — a plain
   inline SVG bar chart, no charting library, themed with the app's own
   categorical colors (indigo/green) already used on the stat cards above it. */
.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); }

/* Low & Out of Stock Alerts card — fixed to the chart card's height (via the
   row's h-100 stretch); the header stays put and only the row list scrolls,
   with an overlay-style scrollbar that's invisible until hovered. */
.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; }

.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-gray { background: #f1f0f5; color: #6b6a78; }

/* A small filled "verified"-style checkmark icon used inside a badge — sized
   and spaced (via the badge's own gap) so it never crowds or overlaps the
   label text next to it. */
.ss-badge-verified-icon { width: 13px; height: 13px; flex-shrink: 0; }

/* Toggle switch — used for real-time active/inactive updates in table rows */
.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);
}

/* Table */
.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 #e6e4ee;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    min-width: 240px;
}

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 22px;
    white-space: nowrap;
}
table.ss-table tbody td {
    padding: 14px 22px;
    border-top: 1px solid var(--ss-border);
    color: #33313f;
    vertical-align: middle;
}
table.ss-table tbody tr:hover { background: #fbfaff; }

.ss-empty { padding: 48px 22px; text-align: center; color: var(--ss-muted); }
.ss-empty-gif { display: block; width: 96px; height: 80px; margin: 0 auto 12px; }

.ss-icon-btn {
    border: 1px solid #e6e4ee;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ss-ink);
}
.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); }

/* Per-row "⋮" action menu (View / Edit / ...) used in table Action columns. */
.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; }

/* Label/value pairs in a read-only "View" modal. */
.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-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; }

/* Modal variant styled to match the app's offcanvas drawers (gradient header,
   icon + title, white close icon) — used for quick-add popups that must stack
   on top of an already-open drawer, which Bootstrap's offcanvas can't do (only
   one offcanvas may be shown at a time; a second one silently closes the first). */
.ss-modal-drawer .modal-header {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    padding: 20px 24px;
    border-bottom: none;
}
.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; }

/* App-themed replacement for the browser's native confirm() — used for
   destructive actions (Delete a vendor, category, transaction, ...). */
.ss-confirm-modal .modal-dialog { max-width: 380px; }
.ss-confirm-body { padding: 32px 28px 8px; text-align: center; }
.ss-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--ss-red-bg);
    color: var(--ss-red);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ss-confirm-icon svg { width: 26px; height: 26px; }
.ss-confirm-title { font-size: 17px; 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.5; }
.ss-confirm-footer { border-top: none; padding: 20px 28px 28px; justify-content: center; gap: 10px; }
.ss-confirm-footer .btn-ss-outline, .ss-confirm-danger-btn { flex: 1; justify-content: center; }
.ss-confirm-danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ss-red);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}
.ss-confirm-danger-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.ss-confirm-danger-btn:hover { background: #c22020; }

/* Card-style container for the added-items table — rounded border, tinted
   header row, and per-row hover so it reads as a finished list, not a bare table. */
.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: 12px 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-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;
}

/* Running grand-total strip under a line-items table (e.g. Challan pricing). */
.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); }

/* Full-width plain summary box (Sub Total / Round Off / Total Amount) —
   label left, value right, each on its own row; the last row is bolded
   and set off with a top border. */
.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: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 5px 0;
    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); }

/* Add-item entry panel that sits above the line-items table — fill it in, click
   Add Item, and it drops into the table below instead of editing rows inline. */
.ss-line-entry {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    border-radius: 14px;
    padding: 16px 16px 14px;
    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; }
.ss-line-entry .choices__list--dropdown { border-radius: 9px; }

/* The Item picker's own column is narrow (it shares the row with Size/Color/
   Qty/Add), but its rich card options — name + code + company + category —
   need real room, so the open dropdown is allowed to spill wider than the
   closed field it hangs from. */
.ss-line-entry .choices { position: relative; }
.ss-line-entry .choices .choices__list--dropdown {
    width: max(100%, 380px) !important;
    max-width: min(480px, 90vw) !important;
}
/* Inside a select + "+" quick-add button row, the Choices wrapper has no
   intrinsic width of its own once it replaces the <select> — without this
   it shrinks to fit its content and leaves the button floating in empty
   space instead of sitting flush against a full-width picker. */
.ss-line-entry .d-flex.gap-2 > .choices { flex: 1 1 auto; min-width: 0; }

/* All entry fields laid out as one continuous row (wraps only when the
   drawer gets too narrow) instead of a fixed 12-column grid, since there
   are too many small fields (Item/Size/Color/Rate/Qty/Tax/Tax Type/Base/
   Amount) for bootstrap's column math to stay tidy. */
.ss-line-entry-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.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-line-entry-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}
.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;
}

/* Small "+" button that sits beside a picker (Vendor, Item) to quick-add a new
   record without leaving the drawer. Height is pinned to match the field it
   sits beside exactly — relying on flex stretch here left it several pixels
   taller than the field whenever the row's cross-axis size came out bigger
   than the field's own box (e.g. a sibling column with more vertical space). */
.ss-quick-add-btn {
    flex-shrink: 0;
    align-self: flex-start;
    width: 40px;
    height: calc(3.3rem + 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); }
/* Inside the purple .ss-line-entry panel a solid gradient button would vanish
   into the background, so it flips to the same white-on-purple treatment as
   the neighboring "+ Add Item" button, and matches that field's shorter
   (non-floating) 40px control height instead of the 54.8px floating one. */
.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; }

/* Bordered card that groups a drawer form into labeled sections (Vendor
   Information, Line Items, ...) instead of one long unbroken form. */
.ss-form-section {
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    padding: 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: 6px;
}
.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; }

/* Drawers (offcanvas) replace modals for Add/Edit forms — themed to match the app's purple/indigo brand */
.ss-drawer.offcanvas {
    width: 760px;
    max-width: 94vw;
    border: none;
    border-radius: 22px 0 0 22px;
    box-shadow: -24px 0 60px rgba(20, 10, 50, 0.28);
    overflow: hidden;
}

.ss-drawer .offcanvas-header {
    background: linear-gradient(135deg, var(--ss-purple-600), var(--ss-indigo-600));
    padding: 22px 24px;
    border-bottom: none;
    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: 26px 24px;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.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; }

.ss-drawer-footer {
    margin-top: auto;
    padding-top: 20px;
    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; }

/* Tint the backdrop to match the brand instead of Bootstrap's neutral black */
.offcanvas-backdrop.show { background-color: rgba(45, 12, 90, 0.45); }

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

/* Bootstrap's default form-control/form-select text is font-weight 400 (regular) —
   bump it app-wide so field values read clearly against the app's bold headings/labels. */
.form-control, .form-select { font-weight: 600; }

/* Floating outlined labels (Material-style notched border, plain text/number/email fields) */
.form-floating { position: relative; }

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

/* Bootstrap's own :focus/:not(:placeholder-shown) rule is more specific than the
   base rule above and would otherwise override just padding-top/bottom on its own,
   causing the text to jump vertically between resting and floated states. Pin both
   to the same value so nothing shifts. */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.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);
}

/* Read-only fields (e.g. HSN/GST derived from the selected category) look
   visibly non-editable instead of identical to a normal input. */
.form-floating > .form-control[readonly] {
    background-color: var(--ss-bg);
    color: var(--ss-muted);
    cursor: default;
}
.form-floating > .form-control[readonly]:focus {
    border-color: #d9d6e8;
    box-shadow: none;
}

.form-floating > label {
    position: absolute;
    top: 27.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: 400;
    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% - 27.4px)) scale(0.82);
        background: #fff;
        color: var(--ss-purple-700);
        font-weight: 600;
        border-radius: 6px;
    }

/* Bootstrap draws its own notch mask via label::after (a solid block behind the
   label). Our label already punches its own notch via `background: #fff` above,
   so Bootstrap's version is redundant and shows through as a stray white patch
   — kill it outright. */
.form-floating > label::after { display: none; }

/* Validation — client-side (HTML5 constraints + Bootstrap's .was-validated) and
   the matching visual state for server-rejected values, themed to the app. */
.form-floating > .form-control:invalid,
.form-floating > .form-control:valid {
    background-image: none;
}

/* No green "valid" styling — a field just looks normal until it's actually
   wrong. Only :invalid gets a distinct (red) treatment. */
.was-validated .form-floating > .form-control:valid,
.form-floating > .form-control.is-valid {
    border-color: #d9d6e8;
}

/* Same reset for compact (non-floating) fields — e.g. the Line Items entry
   row, Notes textarea — which Bootstrap's base .is-valid/:valid rule would
   otherwise still paint with its green checkmark icon and reserved padding. */
.form-control.is-valid,
.was-validated .form-control:valid {
    border-color: #d9d6e8;
    padding-right: .75rem;
    background-image: none;
}
/* Bootstrap's textarea validation selector is more specific (element + class)
   than the rule above and reserves its own icon padding — match it to fully
   clear the space, not just the icon. */
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.js and flatpickr both hide their native control, so HTML5 :invalid
   never applies to them — the JS validator toggles these classes manually. */
.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; }

/* Searchable dropdown (Choices.js) */
.choices { font-size: 14px; }
.choices__inner {
    border-radius: 9px !important;
    border-color: #e6e4ee !important;
    min-height: 46px;
    background: #fff !important;
    padding: 8px 10px 4px !important;
}
.choices__list--single .choices__item { padding-top: 3px; }
.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; }
.choices.is-focused .choices__inner { border-color: var(--ss-purple-500) !important; }

/* Floating-label variant for a searchable dropdown — same notched-outline
   treatment as the text inputs, since Choices.js replaces the native <select>
   with its own markup and none of the :placeholder-shown/:focus CSS applies to it. */
.form-floating > .choices {
    height: calc(3.3rem + 2px);
}
.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; }
.form-floating > .choices .choices__placeholder { opacity: 0 !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 > .choices.is-focused ~ label,
.form-floating > .choices.choices-has-value ~ label {
    transform: translateY(calc(-50% - 27.4px)) scale(0.82);
    background: #fff;
    color: var(--ss-purple-700);
    font-weight: 600;
}

/* Icon-prefixed floating field (e.g. a building icon inside the Vendor picker) */
.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 > 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-required { color: var(--ss-red); }

/* Rich dropdown option — avatar + name + up to two meta lines, like a
   contact card, instead of a plain text row (Vendor and Item pickers). */
.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; }

/* Custom date picker (flatpickr) */
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's popup calendar — rounded card, roomier cells, on-brand accents
   for today/selected instead of the library's stock look. */
.flatpickr-calendar {
    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; }

@media (max-width: 900px) {
    body.ss-body { padding: 0; }
    .ss-shell { border-radius: 0; flex-direction: column; min-height: 100vh; }
    .ss-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--ss-border); flex-direction: row; flex-wrap: wrap; align-items: center; }
    .ss-nav { flex-direction: row; flex-wrap: wrap; }
    .ss-sidebar-footer { border-top: none; margin-left: auto; }
    .ss-main { padding: 20px; }
}

/* Auth pages — two-panel split: branding + feature highlights on the left,
   the actual sign-in form on the right. */
.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; }
.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); }

/* One box per OTP digit — auto-advance/backspace/paste handled by the
   view's own script; this just styles the boxes and their focus state. */
.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: 54px;
    height: 54px;
    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-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; }
}

/* Toasts — top-center, theme-matched, bounce in (+ shake for errors) */
.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); }
}
