:root {
    --primary: #16A34A;
    --primary-dark: #166534;
    --primary-light: #DCFCE7;
    --white: #FFFFFF;
    --bg: #F8FAF9;
    --text: #1A1A1A;
    --text-light: #6B7280;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --danger-dark: #B91C1C;
    --shadow: rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline: none;
}

html, body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding-bottom: 80px;
}

.page {
    display: none;
    animation: fadeIn 0.2s ease;
    min-height: 100vh;
}

.page.active {
    display: block;
    padding-bottom: 80px;
}
 .mt-list{
        margin-top:90px;
    }
 .download-list{
        margin-top:30px;
    }

#page-stock .list-container {
    padding-top: 32px;
    margin-top: 34px;
}
#page-history .header {
    padding-top: 32px;
    margin-top: 54px;
    
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    padding: 24px 20px 16px;
    background: var(--white);
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}

.header-action-btn {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-dark);
    padding: 8px 12px;
    margin-left: auto;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.header-action-btn:active {
    background: var(--primary);
    color: #fff;
}

.custom-date-range {
    display: flex;
    gap: 12px;
    padding: 0 20px 12px;
}

.custom-date-range .input-group {
    flex: 1;
    margin-bottom: 0;
}

.custom-date-range label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    display: block;
}

.custom-date-range input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.header-user {
    font-size: 13px;
    color: var(--text);
    margin-top: 6px;
    font-weight: 500;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-row h2 {
    margin: 0;
}

/* Dashboard header with filter */
#page-dashboard .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

#page-dashboard .filter-bar {
    align-self: stretch;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

#page-dashboard .filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    min-height: 56px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.btn-success {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.btn-danger {
    background: var(--primary-dark);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(22, 101, 52, 0.25);
}

.btn-full {
    width: 100%;
}

