/* ============================================================
   StockPOS — Premium Design System
   A modern, dark-themed POS interface with glassmorphism,
   gradients, and micro-animations.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Custom Properties (Theme Tokens) ────────────────── */
:root {
    /* — Primary Palette — */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* — Accent (Cyan) — */
    --accent-50: #ecfeff;
    --accent-100: #cffafe;
    --accent-200: #a5f3fc;
    --accent-300: #67e8f9;
    --accent-400: #22d3ee;
    --accent-500: #06b6d4;
    --accent-600: #0891b2;
    --accent-700: #0e7490;

    /* — Success — */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;

    /* — Warning — */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    /* — Danger — */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* — Neutral (Dark Theme) — */
    --dark-950: #020617;
    --dark-900: #0f172a;
    --dark-800: #1e293b;
    --dark-700: #334155;
    --dark-600: #475569;
    --dark-500: #64748b;
    --dark-400: #94a3b8;
    --dark-300: #cbd5e1;
    --dark-200: #e2e8f0;
    --dark-100: #f1f5f9;
    --dark-50: #f8fafc;

    /* — Semantic Tokens — */
    --bg-body: var(--dark-950);
    --bg-sidebar: rgba(15, 23, 42, 0.85);
    --bg-card: var(--dark-800);
    --bg-card-hover: var(--dark-700);
    --bg-input: var(--dark-900);
    --bg-input-focus: var(--dark-800);
    --bg-modal-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: var(--dark-50);
    --text-secondary: var(--dark-400);
    --text-muted: var(--dark-500);
    --text-inverse: var(--dark-900);

    --border-color: var(--dark-700);
    --border-color-light: var(--dark-600);

    /* — Gradients — */
    --gradient-primary: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    --gradient-primary-hover: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    --gradient-dark: linear-gradient(180deg, var(--dark-900), var(--dark-950));
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    --gradient-sidebar: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));

    /* — Shadows — */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-accent: 0 0 20px rgba(6, 182, 212, 0.15);

    /* — Glass — */
    --glass-bg: rgba(30, 41, 59, 0.5);
    --glass-border: rgba(148, 163, 184, 0.1);
    --glass-blur: 12px;

    /* — Spacing — */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* — Typography — */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* — Transitions — */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* — Z-Index — */
    --z-sidebar: 100;
    --z-topbar: 90;
    --z-dropdown: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-tooltip: 500;

    /* — Legacy / Alias CSS Variables for Older Views — */
    --bg-color-alt: rgba(255, 255, 255, 0.03);
    --text-color: var(--text-primary);
    --primary-color: var(--primary-500);
    --danger: var(--danger-500);
    --success: var(--success-500);
    --warning: var(--warning-500);
    --text-muted: var(--dark-500);
}


/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--primary-300);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--primary-500);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--dark-900);
}
::-webkit-scrollbar-thumb {
    background: var(--dark-600);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--dark-500);
}


/* ── App Layout ──────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-base);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-area,
.page-content {
    flex: 1;
    padding: 28px 32px;
    margin-top: var(--topbar-height);
}


/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg,
        rgba(9, 11, 28, 0.98) 0%,
        rgba(6, 8, 22, 1) 100%);
    border-right: 1px solid rgba(99, 102, 241, 0.12);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(99, 102, 241, 0.3) 30%,
        rgba(6, 182, 212, 0.2) 70%,
        transparent 100%);
    pointer-events: none;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* ── Sidebar Brand ── */
.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    gap: 12px;
    min-height: var(--topbar-height);
    position: relative;
    flex-shrink: 0;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(99, 102, 241, 0.3),
        transparent);
}

.sidebar-brand-logo {
    width: 38px;
    height: 38px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4),
                0 4px 12px rgba(0,0,0,0.3);
    position: relative;
}

.sidebar-brand-logo::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 11px;
    background: var(--gradient-primary);
    opacity: 0.3;
    filter: blur(6px);
    z-index: -1;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar-brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #e0e7ff, var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-brand-subtitle {
    font-size: 10px;
    font-weight: 500;
    color: var(--dark-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    margin-top: 1px;
}

