/* ======================================
   SwiftPOS — Root Variables (SaaS Modern)
====================================== */

:root {
    /* ── Primary brand palette ── */
    --sp-color-primary:        #6d28d9;
    --sp-color-primary-dark:   #5b21b6;
    --sp-color-secondary:      #8b5cf6;
    --sp-color-accent:         #10b981;
    --sp-color-warning:        #f59e0b;
    --sp-color-info:           #3b82f6;
    --sp-color-danger:         #ef4444;

    /* ── Backgrounds ── */
    --sp-color-bg-white:       #ffffff;
    --sp-color-bg-grey:        #f9fafb;
    --sp-color-bg-light:       #f3f4f6;
    --sp-color-bg-tint:        #f5f3ff;
    --sp-color-bg-teal-tint:   #f0fdfa;

    /* ── Text ── */
    --sp-color-text-main:      #111827;
    --sp-color-text-grey:      #4b5563;
    --sp-color-text-muted:     #9ca3af;

    /* ── Borders ── */
    --sp-color-border:         #e5e7eb;
    --sp-color-border-dark:    #d1d5db;
    --sp-color-border-tint:    #ede9fe;

    /* ── Radius ── */
    --sp-radius:               16px;
    --sp-radius-lg:            24px;
    --sp-radius-pill:          500px;
    --sp-radius-sm:            8px;

    /* ── Backward-compatibility aliases ── */
    --sp-primary:              var(--sp-color-primary);
    --sp-primary-soft:         var(--sp-color-secondary);
    --sp-secondary:            var(--sp-color-accent);
    --sp-bg-body:              var(--sp-color-bg-light);
    --sp-surface:              var(--sp-color-bg-white);
    --sp-surface-soft:         var(--sp-color-bg-grey);
    --sp-surface-muted:        var(--sp-color-bg-grey);
    --sp-border-subtle:        var(--sp-color-border);
    --sp-border:               var(--sp-color-border);
    --sp-text-main:            var(--sp-color-text-main);
    --sp-text-muted:           var(--sp-color-text-muted);
    --sp-success:              var(--sp-color-accent);
    --sp-danger:               var(--sp-color-danger);
    --sp-warning:              var(--sp-color-warning);
    --sp-info:                 var(--sp-color-info);
    --sp-radius-md:            var(--sp-radius-sm);
    --sp-shadow-soft:          0 18px 45px rgba(15, 23, 42, 0.1);

    /* ── Sidebar ── */
    --sp-bg-soft:              #0f172a;
    --sp-text-inverse:         #f9fafb;
}

/* ======================================
   Global Resets + Fixes
====================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

body.swiftpos-body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--sp-bg-body);
    color: var(--sp-text-main);
}

/* ======================================
   Layout Structure
====================================== */

.swiftpos-app {
    min-height: 100vh;
    display: flex;
}

/* FIX: prevent overflow on mobile caused by flex */
@media (max-width: 991.98px) {
    .swiftpos-app {
        display: block !important;
    }
}

.swiftpos-main {
    flex: 1 1 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sp-surface-soft);
    color: var(--sp-text-main);

    /* FIX */
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.swiftpos-content {
    padding: 1rem;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
}

/* ======================================
   Topbar
====================================== */

.swiftpos-topbar {
    height: 56px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sp-color-border);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

.topbar-title {
    font-size: 0.98rem;
    font-weight: 600;
}

.topbar-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--sp-color-bg-grey, #f9fafb);
    border: 1px solid var(--sp-color-border, #e5e7eb);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    line-height: 1;
}

