/* ============================================================
   OnePOS — Modern UI v2
   Responsive, Mobile-Friendly, Dark Mode Ready
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,100..700;1,100..700&display=swap');

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-subtle: #eef2ff;
    --secondary: #8b5cf6;
    --secondary-subtle: #f5f3ff;
    --success: #10b981;
    --success-subtle: #d1fae5;
    --warning: #f59e0b;
    --warning-subtle: #fef3c7;
    --danger: #ef4444;
    --danger-subtle: #fee2e2;
    --info: #3b82f6;
    --info-subtle: #dbeafe;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-2: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --sidebar-bg: #1e1b4b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --sidebar-text: rgba(255, 255, 255, 0.88);
    --sidebar-text-muted: rgba(255, 255, 255, 0.42);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(255, 255, 255, 0.14);
    --sidebar-active-border: #a5b4fc;
    --topbar-height: 64px;
    --topbar-bg: rgba(255, 255, 255, 0.82);
    --content-padding: 28px;
    --content-padding-mobile: 16px;
    --mobile-nav-height: 64px;
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -2px rgba(0, 0, 0, .04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .08), 0 4px 6px -4px rgba(0, 0, 0, .04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, .10), 0 8px 10px -6px rgba(0, 0, 0, .04);
    --shadow-primary: 0 4px 14px rgba(99, 102, 241, .35);
    --timing: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --timing-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --z-sidebar: 100;
    --z-topbar: 90;
    --z-overlay: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-mobile-nav: 150;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #162032;
    --border: #334155;
    --border-2: #475569;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --topbar-bg: rgba(15, 23, 42, 0.88);
    --sidebar-bg: #020617;
    --primary-subtle: rgba(99, 102, 241, .16);
    --secondary-subtle: rgba(139, 92, 246, .14);
    --success-subtle: rgba(16, 185, 129, .14);
    --warning-subtle: rgba(245, 158, 11, .13);
    --danger-subtle: rgba(239, 68, 68, .14);
    --info-subtle: rgba(59, 130, 246, .14);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .4), 0 2px 4px -2px rgba(0, 0, 0, .25);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .45), 0 4px 6px -4px rgba(0, 0, 0, .3);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Kantumruy Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

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

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-700);
}

/* ============================================================
   3. LAYOUT SHELL
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(175deg, #1c1a4e 0%, #131040 45%, #0b0d30 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.045);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: width var(--timing), transform var(--timing);
    overflow: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    transition: opacity var(--timing);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

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

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

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

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .sidebar-footer .nav-text {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

/* ============================================================
   4. SIDEBAR BRAND
   ============================================================ */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    min-height: 70px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer beam behind brand */
.sidebar-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 80% at 20% 50%, rgba(129, 140, 248, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 18px rgba(129, 140, 248, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
    z-index: 1;
    position: relative;
}

.sidebar-title {
    font-weight: 700;
    font-size: 14.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--timing), width var(--timing);
    letter-spacing: -0.01em;
    z-index: 1;
    position: relative;
}

/* ============================================================
   5. SIDEBAR NAV
   ============================================================ */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* ─── Section Container ─── */
.nav-section {
    margin-bottom: 2px;
    position: relative;
}

/* Separator divider between top items and collapsible groups */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 6px 4px 8px;
    border-radius: 1px;
}

/* AI nav item special styling */
.nav-item-ai {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.18);
}

.nav-item-ai:hover {
    background: rgba(124, 58, 237, 0.2) !important;
    border-color: rgba(167, 139, 250, 0.3);
}

.nav-item-ai .nav-icon {
    color: #a78bfa;
}

.nav-item-ai .nav-text {
    color: #c4b5fd;
    font-weight: 600;
}

.nav-item-ai.active {
    border-color: rgba(167, 139, 250, 0.4);
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    padding: 10px 10px 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--timing), height var(--timing), padding var(--timing);
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    height: 0;
    padding: 0;
    pointer-events: none;
}

/* ─── Nav Item ─── */
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: background var(--timing), color var(--timing), transform 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    min-height: 40px;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.nav-item:hover .nav-icon {
    color: #fff;
}

/* Gradient pill active state */
.nav-item.active {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.22) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* Left accent bar — glowing */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(to bottom, #a5b4fc, #818cf8);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 10px rgba(165, 180, 252, 0.75);
}

/* Active icon glow */
.nav-item.active .nav-icon {
    color: #c7d2fe;
    filter: drop-shadow(0 0 4px rgba(165, 180, 252, 0.6));
}

/* Items inside a collapsible body — slight left indent */
.nav-section-body .nav-item {
    padding-left: 14px;
}

/* ─── Collapsed / Icon-only sidebar ─── */
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.sidebar.collapsed .nav-item.active {
    background: rgba(165, 180, 252, 0.18);
}

.sidebar.collapsed .nav-item.active::before {
    top: 8px;
    bottom: 8px;
}

/* Tooltip on collapsed hover */
.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: #14123a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Hide icon wraps in collapsed state */
.sidebar.collapsed .nav-section-icon-wrap {
    display: none;
}

/* ─── Icon ─── */
.nav-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    transition: transform var(--timing), color var(--timing), filter var(--timing);
    color: rgba(255, 255, 255, 0.6);
}

