:root {
    /* Light Mode (Default - Saweria Look) */
    --bg-page: #f9f9f9;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;

    /* Brand Colors */
    --primary: #f0c419;
    --primary-hover: #dbb015;
    --accent-black: #1e1e1e;

    --text-main: #111827;
    --text-muted: #6b7280;

    --success: #10b981;
    --danger: #ef4444;

    --shadow-sm: 2px 2px 0px 0px #000000;
    --shadow-md: 4px 4px 0px 0px #000000;

    --input-bg: #ffffff;
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #ffffff;
    --card-border: 2px solid #000000;
}

/* Dark Mode Overrides */
body.dark-mode {
    --bg-page: #121212;
    --card-bg: #1e1e1e;
    --border-color: #333333;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    --background-glow: radial-gradient(circle at center, rgba(240, 196, 25, 0.05) 0%, rgba(18, 18, 18, 0) 50%);

    --shadow-sm: 2px 2px 0px 0px #ffffff;
    --shadow-md: 4px 4px 0px 0px #555555;
    --card-border: 2px solid #555555;

    --input-bg: #2d2d2d;
    --primary: #f0c419;
    --accent-black: #000000;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1e1e2d;
    display: flex;
    flex-direction: column;
    padding: 24px;
    color: white;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.brand span {
    color: white;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: #94a3b8;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar nav a.active {
    background: var(--primary);
    color: #000000;
    font-weight: 700;
    box-shadow: 2px 2px 0px 0px rgba(255, 255, 255, 0.2);
}

.product-group-row td {
    padding: 18px 14px 10px;
    background: color-mix(in srgb, var(--primary) 9%, transparent);
    border-top: 2px solid var(--border-color);
}

.product-group-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}

.product-group-title {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--text-main);
}

.product-group-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.product-group-add {
    padding: 8px 12px;
    white-space: nowrap;
}

.product-variant-row td:first-child {
    padding-left: 28px;
}

@media (max-width: 760px) {
    .product-group-card {
        align-items: stretch;
        flex-direction: column;
    }

    .product-group-add {
        justify-content: center;
        width: 100%;
    }

    .product-variant-row td:first-child {
        padding-left: 14px;
    }
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.dot {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
}

.dot.online {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: var(--bg-page);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 28px;
    margin: 0 0 8px 0;
    font-weight: 800;
    color: var(--text-main);
}

.header-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #000000;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 700;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px #000000;
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 2px 2px 0px 0px #000;
}

.btn-secondary:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px 0px #000;
}

.reseller-date-preset,
.owner-date-preset {
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reseller-date-preset.active,
.owner-date-preset.active {
    background: var(--primary) !important;
    color: #000 !important;
    border-color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 2px 2px 0px 0px #000;
}

.btn-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
}

/* Grid Layout for Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Transaction Provider Toggle Buttons */
.txn-provider-btn {
    background: transparent;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.txn-provider-btn:hover {
    color: var(--text-main);
    background: rgba(0,0,0,0.05);
}

.txn-provider-btn.active {
    background: var(--primary);
    color: #000;
    font-weight: 800;
    box-shadow: 2px 2px 0px #000;
}

body.dark-mode .txn-provider-btn.active {
    box-shadow: 2px 2px 0px #555;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.glass-card {
    background: var(--card-bg);
    border: var(--card-border);
    padding: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 600;
}

/* Tabs */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Table Area */
.glass-panel {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    color: var(--text-main);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-glass {
    background: white;
    padding: 32px;
    border-radius: 12px;
    width: 500px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000;
}

body.dark-mode .modal-glass {
    background: #1e1e1e;
    border-color: #555;
    box-shadow: 8px 8px 0px #333;
}

/* Modal Header Layout */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    flex: 1;
}

.modal-body {
    margin-bottom: 0;
}

/* Modal Footer — buttons auto-sized, right-aligned */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 2px solid var(--border-color);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    min-width: 140px;
    max-width: 220px;
    width: auto !important;
}

/* Close Button - Icon Only, No Box */
.close-modal,
button.close-modal,
#cancel-product-btn,
#cancel-command-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.close-modal:hover,
#cancel-product-btn:hover,
#cancel-command-btn:hover {
    background: rgba(0,0,0,0.1) !important;
    color: var(--text-main) !important;
}

body.dark-mode .close-modal:hover,
body.dark-mode #cancel-product-btn:hover,
body.dark-mode #cancel-command-btn:hover {
    background: rgba(255,255,255,0.1) !important;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

input, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(240, 196, 25, 0.15);
    outline: none;
}

/* Custom Select Dropdown */
select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

select:focus {
    border-color: var(--primary);
    outline: none;
}

select option {
    background: var(--input-bg);
    color: var(--text-main);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-page);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.hidden { display: none !important; }

/* Provider Cards (Payment Selector) */
.provider-card {
    flex: 1;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    padding: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.provider-card:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.provider-card.active {
    background: var(--primary);
    border-color: #000;
    color: #000;
    box-shadow: 4px 4px 0px #000;
    transform: translate(-2px, -2px);
    font-weight: 700;
}

body.dark-mode .provider-card.active {
    box-shadow: 4px 4px 0px #555;
}

/* Stock badge */
.stock-badge {
    background: #d1fae5;
    color: #059669;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.stock-badge.low {
    background: #fee2e2;
    color: #dc2626;
}

/* Panel header */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 16px;
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

/* Actions cell in table */
.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

body.dark-mode code {
    background: rgba(255,255,255,0.08);
}

/* ========================================================
   📦 Reseller Catalog Product Cards (Neo-Brutalism Theme)
   ======================================================== */
.reseller-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.reseller-catalog-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.reseller-catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 0px 0px #000000;
}

body.dark-mode .reseller-catalog-card:hover {
    box-shadow: 6px 6px 0px 0px #555555;
}

.reseller-catalog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.reseller-catalog-code {
    margin: 0 0 6px 0;
}

.reseller-catalog-code code {
    background: rgba(0, 0, 0, 0.05);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
    display: inline-block;
}

body.dark-mode .reseller-catalog-code code {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}

.reseller-catalog-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.reseller-catalog-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 16px 0;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reseller-catalog-card .reseller-price-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    background: rgba(0, 0, 0, 0.02);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 8px;
    margin-bottom: 16px;
    text-align: center;
}

body.dark-mode .reseller-catalog-card .reseller-price-grid {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.reseller-price-col,
.reseller-price-grid > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 6px;
}

.reseller-price-label,
.reseller-price-grid > div span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reseller-price-val,
.reseller-price-grid > div strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.reseller-price-highlight,
.reseller-price-grid > div:last-child {
    background: color-mix(in srgb, var(--primary) 22%, var(--card-bg));
    border: 1.5px solid var(--primary);
}

.reseller-price-highlight .reseller-price-label,
.reseller-price-grid > div:last-child span {
    color: #111827;
    font-weight: 800;
}

.reseller-price-highlight .reseller-price-val,
.reseller-price-grid > div:last-child strong {
    color: #000000;
    font-weight: 900;
}

body.dark-mode .reseller-price-highlight,
body.dark-mode .reseller-price-grid > div:last-child {
    background: rgba(240, 196, 25, 0.15);
    border-color: var(--primary);
}

body.dark-mode .reseller-price-highlight .reseller-price-label,
body.dark-mode .reseller-price-grid > div:last-child span {
    color: var(--primary);
}

body.dark-mode .reseller-price-highlight .reseller-price-val,
body.dark-mode .reseller-price-grid > div:last-child strong {
    color: #ffffff;
}

.stock-badge.custom-wa {
    background: #e0e7ff;
    color: #4338ca;
    border: 1.5px solid #818cf8;
}

body.dark-mode .stock-badge.custom-wa {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.5);
}

.stock-badge {
    border: 1.5px solid #10b981;
}

.stock-badge.low {
    border: 1.5px solid #ef4444;
}

.reseller-action-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
}

.reseller-action-row .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
}

.reseller-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    color: var(--text-muted);
}

.reseller-placeholder i {
    font-size: 36px;
    margin-bottom: 16px;
    color: var(--primary);
    display: inline-block;
}

.reseller-placeholder h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.reseller-placeholder p {
    margin: 0;
    font-size: 14px;
}

.reseller-placeholder-error i {
    color: var(--danger);
}

.reseller-txn-cards {
    display: none;
}

.reseller-txn-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 28px 16px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    text-align: center;
}

.reseller-txn-error {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 55%, var(--border-color));
}

/* Responsive dashboard shell */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    min-width: 720px;
}

.glass-card,
.glass-panel,
.main-content,
.sidebar,
.content-area,
.modal-glass {
    min-width: 0;
}

.panel-header,
.form-actions,
.cmd-actions,
.reseller-action-row,
.actions-cell,
.modal-footer {
    flex-wrap: wrap;
}