.sidebar-collapsed .sidebar-brand-text {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-toggle {
    position: absolute;
    right: -14px;
    top: 25px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-800);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--dark-400);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 100;
}

.sidebar-toggle:hover {
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* ── Sidebar Nav ── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.2);
    border-radius: 4px;
}

/* ── Nav Sections ── */
.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dark-600);
    padding: 16px 10px 6px;
    white-space: nowrap;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.nav-section-title::before {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.04);
    display: none;
}

.nav-section-title:first-child {
    padding-top: 4px;
}

.sidebar-collapsed .nav-section-title {
    padding: 12px 0 4px;
    justify-content: center;
    color: transparent;
    font-size: 0;
    letter-spacing: 0;
}

.sidebar-collapsed .nav-section-title::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0 auto;
}

/* ── Nav Items ── */
.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: 10px;
    color: var(--dark-400);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--dark-100);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

/* Active nav link */
.nav-link.active {
    color: white;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.2),
        rgba(6, 182, 212, 0.1));
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.nav-link.active .nav-icon-wrap {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.nav-link.active .nav-link-text {
    color: white;
    font-weight: 600;
}

/* Nav icon wrapper */
.nav-icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    font-size: 13px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    color: var(--dark-500);
}

.nav-link:hover .nav-icon-wrap {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-300);
}

.nav-link-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--transition-fast);
    color: var(--dark-400);
}

.sidebar-collapsed .nav-link-text {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.nav-link .badge {
    margin-left: auto;
    flex-shrink: 0;
    transition: opacity var(--transition-fast);
}

.sidebar-collapsed .nav-link .badge {
    opacity: 0;
    pointer-events: none;
}

/* Tooltip for collapsed state */
.sidebar-collapsed .nav-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-800);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.sidebar-collapsed .nav-link:hover::after {
    opacity: 1;
}

/* ── Sidebar Footer / User ── */
.sidebar-footer {
    padding: 12px 10px;
    flex-shrink: 0;
    position: relative;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(99, 102, 241, 0.2),
        transparent);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 1px solid transparent;
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

.sidebar-user-name {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--dark-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sidebar-user-role {
    display: block;
    font-size: 10px;
    color: var(--dark-500);
    white-space: nowrap;
    letter-spacing: 0.02em;
    margin-top: 1px;
}

.sidebar-collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}


/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: rgba(6, 8, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    z-index: var(--z-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    transition: left var(--transition-base);
}

.sidebar-collapsed .topbar {
    left: var(--sidebar-collapsed-width);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: var(--dark-400);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-toggle:hover {
    color: var(--primary-300);
    border-color: rgba(99, 102, 241, 0.3);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: var(--dark-500);
    transition: color var(--transition-fast);
}

.breadcrumb-item a {
    color: var(--dark-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-400);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--dark-700);
    font-size: 9px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-item {
    position: relative;
}

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-full);
    color: var(--dark-300);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.topbar-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--primary-300);
}

.topbar-btn-text {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    color: var(--dark-400);
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.topbar-icon-btn:hover {
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.topbar-icon-btn .notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger-500);
    border-radius: var(--radius-full);
    border: 1.5px solid rgba(6, 8, 22, 0.9);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

.topbar-icon-btn .notification-count {
    position: absolute;
    top: 2px;
    right: 0px;
    min-width: 18px;
    height: 18px;
    background: var(--danger-500);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(6, 8, 22, 0.9);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.topbar-user:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.topbar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    color: white;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.topbar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--dark-200);
}


/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 2px;
}

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

.page-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}


/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}


