/* 1. GLOBAL RESET */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    position: relative;
    min-height: 100vh;
    background: #07111f;
    color: #1f2937;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

body::before,
body::after {
    position: fixed;
    inset: 0;
    pointer-events: none;
    content: "";
}

body::before {
    z-index: -2;
    background:
        radial-gradient(circle at 12% 18%, rgba(96, 165, 250, 0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 28% 72%, rgba(45, 212, 191, 0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 48% 32%, rgba(255, 255, 255, 0.95) 0 1px, transparent 2px),
        radial-gradient(circle at 68% 64%, rgba(129, 140, 248, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 82% 22%, rgba(250, 204, 21, 0.85) 0 1px, transparent 2px),
        radial-gradient(circle at 18% 10%, rgba(37, 99, 235, 0.38), transparent 28%),
        radial-gradient(circle at 90% 15%, rgba(14, 165, 233, 0.32), transparent 25%),
        radial-gradient(circle at 78% 78%, rgba(20, 184, 166, 0.24), transparent 28%),
        linear-gradient(135deg, #050b16 0%, #071d36 45%, #0f172a 100%);
    background-size: 220px 220px, 260px 260px, 180px 180px, 300px 300px, 240px 240px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    animation: starlight-drift 18s linear infinite;
}

body::after {
    z-index: -1;
    width: 180px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.95), rgba(250, 204, 21, 0.75), transparent);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.8), 0 0 32px rgba(45, 212, 191, 0.45);
    opacity: 0;
    transform: translate(-220px, 140px) rotate(-22deg);
    animation: shooting-star 7s ease-in-out infinite;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button,
input,
select {
    font: inherit;
}

/* 2. MAIN ADMIN LAYOUT */
.admin-layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

@keyframes starlight-drift {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }

    100% {
        background-position: 220px 120px, -260px 160px, 180px -110px, -300px -140px, 240px 100px, 0 0;
    }
}

@keyframes shooting-star {
    0%,
    58% {
        opacity: 0;
        transform: translate(-220px, 140px) rotate(-22deg);
    }

    64% {
        opacity: 1;
    }

    78% {
        opacity: 0;
        transform: translate(calc(100vw + 220px), 420px) rotate(-22deg);
    }

    100% {
        opacity: 0;
        transform: translate(calc(100vw + 220px), 420px) rotate(-22deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    body::after {
        animation: none;
    }
}

/* 3. SIDEBAR SECTION */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #111827;
    color: #ffffff;
    padding: 24px 18px;
}

.sidebar-brand {
    margin-bottom: 32px;
}

.sidebar-brand h1 {
    font-size: 24px;
    font-weight: 700;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav a {
    display: block;
    border-radius: 8px;
    padding: 12px 14px;
    color: #d1d5db;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus,
.sidebar-nav a.active {
    background: #2563eb;
    color: #ffffff;
    outline: none;
}

/* 4. MAIN CONTENT AREA */
.main-content {
    width: 100%;
    padding: 24px;
    overflow-x: hidden;
}

/* 5. TOP HEADER SECTION */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.page-title h2 {
    color: #f8fafc;
    font-size: 28px;
    line-height: 1.2;
}

.page-title p {
    margin-top: 4px;
    color: #cbd5e1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-actions button {
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    padding: 10px 14px;
    transition: background 0.2s ease;
}

.topbar-actions button:hover,
.topbar-actions button:focus {
    background: #1d4ed8;
    outline: none;
}

#logoutButton {
    background: #f97316;
}

#logoutButton:hover,
#logoutButton:focus {
    background: #ea580c;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid rgba(226, 232, 240, 0.35);
    padding-left: 14px;
}

.admin-profile span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.admin-profile p {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
}

.mobile-jump-menu {
    display: none;
}

/* 6. STATS CARDS SECTION */
.stats-section {
    margin-bottom: 24px;
}

.stats-section h3,
.panel h3 {
    color: #f8fafc;
    font-size: 20px;
}

.table-section h3 {
    color: #111827;
    font-size: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.stat-card {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.28);
    transform: translateY(-3px);
}

.stat-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 16px 34px rgba(2, 6, 23, 0.28);
    transform: translateY(-3px) scale(1.01);
}

.stat-card h4 {
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

.stat-card p {
    margin-top: 10px;
    color: #111827;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card span {
    display: inline-block;
    margin-top: 8px;
    color: #059669;
    font-size: 13px;
    font-weight: 600;
}

.stat-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.stat-breakdown span {
    margin-top: 0;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 6px 9px;
}

.stat-breakdown span:first-child {
    background: #fef2f2;
    color: #dc2626;
}

.stat-card-action {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    margin-top: 12px;
    padding: 8px 12px;
}

.stat-card-action:hover,
.stat-card-action:focus {
    background: #059669;
    outline: none;
}

/* 7. TABLE SECTION */
.table-section {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    margin-bottom: 24px;
    overflow-x: auto;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 20px;
}

.money-tracker-date-control {
    display: grid;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.money-tracker-date-control input {
    min-width: 170px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    padding: 9px 10px;
}

.section-header a {
    color: #2563eb;
    font-size: 14px;
    font-weight: 700;
}

.section-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-actions label {
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
}

.section-actions input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    padding: 8px 10px;
}

.section-header button {
    border: 0;
    border-radius: 8px;
    background: #ef4444;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 12px;
}

.sales-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 20px;
}

.sales-summary span {
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 10px;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 20px;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f9fafb;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

td {
    color: #374151;
    font-size: 14px;
}

.pending-bill-items {
    min-width: 240px;
    white-space: normal;
}

.pending-bill-item {
    display: grid;
    gap: 3px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    margin-bottom: 8px;
    padding: 8px 10px;
}

.pending-bill-item:last-child {
    margin-bottom: 0;
}

.pending-bill-item strong {
    color: #111827;
}

.pending-bill-item small {
    color: #1d4ed8;
    font-weight: 800;
}

.table-input {
    width: 110px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    padding: 8px 10px;
}

.table-input:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* 8. TWO-COLUMN CONTENT SECTION */
.details-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.panel {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    padding: 20px;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.22);
}

.is-hidden {
    display: none;
}

#add-item {
    grid-column: 1 / -1;
}