.nav-item:hover .nav-icon {
    transform: scale(1.13);
}

/* ─── Text / Badge ─── */
.nav-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity var(--timing), width var(--timing);
    letter-spacing: 0.01em;
}

.nav-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.nav-arrow {
    font-size: 11px;
    color: var(--sidebar-text-muted);
    transition: transform var(--timing);
    flex-shrink: 0;
}

.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--timing-slow);
}

.nav-submenu.open {
    max-height: 500px;
}

.nav-submenu .nav-item {
    padding-left: 38px;
    font-size: 13px;
}

/* ============================================================
   COLLAPSIBLE NAV SECTIONS
   ============================================================ */

/* ─── Toggle Header (clickable section label row) ─── */
.nav-label-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 6px 8px 5px;
    border-radius: var(--radius-sm);
    gap: 4px;
    overflow: visible;
    white-space: normal;
    margin-top: 4px;
    transition: background var(--timing);
}

.nav-label-toggle:hover {
    background: rgba(255, 255, 255, 0.055);
}

/* ─── Icon + Label row ─── */
.nav-section-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Small colored icon pill per section */
.nav-section-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--timing), box-shadow var(--timing);
}

.nav-section-icon {
    font-size: 13px;
    width: auto;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--timing), filter var(--timing);
    color: inherit;
}

/* Per-section accent colors */
[data-section="pos"] .nav-section-icon-wrap {
    background: rgba(129, 140, 248, 0.18);
}

[data-section="pos"] .nav-section-icon {
    color: #818cf8;
}

[data-section="inventory"] .nav-section-icon-wrap {
    background: rgba(52, 211, 153, 0.16);
}

[data-section="inventory"] .nav-section-icon {
    color: #34d399;
}

[data-section="purchase"] .nav-section-icon-wrap {
    background: rgba(251, 191, 36, 0.16);
}

[data-section="purchase"] .nav-section-icon {
    color: #fbbf24;
}

[data-section="returns"] .nav-section-icon-wrap {
    background: rgba(251, 113, 133, 0.16);
}

[data-section="returns"] .nav-section-icon {
    color: #fb7185;
}

[data-section="people"] .nav-section-icon-wrap {
    background: rgba(192, 132, 252, 0.16);
}

[data-section="people"] .nav-section-icon {
    color: #c084fc;
}

[data-section="hrm"] .nav-section-icon-wrap {
    background: rgba(56, 189, 248, 0.16);
}

[data-section="hrm"] .nav-section-icon {
    color: #38bdf8;
}

[data-section="accounting"] .nav-section-icon-wrap {
    background: rgba(45, 212, 191, 0.16);
}

[data-section="accounting"] .nav-section-icon {
    color: #2dd4bf;
}

[data-section="reports"] .nav-section-icon-wrap {
    background: rgba(167, 139, 250, 0.16);
}

[data-section="reports"] .nav-section-icon {
    color: #a78bfa;
}

[data-section="settings"] .nav-section-icon-wrap {
    background: rgba(148, 163, 184, 0.14);
}

[data-section="settings"] .nav-section-icon {
    color: #94a3b8;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.72);
    flex: 1;
    transition: color var(--timing), opacity var(--timing);
}

/* ─── Chevron arrow ─── */
.nav-section-arrow {
    font-size: 9px;
    flex-shrink: 0;
    opacity: 0.32;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity var(--timing), color var(--timing);
}

/* Open section: header brighter */
.nav-section:not(.closed)>.nav-label-toggle .nav-section-label {
    color: rgba(255, 255, 255, 0.9);
}

.nav-section:not(.closed)>.nav-label-toggle .nav-section-arrow {
    opacity: 0.5;
}

/* Section with active item → icon wrap glows */
.nav-section:has(.nav-item.active)>.nav-label-toggle .nav-section-label {
    color: #fff;
}

.nav-section:has(.nav-item.active)>.nav-label-toggle .nav-section-icon-wrap {
    box-shadow: 0 0 12px currentColor;
    opacity: 1;
}

.nav-section:has(.nav-item.active)>.nav-label-toggle .nav-section-arrow {
    opacity: 0.6;
}

/* Closed section: dim thoroughly, rotate arrow */
.nav-section.closed>.nav-label-toggle .nav-section-label {
    color: rgba(255, 255, 255, 0.38);
}

.nav-section.closed>.nav-label-toggle .nav-section-icon-wrap {
    opacity: 0.45;
}

.nav-section.closed>.nav-label-toggle .nav-section-arrow {
    transform: rotate(-90deg);
    opacity: 0.22;
}

/* ─── Collapsible body (JS height-driven animation) ─── */
.nav-section-body {
    overflow: hidden;
    padding-left: 4px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.06);
    margin-left: 13px;
    margin-bottom: 4px;
}

.nav-section.closed>.nav-section-body {
    max-height: 0;
    /* no-JS fallback */
}

/* ─── Icon-only collapsed sidebar overrides ─── */
.sidebar.collapsed .nav-section-body {
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    padding-left: 0;
    border-left: none;
    margin-left: 0;
    margin-bottom: 0;
}

.sidebar.collapsed .nav-label-toggle {
    display: none !important;
}