.btn-back {
    background: none;
    border: none;
    color: var(--primary);
    padding: 8px;
    margin-left: -8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Login Page */
.login-container {
    padding: 60px 24px 40px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-section {
    margin-bottom: 48px;
}

.logo-icon {
    width: 96px;
    height: 96px;
    background: var(--primary-light);
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 20px;
}

.app-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: 400;
}

.login-form {
    text-align: left;
    background: var(--white);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.login-hint {
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px;
}

.metric-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-card-full {
    grid-column: 1 / -1;
}

.metric-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.metric-sales .metric-value { color: var(--primary); }
.metric-expenses .metric-value { color: var(--danger); }
.metric-net .metric-value { color: var(--text); }
.metric-count .metric-value { color: var(--text); }
.metric-purchases .metric-value { color: #D97706; }
.metric-products .metric-value { color: #2563EB; }
.metric-stock .metric-value { color: #7C3AED; }

/* Split */
.section {
    padding: 0 20px 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.split-item {
    background: var(--white);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 6px var(--shadow);
}

.split-item span:first-child {
    flex: 1;
}

.split-item strong {
    font-weight: 600;
    color: var(--text);
}

.split-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Form Page */
.form-page {
    padding: 24px 20px;
}

/* Filters */
.filter-bar {
    display: flex;
    gap: 10px;
    padding: 0 20px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* List */
.list-container {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px var(--shadow);
}

.list-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-light);
}

.list-item-amount {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
}

.list-item-amount.positive {
    color: var(--primary);
}

.list-item-amount.negative {
    color: var(--danger);
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.list-item-actions .btn {
    min-height: 44px;
    padding: 10px 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.2s ease;
}

.badge:active {
    opacity: 0.7;
}

.badge-actif,
.badge-role {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-inactif {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.badge-warning {
    background: #FEF3C7;
    color: #B45309;
}

.badge-en_attente {
    background: #FEF3C7;
    color: #B45309;
}

.badge-expire {
    background: #F3F4F6;
    color: #4B5563;
}

.badge-suspendu {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.list-item-column {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.abonnement-statut {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    background: var(--white);
    color: var(--text);
}

.abonnement-statut:focus {
    outline: none;
    border-color: var(--primary);
}

.reabonnement-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reabonnement-row .abonnement-statut {
    flex: 1;
}

.reabonnement-row .btn {
    min-height: 44px;
    padding: 10px 18px;
    white-space: nowrap;
}

.expired-box {
    text-align: center;
    padding: 24px 16px;
}

.expired-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.expired-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.expired-message {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.expired-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.expired-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--white);
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.expired-contact-item strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.list-item-delete {
    background: none;
    border: none;
    color: var(--danger);
    padding: 8px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Chart Tabs */
.chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chart-tab {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.chart-container {
    background: var(--white);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    height: 260px;
}

.chart-container canvas {
    width: 100% !important;
    height: 220px !important;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.chart-legend-dot.sales { background: var(--primary); }
.chart-legend-dot.expenses { background: var(--danger); }

/* Cash */
.cash-summary {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--text-light);
}

.cash-row strong {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.cash-row-total strong {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 12px;
    z-index: 100;
    box-shadow: 0 -2px 10px var(--shadow);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    min-width: 60px;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    stroke: currentColor;
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    transition: transform 0.2s ease;
}

.fab:active {
    transform: scale(0.92);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 10px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 2px 6px var(--shadow);
    white-space: nowrap;
}

.fab-menu-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dev-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.dev-actions .btn {
    flex: 1;
}

/* Bottom spacer */
.bottom-spacer {
    height: 20px;
}

/* Utility */
.text-center {
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* Desktop adjustments */
@media (min-width: 481px) {
    #app {
        border-left: 1px solid #E5E7EB;
        border-right: 1px solid #E5E7EB;
    }
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 200;
    max-width: 90%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Search Trigger */
.btn-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid #E5E7EB;
    background: var(--white);
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-search-trigger:active {
    border-color: var(--primary);
    color: var(--primary);
}

.dev-search-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px 4px;
}

.dev-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background: var(--white);
    color: var(--text);
}

.dev-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 8px 20px 16px;
    padding: 14px;
    border-radius: 14px;
    border: 2px solid #E5E7EB;
    background: var(--white);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-load-more:active {
    border-color: var(--primary);
    color: var(--primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-transactions-scroll {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast.toast-success {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.toast.toast-error {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.logout-top {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--white);
    border: 2px solid #D1D5DB;
    color: #4B5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    box-shadow: 0 2px 8px var(--shadow);
}

.logout-top:active {
    transform: scale(0.95);
}

.download-top {
    position: fixed;
    top: 16px;
    right: 68px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--white);
    border: 1.5px solid #E5E7EB;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    box-shadow: 0 2px 8px var(--shadow);
}

.download-top:active {
    transform: scale(0.95);
}

.download-hero {
    text-align: center;
    padding: 32px 20px;
}

.download-icon {
    width: 96px;
    height: 96px;
    background: var(--primary-light);
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 16px;
}

.download-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
}

.download-version {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.download-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.download-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    box-shadow: 0 2px 6px var(--shadow);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 12px;
}

.list-item-arrow {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 8px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.list-item-print {
    background: none;
    border: none;
    color: var(--primary);
    padding: 8px;
    margin-left: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.detail-section {
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-light);
}

.detail-item strong {
    font-weight: 600;
    color: var(--text);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.detail-transactions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 300;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.open {
    display: flex;
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--bg);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    background: var(--white);
    border-bottom: 1px solid #E5E7EB;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.confirm-sheet {
    padding: 24px 20px 32px;
    text-align: center;
}

.confirm-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #FEF2F2;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.confirm-message {
    font-size: 14px;
    color: var(--text-light);
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-actions .btn {
    flex: 1;
}

.btn-secondary:active {
    background: #F3F4F6;
}

/* Loader & Skeleton */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

.skeleton {
    background: linear-gradient(90deg, #E5E7EB 25%, #F3F4F6 50%, #E5E7EB 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
    border-radius: 10px;
}

.skeleton-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-line {
    height: 14px;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.h-24 { height: 24px; }
.skeleton-line.h-20 { height: 20px; }

.skeleton-metric {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    backdrop-filter: blur(2px);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-list-item {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 6px var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 2px solid #E5E7EB;
    box-shadow: none;
}

.btn-secondary:active {
    background: #F3F4F6;
}

/* Purchase supplier add button */
.select-with-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.select-with-action select {
    flex: 1;
}

.btn-add-sm {
    width: 56px;
    min-height: 56px;
    border-radius: 14px;
    border: 2px dashed #E5E7EB;
    background: var(--white);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-add-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-add-sm:active {
    transform: scale(0.95);
}

/* Sale multi-product selector */
.product-search-wrapper {
    position: relative;
}

.product-search-input {
    width: 100%;
    padding: 16px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.product-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.product-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px var(--shadow);
}

.product-autocomplete-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s ease;
}

.product-autocomplete-item:last-child {
    border-bottom: none;
}

.product-autocomplete-item:hover,
.product-autocomplete-item.active {
    background: var(--primary-light);
}

.product-autocomplete-item .pa-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.product-autocomplete-item .pa-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.product-chips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.product-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--white);
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    flex-wrap: wrap;
}

.product-chip-info {
    flex: 1;
    min-width: 120px;
}

.product-chip-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.product-chip-unit {
    font-size: 12px;
    color: var(--text-light);
}

.chip-qty,
.chip-price {
    width: 90px;
    padding: 8px 10px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    text-align: center;
}

.chip-qty:focus,
.chip-price:focus {
    outline: none;
    border-color: var(--primary);
}

.chip-remove {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: var(--danger-light);
    color: var(--danger-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.chip-remove:active {
    opacity: 0.7;
}

.sale-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--primary-light);
    border-radius: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

.sale-total-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sale-total-amount {
    font-size: 18px;
}

/* Sale client info card */
.client-info-card {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--white);
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.client-info-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

.client-info-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: var(--primary-light);
    color: var(--primary-dark);
}

.client-info-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-info-detail-item {
    font-size: 13px;
    color: var(--text-light);
}

.client-info-debt {
    margin-top: 4px;
    padding: 8px 10px;
    background: var(--danger-light);
    border-radius: 10px;
    font-size: 13px;
    color: var(--danger-dark);
}

.debt-amount {
    color: var(--danger);
    font-weight: 700;
}

.inventory-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.inventory-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

.inventory-table th {
    text-align: left;
    padding: 10px 6px;
    border-bottom: 2px solid #E5E7EB;
    color: var(--text-light);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.inventory-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: top;
    white-space: nowrap;
}

.inventory-table tr:last-child td {
    border-bottom: none;
}

.inventory-title {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.inventory-code {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.inventory-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.inventory-benefice {
    color: var(--primary);
    font-weight: 700;
}

.inventory-mobile {
    display: contents;
}

.inventory-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    width: 100%;
}

.inventory-mobile-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    padding: 3px 0;
}

.inventory-mobile-row strong {
    color: var(--text);
    font-weight: 600;
}

.inventory-mobile-total {
    grid-column: 1 / -1;
    border-top: 1px solid #E5E7EB;
    margin-top: 2px;
    padding-top: 4px;
}

.inventory-mobile-total strong {
    color: var(--primary-dark);
    font-size: 12px;
}

@media (min-width: 481px) {
    .inventory-mobile {
        display: none;
    }
    .inventory-desktop {
        display: block;
    }
}

@media (max-width: 480px) {
    .inventory-desktop {
        display: none;
    }
    .inventory-mobile {
        display: contents;
    }
}

.inventory-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.inventory-detail-table th {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 2px solid #E5E7EB;
    color: var(--text-light);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.inventory-detail-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #F3F4F6;
    white-space: nowrap;
    vertical-align: top;
}

.inventory-detail-table tr:last-child td {
    border-bottom: none;
}

.inventory-actions {
    text-align: right;
    white-space: nowrap;
}