.panel h3 {
    color: #111827;
}

.panel ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.panel li {
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    padding: 12px;
    font-size: 14px;
}

.business-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.balance-adjust-form {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    margin: 18px 20px 0;
    padding: 16px;
}

.balance-adjust-form h4 {
    color: #111827;
    font-size: 16px;
}

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

.business-form input,
.business-form select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    padding: 12px 14px;
}

.business-form input:focus,
.business-form select:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
}

.business-form button {
    border: 0;
    border-radius: 8px;
    background: #10b981;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.business-form button:hover,
.business-form button:focus {
    background: #059669;
    outline: none;
    transform: translateY(-1px);
}

.status-badge {
    display: inline-block;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.status-ok {
    background: #dcfce7;
    color: #166534;
}

.status-low {
    background: #fee2e2;
    color: #991b1b;
}

.danger-link {
    border: 0;
    border-radius: 8px;
    background: #ef4444;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 10px;
}

/* 9. FOOTER SECTION */
.footer {
    color: #cbd5e1;
    font-size: 14px;
    text-align: center;
}

/* 10. JAVASCRIPT HELPERS */
.toast-message {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10;
    max-width: 320px;
    border: 1px solid rgba(125, 211, 252, 0.45);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.4);
    color: #f8fafc;
    opacity: 0;
    padding: 14px 16px;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* 11. LOGIN PAGE */
.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
}

.login-card {
    border: 1px solid rgba(125, 211, 252, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.38);
    padding: 28px;
}

.register-card {
    margin-top: 18px;
}

.register-card h2 {
    color: #111827;
    font-size: 20px;
    margin-bottom: 16px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.ice-cream-logo {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe, #fdf2f8);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), 0 10px 24px rgba(37, 99, 235, 0.22);
    overflow: hidden;
}

.ice-cream-logo .scoop {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.12);
}

.ice-cream-logo .scoop-pink {
    top: 11px;
    left: 9px;
    width: 18px;
    height: 18px;
    background: #fb7185;
}

.ice-cream-logo .scoop-mint {
    top: 11px;
    right: 9px;
    width: 18px;
    height: 18px;
    background: #5eead4;
}

.ice-cream-logo .scoop-cream {
    top: 4px;
    left: 15px;
    width: 19px;
    height: 19px;
    background: #fde68a;
}

.ice-cream-logo .cone {
    position: absolute;
    left: 17px;
    bottom: 6px;
    width: 0;
    height: 0;
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
    border-top: 22px solid #d97706;
}

.ice-cream-logo .cone::before {
    position: absolute;
    top: -19px;
    left: -6px;
    width: 12px;
    height: 1px;
    background: rgba(120, 53, 15, 0.45);
    box-shadow: 0 5px 0 rgba(120, 53, 15, 0.32), 0 10px 0 rgba(120, 53, 15, 0.24);
    content: "";
    transform: rotate(24deg);
}

.login-brand h1 {
    color: #111827;
    font-size: 26px;
    line-height: 1.2;
}

.login-brand p {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.logout-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.logout-screen {
    width: min(100%, 390px);
    border: 1px solid rgba(125, 211, 252, 0.35);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.38);
    padding: 34px 28px;
    text-align: center;
}

.logout-logo {
    margin: 0 auto 18px;
}

.logout-screen h1 {
    color: #111827;
    font-size: 28px;
    line-height: 1.2;
}

.logout-screen p {
    margin-top: 8px;
    color: #4b5563;
    font-size: 16px;
    font-weight: 700;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    padding: 12px 14px;
}

.form-group input:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
}

