/* ============================================================
   saas_dashboard.css — AvoloPay Pro Merchant Dashboard
   ============================================================ */

/* --- Variables --- */
:root {
    --saas-primary: #2F80ED;
    --saas-primary-light: #56CCF2;
    --saas-accent: #a855f7;
    --saas-success: #00e676;
    --saas-warning: #ffa726;
    --saas-danger: #ff5252;
    --saas-dark: #0A0F1E;
    --saas-card: rgba(15, 25, 55, 0.65);
    --saas-border: rgba(47, 128, 237, 0.15);
    --saas-text: #ffffff;
    --saas-muted: rgba(255, 255, 255, 0.6);
    --saas-sidebar-w: 240px;
    --saas-font: 'Outfit', 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--saas-font);
    background-color: var(--saas-dark);
    color: var(--saas-text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(10, 30, 90, 0.5) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 30%, rgba(5, 20, 70, 0.6) 0%, transparent 60%),
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.7) 0%, transparent 0%),
        radial-gradient(1px 1px at 40% 8%, rgba(255, 255, 255, 0.6) 0%, transparent 0%),
        radial-gradient(1px 1px at 70% 22%, rgba(255, 255, 255, 0.7) 0%, transparent 0%),
        radial-gradient(1px 1px at 85% 65%, rgba(255, 255, 255, 0.5) 0%, transparent 0%),
        radial-gradient(1.5px 1.5px at 48% 72%, rgba(150, 200, 255, 0.6) 0%, transparent 0%),
        linear-gradient(160deg, #0a0f1e 0%, #0d1a3a 40%, #091428 100%);
    background-attachment: fixed;
}

/* --- Loading Screen --- */
.saas-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--saas-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: opacity 0.5s;
}

.saas-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.saas-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--saas-primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══ Sidebar ═══ */
.saas-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--saas-sidebar-w);
    background: rgba(8, 14, 35, 0.95);
    border-right: 1px solid var(--saas-border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 1.5rem 0;
    transition: transform 0.3s ease;
}

.saas-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.saas-sidebar-logo {
    height: 32px;
}

.saas-sidebar-brand {
    background: linear-gradient(135deg, var(--saas-primary), var(--saas-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 1.1rem;
}

.saas-sidebar-business {
    padding: 1rem 1.2rem 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.4;
    font-weight: 600;
}

.saas-sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.saas-sidebar-menu li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--saas-muted);
    border-left: 3px solid transparent;
}

.saas-sidebar-menu li:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--saas-text);
}

.saas-sidebar-menu li.active {
    color: var(--saas-primary-light);
    background: rgba(47, 128, 237, 0.08);
    border-left-color: var(--saas-primary-light);
}

.saas-sidebar-menu li i {
    width: 20px;
    text-align: center;
}

.saas-sidebar-footer {
    padding: 1rem 1.2rem;
}

.saas-sandbox-badge {
    background: rgba(255, 167, 38, 0.15);
    border: 1px solid rgba(255, 167, 38, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--saas-warning);
    margin-bottom: 0.75rem;
}

.saas-sandbox-badge.hidden {
    display: none;
}

.saas-logout-btn {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%;
    color: var(--saas-danger);
    cursor: pointer;
    font-family: var(--saas-font);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.saas-logout-btn:hover {
    background: rgba(255, 82, 82, 0.2);
}

/* ═══ Topbar (Desktop & Mobile) ═══ */
.saas-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: var(--saas-sidebar-w);
    right: 0;
    height: 56px;
    background: rgba(8, 14, 35, 0.95);
    border-bottom: 1px solid var(--saas-border);
    backdrop-filter: blur(20px);
    z-index: 99;
    align-items: center;
    padding: 0 1.5rem;
    gap: 12px;
}

.saas-topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}

.saas-topbar-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

/* ═══ Topbar Mode Test Pill ═══ */
.topbar-sandbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: #fbbf24;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
    outline: none;
}

.topbar-sandbox-pill:hover {
    background: rgba(245, 158, 11, 0.26);
    border-color: #f59e0b;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.sandbox-dot-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
    animation: sandboxPulseAnim 1.8s infinite ease-in-out;
}

@keyframes sandboxPulseAnim {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.4;
    }
}

.highlight-pulse {
    animation: highlightCardPulse 1.2s ease-in-out 2 !important;
}