.sidebar.collapsed .nav-section-arrow {
    display: none;
}

.sidebar.collapsed .nav-divider {
    margin: 4px 8px;
}

/* ============================================================
   6. SIDEBAR FOOTER
   ============================================================ */
.sidebar-footer {
    padding: 10px 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.065);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sidebar-footer .nav-item {
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: default;
}

.sidebar-footer .nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

/* ============================================================
   7. TOPBAR
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    z-index: var(--z-topbar);
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--timing), color var(--timing);
    flex-shrink: 0;
}

.topbar-toggle:hover {
    background: var(--gray-100);
    color: var(--text);
}

[data-theme="dark"] .topbar-toggle:hover {
    background: var(--gray-800);
}

.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13.5px;
    transition: border-color var(--timing), box-shadow var(--timing);
    outline: none;
}

.topbar-search input::placeholder {
    color: var(--text-light);
}

.topbar-search input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.topbar-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 17px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--timing), color var(--timing);
}

.topbar-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

[data-theme="dark"] .topbar-btn:hover {
    background: var(--gray-800);
}

.topbar-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--topbar-bg);
}

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */
.notif-badge {
    animation: none;
}

@keyframes notif-ping-anim {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, .7);
    }

    70% {
        transform: scale(1.25);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.notif-badge.notif-ping {
    animation: notif-ping-anim 0.6s ease forwards;
}

.notif-panel {
    width: 340px !important;
    min-width: 340px !important;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.notif-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background var(--timing);
    display: flex;
    align-items: center;
}

.notif-mark-all:hover {
    background: var(--primary-subtle);
}

.notif-list {
    overflow-y: auto;
    max-height: 340px;
    scrollbar-width: thin;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: .85rem;
}

.notif-empty i {
    font-size: 28px;
    opacity: .4;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    position: relative;
    transition: background var(--timing);
}

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

.notif-item:hover {
    background: var(--primary-subtle);
}

.notif-item.notif-unread {
    background: var(--warning-subtle);
}

[data-theme="dark"] .notif-item.notif-unread {
    background: rgba(245, 158, 11, .08);
}

.notif-item.notif-unread:hover {
    background: var(--primary-subtle);
}

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.notif-item-msg {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: .72rem;
    color: var(--text-light);
    margin-top: 3px;
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-footer {
    border-top: 1px solid var(--border);
    padding: 9px 16px;
}

.notif-footer-link {
    font-size: .8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--timing);
}

.notif-footer-link:hover {
    opacity: .8;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--timing);
    border: 1.5px solid transparent;
}

.user-menu:hover {
    background: var(--gray-100);
    border-color: var(--border);
}

[data-theme="dark"] .user-menu:hover {
    background: var(--gray-800);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

/* ============================================================
   8. DROPDOWN
   ============================================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
    transition: background var(--timing);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--gray-800);
}

.dropdown-item.active {
    color: var(--primary);
    font-weight: 600;
}

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

/* ============================================================
   9. CONTENT AREA
   ============================================================ */
.content {
    flex: 1;
    padding: var(--content-padding);
    max-width: 100%;
}

/* Prevent double padding when .content is nested inside the global .content wrapper */
.content .content {
    padding: 0;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    margin-top: 0;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

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

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color var(--timing);
}

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

.breadcrumb-sep {
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* ============================================================
   10. CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--timing);
}

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

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    font-size: 18px;
    color: var(--primary);
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.card-body {
    padding: 20px;
}

.card-body.p-0 {
    padding: 0;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   11. STAT CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--timing), box-shadow var(--timing);
    overflow: hidden;
    position: relative;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transform: translate(20px, -20px);
}

.stat-card:nth-child(1)::before {
    background: var(--primary);
}

.stat-card:nth-child(2)::before {
    background: var(--success);
}

.stat-card:nth-child(3)::before {
    background: var(--warning);
}

.stat-card:nth-child(4)::before {
    background: var(--danger);
}

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

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

.stat-icon.primary {
    background: var(--primary-subtle);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-subtle);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-subtle);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-subtle);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-subtle);
    color: var(--info);
}

.stat-icon.secondary {
    background: var(--secondary-subtle);
    color: var(--secondary);
}

.stat-info {
    flex: 1;
    min-width: 0;
}

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

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.stat-trend.up {
    background: var(--success-subtle);
    color: var(--success);
}

.stat-trend.down {
    background: var(--danger-subtle);
    color: var(--danger);
}