/* ── Stats Cards (Dashboard) ─────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-info h3 {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.stat-change.positive {
    color: var(--success-400);
    background: rgba(34, 197, 94, 0.1);
}

.stat-change.negative {
    color: var(--danger-400);
    background: rgba(239, 68, 68, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
}

.stat-icon.accent {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-400);
}

.stat-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-400);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
}


/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-secondary {
    background: var(--dark-700);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--dark-600);
    border-color: var(--border-color-light);
    color: var(--text-primary);
}

.btn-success {
    background: var(--success-600);
    color: white;
}

.btn-success:hover {
    background: var(--success-500);
    color: white;
}

.btn-warning {
    background: var(--warning-600);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-500);
    color: white;
}

.btn-danger {
    background: var(--danger-600);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-500);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary-400);
    border: 1px solid var(--primary-500);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-300);
}

.btn-sm {
    padding: 6px 14px;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-size-md);
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
    padding: 6px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}


/* ── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger-400);
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control::placeholder {
    color: var(--dark-500);
}

.form-control.error {
    border-color: var(--danger-500);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-text {
    font-size: var(--font-size-xs);
    color: var(--dark-500);
    margin-top: 4px;
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--danger-400);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group-append {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--dark-700);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
}

.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.form-switch-slider {
    width: 44px;
    height: 24px;
    background: var(--dark-600);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-fast);
}

.form-switch-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: white;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
}

.form-switch input:checked + .form-switch-slider {
    background: var(--primary-500);
}

.form-switch input:checked + .form-switch-slider::after {
    transform: translateX(20px);
}


/* ── Tables ──────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table thead {
    background: rgba(15, 23, 42, 0.5);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}

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

.table .actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}


/* ── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-400);
}

.badge-accent {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-400);
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-400);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-400);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
}

.badge-dark {
    background: var(--dark-700);
    color: var(--dark-300);
}

.pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
    50% { opacity: 0.85; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}


/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn var(--transition-fast) ease-out;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--dark-800);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp var(--transition-base) ease-out;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--dark-400);
    font-size: var(--font-size-lg);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-400);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}


/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: var(--dark-800);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    animation: slideInRight var(--transition-base) ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast-success::before { background: var(--success-500); }
.toast-error::before { background: var(--danger-500); }
.toast-warning::before { background: var(--warning-500); }
.toast-info::before { background: var(--primary-500); }

.toast-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { color: var(--success-400); }
.toast-error .toast-icon { color: var(--danger-400); }
.toast-warning .toast-icon { color: var(--warning-400); }
.toast-info .toast-icon { color: var(--primary-400); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--dark-500);
    cursor: pointer;
    padding: 4px;
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-500);
    animation: toastProgress 4s linear forwards;
}


/* ── Dropdown ────────────────────────────────────────────── */
.dropdown {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--dark-800);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    z-index: var(--z-dropdown);
    display: none;
    animation: fadeInDown var(--transition-fast) ease-out;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: var(--font-size-base);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 0;
}

.dropdown-item.danger {
    color: var(--danger-400);
}
.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
}


/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination li a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-400);
}

.pagination li.active span {
    background: var(--gradient-primary);
    color: white;
}

.pagination li.disabled span {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 10px;
}


/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    border: 1px solid transparent;
    margin-bottom: 20px;
    animation: fadeIn var(--transition-fast) ease-out;
}

.alert-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-dismiss {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: var(--font-size-lg);
    padding: 4px;
    transition: opacity var(--transition-fast);
}

.alert-dismiss:hover {
    opacity: 1;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--success-400);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-400);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-400);
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--primary-400);
}


/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--primary-400);
    border-bottom-color: var(--primary-500);
}

.tab-content {
    display: none;
}

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


/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ── Loading & Skeleton ──────────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--dark-700);
    border-top-color: var(--primary-500);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

.skeleton {
    background: linear-gradient(90deg, var(--dark-700) 25%, var(--dark-600) 50%, var(--dark-700) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 22px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.page-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--dark-700);
    border-top-color: var(--primary-500);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.page-loader-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}


/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: var(--radius-xl);
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-400);
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}


/* ── POS Terminal ────────────────────────────────────────── */
.pos-wrapper {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 0;
    height: calc(100vh - var(--topbar-height));
    margin: calc(-1 * 24px);
    margin-top: calc(-1 * 24px);
}