@keyframes highlightCardPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        border-color: rgba(255, 255, 255, 0.08);
    }

    50% {
        box-shadow: 0 0 30px rgba(245, 158, 11, 0.65);
        border-color: #f59e0b;
    }
}

.saas-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(47, 128, 237, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--saas-primary-light);
}

/* ═══ Main Content ═══ */
.saas-main {
    margin-left: var(--saas-sidebar-w);
    padding: 76px 2.5rem 2rem;
    min-height: 80vh;
}

.saas-page {
    display: none;
}

.saas-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saas-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ═══ KPI Cards ═══ */
.saas-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.saas-kpi-card {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(12px);
    transition: transform 0.3s;
}

.saas-kpi-card:hover {
    transform: translateY(-3px);
}

.saas-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.kpi-revenue .saas-kpi-icon {
    background: rgba(0, 230, 118, 0.15);
    color: var(--saas-success);
}

.kpi-orders .saas-kpi-icon {
    background: rgba(47, 128, 237, 0.15);
    color: var(--saas-primary-light);
}

.kpi-clients .saas-kpi-icon {
    background: rgba(168, 85, 247, 0.15);
    color: var(--saas-accent);
}

.kpi-return .saas-kpi-icon {
    background: rgba(255, 167, 38, 0.15);
    color: var(--saas-warning);
}

.saas-kpi-info {
    display: flex;
    flex-direction: column;
}

.saas-kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
}

.saas-kpi-label {
    font-size: 0.78rem;
    opacity: 0.5;
    font-weight: 500;
}