.login-form button {
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-form button:hover,
.login-form button:focus {
    background: #1d4ed8;
    outline: none;
    transform: translateY(-1px);
}

.login-message {
    min-height: 21px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
}

.login-message.success {
    color: #059669;
}

.login-hint {
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 13px;
    padding-top: 16px;
}

.login-hint a {
    color: #2563eb;
    font-weight: 700;
}

.login-hint a:hover,
.login-hint a:focus {
    color: #1d4ed8;
    outline: none;
}

.link-button {
    border: 0;
    background: none;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.link-button:hover,
.link-button:focus {
    color: #1d4ed8;
    outline: none;
}

.reset-form {
    margin-top: 16px;
}

.role-actions {
    display: grid;
    gap: 12px;
}

.role-button {
    display: block;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 800;
    padding: 14px 16px;
    text-align: center;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.role-button:hover,
.role-button:focus {
    filter: brightness(0.96);
    outline: none;
    transform: translateY(-1px);
}

.admin-role {
    background: #2563eb;
}

.seller-role {
    background: #10b981;
}

/* 12. SELLER PAGE */
.seller-page {
    min-height: 100vh;
    padding: 24px;
}

.seller-wrapper {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.seller-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.seller-header h1 {
    color: #f8fafc;
    font-size: 32px;
    line-height: 1.2;
}

.seller-header p {
    margin-top: 4px;
    color: #cbd5e1;
}

.seller-header em {
    color: #fef3c7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-style: italic;
    letter-spacing: 0;
}

.seller-header-actions {
    display: flex;
    gap: 10px;
}

.seller-header a,
.seller-header button {
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 14px;
}

.seller-header button {
    background: #f97316;
}

.seller-header button[data-action="refresh-app-data"] {
    background: #2563eb;
}

.seller-header button:hover,
.seller-header button:focus {
    background: #ea580c;
    outline: none;
}

.seller-header button[data-action="refresh-app-data"]:hover,
.seller-header button[data-action="refresh-app-data"]:focus {
    background: #1d4ed8;
}

.seller-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.seller-card {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.28);
    overflow-x: auto;
    padding: 20px;
}

.seller-card h2 {
    color: #111827;
    font-size: 20px;
}

.seller-message {
    min-height: 21px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
}

.seller-message.success {
    color: #059669;
}

.date-display {
    display: block;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
    margin-top: 6px;
}

.seller-stock-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.seller-entry-list {
    display: grid;
    gap: 12px;
}

.seller-empty-state {
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 14px;
    font-weight: 800;
    padding: 12px;
}

.seller-entry-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.5fr) minmax(280px, 1fr);
    align-items: stretch;
    gap: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    padding: 12px;
}

.seller-entry-row:nth-child(4n + 1) {
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border-color: #bfdbfe;
}

.seller-entry-row:nth-child(4n + 2) {
    background: linear-gradient(135deg, #ecfdf5, #f8fafc);
    border-color: #bbf7d0;
}

.seller-entry-row:nth-child(4n + 3) {
    background: linear-gradient(135deg, #fff7ed, #f8fafc);
    border-color: #fed7aa;
}

.seller-entry-row:nth-child(4n + 4) {
    background: linear-gradient(135deg, #f5f3ff, #f8fafc);
    border-color: #ddd6fe;
}

.seller-entry-row.low {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff1f2, #fff7ed);
}

.seller-entry-row strong,
.seller-entry-row span {
    display: block;
}

.seller-entry-row strong {
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.15;
    text-transform: uppercase;
}

.seller-entry-row span {
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
}

.seller-item-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.seller-item-summary > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.seller-item-summary > div > span {
    width: fit-content;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 4px 10px;
}

.seller-entry-row.low .seller-item-summary > div > span {
    background: #fee2e2;
    color: #b91c1c;
}

.seller-item-logo {
    position: relative;
    display: block;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(17, 24, 39, 0.12);
    border-radius: 50%;
    background: #dbeafe;
    box-shadow: inset 0 -7px 0 rgba(255, 255, 255, 0.38);
}

.seller-item-logo::before,
.seller-item-logo::after {
    content: "";
    position: absolute;
    display: block;
}

.seller-item-logo.mango {
    border-radius: 55% 45% 58% 42%;
    background: linear-gradient(135deg, #65a30d, #fde047 72%);
}

.seller-item-logo.mango::before {
    width: 13px;
    height: 7px;
    border-radius: 999px 999px 0 999px;
    background: #15803d;
    right: 3px;
    top: 3px;
    transform: rotate(-24deg);
}

.seller-item-logo.kulfi {
    border-radius: 14px 14px 20px 20px;
    background: linear-gradient(135deg, #f59e0b, #fef3c7);
}

.seller-item-logo.kulfi::after {
    width: 8px;
    height: 15px;
    border-radius: 0 0 999px 999px;
    background: #92400e;
    bottom: -12px;
    left: 15px;
}

.seller-item-logo.cup {
    border-radius: 12px 12px 18px 18px;
    background: linear-gradient(135deg, #38bdf8, #f0f9ff);
}

.seller-item-logo.cup-choco {
    border-radius: 12px 12px 18px 18px;
    background: linear-gradient(135deg, #3f1d12, #fcd34d);
}

.seller-item-logo.cup-butterscotch {
    border-radius: 12px 12px 18px 18px;
    background: linear-gradient(135deg, #f59e0b, #ffedd5);
}

.seller-item-logo.cup::before {
    width: 27px;
    height: 9px;
    border-radius: 999px;
    background: #7c3aed;
    left: 6px;
    top: 6px;
}

.seller-item-logo.cone {
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(135deg, #f472b6, #fde68a);
}

.seller-item-logo.cone-choco {
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(135deg, #3f1d12 0 48%, #facc15 49% 100%);
}

.seller-item-logo.cone-choco::before {
    width: 24px;
    height: 6px;
    border-radius: 999px;
    background: #f59e0b;
    left: 7px;
    top: 10px;
}

.seller-item-logo.cone-butterscotch {
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(135deg, #f59e0b 0 48%, #fef3c7 49% 100%);
}

.seller-item-logo.cone-butterscotch::before {
    width: 24px;
    height: 6px;
    border-radius: 999px;
    background: #fbbf24;
    left: 7px;
    top: 10px;
}

.seller-item-logo.cone::after,
.seller-item-logo.cone-choco::after,
.seller-item-logo.cone-butterscotch::after {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid #d97706;
    bottom: -12px;
    left: 7px;
}

.seller-item-logo.bar-choco {
    border-radius: 10px;
    background: linear-gradient(135deg, #3f1d12 0 70%, #fef3c7 71% 100%);
}

.seller-item-logo.bar-choco::after {
    width: 7px;
    height: 14px;
    border-radius: 0 0 999px 999px;
    background: #92400e;
    bottom: -11px;
    left: 16px;
}

.seller-item-logo.sandwich {
    border-radius: 10px;
    background: linear-gradient(180deg, #7c2d12 0 28%, #fef3c7 29% 70%, #7c2d12 71% 100%);
}

.seller-item-logo.cassata {
    border-radius: 50% 50% 12px 12px;
    background: linear-gradient(90deg, #f87171 0 33%, #fef3c7 34% 66%, #4ade80 67% 100%);
}

.seller-item-logo.family-pack {
    border-radius: 10px;
    background: linear-gradient(135deg, #0f766e, #99f6e4);
}

.seller-item-logo.family-pack::before {
    width: 26px;
    height: 7px;
    border-radius: 999px;
    background: #134e4a;
    left: 6px;
    top: 8px;
}

.seller-item-logo.chocolate {
    background: linear-gradient(135deg, #3f1d12, #a16207);
}

.seller-item-logo.butterscotch {
    background: linear-gradient(135deg, #f59e0b, #fde68a);
}

.seller-item-logo.vanilla {
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
}

.seller-item-logo.strawberry {
    background: linear-gradient(135deg, #e11d48, #fecdd3);
}

.seller-item-logo.pista {
    background: linear-gradient(135deg, #16a34a, #bbf7d0);
}

.seller-item-logo.kesar,
.seller-item-logo.badam {
    background: linear-gradient(135deg, #f97316, #fef3c7);
}

.seller-item-logo.orange {
    background: linear-gradient(135deg, #f97316, #fed7aa);
}

.seller-item-logo.blackcurrant {
    background: linear-gradient(135deg, #4c1d95, #c4b5fd);
}

.seller-item-logo.coffee {
    background: linear-gradient(135deg, #78350f, #d6d3d1);
}

.seller-item-logo.scoop {
    background: linear-gradient(135deg, #c084fc, #f5d0fe);
}

.seller-entry-row input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    padding: 11px 10px;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
}

.seller-entry-row input:focus {
    border-color: #2563eb;
    outline: 3px solid #bfdbfe;
}

.seller-price-inputs {
    display: grid;
    gap: 8px;
}

.seller-rate-line {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

.seller-rate-line.primary {
    background: #eff6ff;
}

.seller-rate-line:not(.primary) {
    border-color: #fdba74;
    background: linear-gradient(135deg, #fff7ed, #fef2f2);
}

.seller-rate-badge {
    display: grid;
    align-content: center;
    justify-items: center;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    padding: 8px;
    text-align: center;
}

.seller-rate-line:not(.primary) .seller-rate-badge {
    background: linear-gradient(135deg, #dc2626, #f97316);
}

.seller-rate-line:not(.primary) .seller-payment-input {
    border-color: #fdba74;
    background: #fff7ed;
}

.seller-rate-badge span {
    color: #bfdbfe;
    font-size: 12px;
    text-transform: uppercase;
}

.seller-rate-badge strong {
    color: #ffffff;
    font-size: 15px;
}

.seller-payment-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.seller-payment-pair.one-input {
    grid-template-columns: 1fr;
}

.seller-bill-box {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    padding: 12px;
}

.seller-pending-box {
    display: grid;
    gap: 4px;
    border: 1px solid #facc15;
    border-radius: 8px;
    background: #fefce8;
    color: #713f12;
    padding: 10px 12px;
}

.seller-pending-box strong,
.seller-pending-box span {
    display: block;
}

.seller-pending-box strong {
    color: #854d0e;
}

.seller-bill-box > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #bfdbfe;
    padding-bottom: 10px;
}

.seller-bill-box span {
    color: #374151;
    font-size: 16px;
    font-weight: 900;
}

.seller-bill-box strong {
    color: #111827;
    font-size: 30px;
    font-weight: 900;
}

.seller-payment-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.seller-payment-actions button {
    border: 0;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    padding: 10px;
}

.seller-payment-actions button:first-child {
    background: #dc2626;
}

.seller-payment-actions button:last-child {
    background: #2563eb;
}

.seller-bill-payments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.seller-bill-payments label {
    display: grid;
    gap: 6px;
}

.payment-cash {
    color: #dc2626;
}

.payment-upi {
    color: #2563eb;
}

.seller-payment-input {
    display: grid;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
}

.seller-payment-input span {
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.seller-payment-input.cash-box {
    background: #fff1f2;
    border-color: #fecaca;
}

.seller-payment-input.upi-box {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.payment-entry {
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    padding: 14px;
}

.payment-entry h3 {
    color: #111827;
    font-size: 16px;
    margin-bottom: 12px;
}

.payment-entry p {
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    margin-top: 10px;
}

.seller-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: linear-gradient(135deg, #f0fdf4, #ecfeff);
    padding: 12px;
}

.seller-stock-item.low {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff1f2, #fff7ed);
}

.seller-stock-item strong,
.seller-stock-item span {
    display: block;
}

.seller-stock-item strong {
    color: #111827;
}

.seller-stock-item span {
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
}

.seller-stock-item p {
    color: #059669;
    font-weight: 700;
    white-space: nowrap;
}

.seller-stock-item.low p {
    color: #dc2626;
}

.seller-section-header {
    margin: -20px -20px 0;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 10px;
}

.table-actions button[data-action="edit"],
.table-actions button[data-action="edit-stock"],
.table-actions button[data-action="save-cost"],
.table-actions button[data-action="reset-seller-password"] {
    background: #2563eb;
}

.table-actions button[data-action="delete"],
.table-actions button[data-action="remove-item"],
.table-actions button[data-action="remove-seller"] {
    background: #ef4444;
}

#sale-corrections .table-actions button[data-action="admin-edit-sale"] {
    background: #2563eb;
    min-width: 68px;
}

#sale-corrections .table-actions button[data-action="admin-delete-sale"] {
    background: #dc2626;
    min-width: 76px;
}

.muted-text {
    color: #6b7280;
    font-size: 13px;
}

/* 13. RESPONSIVE DESIGN */
@media (min-width: 769px) and (max-width: 1366px) {
    #sales-log table,
    #sale-corrections table {
        min-width: 0;
        table-layout: auto;
        font-size: 13px;
    }

    #sales-log th,
    #sales-log td,
    #sale-corrections th,
    #sale-corrections td {
        padding: 8px 9px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #salesLogBody,
    #saleCorrectionsBody {
        font-size: 13px;
    }

    #sales-log .table-actions,
    #sale-corrections .table-actions {
        gap: 6px;
        flex-wrap: wrap;
    }

    #sales-log .table-actions button,
    #sale-corrections .table-actions button {
        min-width: 0;
        padding: 6px 8px;
        font-size: 12px;
    }

    #sale-corrections .table-actions button[data-action="admin-edit-sale"],
    #sale-corrections .table-actions button[data-action="admin-delete-sale"] {
        min-width: 0;
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 18px;
    }

    .sidebar-brand {
        margin-bottom: 16px;
    }

    .sidebar-nav ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-content {
        padding: 18px;
    }

    .topbar-actions button,
    .admin-profile {
        width: 100%;
    }

    .admin-profile {
        border-left: 0;
        padding-left: 0;
    }

    .stats-grid,
    .details-section,
    .seller-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #sales-log,
    #pending-bills,
    #money-tracker,
    #inventory,
    #cost-profit,
    #seller-list,
    #sale-corrections {
        overflow-x: hidden;
    }

    #sales-log table,
    #pending-bills table,
    #money-tracker table,
    #inventory table,
    #cost-profit table,
    #seller-list table,
    #sale-corrections table,
    .seller-page .seller-card table {
        display: block;
        min-width: 0;
    }

    #sales-log thead,
    #pending-bills thead,
    #money-tracker thead,
    #inventory thead,
    #cost-profit thead,
    #seller-list thead,
    #sale-corrections thead,
    .seller-page .seller-card thead {
        display: none;
    }

    #sales-log tbody,
    #pending-bills tbody,
    #money-tracker tbody,
    #inventory tbody,
    #cost-profit tbody,
    #seller-list tbody,
    #sale-corrections tbody,
    .seller-page .seller-card tbody {
        display: grid;
        gap: 12px;
    }

    #sales-log tr,
    #pending-bills tr,
    #money-tracker tr,
    #inventory tr,
    #cost-profit tr,
    #seller-list tr,
    #sale-corrections tr,
    .seller-page .seller-card tr {
        display: block;
        border: 1px solid rgba(148, 163, 184, 0.32);
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
        overflow: hidden;
    }

    #sales-log td,
    #pending-bills td,
    #money-tracker td,
    #inventory td,
    #cost-profit td,
    #seller-list td,
    #sale-corrections td,
    .seller-page .seller-card td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        padding: 9px 12px;
        text-align: right;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #sales-log td:last-child,
    #pending-bills td:last-child,
    #money-tracker td:last-child,
    #inventory td:last-child,
    #cost-profit td:last-child,
    #seller-list td:last-child,
    #sale-corrections td:last-child,
    .seller-page .seller-card td:last-child {
        border-bottom: 0;
    }

    #sales-log td::before,
    #pending-bills td::before,
    #money-tracker td::before,
    #inventory td::before,
    #cost-profit td::before,
    #seller-list td::before,
    #sale-corrections td::before,
    .seller-page .seller-card td::before {
        flex: 0 0 42%;
        color: #4b5563;
        font-size: 12px;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
    }

    #sales-log td[colspan],
    #pending-bills td[colspan],
    #money-tracker td[colspan],
    #inventory td[colspan],
    #cost-profit td[colspan],
    #seller-list td[colspan],
    #sale-corrections td[colspan],
    .seller-page .seller-card td[colspan] {
        display: block;
        text-align: center;
    }

    #sales-log td[colspan]::before,
    #pending-bills td[colspan]::before,
    #money-tracker td[colspan]::before,
    #inventory td[colspan]::before,
    #cost-profit td[colspan]::before,
    #seller-list td[colspan]::before,
    #sale-corrections td[colspan]::before,
    .seller-page .seller-card td[colspan]::before {
        content: "";
        display: none;
    }

    #sales-log .table-actions,
    #money-tracker .table-actions,
    #inventory .table-actions,
    #cost-profit .table-actions,
    #seller-list .table-actions,
    #sale-corrections .table-actions,
    .seller-page .seller-card .table-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .mobile-jump-menu {
        display: flex;
        gap: 8px;
        margin: -12px 0 18px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .mobile-jump-menu a {
        flex: 0 0 auto;
        border: 1px solid rgba(191, 219, 254, 0.85);
        border-radius: 999px;
        background: rgba(239, 246, 255, 0.96);
        color: #1d4ed8;
        font-size: 13px;
        font-weight: 800;
        padding: 8px 11px;
        white-space: nowrap;
    }

    #sales-log td:nth-child(1)::before {
        content: "Seller";
    }

    #sales-log td:nth-child(2)::before {
        content: "Item";
    }

    #sales-log td:nth-child(3)::before {
        content: "Rate";
    }

    #sales-log td:nth-child(4)::before {
        content: "Quantity";
    }

    #sales-log td:nth-child(5)::before {
        content: "Amount";
    }

    #sales-log td:nth-child(6)::before {
        content: "Cash";
    }

    #sales-log td:nth-child(7)::before {
        content: "UPI";
    }

    #sales-log td:nth-child(8)::before {
        content: "Profit/Piece";
    }

    #sales-log td:nth-child(9)::before {
        content: "Total Profit";
    }

    #sales-log td:nth-child(10)::before {
        content: "Entries";
    }

    #pending-bills td:nth-child(1)::before {
        content: "Date";
    }

    #pending-bills td:nth-child(2)::before {
        content: "Seller";
    }

    #pending-bills td:nth-child(3)::before {
        content: "Items";
    }

    #pending-bills td:nth-child(4)::before {
        content: "Total Bill";
    }

    #pending-bills td:nth-child(5)::before {
        content: "Status";
    }

    #money-tracker td:nth-child(1)::before {
        content: "Date";
    }

    #money-tracker td:nth-child(2)::before {
        content: "Type";
    }

    #money-tracker td:nth-child(3)::before {
        content: "Details";
    }

    #money-tracker td:nth-child(4)::before {
        content: "Cash";
    }

    #money-tracker td:nth-child(5)::before {
        content: "UPI";
    }

    #money-tracker td:nth-child(6)::before {
        content: "Action";
    }

    #inventory td:nth-child(1)::before {
        content: "Item";
    }

    #inventory td:nth-child(2)::before {
        content: "MRP";
    }

    #inventory td:nth-child(3)::before {
        content: "Selling Price";
    }

    #inventory td:nth-child(4)::before {
        content: "Opening Stock";
    }

    #inventory td:nth-child(5)::before {
        content: "Sold";
    }

    #inventory td:nth-child(6)::before {
        content: "Current Stock";
    }

    #inventory td:nth-child(7)::before {
        content: "Status";
    }

    #inventory td:nth-child(8)::before {
        content: "Action";
    }

    #cost-profit td:nth-child(1)::before {
        content: "Item";
    }

    #cost-profit td:nth-child(2)::before {
        content: "Amount";
    }

    #cost-profit td:nth-child(3)::before {
        content: "Rate/Piece";
    }

    #cost-profit td:nth-child(4)::before {
        content: "Tax";
    }

    #cost-profit td:nth-child(5)::before {
        content: "Pieces";
    }

    #cost-profit td:nth-child(6)::before {
        content: "Cost/Piece";
    }

    #cost-profit td:nth-child(7)::before {
        content: "MRP Profit";
    }

    #cost-profit td:nth-child(8)::before {
        content: "Sale Profit";
    }

    #cost-profit td:nth-child(9)::before {
        content: "Action";
    }

    #seller-list td:nth-child(1)::before {
        content: "User ID";
    }

    #seller-list td:nth-child(2)::before {
        content: "Name";
    }

    #seller-list td:nth-child(3)::before {
        content: "Role";
    }

    #seller-list td:nth-child(4)::before {
        content: "Action";
    }

    #sale-corrections td:nth-child(1)::before {
        content: "Date/Time";
    }

    #sale-corrections td:nth-child(2)::before {
        content: "Seller";
    }

    #sale-corrections td:nth-child(3)::before {
        content: "Item";
    }

    #sale-corrections td:nth-child(4)::before {
        content: "Rate";
    }

    #sale-corrections td:nth-child(5)::before {
        content: "Quantity";
    }

    #sale-corrections td:nth-child(6)::before {
        content: "Amount";
    }

    #sale-corrections td:nth-child(7)::before {
        content: "Cash";
    }

    #sale-corrections td:nth-child(8)::before {
        content: "UPI";
    }

    #sale-corrections td:nth-child(9)::before {
        content: "Sale ID";
    }

    #sale-corrections td:nth-child(10)::before {
        content: "Action";
    }

    #sellerSalesLogBody td:nth-child(1)::before {
        content: "Seller";
    }

    #sellerSalesLogBody td:nth-child(2)::before {
        content: "Item";
    }

    #sellerSalesLogBody td:nth-child(3)::before {
        content: "Rate";
    }

    #sellerSalesLogBody td:nth-child(4)::before {
        content: "Quantity";
    }

    #sellerSalesLogBody td:nth-child(5)::before {
        content: "Amount";
    }

    #sellerSalesLogBody td:nth-child(6)::before {
        content: "Cash";
    }

    #sellerSalesLogBody td:nth-child(7)::before {
        content: "UPI";
    }

    #sellerSalesLogBody td:nth-child(8)::before {
        content: "Entries";
    }

    #sellerSalesLogBody td:nth-child(9)::before {
        content: "Action";
    }
}