.pos-products {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    overflow: hidden;
}

.pos-products-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pos-search {
    flex: 1;
    position: relative;
}

.pos-search input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.pos-search input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.pos-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-500);
}

.pos-scan-btn {
    padding: 12px 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-scan-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.pos-categories {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pos-categories::-webkit-scrollbar {
    height: 3px;
}

.pos-category-btn {
    padding: 8px 16px;
    background: var(--dark-700);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-family);
}

.pos-category-btn:hover,
.pos-category-btn.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.pos-products-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    align-content: start;
}

.pos-product-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    position: relative;
}

.pos-product-card:hover {
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.pos-product-card.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
}

.pos-product-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    border-radius: var(--radius-md);
    background: var(--dark-700);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pos-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-product-image i {
    font-size: 24px;
    color: var(--dark-500);
}

.pos-product-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-product-price {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--primary-400);
}

.pos-product-stock {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

.pos-product-promo {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-500);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* ── POS Cart ────────────────────────────────────────────── */
.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--dark-900);
    height: 100%;
}

.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pos-cart-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-cart-count {
    background: var(--primary-500);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
}

.pos-cart-customer {
    padding: 12px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    animation: fadeIn var(--transition-fast) ease-out;
}

.pos-cart-item:last-child {
    border-bottom: none;
}

.pos-cart-item-info {
    flex: 1;
    min-width: 0;
}

.pos-cart-item-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-cart-item-price {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.pos-cart-item-promo {
    font-size: var(--font-size-xs);
    color: var(--success-400);
}

.pos-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos-cart-item-qty button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-700);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.pos-cart-item-qty button:hover {
    background: var(--dark-600);
    border-color: var(--primary-500);
}

.pos-cart-item-qty span {
    width: 32px;
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.pos-cart-item-total {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary-400);
    min-width: 70px;
    text-align: right;
}