/* ============================================================
   12. TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table thead {
    background: var(--gray-50);
    position: sticky;
    top: 0;
    z-index: 2;
}

[data-theme="dark"] .data-table thead {
    background: var(--gray-800);
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.data-table thead th[data-sort] {
    cursor: pointer;
}

.data-table thead th[data-sort]:hover {
    color: var(--primary);
}

.data-table tbody tr {
    transition: background var(--timing);
    border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:hover {
    background: var(--gray-50);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(99, 102, 241, .06);
}

.data-table td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text);
    vertical-align: middle;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.table-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

/* ============================================================
   13. FORMS
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}

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

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

.form-control {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--timing), box-shadow var(--timing);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control[readonly] {
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

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

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control {
    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='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

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

.invalid-feedback {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

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

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

.form-row .form-group {
    margin-bottom: 0;
}

.form-row .col-span-2 {
    grid-column: span 2;
}

.form-row .col-span-full {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
}

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

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--gray-100);
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
    font-size: 13.5px;
    white-space: nowrap;
}

[data-theme="dark"] .input-group-text {
    background: var(--gray-800);
}

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ============================================================
   14. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 18px;
    height: 40px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background var(--timing), box-shadow var(--timing), transform 0.12s, border-color var(--timing);
    white-space: nowrap;
    text-decoration: none;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    min-height: 44px;
}

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

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 18px rgba(99, 102, 241, .42);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: #7c3aed;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
    box-shadow: 0 4px 10px rgba(16, 185, 129, .3);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 4px 10px rgba(239, 68, 68, .3);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.btn-info:hover {
    background: #2563eb;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-2);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: var(--gray-800);
}

.btn-light {
    background: var(--gray-100);
    color: var(--text);
    border-color: var(--border);
}

.btn-light:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .btn-light {
    background: var(--gray-800);
}

[data-theme="dark"] .btn-light:hover {
    background: var(--gray-700);
}

.btn-sm {
    padding: 5px 12px;
    height: 32px;
    font-size: 12.5px;
    min-height: 32px;
    border-radius: var(--radius-xs);
    gap: 5px;
}

.btn-lg {
    padding: 10px 24px;
    height: 48px;
    font-size: 15px;
}

.btn-icon {
    width: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    min-height: 40px;
}

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

/* ============================================================
   15. BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-subtle);
    color: var(--primary-dark);
}

.badge-secondary {
    background: var(--secondary-subtle);
    color: var(--secondary);
}

.badge-success {
    background: var(--success-subtle);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-subtle);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-subtle);
    color: #991b1b;
}

.badge-info {
    background: var(--info-subtle);
    color: #1e40af;
}

.badge-dark {
    background: var(--gray-800);
    color: #fff;
}

.badge-light {
    background: var(--gray-100);
    color: var(--gray-700);
}

[data-theme="dark"] .badge-success {
    color: #6ee7b7;
}

[data-theme="dark"] .badge-warning {
    color: #fcd34d;
}

[data-theme="dark"] .badge-danger {
    color: #fca5a5;
}

[data-theme="dark"] .badge-info {
    color: #93c5fd;
}

.color-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   16. MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--timing);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(16px) scale(0.98);
    opacity: 0;
    transition: transform var(--timing), opacity var(--timing);
    border: 1px solid var(--border);
}

.modal-sm {
    max-width: 400px;
}

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

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: background var(--timing), color var(--timing);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--danger);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--gray-800);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

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

/* ============================================================
   17. ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert i {
    font-size: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-subtle);
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-warning {
    background: var(--warning-subtle);
    color: #92400e;
    border-color: #fde68a;
}

.alert-danger {
    background: var(--danger-subtle);
    color: #991b1b;
    border-color: #fca5a5;
}

.alert-info {
    background: var(--info-subtle);
    color: #1e40af;
    border-color: #bfdbfe;
}

[data-theme="dark"] .alert-success {
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .25);
}

[data-theme="dark"] .alert-warning {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, .25);
}

[data-theme="dark"] .alert-danger {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, .25);
}

[data-theme="dark"] .alert-info {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, .25);
}

/* ============================================================
   18. TOASTS
   ============================================================ */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 16px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 340px;
    max-width: calc(100vw - 32px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    pointer-events: all;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.28s, transform 0.28s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info .toast-icon {
    color: var(--info);
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.toast-message {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast-info {
    border-left: 3px solid var(--info);
}

/* ============================================================
   19. PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--timing);
    text-decoration: none;
}

.page-link:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-light);
    color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   20. POS SYSTEM
   ============================================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}

.pos-products {
    overflow-y: auto;
    padding: 18px;
    background: var(--bg);
    -webkit-overflow-scrolling: touch;
}

.pos-cart {
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-search-bar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pos-search {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.pos-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: border-color var(--timing);
}

.pos-search input:focus {
    border-color: var(--primary);
}

.pos-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-light);
}

.cat-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.cat-chips::-webkit-scrollbar {
    display: none;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--timing);
    min-height: 34px;
}

.cat-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-subtle);
}

.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
    padding-top: 4px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 12px;
    cursor: pointer;
    transition: border-color var(--timing), box-shadow var(--timing), transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, .18);
    transform: translateY(-2px);
}

.product-card:active {
    transform: scale(0.96);
}

.product-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.product-img-placeholder {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--primary-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.product-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.product-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
}

.product-stock {
    font-size: 11px;
    color: var(--text-muted);
}

.product-card .out-of-stock {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 12px;
    color: #fff;
    font-weight: 700;
}

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

.cart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.cart-count {
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: background var(--timing);
    border: 1px solid transparent;
}

.cart-item:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.cart-item-price {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

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

.qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background var(--timing), border-color var(--timing);
    flex-shrink: 0;
}

.qty-btn:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-light);
    color: var(--primary);
}

.qty-input {
    width: 40px;
    height: 26px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 12.5px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.cart-remove {
    width: 26px;
    height: 26px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--timing), color var(--timing);
    flex-shrink: 0;
}

.cart-remove:hover {
    background: var(--danger-subtle);
    color: var(--danger);
}

.cart-options {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.cart-summary {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    flex-shrink: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 3px 0;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    padding-top: 10px;
    margin-top: 6px;
    border-top: 2px solid var(--border);
}

.summary-row.total .amount {
    color: var(--primary);
}

.cart-action {
    padding: 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.cart-action .btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
    border-radius: var(--radius);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.numpad-key {
    height: 52px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--timing), border-color var(--timing);
    color: var(--text);
}

.numpad-key:hover {
    background: var(--primary-subtle);
    border-color: var(--primary-light);
    color: var(--primary);
}

.numpad-key.special {
    font-size: 14px;
}

.payment-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.payment-tab {
    flex: 1;
    padding: 7px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: background var(--timing), color var(--timing);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.payment-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.payment-panel {
    display: none;
}

/* ============================================================
   21. LOGIN PAGE
   ============================================================ */

/* Shell */
.auth-shell {
    min-height: 100vh;
    display: flex;
}

/* ── Left brand panel ───────────────────────────────────────── */
.auth-brand {
    position: relative;
    flex: 0 0 44%;
    overflow: hidden;
    background: linear-gradient(145deg, #0d0b2e 0%, #1e1b4b 35%, #312e81 68%, #4338ca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.auth-brand-inner {
    position: relative;
    z-index: 2;
    max-width: 340px;
    width: 100%;
}

/* Decorative animated orbs */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
    z-index: 1;
}

.auth-orb-1 {
    width: 380px;
    height: 380px;
    background: #818cf8;
    top: -100px;
    right: -120px;
    animation: orbFloat 9s ease-in-out infinite;
}

.auth-orb-2 {
    width: 280px;
    height: 280px;
    background: #8b5cf6;
    bottom: -80px;
    left: -80px;
    animation: orbFloat 12s ease-in-out infinite reverse;
}

.auth-orb-3 {
    width: 200px;
    height: 200px;
    background: #6366f1;
    bottom: 30%;
    right: -60px;
    animation: orbFloat 7s ease-in-out infinite 2s;
}

@keyframes orbFloat {

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

    50% {
        transform: translateY(-24px) scale(1.06);
    }
}

/* Grid dots pattern overlay */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 28px 28px;
}

/* Brand logo */
.auth-brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(165, 180, 252, .25) 0%, rgba(139, 92, 246, .3) 100%);
    border: 1.5px solid rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
    letter-spacing: -1px;
}