.topbar-user-btn:hover {
    background: var(--sp-color-bg-tint, #f5f3ff);
    border-color: var(--sp-color-border-dark, #d1d5db);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sp-color-primary, #6d28d9) 0%, var(--sp-color-secondary, #8b5cf6) 100%);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-pos-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 1rem;
    border-radius: var(--sp-radius-sm, 8px);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none !important;
    background: var(--sp-color-bg-tint, #f5f3ff);
    color: var(--sp-color-primary, #6d28d9) !important;
    border: 1px solid var(--sp-color-border-tint, #ede9fe);
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.sp-pos-quick-btn:hover {
    background: #ede9fe;
    color: var(--sp-color-primary-dark, #5b21b6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.12);
}

.sp-pos-quick-btn i {
    color: var(--sp-color-primary, #6d28d9);
}

/* ======================================
   Footer
====================================== */

.swiftpos-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

/* ===========================================================
   SWIFTPOS � PERFECT SIDEBAR (FULL REWRITE)
   Mobile + Desktop stable version
=========================================================== */

/* ==== SIDEBAR BASE ==== */
.swiftpos-sidebar {
    background:
        radial-gradient(circle at top, rgba(109, 40, 217, 0.85) 0%,
            rgba(91, 33, 182, 0.45) 50%,
            transparent 100%)
        var(--sp-bg-soft);
    color: var(--sp-text-inverse);

    display: flex;
    flex-direction: column;

    padding: 0.75rem 0.5rem;

    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    border-right: 1px solid rgba(15, 23, 42, 0.85);

    z-index: 1030;

    /* ANIMATION */
    transition:
        width 0.25s ease,
        transform 0.30s ease,
        opacity 0.25s ease;
}

/* Prevent page shifting */
.swiftpos-sidebar * {
    box-sizing: border-box;
}

/* ===========================================================
   DESKTOP MODE
=========================================================== */
@media (min-width: 992px) {

    /* Normal desktop sidebar (expanded) */
    .swiftpos-sidebar {
        position: sticky;
        top: 0;
        width: 260px;
        transform: translateX(0); /* always open */
    }

    /* Collapsed sidebar (desktop only) */
    .swiftpos-sidebar.collapsed {
        width: 78px;
    }

    /* Hide labels on collapsed */
    .swiftpos-sidebar.collapsed .brand-text,
    .swiftpos-sidebar.collapsed .sidebar-section-label,
    .swiftpos-sidebar.collapsed .sidebar-link .label,
    .swiftpos-sidebar.collapsed .sidebar-user .user-meta {
        display: none !important;
    }

    /* Icon centering when collapsed */
    .swiftpos-sidebar.collapsed .sidebar-link {
        justify-content: center;
        padding-inline: 0.5rem !important;
    }
}

/* ===========================================================
   MOBILE MODE (OFF-CANVAS)
=========================================================== */
@media (max-width: 991.98px) {

    .swiftpos-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;

        width: 260px;
        max-width: 80%;

        /* START HIDDEN */
        transform: translateX(-100%);
        opacity: 0;

        box-shadow: 10px 0 28px rgba(0, 0, 0, 0.4);
    }

    /* When mobile menu is open */
    body.sidebar-mobile-open .swiftpos-sidebar {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===========================================================
   MOBILE OVERLAY DARK BACKGROUND
=========================================================== */
.swiftpos-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;

    z-index: 1020;

    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Show overlay only when sidebar is open */
body.sidebar-mobile-open .swiftpos-overlay {
    opacity: 1;
    visibility: visible;
}

/* Hide completely on desktop */
@media (min-width: 992px) {
    .swiftpos-overlay {
        display: none !important;
    }
}

/* ===========================================================
   SIDEBAR INNER ELEMENTS (Stable UI)
=========================================================== */

.sidebar-header {
    padding: 0.4rem 0.6rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sp-color-primary), var(--sp-color-secondary));
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.brand-subtitle {
    font-size: 0.7rem;
    opacity: 0.75;
}

/* User info */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem 0.25rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Section labels */
.sidebar-section-label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.8rem 1rem 0.4rem;
    color: rgba(148, 163, 184, 0.9);
}

/* Nav links */
.sidebar-nav {
    margin-top: 0.4rem;
    padding-bottom: 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    padding: 0.45rem 0.9rem;
    border-radius: var(--sp-radius-pill);

    color: #E5E7EB;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;

    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.sidebar-link.active {
    background: linear-gradient(90deg,
        var(--sp-color-primary),
        var(--sp-color-secondary));
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.7rem 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.logout-link {
    color: #FCA5A5;
}



/* ======================================
   Cards
====================================== */

.card {
    background: var(--sp-surface);
    border-radius: var(--sp-radius-lg);
    border: 1px solid var(--sp-border-subtle);
    box-shadow: var(--sp-shadow-soft);
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.75rem 1rem;
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Metric-style cards */

/* Hub Pages Custom Grid */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.hub-card {
    background: var(--sp-surface);
    border-radius: var(--sp-radius-lg);
    border: 1px solid var(--sp-border-subtle);
    padding: 1.8rem;
    text-decoration: none;
    color: var(--sp-text-main);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
    border-color: var(--sp-primary-soft);
    color: inherit;
}

.hub-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg,
        var(--sp-color-bg-tint),
        rgba(139, 92, 246, 0.12));
    color: var(--sp-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
}

.hub-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.hub-card-text {
    font-size: 0.85rem;
    color: var(--sp-text-muted);
    line-height: 1.5;
}

.metric-card {
    border-radius: var(--sp-radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    padding: 1rem 1.1rem;
}

.metric-card-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sp-text-muted);
}

.metric-card-value {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.metric-card-sub {
    font-size: 0.75rem;
    color: var(--sp-text-muted);
}

.metric-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* ======================================
   Buttons
====================================== */

.btn {
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--sp-radius-pill);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
}

.btn-primary {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
    border-color: #4338ca;
}

/* ======================================
   Forms
====================================== */

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sp-text-main);
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--sp-primary-soft);
    box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.55);
}

/* ══════════════════════════════════════════════════════
   PREMIUM DATA TABLE  (sp-table-container)
   ══════════════════════════════════════════════════════ */

.sp-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--sp-radius-lg, 14px);
    background: var(--sp-surface, #fff);
}

/* Remove double border when inside a .card */
.card > .card-body > .sp-table-container,
.card > .card-body.p-0 > .sp-table-container {
    border-radius: 0 0 var(--sp-radius-lg, 14px) var(--sp-radius-lg, 14px);
    margin: 0;
}

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

/* ── Header ─────────────────────────────────────────── */
.sp-table-container thead {
    background: #f8fafc;
}

.sp-table-container thead th {
    padding: 0.75rem 1.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

/* First / last cell radii */
.sp-table-container thead tr th:first-child { padding-left: 1.4rem; }
.sp-table-container thead tr th:last-child  { padding-right: 1.4rem; }

/* ── Body rows ───────────────────────────────────────── */
.sp-table-container tbody tr {
    border-bottom: 1px solid var(--sp-border-subtle, #f1f5f9);
    transition: background 0.12s ease, box-shadow 0.12s ease;
    position: relative;
}

.sp-table-container tbody tr:last-child {
    border-bottom: none;
}

.sp-table-container tbody tr:hover {
    background: #f5f7ff;
    box-shadow: inset 3px 0 0 var(--sp-primary, #4f46e5);
}

.sp-table-container td {
    padding: 0.82rem 1.1rem;
    font-size: 0.82rem;
    color: var(--sp-text-main, #1e293b);
    vertical-align: middle;
    white-space: nowrap;
    border: none;
}

.sp-table-container td:first-child { padding-left: 1.4rem; }
.sp-table-container td:last-child  { padding-right: 1.4rem; }

/* ── Cell helpers ────────────────────────────────────── */
/* Primary column (name / title) */
.sp-table-container .sp-col-primary {
    font-weight: 600;
    color: var(--sp-text-main);
}

/* Muted secondary text inside a cell */
.sp-table-container .sp-col-sub {
    font-size: 0.72rem;
    color: var(--sp-text-muted);
    display: block;
    line-height: 1.3;
}

/* ── Action buttons inside table ─────────────────────── */
.sp-table-container .btn-sm {
    font-size: 0.72rem;
    padding: 0.28rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.sp-table-container .btn-outline-secondary {
    border-color: var(--sp-border-subtle, #e2e8f0);
    color: var(--sp-text-muted);
}

.sp-table-container .btn-outline-secondary:hover {
    background: var(--sp-primary, #4f46e5);
    border-color: var(--sp-primary, #4f46e5);
    color: #fff;
}

/* ── Empty state inside table ───────────────────────── */
.sp-table-container .sp-table-empty td {
    padding: 3.5rem 1rem;
    text-align: center;
    color: var(--sp-text-muted);
}

/* ── Dark-mode aware adjustments ────────────────────── */
[data-bs-theme="dark"] .sp-table-container thead {
    background: #0f172a;
}

[data-bs-theme="dark"] .sp-table-container tbody tr:hover {
    background: rgba(79, 70, 229, 0.08);
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .sp-table-container table { min-width: 600px; }
    .sp-table-container td,
    .sp-table-container thead th {
        padding: 0.65rem 0.85rem;
        font-size: 0.78rem;
    }
    .sp-table-container td:first-child,
    .sp-table-container thead tr th:first-child { padding-left: 1rem; }
}

/* ======================================
   Badges & Status Chips
====================================== */

.badge {
    border-radius: 999px;
    padding: 0.25em 0.55em;
    font-size: 0.7rem;
}

.bg-success-subtle {
    background-color: rgba(22, 163, 74, 0.14) !important;
    color: #166534 !important;
}

.bg-danger-subtle {
    background-color: rgba(220, 38, 38, 0.14) !important;
    color: #991b1b !important;
}

.bg-info-subtle {
    background-color: rgba(59, 130, 246, 0.14) !important;
    color: #1d4ed8 !important;
}

/* ======================================
   Animations (Original untouched)
====================================== */

.card.sp-animate-card,
.metric-card.sp-animate-card {
    position: relative;
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transition:
        opacity 0.45s ease-out,
        transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.25s ease-out,
        border-color 0.25s ease-out,
        background-color 0.25s ease-out;
    will-change: opacity, transform;
}

.card.sp-animate-card.sp-animate-visible,
.metric-card.sp-animate-card.sp-animate-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hover effect */
.card.sp-animate-card:hover,
.metric-card.sp-animate-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    border-color: rgba(79, 70, 229, 0.22);
    background-color: var(--sp-surface-soft);
}

/* Header sheen */
.card.sp-animate-card .card-header,
.metric-card.sp-animate-card .card-header {
    background: linear-gradient(
        120deg,
        rgba(79, 70, 229, 0.06),
        rgba(79, 70, 229, 0.00),
        rgba(79, 70, 229, 0.10)
    );
    background-size: 220% 100%;
    animation: sp-card-header-sheen 9s linear infinite;
}

@keyframes sp-card-header-sheen {
    0% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Fade-in for sections */
.swiftpos-content.sp-animate-section {
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.4s ease-out,
        transform 0.4s ease-out;
}

.swiftpos-content.sp-animate-section.sp-animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion fix */
@media (prefers-reduced-motion: reduce) {
    .card.sp-animate-card,
    .metric-card.sp-animate-card,
    .swiftpos-content.sp-animate-section {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ═══════════════════════════════════════════════════
   SWIFTPOS GLOBAL TOAST SYSTEM
   ═══════════════════════════════════════════════════ */
.swiftpos-toast-container {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 360px;
}

.swiftpos-toast {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    animation: toast-in 0.3s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
    cursor: pointer;
    min-width: 280px;
}

.swiftpos-toast .toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.swiftpos-toast .toast-text {
    flex: 1;
    line-height: 1.4;
}

/* Success */
.swiftpos-toast-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-left: 4px solid rgba(255,255,255,0.4);
}

/* Error / danger */
.swiftpos-toast-error,
.swiftpos-toast-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border-left: 4px solid rgba(255,255,255,0.4);
}

/* Warning */
.swiftpos-toast-warning {
    background: linear-gradient(135deg, #f39c12, #f7ca18);
    color: #1a1a1a;
    border-left: 4px solid rgba(0,0,0,0.15);
}
.swiftpos-toast-warning .toast-icon,
.swiftpos-toast-warning .toast-text {
    color: #1a1a1a;
}

/* Info */
.swiftpos-toast-info,
.swiftpos-toast- {
    background: linear-gradient(135deg, #2980b9, #6dd5fa);
    border-left: 4px solid rgba(255,255,255,0.4);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(60px) scale(0.9); }
}

/* ═══════════════════════════════════════════════════
   SWIFTPOS TOP NAVIGATION (Desktop lg+)
   ═══════════════════════════════════════════════════ */
.sp-topnav {
    display: none;
    background: var(--sp-surface, #fff);
    border-bottom: 1px solid var(--sp-border, #e5e7eb);
    padding: 0 1.5rem;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 990;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

@media (min-width: 992px) {
    .sp-topnav {
        display: flex;
        align-items: stretch;
    }
    /* Hide sidebar on desktop when top-nav is active */
    body.sp-topnav-mode #swiftposSidebar {
        display: none !important;
    }
    body.sp-topnav-mode .swiftpos-main {
        margin-left: 0 !important;
    }
}

.sp-topnav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.sp-topnav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 1.1rem;
    color: var(--sp-text-muted, #6b7280);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.18s ease;
    cursor: pointer;
    border-top: none;
    border-left: none;
    border-right: none;
    background: none;
}

.sp-topnav-link:hover,
.sp-topnav-link.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    background: #f3f0ff;
    border-radius: 6px;
}

/* Dropdown panel */
.sp-topnav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 215px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    padding: 0.4rem;
}

.sp-topnav-item:hover .sp-topnav-dropdown,
.sp-topnav-item:focus-within .sp-topnav-dropdown {
    display: block;
    animation: sp-drop-in 0.15s ease;
}

@keyframes sp-drop-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sp-topnav-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.81rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
}

.sp-topnav-dropdown a:hover {
    background: #f3f0ff;
    color: #7c3aed;
}

.sp-topnav-dropdown .sp-nav-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sp-text-muted, #9ca3af);
    padding: 0.6rem 1.2rem 0.2rem;
}

.sp-topnav-dropdown .sp-lock-item {
    opacity: 0.55;
    cursor: not-allowed;
}
.sp-topnav-dropdown .sp-lock-item:hover {
    background: none;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE NAV — Desktop: top-nav only (no sidebar)
                  — Mobile:  sidebar only (no top-nav)
   ═══════════════════════════════════════════════════ */

/* Desktop (lg = 992px+): hide sidebar, show top-nav */
@media (min-width: 992px) {
    #swiftposSidebar {
        display: none !important;
    }
    .swiftpos-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .sp-topnav {
        display: flex !important;
    }
}

/* Mobile (< 992px): hide top-nav, keep sidebar */
@media (max-width: 991.98px) {
    .sp-topnav {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   SWIFTPOS — UNIVERSAL DESIGN SYSTEM UTILITIES
   (additive only — safe to use alongside existing classes)
   ═══════════════════════════════════════════════════════════ */

/* ── Page Header ─────────────────────────────────────────── */
.sp-page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sp-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sp-text-main);
    margin: 0 0 0.15rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sp-page-title i {
    color: var(--sp-primary);
    font-size: 0.95rem;
    opacity: 0.85;
}

.sp-page-subtitle {
    font-size: 0.78rem;
    color: var(--sp-text-muted);
    margin: 0;
    line-height: 1.4;
}

.sp-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    .sp-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .sp-page-actions {
        width: 100%;
    }
}

/* ── Stat / KPI Cards ────────────────────────────────────── */
.sp-stat-card {
    border-radius: var(--sp-radius-lg);
    border: 1px solid var(--sp-border-subtle);
    background: var(--sp-surface);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.sp-stat-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.sp-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sp-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-text-muted);
    margin-bottom: 0.2rem;
}

.sp-stat-value {
    font-size: clamp(1rem, 4vw, 1.65rem);
    font-weight: 700;
    color: var(--sp-text-main);
    line-height: 1.15;
    word-break: break-all;
}

.sp-stat-sub {
    font-size: 0.72rem;
    color: var(--sp-text-muted);
    margin-top: 0.2rem;
}

/* Gradient accent stat card (hero-style) */
.sp-stat-card-accent {
    background: linear-gradient(135deg, #5b2d8b 0%, #4338ca 60%, #3b82f6 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(91, 45, 139, 0.3);
}

.sp-stat-card-accent .sp-stat-label,
.sp-stat-card-accent .sp-stat-sub {
    color: rgba(255, 255, 255, 0.72);
}

.sp-stat-card-accent .sp-stat-value {
    color: #fff;
}

/* ── Filter Bar ──────────────────────────────────────────── */
.sp-filter-bar {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border-subtle);
    border-radius: var(--sp-radius-md);
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* ── Empty State ─────────────────────────────────────────── */
.sp-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sp-text-muted);
}

.sp-empty-state-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--sp-surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--sp-text-muted);
    opacity: 0.45;
    margin-bottom: 1rem;
}

.sp-empty-state-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sp-text-main);
    margin-bottom: 0.3rem;
}

.sp-empty-state-text {
    font-size: 0.8rem;
    color: var(--sp-text-muted);
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Hover Lift (replace local .hover-lift) ──────────────── */
.sp-hover-lift {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1) !important;
}

/* ── Consistent Badge Set ────────────────────────────────── */
.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2em 0.55em;
    border-radius: 50px;
    line-height: 1.4;
}

.sp-badge-success { background: #dcfce7; color: #16a34a; }
.sp-badge-danger  { background: #fee2e2; color: #dc2626; }
.sp-badge-warning { background: #fef3c7; color: #d97706; }
.sp-badge-info    { background: #dbeafe; color: #2563eb; }
.sp-badge-neutral { background: #f1f5f9; color: #64748b; }
.sp-badge-purple  { background: #f3f0ff; color: #7c3aed; }

/* ── Section Card (replaces card + shadow-sm pattern) ───── */
.sp-section-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border-subtle);
    border-radius: var(--sp-radius-lg);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
}

.sp-section-card > .sp-section-header {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--sp-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sp-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sp-text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.sp-section-title i {
    color: var(--sp-primary);
    font-size: 0.8rem;
}

/* ── Pagination (consistent across all pages) ───────────── */
.sp-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--sp-border-subtle);
    font-size: 0.78rem;
    color: var(--sp-text-muted);
}

.sp-pagination .pagination {
    margin: 0;
}

.sp-pagination .pagination .page-link {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px !important;
    margin: 0 1px;
    color: var(--sp-text-main);
}

.sp-pagination .pagination .page-item.active .page-link {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
    color: #fff;
}

/* ── Utility: min-width-0 for flex children ─────────────── */
.min-w-0 { min-width: 0; }

/* ── Responsive utility additions ───────────────────────── */
@media (max-width: 575.98px) {
    .sp-stat-value {
        font-size: 1.1rem;
    }
    .sp-page-title {
        font-size: 0.95rem;
    }
}

/* ══════════════════════════════════════════════════════
   FINAL POLISH — TABLE & CARD NORMALIZATION
   ══════════════════════════════════════════════════════ */

/* Normalize Bootstrap's thead variants inside our container */
.sp-table-container thead.table-dark,
.sp-table-container thead.table-light {
    background: #f8fafc !important;
    --bs-table-bg: #f8fafc !important;
    --bs-table-color: #64748b !important;
}

.sp-table-container thead.table-dark th,
.sp-table-container thead.table-light th {
    color: #64748b !important;
    border-color: #e2e8f0 !important;
    background: transparent !important;
}

/* Cards that wrap tables — cleaner, no heavy shadow */
.card {
    border-radius: var(--sp-radius-lg, 14px);
    border: 1px solid var(--sp-border-subtle, #e8ecf0);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Make the outer page wrapper zero-padded so tables reach the edge */
.container-fluid.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ── Two-line cell helper ──────────────────────────────── */
.sp-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sp-cell-stack .sp-cell-title {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--sp-text-main);
    line-height: 1.3;
}

.sp-cell-stack .sp-cell-sub {
    font-size: 0.7rem;
    color: var(--sp-text-muted);
    line-height: 1.3;
}

/* ── Page header polish ───────────────────────────────── */
.sp-page-header {
    padding: 0.2rem 0 1rem;
}

.sp-page-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--sp-text-main);
}

.sp-page-subtitle {
    font-size: 0.77rem;
    color: var(--sp-text-muted);
    margin-top: 0.1rem;
}

/* ── Pill action buttons (header area) ───────────────── */
.sp-page-actions .btn {
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.42rem 1rem;
}

/* ── Stat card border-left accent variants ───────────── */
.sp-stat-card.sp-accent-green  { border-left: 3px solid #22c55e; }
.sp-stat-card.sp-accent-red    { border-left: 3px solid #ef4444; }
.sp-stat-card.sp-accent-blue   { border-left: 3px solid #3b82f6; }
.sp-stat-card.sp-accent-purple { border-left: 3px solid #7c3aed; }
.sp-stat-card.sp-accent-orange { border-left: 3px solid #f97316; }