/* ═══ Quick Actions ═══ */
.saas-quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.saas-quick-btn {
    background: rgba(47, 128, 237, 0.1);
    border: 1px solid rgba(47, 128, 237, 0.2);
    border-radius: 12px;
    padding: 10px 18px;
    color: var(--saas-primary-light);
    cursor: pointer;
    font-family: var(--saas-font);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-quick-btn:hover {
    background: rgba(47, 128, 237, 0.2);
    transform: translateY(-2px);
}

/* ═══ Charts ═══ */
.saas-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.saas-chart-card {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.saas-chart-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.saas-chart-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.saas-chart-small canvas {
    max-width: 160px;
    max-height: 160px;
}

.saas-quota-text {
    margin-top: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
}

/* ═══ Month Summary ═══ */
.saas-month-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.saas-summary-item {
    flex: 1;
    min-width: 180px;
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.saas-summary-item i {
    font-size: 1.2rem;
    color: var(--saas-primary-light);
    opacity: 0.6;
}

.saas-summary-value {
    font-weight: 700;
    display: block;
}

.saas-summary-label {
    font-size: 0.78rem;
    opacity: 0.5;
    display: block;
}

/* ═══ Order Form ═══ */
.saas-order-form {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.saas-order-step {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.saas-order-step:last-of-type {
    border-bottom: none;
}

.saas-order-step h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-search-box {
    position: relative;
}

.saas-search-box input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.95rem;
    font-family: var(--saas-font);
    outline: none;
    box-sizing: border-box;
}

.saas-search-box input:focus {
    border-color: var(--saas-primary-light);
}

.saas-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 18, 40, 0.98);
    border: 1px solid var(--saas-border);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.saas-search-results.visible {
    display: block;
}

.saas-search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.saas-search-result-item:hover {
    background: rgba(47, 128, 237, 0.15);
}

.saas-search-result-item .price {
    opacity: 0.5;
    font-weight: 600;
}

.saas-selected-customer {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 12px;
    padding: 10px 16px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ═══ Customer Suggestion Bubbles (above input) ═══ */
.customer-bubbles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    max-height: 95px;
    overflow-y: auto;
    padding: 2px 1px;
}

.customer-bubble-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(47, 128, 237, 0.12);
    border: 1px solid rgba(47, 128, 237, 0.35);
    color: #93c5fd;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.customer-bubble-chip:hover {
    background: rgba(47, 128, 237, 0.28);
    border-color: #60a5fa;
    color: #ffffff;
    transform: translateY(-1px);
}

.customer-bubble-chip.is-unknown {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.customer-bubble-chip.is-unknown:hover {
    background: rgba(245, 158, 11, 0.28);
    border-color: #fbbf24;
    color: #ffffff;
}

.customer-bubble-chip .bubble-name {
    font-weight: 700;
}

.customer-bubble-chip .bubble-phone {
    font-size: 0.72rem;
    opacity: 0.8;
}

/* ═══ Customer Rename Prompt Card ═══ */
.customer-rename-card {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.35);
    animation: fadeInSlide 0.25s ease;
}

.customer-rename-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fbbf24;
}

.customer-rename-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.customer-rename-form input {
    flex: 1;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(10, 15, 30, 0.85);
    color: #ffffff;
    font-size: 0.82rem;
    outline: none;
}

.customer-rename-form input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.customer-rename-form button {
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.customer-rename-form button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.saas-link-btn {
    background: none;
    border: none;
    color: var(--saas-primary-light);
    cursor: pointer;
    font-family: var(--saas-font);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.saas-order-cart {
    margin-top: 0.75rem;
}

.saas-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.saas-cart-item .name {
    flex: 1;
}

.saas-cart-item .qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-cart-item .qty-controls button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saas-cart-item .subtotal {
    font-weight: 700;
    min-width: 80px;
    text-align: right;
}

.saas-cart-item .remove-btn {
    background: none;
    border: none;
    color: var(--saas-danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.saas-order-total {
    margin-top: 1rem;
    text-align: right;
    font-size: 1.1rem;
    padding-top: 0.75rem;
}

.saas-order-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saas-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.saas-checkbox-label input[type="checkbox"] {
    accent-color: var(--saas-primary-light);
    width: 18px;
    height: 18px;
}

.saas-select,
.saas-textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--saas-font);
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    width: 100%;
}

.saas-select option {
    background: var(--saas-dark);
}

/* ═══ Toolbar ═══ */
.saas-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.saas-toolbar input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--saas-font);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

/* Page Products Toolbar & Design System Buttons */
.saas-products-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.saas-search-box {
    position: relative;
    min-width: 240px;
}

.saas-search-box .saas-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.88rem;
    pointer-events: none;
}

.saas-search-box input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: white;
    font-family: var(--saas-font);
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.saas-search-box input:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

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

.saas-btn-product {
    padding: 10px 18px;
    border-radius: 12px;
    font-family: var(--saas-font);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    border: 1px solid transparent;
}

.btn-primary.saas-btn-product {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary.saas-btn-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
    filter: brightness(1.05);
}

.btn-outline.saas-btn-product {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    backdrop-filter: blur(8px);
}

.btn-outline.saas-btn-product:hover {
    background: rgba(56, 189, 248, 0.18);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-secondary.saas-btn-product {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-secondary.saas-btn-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    filter: brightness(1.05);
}

.explainer-on-accent {
    background: rgba(0, 0, 0, 0.28) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.32) !important;
    font-size: 0.76rem !important;
}

.explainer-on-accent:hover {
    background: #000000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.saas-btn-accent {
    background: linear-gradient(135deg, var(--saas-primary), var(--saas-primary-light));
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    color: white;
    cursor: pointer;
    font-family: var(--saas-font);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.saas-btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 128, 237, 0.4);
}

.saas-btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ═══ Products Grid ═══ */
.saas-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.saas-product-card {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 16px;
    padding: 1.2rem;
    transition: all 0.3s;
}

.saas-product-card:hover {
    transform: translateY(-3px);
    border-color: rgba(47, 128, 237, 0.3);
}

.saas-product-card .name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.saas-product-card .category {
    font-size: 0.75rem;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.saas-product-card .price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--saas-success);
}

.saas-product-card .actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.saas-product-card .actions button {
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.saas-product-card .actions .btn-edit-prod {
    background: rgba(47, 128, 237, 0.12);
    border: 1px solid rgba(47, 128, 237, 0.35);
    color: #60a5fa;
}

.saas-product-card .actions .btn-edit-prod:hover {
    background: rgba(47, 128, 237, 0.26);
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 128, 237, 0.35);
}

.saas-product-card .actions .btn-delete-prod {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.saas-product-card .actions .btn-delete-prod:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.saas-product-card .renewable-badge {
    display: inline-block;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.7rem;
    color: var(--saas-accent);
    margin-top: 6px;
    font-weight: 600;
}

/* ═══ Table Container ═══ */
.saas-table-container {
    overflow-x: auto;
}

.saas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.saas-table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    opacity: 0.5;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.saas-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.saas-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.saas-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.saas-badge-sent {
    background: rgba(0, 230, 118, 0.15);
    color: var(--saas-success);
}

.saas-badge-pending {
    background: rgba(255, 167, 38, 0.15);
    color: var(--saas-warning);
}

.saas-badge-failed {
    background: rgba(255, 82, 82, 0.15);
    color: var(--saas-danger);
}

.saas-badge-cancelled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--saas-muted);
}