.auth-brand-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
}

.auth-brand-name {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -.5px;
}

.auth-brand-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, .6);
    line-height: 1.55;
    margin-bottom: 40px;
}

/* Feature list */
.auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .78);
    font-size: .88rem;
    font-weight: 500;
    animation: featureSlide .5s ease-out backwards;
}

.auth-features li:nth-child(1) {
    animation-delay: .1s;
}

.auth-features li:nth-child(2) {
    animation-delay: .18s;
}

.auth-features li:nth-child(3) {
    animation-delay: .26s;
}

.auth-features li:nth-child(4) {
    animation-delay: .34s;
}

.auth-features li:nth-child(5) {
    animation-delay: .42s;
}

@keyframes featureSlide {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }

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

.auth-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: #a5b4fc;
    backdrop-filter: blur(4px);
}

/* Brand footer version */
.auth-brand-version {
    position: absolute;
    bottom: 24px;
    left: 40px;
    font-size: .72rem;
    color: rgba(255, 255, 255, .22);
    z-index: 2;
}

/* ── Right form panel ───────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 48px 24px;
    overflow-y: auto;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
    animation: authFadeUp .45s cubic-bezier(.22, 1, .36, 1) backwards;
    animation-delay: .08s;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

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

/* Mobile logo (hidden on desktop) */
.auth-logo-mobile {
    display: none;
    margin-bottom: 28px;
    text-align: center;
}

.auth-logo-mobile-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
    letter-spacing: -1px;
}

.auth-logo-mobile-icon img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
}

/* Form header */
.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--primary);
    background: var(--primary-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 14px;
}

[data-theme="dark"] .auth-form-eyebrow {
    background: rgba(99, 102, 241, .18);
}

.auth-form-heading {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -.4px;
    margin-bottom: 6px;
}

.auth-form-subheading {
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Input groups */
.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-light);
    pointer-events: none;
    z-index: 1;
    transition: color var(--timing);
}

.auth-input {
    height: 48px !important;
    padding-left: 42px !important;
    padding-right: 44px;
    font-size: .9rem !important;
    border-radius: 10px !important;
    border-color: var(--border-2) !important;
    transition: border-color var(--timing), box-shadow var(--timing), background var(--timing) !important;
}

.auth-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1) !important;
}

.auth-input:focus~.auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--primary);
}

.auth-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1rem;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
    transition: color var(--timing);
    z-index: 1;
}

.auth-pwd-toggle:hover {
    color: var(--primary);
}

/* Remember me row */
.auth-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text-muted);
    user-select: none;
}

.auth-form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Submit */
.auth-submit {
    height: 50px !important;
    font-size: .95rem !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, .38) !important;
    transition: box-shadow var(--timing), transform 0.12s !important;
    letter-spacing: .01em;
}