.pos-cart-item-remove {
    background: none;
    border: none;
    color: var(--dark-500);
    cursor: pointer;
    padding: 4px;
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.pos-cart-item-remove:hover {
    color: var(--danger-400);
}

.pos-cart-summary {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    flex-shrink: 0;
}

.pos-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.pos-cart-summary-row.total {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 0 4px;
    border-top: 1px solid var(--glass-border);
    margin-top: 8px;
}

.pos-cart-summary-row .discount-label {
    color: var(--success-400);
}

.pos-cart-summary-row .tax-label {
    color: var(--warning-400);
}

.pos-cart-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.pos-pay-btn {
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-md);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pos-pay-btn:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.pos-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pos-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


/* ── Receipt Print Styles ────────────────────────────────── */
.receipt {
    max-width: 320px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px dashed #000;
    padding-bottom: 12px;
}

.receipt-logo {
    max-height: 48px;
    margin-bottom: 8px;
}

.receipt-company {
    font-size: 16px;
    font-weight: bold;
}

.receipt-items {
    margin-bottom: 12px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.receipt-totals {
    border-top: 1px dashed #000;
    padding-top: 8px;
    margin-bottom: 12px;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.receipt-grand-total {
    font-size: 16px;
    font-weight: bold;
    border-top: 2px solid #000;
    padding-top: 8px;
}

.receipt-footer {
    text-align: center;
    border-top: 1px dashed #000;
    padding-top: 12px;
    font-size: 11px;
}

@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
}


/* ── Grid System ─────────────────────────────────────────── */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.col { flex: 1; min-width: 0; }
.col-auto { flex: 0 0 auto; }
.col-1 { flex: 0 0 calc(8.333% - 20px); }
.col-2 { flex: 0 0 calc(16.666% - 20px); }
.col-3 { flex: 0 0 calc(25% - 20px); }
.col-4 { flex: 0 0 calc(33.333% - 20px); }
.col-5 { flex: 0 0 calc(41.666% - 20px); }
.col-6 { flex: 0 0 calc(50% - 15px); }
.col-7 { flex: 0 0 calc(58.333% - 20px); }
.col-8 { flex: 0 0 calc(66.666% - 20px); }
.col-9 { flex: 0 0 calc(75% - 20px); }
.col-10 { flex: 0 0 calc(83.333% - 20px); }
.col-11 { flex: 0 0 calc(91.666% - 20px); }
.col-12 { flex: 0 0 100%; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }


/* ── Utility Classes ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: var(--primary-400); }
.text-accent { color: var(--accent-400); }
.text-success { color: var(--success-400); }
.text-warning { color: var(--warning-400); }
.text-danger { color: var(--danger-400); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-bold { font-weight: 700; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.cursor-pointer { cursor: pointer; }
.no-select { user-select: none; }


/* ── Login Page ──────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1), transparent 70%);
    bottom: -200px;
    left: -200px;
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s ease-out;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: var(--font-size-2xl);
    color: white;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow);
}

.auth-logo-icon img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
}

.auth-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

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

.auth-form .form-control {
    padding: 12px 14px;
}

.auth-form .btn {
    padding: 12px 24px;
    font-size: var(--font-size-base);
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}


/* ── Data Filter Bar ─────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
}

.filter-bar .search-input {
    min-width: 260px;
    position: relative;
}

.filter-bar .search-input input {
    padding-left: 36px;
}

.filter-bar .search-input i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-500);
}


/* ── Color Picker (Settings) ─────────────────────────────── */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: none;
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}


/* ── Chart Container ─────────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    padding: 16px;
}

.chart-container canvas {
    max-height: 350px;
}


/* ── Status Indicators ───────────────────────────────────── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-dot.active { background: var(--success-400); }
.status-dot.inactive { background: var(--dark-500); }
.status-dot.pending { background: var(--warning-400); }
.status-dot.danger { background: var(--danger-400); }

.stock-level {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-bar {
    flex: 1;
    height: 6px;
    background: var(--dark-700);
    border-radius: var(--radius-full);
    overflow: hidden;
    max-width: 100px;
}

.stock-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.stock-bar-fill.high { background: var(--success-400); }
.stock-bar-fill.medium { background: var(--warning-400); }
.stock-bar-fill.low { background: var(--danger-400); }


/* ── Promotion Card ──────────────────────────────────────── */
.promo-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.promo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.promo-card.active::before {
    background: var(--success-500);
}

.promo-card.scheduled::before {
    background: var(--warning-500);
}

.promo-card.expired::before {
    background: var(--dark-600);
}

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

.promo-dates {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}


/* ── Confirm Dialog ──────────────────────────────────────── */
.confirm-dialog {
    text-align: center;
    padding: 16px 0;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.confirm-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-400);
}

.confirm-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-400);
}

.confirm-message {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 24px;
}


/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .pos-wrapper {
        grid-template-columns: 1fr 360px;
    }
}

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

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

    .main-content {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }

    .pos-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }

    .pos-cart {
        height: auto;
        max-height: 50vh;
    }

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

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

@media (max-width: 768px) {
    .content-area,
    .page-content {
        padding: 16px;
    }

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

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

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control,
    .filter-bar .search-input {
        min-width: 100%;
    }

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

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }

    .col-4, .col-6, .col-8 {
        flex: 0 0 100%;
    }

    /* Mobile sidebar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base), width var(--transition-base);
    }

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

    .main-content {
        margin-left: 0 !important;
    }

    .topbar {
        left: 0 !important;
        padding: 0 16px;
    }

    .mobile-toggle {
        display: flex;
    }

    .topbar-btn-text,
    .topbar-user-name {
        display: none;
    }

    .modal {
        max-width: 100%;
        margin: 12px;
    }
}


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

    .auth-card {
        padding: 28px 20px;
    }

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

    .table {
        font-size: var(--font-size-xs);
    }

    .table th, .table td {
        padding: 10px 12px;
    }
}


/* ── Thermal Print Override ──────────────────────────────── */
@media print {
    .sidebar, .topbar, .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-area {
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12px !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
    }

    .receipt {
        width: 80mm !important;
        max-width: 80mm !important;
        padding: 2mm !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
}


/* ── File Upload / Image Preview ─────────────────────────── */
.file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.file-upload:hover {
    border-color: var(--primary-500);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 32px;
    color: var(--dark-500);
    margin-bottom: 12px;
}

.file-upload-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.file-upload-text strong {
    color: var(--primary-400);
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--danger-500);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ── Barcode Display ─────────────────────────────────────── */
.barcode-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
}