/* ═══ Modals ═══ */
.saas-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.saas-modal.active,
.saas-modal.open {
    display: flex;
}

.saas-modal-box {
    background: radial-gradient(ellipse at top left, rgba(30, 58, 138, 0.3), transparent 70%), rgba(11, 19, 43, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(56, 189, 248, 0.12);
    border-radius: 20px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: saasModalIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes saasModalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.saas-modal-box.saas-modal-import-bulk,
.saas-modal-box.saas-modal-dfy {
    max-width: 580px;
    width: 94%;
    padding: 1.75rem;
}

.saas-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.saas-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

.saas-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.saas-modal-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.saas-modal-icon-badge.icon-badge-amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.saas-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.saas-modal-subtitle {
    font-size: 0.82rem;
    color: var(--saas-muted);
    margin: 2px 0 0;
    line-height: 1.4;
}

.saas-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══ Visual Import Preview Component ═══ */
.import-format-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.import-format-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.import-format-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-format-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.import-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--saas-font);
}

.import-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.import-tab-btn.active {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.35);
}

.import-code-window {
    background: #030712;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.import-code-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.74rem;
}

.import-window-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.import-window-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red {
    background: #ef4444;
}

.dot-yellow {
    background: #f59e0b;
}

.dot-green {
    background: #10b981;
}

.import-window-filename {
    color: #94a3b8;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
}

.import-window-actions {
    display: flex;
    gap: 6px;
}

.import-btn-copy,
.import-btn-download {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--saas-font);
}

.import-btn-copy:hover,
.import-btn-download:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.import-code-content {
    padding: 10px 14px;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
}

.import-preview-line {
    display: flex;
    align-items: center;
    white-space: pre;
}

.import-preview-line .line-num {
    width: 22px;
    color: rgba(255, 255, 255, 0.22);
    font-size: 0.74rem;
    user-select: none;
    flex-shrink: 0;
}

.tok-name {
    color: #f8fafc;
    font-weight: 500;
}

.tok-sep {
    color: #fbbf24;
    font-weight: 700;
    margin: 0 4px;
}

.tok-price {
    color: #34d399;
    font-weight: 700;
}

.import-format-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.76rem;
    color: #94a3b8;
}

.import-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-name {
    background: #f8fafc;
}

.dot-sep {
    background: #fbbf24;
}

.dot-price {
    background: #34d399;
}

/* ═══ Modern File Dropzone ═══ */
.saas-dropzone {
    border: 2px dashed rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.03);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.saas-dropzone:hover,
.saas-dropzone.dragover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.09);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
    transform: translateY(-1px);
}

.dropzone-icon-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-size: 1.25rem;
    margin-bottom: 8px;
    transition: transform 0.25s ease;
}

.saas-dropzone:hover .dropzone-icon-ring {
    transform: scale(1.1);
}

.icon-ring-amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #f59e0b;
}

.dropzone-main-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 3px;
}

.dropzone-link {
    color: #38bdf8;
    text-decoration: underline;
    font-weight: 700;
}

.link-amber {
    color: #f59e0b;
}

.dropzone-sub-text {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.55);
}

.dropzone-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
}

.dropzone-file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.dropzone-file-icon {
    font-size: 1.4rem;
    color: #34d399;
}

.dropzone-file-icon.icon-amber {
    color: #f59e0b;
}

.dropzone-filename {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    word-break: break-all;
}

.dropzone-filesize {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 2px;
}

.dropzone-clear-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dropzone-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.saas-modal-box h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
}

/* Form elements */
.saas-input-group {
    margin-bottom: 1rem;
}

.saas-input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.7;
}

.saas-input-group input,
.saas-input-group select,
.saas-input-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 0.92rem;
    font-family: var(--saas-font);
    outline: none;
    box-sizing: border-box;
}

.saas-input-group input:focus,
.saas-input-group select:focus {
    border-color: var(--saas-primary-light);
}

.saas-input-group select option {
    background: var(--saas-dark);
}

.saas-form-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--saas-primary), var(--saas-primary-light));
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--saas-font);
    margin-top: 0.5rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.saas-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(47, 128, 237, 0.4);
}