.auth-submit:hover {
    box-shadow: 0 6px 28px rgba(99, 102, 241, .52) !important;
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0) scale(.98);
}

.auth-submit .btn-arrow {
    transition: transform var(--timing);
}

.auth-submit:hover .btn-arrow {
    transform: translateX(3px);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--text-light);
    font-size: .75rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Footer bar */
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.auth-lang-row {
    display: flex;
    gap: 4px;
}

.auth-lang-btn {
    background: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--timing);
}

.auth-lang-btn:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}

.auth-lang-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-subtle);
}

[data-theme="dark"] .auth-lang-btn.active,
[data-theme="dark"] .auth-lang-btn:hover {
    background: rgba(99, 102, 241, .18);
}

.auth-theme-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 5px 12px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: inherit;
    transition: all var(--timing);
}

.auth-theme-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Version tag */
.auth-version {
    text-align: center;
    margin-top: 20px;
    font-size: .7rem;
    color: var(--text-light);
    letter-spacing: .03em;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
    .auth-brand {
        display: none;
    }

    .auth-logo-mobile {
        display: block;
    }

    .auth-form-panel {
        justify-content: center;
        padding: 36px 20px;
    }
}

@media (max-width: 420px) {
    .auth-form-wrap {
        max-width: 100%;
    }
}

/* ============================================================
   22. EMPTY STATES
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 12px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    opacity: 0.4;
    line-height: 1;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.empty-state p {
    font-size: 13.5px;
    margin: 0;
    max-width: 300px;
}

/* ============================================================
   23. SPINNER
   ============================================================ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    flex-shrink: 0;
}

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

/* ============================================================
   24. UTILITIES
   ============================================================ */
.flex-1 {
    flex: 1;
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

.d-none {
    display: none !important;
}

.d-flex {
    display: flex !important;
}

.d-block {
    display: block !important;
}

.d-grid {
    display: grid !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-light) !important;
}