.barcode-container img {
    max-width: 200px;
}

.barcode-text {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: #000;
    font-weight: 600;
}


/* ── Tooltip ─────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: var(--dark-700);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
}


/* ── Progress Bar ────────────────────────────────────────── */
.progress {
    width: 100%;
    height: 8px;
    background: var(--dark-700);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.success { background: var(--success-500); }
.progress-bar.warning { background: var(--warning-500); }
.progress-bar.danger { background: var(--danger-500); }


/* ── Date/Time Picker Enhancements ───────────────────────── */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}


/* ── Accounting Specific ─────────────────────────────────── */
.account-tree {
    padding-left: 0;
    list-style: none;
}

.account-tree li {
    padding: 8px 0;
}

.account-tree ul {
    padding-left: 24px;
    list-style: none;
    border-left: 1px solid var(--glass-border);
    margin-left: 8px;
}

.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.account-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.account-code {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    color: var(--primary-400);
    margin-right: 12px;
}

.account-name {
    flex: 1;
    font-size: var(--font-size-sm);
}

.account-balance {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.debit { color: var(--danger-400); }
.credit { color: var(--success-400); }

/* -- UI Fixes (Icons & Outlines) --------------------------- */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

.input-icon-wrapper {
    position: relative;
    width: 100%;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 45px !important;
    padding-right: 45px !important;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
}

.password-toggle:hover {
    color: var(--primary-400);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: var(--font-size-xs);
    color: var(--dark-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .user-info {
    display: none;
}

/* Breadcrumb items */
.breadcrumb-item {
    color: var(--dark-400);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.breadcrumb-item:hover {
    color: var(--primary-400);
}
.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}
.breadcrumb-separator {
    color: var(--dark-600);
    font-size: 9px;
}

/* KPI Cards (Dashboard) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.kpi-gradient-1 { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.kpi-gradient-2 { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.kpi-gradient-3 { background: linear-gradient(135deg, #059669, #10b981); }
.kpi-gradient-4 { background: linear-gradient(135deg, #d97706, #f59e0b); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.kpi-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.kpi-label {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-sparkline {
    color: rgba(255,255,255,0.5);
    font-size: 20px;
}

/* Dashboard grids */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Card chart height */
.card-chart .card-body {
    position: relative;
    min-height: 300px;
}

/* Quick stats list */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Card action link */
.card-action {
    font-size: var(--font-size-xs);
    color: var(--primary-400);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.card-action:hover {
    color: var(--primary-300);
}

/* Empty state small */
.empty-state-sm {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
}
.empty-state-sm i {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.3;
}
.empty-state-sm p {
    font-size: var(--font-size-sm);
    margin: 0;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Status badge helper (used in status_badge() helper) */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}
.status-active   { background: rgba(34, 197, 94, 0.15); color: var(--success-400); }
.status-inactive { background: var(--dark-700); color: var(--dark-400); }
.status-pending  { background: rgba(245, 158, 11, 0.15); color: var(--warning-400); }
.status-blocked  { background: rgba(239, 68, 68, 0.15); color: var(--danger-400); }

/* List group (used in roles view) */
.list-group {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.list-group-item {
    display: block;
    padding: 12px 16px;
    background: var(--dark-800);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}
.list-group-item:last-child {
    border-bottom: none;
}
.list-group-item:hover {
    background: rgba(99, 102, 241, 0.06);
    color: var(--text-primary);
}
.list-group-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-400);
    border-left: 3px solid var(--primary-500);
}

/* Inventory rows highlight */
.table tbody tr.row-highlight {
    background: var(--bg-color-alt);
    font-weight: 600;
}

/* Receipt styling */
.receipt-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

/* Print receipt page */
.receipt {
    background: white;
    color: #000;
    padding: 20px;
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
}

/* Filter form bar */
.filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* Checkbox label custom style */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

/* Permission module block (roles view) */
.permission-module {
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--glass-border);
}

/* Inline SVG barcode display */
.barcode-svg-wrapper {
    background: white;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: inline-block;
    text-align: center;
    max-width: 100%;
}
.barcode-svg-wrapper svg {
    max-width: 100%;
    height: auto;
    display: block;
}
.barcode-code-label {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    margin-top: 6px;
    letter-spacing: 0.1em;
}

/* Row/col layout utilities (used in product create) */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.col {
    flex: 1;
    min-width: 0;
}

/* ── Dropdown Menus ──────────────────────────────────────── */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: rgba(15, 18, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5),
                0 0 0 1px rgba(255,255,255,0.03);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--z-dropdown);
    animation: dropdownOpen 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

@keyframes dropdownOpen {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 9px 16px;
    color: var(--dark-300);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--dark-500);
    transition: color var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dropdown-item:hover i {
    color: var(--primary-400);
}

.dropdown-item.text-danger {
    color: var(--danger-400);
}

.dropdown-item.text-danger i {
    color: var(--danger-500);
}

.dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger-300);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 4px 0;
}