.saas-btn-lg {
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 14px;
}

/* ═══ Section Divider ═══ */
.saas-section-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.saas-section-divider h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.saas-date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-date-filter input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: var(--saas-font);
    font-size: 0.85rem;
}

.saas-filter-btn {
    background: var(--saas-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ═══ Orders List ═══ */
.saas-orders-list {}

.saas-order-item {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.saas-order-item .order-info {
    flex: 1;
    min-width: 200px;
}

.saas-order-item .order-customer {
    font-weight: 700;
}

.saas-order-item .order-details {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 2px;
}

.saas-order-item .order-amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--saas-success);
}

/* ═══ Settings ═══ */
.saas-settings-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.saas-settings-card {
    background: var(--saas-card);
    border: 1px solid var(--saas-border);
    border-radius: 18px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
}

.saas-settings-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-settings-desc {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.saas-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.saas-toggle {
    position: relative;
    width: 50px;
    height: 28px;
}

.saas-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.saas-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

.saas-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    left: 3px;
    top: 3px;
    transition: 0.3s;
}

.saas-toggle input:checked+.saas-toggle-slider {
    background: var(--saas-warning);
}

.saas-toggle input:checked+.saas-toggle-slider::before {
    transform: translateX(22px);
}

.saas-sub-info p {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

/* ═══ Staff Cards ═══ */
.saas-staff-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.saas-staff-item .staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(168, 85, 247, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--saas-accent);
}

.saas-staff-item .staff-info {
    flex: 1;
}

.saas-staff-item .staff-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.saas-staff-item .staff-role {
    font-size: 0.75rem;
    opacity: 0.4;
    text-transform: uppercase;
}

.saas-staff-item .staff-delete {
    background: none;
    border: none;
    color: var(--saas-danger);
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.6;
}

.saas-staff-item .staff-delete:hover {
    opacity: 1;
}

/* ═══ Responsive ═══ */
body.has-avolo-topbar .saas-topbar {
    top: 60px;
}

body.has-avolo-topbar .saas-sidebar {
    top: 60px;
    height: calc(100vh - 60px);
}

body.has-avolo-topbar .saas-main {
    padding-top: calc(56px + 60px + 1.25rem);
}

@media (max-width: 900px) {
    .saas-sidebar {
        transform: translateX(-100%);
    }

    .saas-sidebar.open {
        transform: translateX(0);
    }

    .saas-topbar {
        display: flex;
        left: 0 !important;
        right: 0 !important;
        padding: 0 1rem;
    }

    .saas-topbar-toggle {
        display: block !important;
    }

    .saas-main {
        margin-left: 0;
        padding: 72px 1rem 2rem;
    }

    body.has-avolo-topbar .saas-main {
        padding-top: calc(56px + 60px + 12px);
    }

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

    .saas-settings-sections {
        grid-template-columns: 1fr;
    }

    .saas-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .saas-kpi-grid {
        grid-template-columns: 1fr;
    }

    .saas-products-grid {
        grid-template-columns: 1fr;
    }

    .saas-order-form {
        padding: 1.2rem;
    }
}

/* ═══ QR Modal Customization ═══ */
.saas-qr-modal-box {
    background: linear-gradient(145deg, #0f172a, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.saas-qr-icon-success {
    width: 60px;
    height: 60px;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.saas-qr-title {
    color: #f8fafc;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.saas-qr-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.saas-qr-image-container {
    background: white;
    padding: 15px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.saas-qr-image-container img {
    display: block;
    width: 200px;
    height: 200px;
}

.saas-qr-link-wrapper {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.saas-qr-link-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.9rem;
    padding: 8px 12px;
    outline: none;
}

.saas-qr-copy-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.saas-qr-copy-btn:hover {
    opacity: 0.9;
}

/* ═══ Single-Screen POS Layout (Zero vertical scroll) ═══ */
@media (min-width: 901px) {
    body.pos-mode {
        overflow: hidden;
        height: 100vh;
    }

    body.pos-mode .saas-main {
        height: 90vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding: 1.25rem 2rem;
    }

    body.pos-mode #page-orders.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    body.pos-mode .saas-order-form {
        flex: 1;
        min-height: 0;
        margin-bottom: 0;
        padding: 1.25rem 1.5rem;
        display: flex;
        flex-direction: column;
    }

    body.pos-mode .saas-pos-split {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 1.5rem;
        flex: 1;
        min-height: 0;
    }

    body.pos-mode .pos-left-col,
    body.pos-mode .pos-right-col {
        display: flex;
        flex-direction: column;
        min-height: 0;
        gap: 0.85rem;
    }

    body.pos-mode .pos-products-container {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body.pos-mode .pos-products-scroll {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding-right: 4px;
    }

    body.pos-mode .pos-cart-container {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.22);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 12px;
        padding: 0.85rem;
    }

    body.pos-mode #order-cart {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    body.pos-mode .saas-order-step {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    body.pos-mode .pos-left-col .saas-order-step {
        /* La section Contact Client ne doit jamais être compressée */
        flex-shrink: 0;
        flex-grow: 0;
    }

    body.pos-mode .pos-products-container {
        /* S'assurer que la zone produits ne dépasse pas l'espace dispo */
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
}

/* ═══ Products Grid & Cards ═══ */
.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.pos-prod-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    user-select: none;
}

.pos-prod-card:hover {
    background: rgba(47, 128, 237, 0.1);
    border-color: rgba(47, 128, 237, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.pos-prod-info {
    margin-bottom: 8px;
}

.pos-prod-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-prod-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: #34d399;
    margin-top: 4px;
}

.pos-prod-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
}

.pos-add-btn {
    flex: 1;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.2s;
}

.pos-add-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
}

.pos-qty-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #6ee7b7;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    display: none;
}