.panel-header {
    gap: 12px;
}

.panel-header .search-box,
.panel-header .search-box input {
    max-width: 100%;
}

.content-area {
    width: 100%;
}

@media (max-width: 1180px) {
    .sidebar {
        width: 232px;
        padding: 20px;
    }

    .main-content {
        padding: 32px;
    }

    .stats-grid,
    .reseller-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .form-grid,
    .reseller-dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    html,
    body {
        min-height: 100%;
    }

    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .dashboard-container {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    body {
        --mobile-nav-gutter: 0px;
        --mobile-nav-height: 68px;
        --mobile-nav-radius: 0px;
        --mobile-nav-gap: 6px;
        --mobile-nav-icon-size: 46px;
        --mobile-nav-icon-font: 17px;
        --mobile-nav-padding: 8px;
        --mobile-nav-shadow: none;
        --mobile-nav-border: 0;
        --mobile-nav-active: #1495e8;
        --mobile-nav-bg: var(--card-bg);
        --mobile-nav-muted: color-mix(in srgb, var(--text-muted) 88%, var(--primary));
        --mobile-nav-bottom-space: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    .sidebar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 900;
        width: 100%;
        max-height: none;
        padding: 0;
        background: var(--mobile-nav-bg);
        color: var(--text-main);
        box-shadow: none;
        pointer-events: auto;
    }

    .brand,
    .sidebar-footer {
        display: none;
    }

    .sidebar nav,
    #sidebar-nav {
        width: 100%;
        min-height: var(--mobile-nav-height);
        margin: 0;
        padding: var(--mobile-nav-padding) max(var(--mobile-nav-padding), env(safe-area-inset-left)) calc(var(--mobile-nav-padding) + env(safe-area-inset-bottom)) max(var(--mobile-nav-padding), env(safe-area-inset-right));
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: var(--mobile-nav-gap);
        overflow-x: auto;
        overflow-y: hidden;
        background: var(--mobile-nav-bg);
        border: var(--mobile-nav-border);
        border-top: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent);
        border-radius: var(--mobile-nav-radius);
        box-shadow: var(--mobile-nav-shadow);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        pointer-events: auto;
    }

    #sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar nav a,
    .sidebar .nav-btn {
        flex: 0 0 var(--mobile-nav-icon-size);
        width: var(--mobile-nav-icon-size);
        height: var(--mobile-nav-icon-size);
        min-height: var(--mobile-nav-icon-size);
        margin-bottom: 0;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        white-space: nowrap;
        overflow: hidden;
        border-radius: 50%;
        color: var(--mobile-nav-muted);
        font-size: 0;
        line-height: 1;
        background: transparent;
        box-shadow: none;
    }

    .sidebar nav a i,
    .sidebar .nav-btn i {
        flex: 0 0 auto;
        margin: 0;
        font-size: var(--mobile-nav-icon-font);
        line-height: 1;
    }

    .sidebar nav a:hover,
    .sidebar .nav-btn:hover {
        color: var(--text-main);
        background: color-mix(in srgb, var(--primary) 16%, transparent);
    }

    .sidebar nav a.active,
    .sidebar .nav-btn.active {
        flex-basis: calc(var(--mobile-nav-icon-size) + 14px);
        width: calc(var(--mobile-nav-icon-size) + 14px);
        border-radius: 999px;
        color: #ffffff;
        background: var(--mobile-nav-active);
        box-shadow: none;
        transform: none;
    }

    .sidebar nav > div {
        display: flex !important;
        flex: 0 0 auto;
        align-items: center;
        gap: var(--mobile-nav-gap);
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    .sidebar nav > div a {
        color: var(--mobile-nav-muted);
    }

    .sidebar nav > div #btn-logout {
        display: none;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        overflow: visible;
        padding: 24px 16px calc(var(--mobile-nav-bottom-space) + 32px);
    }

    .dashboard-container,
    .content-area,
    .tab-pane,
    #reseller-history-tab,
    #reseller-history-tab .glass-panel {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

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

    header {
        gap: 16px;
        margin-bottom: 24px;
    }

    .header-title h1 {
        font-size: 24px;
    }

    .stats-grid,
    .reseller-stats-grid,
    .form-grid,
    .reseller-dashboard-grid,
    .reseller-order-grid,
    .reseller-price-grid,
    .reseller-result-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .stats-grid {
        margin-bottom: 24px;
    }

    .glass-card,
    .glass-panel {
        padding: 18px;
        box-shadow: var(--shadow-sm);
    }

    .glass-card {
        align-items: flex-start;
        gap: 14px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .stat-value {
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    .panel-header .search-box,
    .panel-header .search-box input,
    .btn-primary,
    .btn-secondary,
    .form-actions button,
    .reseller-action-row button {
        width: 100%;
        justify-content: center;
    }

    .actions-cell {
        justify-content: flex-start;
        min-width: 112px;
    }

    .table-container {
        margin-inline: -2px;
        padding-bottom: 6px;
    }

    .table-container table {
        min-width: 680px;
    }

    #reseller-history-tab .reseller-txn-table-wrap {
        display: none;
    }

    #reseller-history-tab .panel-header {
        width: 100%;
    }

    #reseller-refresh-transactions {
        width: 100%;
        justify-content: center;
    }

    .reseller-txn-cards {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding-bottom: 8px;
    }

    .reseller-txn-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 16px;
        border: 2px solid var(--border-color);
        border-radius: 14px;
        background: var(--card-bg);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }

    .reseller-txn-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--border-color);
        min-width: 0;
    }

    .reseller-txn-card-title {
        min-width: 0;
    }

    .reseller-txn-label,
    .reseller-txn-card-row span {
        display: block;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .reseller-txn-order {
        display: block;
        max-width: 100%;
        margin-top: 4px;
        color: var(--text-main);
        font-size: 14px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .reseller-txn-status {
        flex: 0 0 auto;
        padding: 5px 10px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.04em;
        line-height: 1;
        color: #064e3b;
        background: #d1fae5;
        border: 1px solid #6ee7b7;
    }

    .reseller-txn-status.is-failed {
        color: #991b1b;
        background: #fee2e2;
        border-color: #fecaca;
    }

    .reseller-txn-status.is-pending {
        color: #92400e;
        background: #fef3c7;
        border-color: #fde68a;
    }

    .reseller-txn-card-row {
        display: grid;
        grid-template-columns: minmax(78px, 0.42fr) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        width: 100%;
        max-width: 100%;
        padding: 9px 0;
        min-width: 0;
    }

    .reseller-txn-card-row + .reseller-txn-card-row {
        border-top: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
    }

    .reseller-txn-card-row strong {
        min-width: 0;
        color: var(--text-main);
        text-align: right;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .reseller-txn-product-row strong {
        line-height: 1.45;
    }

    th,
    td {
        padding: 12px;
        white-space: nowrap;
    }

    .modal-backdrop {
        align-items: flex-start;
        padding: 16px;
        overflow-y: auto;
    }

    .modal-glass {
        width: 100% !important;
        max-width: 100%;
        max-height: calc(100dvh - 32px);
        padding: 22px;
        border-width: 2px;
        box-shadow: 4px 4px 0px #000;
    }

    body.dark-mode .modal-glass {
        box-shadow: 4px 4px 0px #333;
    }

    .modal-header {
        gap: 12px;
        margin-bottom: 18px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-footer {
        justify-content: stretch;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100% !important;
        max-width: none;
    }

    #account-content {
        height: 42vh !important;
        min-height: 220px;
    }

    .reseller-login-screen {
        align-items: center;
        justify-content: center;
        min-height: 100dvh;
        overflow-y: auto;
        padding: 18px;
    }

    .reseller-login-card,
    .reseller-placeholder {
        padding: 22px;
    }

    .reseller-login-card {
        margin: auto;
        width: min(420px, 100%);
    }
}

@media (max-width: 480px) {
    body {
        --mobile-nav-gutter: 12px;
        --mobile-nav-height: 66px;
        --mobile-nav-radius: 24px;
        --mobile-nav-icon-size: 42px;
        --mobile-nav-icon-font: 16px;
    }

    .main-content {
        padding: 20px 12px calc(var(--mobile-nav-bottom-space) + 28px);
    }

    .sidebar {
        padding: 0 var(--mobile-nav-gutter) calc(var(--mobile-nav-gutter) + env(safe-area-inset-bottom));
    }

    .sidebar nav a,
    .sidebar .nav-btn {
        padding: 0;
        font-size: 0;
    }

    .glass-card,
    .glass-panel,
    .modal-glass {
        padding: 16px;
    }

    .btn-primary,
    .btn-secondary {
        padding-inline: 16px;
    }

    .table-container table {
        min-width: 620px;
    }
}