.dropdown-user-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-user-info strong {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.dropdown-user-info small {
    color: var(--dark-500);
    font-size: var(--font-size-xs);
}

.dropdown-notifications {
    width: 320px;
}

.dropdown-notifications .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-notifications .dropdown-header a.mark-read {
    font-size: var(--font-size-xs);
    color: var(--primary-400);
    font-weight: 500;
}

.dropdown-notifications .dropdown-header a.mark-read:hover {
    color: var(--primary-300);
}

.dropdown-notifications .dropdown-body {
    max-height: 280px;
    overflow-y: auto;
}

/* ── Modal Overlay & Box ─────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.modal-overlay.show .modal-box {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ── Utility Classes ─────────────────────────────────────── */
.mb-0 { margin-bottom: 0px !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }

.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }

.mr-1 { margin-right: 4px !important; }
.mr-2 { margin-right: 8px !important; }

.ml-1 { margin-left: 4px !important; }
.ml-2 { margin-left: 8px !important; }

.p-0 { padding: 0px !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-mono { font-family: 'Courier New', Courier, monospace !important; }

.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-400); }
.badge-secondary { background: var(--dark-700); color: var(--dark-300); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success-400); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-400); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-400); }

.btn-group {
    display: inline-flex;
    gap: 8px;
}

.page-content {
    padding: 24px;
}

.card-body-table {
    padding: 0 !important;
}

.card-body-table .table {
    margin-bottom: 0;
    border: none;
}

.stat-icon-primary { background: rgba(99, 102, 241, 0.15) !important; color: var(--primary-400) !important; }
.stat-icon-success { background: rgba(34, 197, 94, 0.15) !important; color: var(--success-400) !important; }
.stat-icon-warning { background: rgba(245, 158, 11, 0.15) !important; color: var(--warning-400) !important; }
.stat-icon-danger { background: rgba(239, 68, 68, 0.15) !important; color: var(--danger-400) !important; }

/* ── Topbar Buttons & Swapper ────────────────────────────── */
.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--dark-800);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.topbar-btn:hover {
    background: var(--dark-700);
    border-color: var(--border-color-light);
}

.topbar-btn-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
    margin-top: auto;
    padding: 14px 32px;
    background: rgba(6, 8, 22, 0.6);
    border-top: 1px solid rgba(99, 102, 241, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    color: var(--dark-600);
    letter-spacing: 0.02em;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dark-600);
}

.footer-badge {
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-400);
    letter-spacing: 0.04em;
}

/* ── Info & Summary Lists ────────────────────────────────── */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}