.pos-qty-badge.active {
    display: inline-block;
}

/* ═══ Quick Add Product Bar Under Search ═══ */
.pos-quick-add-bar {
    display: none;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.15));
    border: 1.5px dashed rgba(59, 130, 246, 0.4);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 8px;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.25s ease;
}

.pos-quick-add-bar.active {
    display: flex;
    flex-wrap: wrap;
}

.pos-quick-add-bar .label-create {
    font-size: 0.85rem;
    font-weight: 600;
    color: #93c5fd;
    flex: 1;
    min-width: 140px;
}

.pos-quick-add-bar input[type="number"] {
    width: 120px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #34d399;
    font-weight: 700;
    font-size: 0.9rem;
    outline: none;
}

.pos-quick-add-bar .btn-confirm-add {
    background: #10b981;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.pos-quick-add-bar .btn-confirm-add:hover {
    background: #059669;
}

/* ═══ Mobile Modal Bottom-Sheet & Trigger ═══ */
.pos-mobile-trigger-card {
    display: none;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(14, 165, 233, 0.12));
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.pos-mobile-trigger-card:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(14, 165, 233, 0.2));
    border-color: #38bdf8;
}

@media (max-width: 900px) {
    .pos-desktop-only {
        display: none !important;
    }

    .pos-mobile-trigger-card {
        display: flex;
    }

    /* Sur mobile, la page POS n'a pas besoin de grand scrolling : le seul défilement interne est dans le modal */
    .saas-order-form {
        padding: 1rem;
    }
}

#modal-mobile-products.saas-modal {
    z-index: 300;
}

#modal-mobile-products .saas-modal-box {
    max-width: 520px;
    width: 95%;
    display: flex;
    flex-direction: column;
    height: 85vh;
    max-height: 85vh;
    padding: 1.25rem;
    overflow: hidden;
    /* Le seul défilement est sur la liste des produits ci-dessous */
}

#mobile-modal-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding-right: 4px;
}

@media (max-width: 480px) {
    #modal-mobile-products.saas-modal.active {
        align-items: flex-end;
    }

    #modal-mobile-products .saas-modal-box {
        max-width: 100%;
        width: 100%;
        border-radius: 24px 24px 0 0;
        margin: 0;
        height: 88vh;
        max-height: 88vh;
        padding-bottom: 2rem;
        animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* ── Animation Bouton Actualiser POS ── */
.btn-refresh-clicked {
    animation: avolo-btn-pulse 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes avolo-btn-pulse {
    0% {
        transform: scale(1);
    }

    45% {
        transform: scale(0.90);
    }

    100% {
        transform: scale(1);
    }
}

.btn-refreshing {
    pointer-events: none;
    opacity: 0.88;
    border-color: rgba(56, 189, 248, 0.5) !important;
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.3) !important;
}

.btn-refreshing i {
    display: inline-block;
    animation: avolo-icon-spin 0.75s linear infinite !important;
}

@keyframes avolo-icon-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}