@media (max-width: 430px) {
    .sidebar-nav ul {
        grid-template-columns: 1fr;
    }

    .page-title h2 {
        font-size: 24px;
    }

    .stat-card p {
        font-size: 26px;
    }

    .seller-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .seller-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .seller-header a,
    .seller-header button {
        width: 100%;
        text-align: center;
    }

    .seller-entry-row {
        grid-template-columns: 1fr;
    }

    .seller-rate-line {
        grid-template-columns: 76px minmax(0, 1fr);
    }
}

@media (max-width: 520px) {
    .seller-entry-row {
        gap: 10px;
        padding: 10px;
    }

    .seller-rate-line {
        grid-template-columns: 1fr;
    }

    .seller-rate-badge {
        grid-template-columns: auto auto;
        justify-content: space-between;
        padding: 7px 10px;
    }

    .seller-payment-pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .seller-bill-payments {
        grid-template-columns: 1fr;
    }

    .seller-payment-input {
        padding: 7px;
    }
}
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }

    body {
        padding-bottom: 88px;
    }

    .main-content {
        padding-bottom: 96px;
    }

    .mobile-jump-menu {
        display: flex;
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 1000;
        gap: 8px;
        overflow-x: auto;
        padding: 8px;
        margin: 0;
        background: #fff;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
        scrollbar-width: thin;
    }

    .mobile-jump-menu a {
        flex: 0 0 auto;
        padding: 8px 10px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.06);
        color: inherit;
        text-decoration: none;
        font-size: 0.85rem;
        font-weight: 700;
        white-space: nowrap;
    }

    #top,
    #inventory,
    #sales-log,
    #money-tracker,
    #cost-profit,
    #seller-list {
        scroll-margin-top: 72px;
    }
}