.text-white {
    color: #fff !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-start {
    text-align: left !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-extrabold {
    font-weight: 800 !important;
}

.fs-sm {
    font-size: 12px !important;
}

.fs-xs {
    font-size: 11px !important;
}

.w-100 {
    width: 100% !important;
}

.mb-0 {
    margin-bottom: 0 !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-0 {
    margin-top: 0 !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;
}

.p-0 {
    padding: 0 !important;
}

.p-3 {
    padding: 12px !important;
}

.p-4 {
    padding: 20px !important;
}

.py-3 {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.px-4 {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.rounded {
    border-radius: var(--radius) !important;
}

.rounded-sm {
    border-radius: var(--radius-sm) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-full {
    border-radius: var(--radius-full) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.border {
    border: 1px solid var(--border) !important;
}

.border-0 {
    border: none !important;
}

.bg-surface {
    background: var(--surface) !important;
}

.bg-primary {
    background: var(--primary) !important;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.col {
    flex: 1 1 0;
    min-width: 0;
}

.col-auto {
    flex: 0 0 auto;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.col-6 {
    flex: 0 0 calc(50% - 9px);
    max-width: calc(50% - 9px);
}

.col-4 {
    flex: 0 0 calc(33.33% - 12px);
    max-width: calc(33.33% - 12px);
}

.col-3 {
    flex: 0 0 calc(25% - 13.5px);
    max-width: calc(25% - 13.5px);
}

.col-8 {
    flex: 0 0 calc(66.66% - 6px);
    max-width: calc(66.66% - 6px);
}

/* ============================================================
   25. RECEIPT
   ============================================================ */
.receipt-container {
    max-width: 380px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed var(--gray-400);
    margin: 10px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.receipt-total {
    font-weight: 700;
    font-size: 14px;
}

/* ============================================================
   26. MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: var(--z-mobile-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-inner {
    display: flex;
    height: 100%;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 600;
    transition: color var(--timing);
    padding: 6px 4px;
    position: relative;
    min-height: 44px;
}

.mobile-nav-item i {
    font-size: 20px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
    transition: width var(--timing);
}

.mobile-nav-item.active::before {
    width: 44px;
}

/* ============================================================
   27. ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

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

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

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

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

    100% {
        background-position: 200% 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-fade-in-up {
    animation: fadeInUp 0.35s ease;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, var(--gray-800) 25%, var(--gray-700) 50%, var(--gray-800) 75%);
    background-size: 200% 100%;
}

/* ============================================================
   28. PRINT
   ============================================================ */
@media print {

    .sidebar,
    .topbar,
    .mobile-nav,
    .no-print,
    .btn,
    .page-actions,
    .topbar-toggle,
    .toast-container {
        display: none !important;
    }

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

    .content {
        padding: 0 !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

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

    .data-table thead {
        background: #f0f0f0 !important;
    }
}

/* ============================================================
   29. RESPONSIVE — TABLET (<=1024px)
   ============================================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
        --content-padding: 20px;
    }

    .pos-layout {
        grid-template-columns: 1fr 340px;
    }

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

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

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

/* ============================================================
   30. RESPONSIVE — MOBILE (<=768px)
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --content-padding: var(--content-padding-mobile);
        --topbar-height: 56px;
        --mobile-nav-height: 60px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        box-shadow: none;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-wrapper {
        margin-left: 0 !important;
        padding-bottom: var(--mobile-nav-height);
    }

    .mobile-nav {
        display: block;
    }

    .topbar-search {
        display: none;
    }

    .user-name,
    .user-role {
        display: none;
    }

    .user-menu {
        padding: 4px;
        border: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 18px;
    }

    .card-header {
        padding: 13px 16px;
    }

    .card-body {
        padding: 16px;
    }

    .card-footer {
        padding: 12px 16px;
    }

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

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 18px;
    }

    .form-row,
    .form-row.cols-3,
    .form-row.cols-4 {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .form-row .col-span-2,
    .form-row .col-span-full {
        grid-column: 1 / -1;
    }

    /* Responsive table — card view */
    .table-wrapper {
        border-radius: var(--radius);
        overflow: hidden;
        overflow-x: hidden;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin: 8px 0;
        padding: 4px 0;
        background: var(--surface);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 9px 14px;
        font-size: 13px;
        border-bottom: 1px solid var(--border);
        min-height: 44px;
        gap: 10px;
    }

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

    .data-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
        max-width: 45%;
    }

    .data-table td:empty {
        display: none;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .table-filters {
        flex-direction: column;
    }

    .table-filters .form-control {
        width: 100%;
    }

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

    .pos-products {
        min-height: 60vh;
    }

    .pos-cart {
        border-left: none;
        border-top: 2px solid var(--primary);
        min-height: 360px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal,
    .modal.modal-sm,
    .modal.modal-lg,
    .modal.modal-xl {
        max-width: 100%;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
        transform: translateY(100%);
        opacity: 1;
    }

    .modal-overlay.open .modal {
        transform: translateY(0);
    }

    .toast-container {
        right: 8px;
        left: 8px;
        width: auto;
    }

    .pagination {
        justify-content: center;
    }

    .row {
        gap: 12px;
    }

    .col-6,
    .col-4,
    .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dropdown-menu {
        min-width: 90vw;
        right: -8px;
    }
}

/* ============================================================
   31. RESPONSIVE — SMALL MOBILE (<=480px)
   ============================================================ */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stat-value {
        font-size: 16px;
    }

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

    .btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 44px;
    }

    .page-title {
        font-size: 16px;
    }

    .topbar {
        padding: 0 12px;
        gap: 8px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================
   PREMIUM PAGE DESIGN SYSTEM — Shared across all pages
   (sh-hero, sh-kpi, sh-filter, sh-card, sh-table)
   ============================================================ */

/* ── Hero Banner ──────────────────────────────────────────── */
.sh-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    padding: 26px 30px 24px;
    margin-bottom: 20px;
    color: #fff;
}

.sh-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='40' cy='40' r='40'/%3E%3C/g%3E%3C/svg%3E");
}

.sh-hero-orb1 {
    position: absolute;
    right: -80px;
    top: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
    pointer-events: none;
}

.sh-hero-orb2 {
    position: absolute;
    left: -40px;
    bottom: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .04);
    pointer-events: none;
}

.sh-hero-orb3 {
    position: absolute;
    right: 180px;
    bottom: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    pointer-events: none;
}

.sh-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.sh-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.sh-hero-text {
    flex: 1;
    min-width: 0;
}

.sh-hero-text h1 {
    font-size: 20px;
    font-weight: 900;
    margin: 0 0 3px;
    line-height: 1.2;
}

.sh-hero-text p {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .72);
    margin: 0;
}

.sh-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sh-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.sh-hero-btn.primary {
    background: #fff;
    color: #4f46e5;
    border-color: #fff;
}

.sh-hero-btn.primary:hover {
    background: rgba(255, 255, 255, .9);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.sh-hero-btn.ghost {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: rgba(255, 255, 255, .3);
    backdrop-filter: blur(8px);
}

.sh-hero-btn.ghost:hover {
    background: rgba(255, 255, 255, .22);
    transform: translateY(-2px);
}

.sh-hero-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sh-hero-stat {
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.sh-hero-stat-val {
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 2px;
}

.sh-hero-stat-lbl {
    font-size: 10px;
    color: rgba(255, 255, 255, .65);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

/* ── KPI Grid ─────────────────────────────────────────────── */
.sh-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

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

.sh-kpi-grid.cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

@media(max-width:1100px) {
    .sh-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.sh-kpi {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 14px;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.sh-kpi:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sh-kpi-glow {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    opacity: .07;
    pointer-events: none;
    transition: opacity .2s;
}

.sh-kpi:hover .sh-kpi-glow {
    opacity: .13;
}

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

.sh-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
}

.sh-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-full);
}

.sh-kpi-badge.up {
    background: var(--success-subtle);
    color: var(--success);
}

.sh-kpi-badge.neutral {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.sh-kpi-badge.down {
    background: var(--danger-subtle);
    color: var(--danger);
}

.sh-kpi-val {
    font-size: 24px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    letter-spacing: -.02em;
}

.sh-kpi-lbl {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 700;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.sh-filter-wrap {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    margin-bottom: 20px;
}

.sh-preset-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: center;
}

.sh-preset-lbl {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 2px;
}

.sh-preset {
    padding: 5px 13px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    transition: .15s;
    white-space: nowrap;
}

.sh-preset:hover {
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: var(--primary);
}

.sh-preset.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
}

.sh-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.sh-filter-grid.cols-2 {
    grid-template-columns: 2fr 1fr auto;
}

.sh-filter-grid.cols-3 {
    grid-template-columns: 2fr 1fr 1fr auto;
}

.sh-filter-grid.cols-6 {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
}

@media(max-width:900px) {

    .sh-filter-grid,
    .sh-filter-grid.cols-2,
    .sh-filter-grid.cols-3,
    .sh-filter-grid.cols-6 {
        grid-template-columns: 1fr 1fr;
    }
}

.sh-fi {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sh-fi label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.sh-fi-srch {
    position: relative;
}

.sh-fi-srch .bi {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 13px;
    pointer-events: none;
}

.sh-inp {
    height: 38px;
    width: 100%;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.sh-inp:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.sh-inp-srch {
    padding-left: 34px;
}

.sh-sel {
    height: 38px;
    padding: 0 28px 0 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s;
    appearance: none;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 9px;
    background-color: var(--bg);
}

.sh-sel:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

/* ── Table Card ───────────────────────────────────────────── */
.sh-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sh-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 17px;
    border-bottom: 1.5px solid var(--border);
    background: var(--surface-2);
    flex-wrap: wrap;
}

.sh-card-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.sh-count-tag {
    font-size: 11px;
    font-weight: 700;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.sh-card-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.sh-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: .15s;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.sh-toolbar-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.sh-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: .15s;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.sh-clear-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: #fef2f2;
}

/* ── Premium Table ────────────────────────────────────────── */
.sh-table {
    width: 100%;
    border-collapse: collapse;
}

.sh-table thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}

.sh-table tbody td {
    padding: 11px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.sh-table tbody tr:hover td {
    background: color-mix(in srgb, var(--primary) 3%, var(--surface-2));
}

/* ── Card Grid Items (categories / brands / warehouses) ───── */
.sh-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sh-item-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.sh-item-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
    transform: translateY(-3px);
}

.sh-item-card-accent {
    height: 4px;
    width: 100%;
    flex-shrink: 0;
}

.sh-item-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    gap: 6px;
}

.sh-item-card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* ── Premium Pagination ───────────────────────────────────── */
.sh-pag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1.5px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.sh-pag-info {
    font-size: 12.5px;
    color: var(--text-muted);
}

.sh-pag-pages {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.sh-pag-btn {
    min-width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    text-decoration: none;
    transition: .15s;
    padding: 0 6px;
}

.sh-pag-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sh-pag-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Empty state (premium) ────────────────────────────────── */
.sh-empty {
    padding: 64px 24px;
    text-align: center;
}

.sh-empty i {
    font-size: 3.25rem;
    color: var(--text-muted);
    opacity: .35;
    display: block;
    margin-bottom: 14px;
}

.sh-empty h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.sh-empty p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ── Action buttons (shared) ──────────────────────────────── */
.sh-act-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    line-height: 1;
}

.sh-act-btn:hover {
    transform: translateY(-1px);
}

.sh-act-edit:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

.sh-act-del:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-subtle);
}

.sh-act-view:hover {
    border-color: var(--info);
    color: var(--info);
    background: rgba(6, 182, 212, .08);
}

.sh-act-success:hover {
    border-color: var(--success);
    color: var(--success);
    background: var(--success-subtle);
}

/* ── Two-col form+table layout ────────────────────────────── */
.sh-2col {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    align-items: start;
}

.sh-2col-wide {
    grid-template-columns: 380px 1fr;
}

@media(max-width:1000px) {

    .sh-2col,
    .sh-2col-wide {
        grid-template-columns: 1fr;
    }
}

.sh-form-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.sh-form-hd {
    padding: 14px 18px;
    border-bottom: 1.5px solid var(--border);
    font-weight: 700;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
}

.sh-form-bd {
    padding: 18px;
}

/* ── Hero gradient presets ────────────────────────────────── */
.sh-hero-emerald {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 30%, #059669 65%, #10b981 100%);
}

.sh-hero-indigo {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4f46e5 65%, #7c3aed 100%);
}

.sh-hero-rose {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 30%, #dc2626 65%, #ef4444 100%);
}

.sh-hero-sky {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 30%, #0284c7 65%, #0ea5e9 100%);
}

.sh-hero-amber {
    background: linear-gradient(135deg, #78350f 0%, #92400e 30%, #d97706 65%, #f59e0b 100%);
}

.sh-hero-violet {
    background: linear-gradient(135deg, #2e1065 0%, #4c1d95 30%, #7c3aed 65%, #8b5cf6 100%);
}

.sh-hero-teal {
    background: linear-gradient(135deg, #134e4a 0%, #115e59 30%, #0d9488 65%, #14b8a6 100%);
}

/* ============================================================
   32. LARGE SCREENS (>=1440px)
   ============================================================ */
@media (min-width: 1440px) {
    :root {
        --content-padding: 32px;
    }

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

    .pos-layout {
        grid-template-columns: 1fr 420px;
    }
}