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

:root {
    /* Primary Colors - Modern Indigo/Purple */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #a855f7;

    /* Dark Theme Surface Colors */
    --bg-body: #09090b;
    --bg-card: rgba(18, 18, 23, 0.7);
    --bg-sidebar: rgba(12, 12, 16, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Text Colors */
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;

    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Decorative */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);

    /* Layout */
    --sidebar-width: 280px;
    --topbar-height: 80px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Support */
[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.03);

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dashboard & Shop Components */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.shop-stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.shop-stat-card .label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shop-stat-card .value {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== Split Layout: Fixed header + Scrollable content ===== */
.page-split-layout {
    display: flex;
    flex-direction: column;
    /* Fill the entire #page-content area, accounting for its padding */
    height: calc(100vh - 70px);          /* viewport minus topbar */
    margin: -2.5rem;                     /* bleed into page-content padding */
    overflow: hidden;
}

.page-split-header {
    flex-shrink: 0;
    background: var(--bg-body);
    padding: 1.5rem 2.5rem 1rem 2.5rem;
    z-index: 20;
    box-shadow: 0 4px 16px -4px rgba(0,0,0,0.35);
    border-bottom: 1px solid var(--border-color);
}

.page-split-header .page-header {
    margin-bottom: 1rem;
}

.page-split-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2.5rem 2.5rem 2.5rem;
    scroll-behavior: smooth;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-group input,
.filter-group select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    color: var(--text-main);
    outline: none;
}

select option {
    background-color: #121217 !important;
    color: #fff !important;
}

[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #000000 !important;
}


.product-card-premium {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card-premium:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.product-card-img {
    height: 220px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-card-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-info {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.product-card-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.product-card-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.product-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    /* Align price to start */
}

.product-card-bottom .flex {
    width: 100%;
    display: flex;
    gap: 0.25rem !important;
    /* Minimize gap */
}

.product-card-bottom .qty-input {
    width: 40px !important;
    /* Minimal width for number */
    font-size: 0.85rem;
    padding: 0;
    text-align: center;
}

.product-card-bottom .btn {
    flex: 1;
    padding: 0 4px !important;
    font-size: 0.65rem !important;
    /* Very small font to fit "ADD TO CART" */
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
}

/* Warehouse Tabs */
.warehouse-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.w-tab {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.w-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.w-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Order Cards */
.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.order-card-header {
    padding: 1.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.order-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.order-actions {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.01);
}

/* Badge Logic */
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-pending {
    background: #f59e0b;
}

.status-approved {
    background: #10b981;
}

.status-rejected {
    background: #ef4444;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #f8fafc 0%, #f1f5f9 100%);
}

[data-theme="light"] .sidebar {
    background: #fff;
}

[data-theme="light"] .login-overlay {
    background: #f8fafc;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.9);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

button {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    color: inherit;
}

body {
    background: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.brand,
.page-title {
    font-family: 'Outfit', sans-serif;
}

/* Premium Background - Animated Mesh Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(9, 9, 11, 1) 0%, rgba(9, 9, 11, 1) 100%);
    z-index: -1;
}

/* App Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transition: var(--transition);
    position: relative;
    z-index: 100;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand img {
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: -8px;
    /* Offset scrollbar */
    padding-right: 8px;
}

/* Scrollbar for nav-links */
.nav-links::-webkit-scrollbar {
    width: 4px;
}

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

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

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-links a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-links a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* User Profile in Sidebar */
.user-profile {
    margin-top: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

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

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.user-info .name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-transform: capitalize;
    /* Force capitalize */
}

.user-info .role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: var(--topbar-height);
    background: rgba(var(--bg-card), 0.5);
    /* Semi-transparent */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 50;
}

.toggle-sidebar {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    margin-right: 1.5rem;
}

.search-bar {
    position: relative;
    width: 400px;
}

.search-bar i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

.search-bar input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-radius: var(--radius-xl);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

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

.action-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border-color);
}

.action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
}

.badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-body);
}

/* Page Content */
#page-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 2rem;
    flex-wrap: wrap;
    /* Allow wrapping on small screens but keep alignment */
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* Buttons */
.btn {
    padding: 0.85rem 1.25rem;
    min-height: 48px;
    /* Ensure consistent height */
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
}

/* Cards & Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.25rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.card-header i {
    font-size: 1.5rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    font-family: 'Outfit';
    letter-spacing: -0.02em;
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-category {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

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

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

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

/* Login UI */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-overlay::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    top: -200px;
    right: -200px;
}

.login-card {
    background: rgba(18, 18, 23, 0.8);
    backdrop-filter: blur(25px);
    padding: 3.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 10;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-confirm .modal-card {
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-confirm .modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 0.5rem;
}

.modal-confirm .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff !important;
}

.modal-confirm .close-modal {
    color: #fff !important;
    opacity: 0.7;
}

.modal-confirm .close-modal:hover {
    opacity: 1;
}

.modal-confirm .modal-body {
    padding: 0.5rem 1.5rem 1.5rem;
}

.modal-confirm .modal-body p {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 1 !important;
}

.modal-confirm .modal-footer {
    border-top: none;
    padding: 0.5rem 1.5rem 1.5rem;
}

.modal-confirm .btn-confirm-ok {
    background: #AFC8F2 !important;
    color: #111114 !important;
    border-radius: 24px !important;
    font-weight: 700 !important;
    padding: 0.8rem 2rem !important;
    border: 2px solid #3B82F6 !important;
    transition: all 0.2s ease;
}

.modal-confirm .btn-confirm-cancel {
    background: #003A6B !important;
    color: #fff !important;
    border-radius: 24px !important;
    font-weight: 700 !important;
    padding: 0.8rem 2rem !important;
    transition: all 0.2s ease;
}

.modal-confirm .btn-confirm-ok:hover,
.modal-confirm .btn-confirm-cancel:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Layout Utilities */
.flex {
    display: flex !important;
}

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

.flex-col {
    flex-direction: column !important;
}

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

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

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-1 {
    flex: 1 !important;
}

.gap-1 {
    gap: 0.5rem !important;
}

.gap-2 {
    gap: 1rem !important;
}

.gap-3 {
    gap: 1.5rem !important;
}

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

/* Helper Classes */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 1rem;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Responsive */

/* Prevent horizontal overflow globally */
.main-content,
#page-content {
    overflow-x: hidden;
}

/* ===== 1200px: Reduce product grid columns ===== */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Reduce filter group minimum width so they don't overflow */
    .filter-group {
        min-width: 130px;
        flex: 1 1 130px;
    }
}

/* ===== 1024px: Collapse sidebar, reduce layout ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.75rem;
    }

    .nav-links a span,
    .brand span,
    .user-info {
        display: none;
    }

    .brand {
        justify-content: center;
    }

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

    #page-content {
        padding: 1.5rem;
    }

    .filter-bar {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .filter-group {
        min-width: 110px;
        flex: 1 1 110px;
    }

    /* Keep split header aligned with page content at 1024px */
    .page-split-layout {
        margin: -1.5rem;
    }
    .page-split-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
    }
    .page-split-scroll {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
}

/* ===== 768px: Mobile sidebar overlay, major layout changes ===== */
@media (max-width: 768px) {
    /* Sidebar becomes off-canvas overlay */
    .sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        height: 100vh;
        top: 0;
        padding: 2rem 1.5rem;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Restore hidden text in mobile sidebar overlay */
    .sidebar.active .nav-links a span,
    .sidebar.active .brand span,
    .sidebar.active .user-info {
        display: inline;
    }

    /* Show hamburger toggle */
    .toggle-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Topbar */
    .topbar {
        padding: 0 1rem;
        height: 60px;
    }

    /* Search bar */
    .search-bar {
        width: auto;
        flex: 1;
    }

    .search-bar input {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem 0.6rem 2.5rem;
    }

    /* Page content spacing */
    #page-content {
        padding: 1rem;
    }

    /* Page header — remove sticky, let it flow naturally */
    .page-header {
        position: static !important;
        margin-bottom: 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .page-title {
        font-size: 1.5rem;
    }

    /* Product type toggle — keep inline flow, wrap on small screens */
    #product-type-toggle {
        position: static !important;
        top: unset !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.5rem 0 !important;
        margin-bottom: 0.5rem !important;
    }

    #product-type-toggle button {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }

    /* Filter bar — stack vertically on mobile */
    .filter-bar {
        position: static !important;
        top: unset !important;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: var(--radius-md);
    }

    /* Split layout — at 768px, match 1rem page padding */
    .page-split-layout {
        margin: -1rem;
    }
    .page-split-header {
        padding: 0.75rem 1rem 0.5rem 1rem;
    }
    .page-split-scroll {
        padding: 0.75rem 1rem 1rem 1rem;
    }

    .filter-group {
        min-width: unset;
        width: 100%;
        flex: unset;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
    }

    /* Product grid — 2 columns */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    /* Product cards */
    .product-card-img {
        height: 160px;
    }

    .product-card-info {
        padding: 1rem;
    }

    .product-card-bottom {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    .product-card-bottom .btn {
        font-size: 0.7rem !important;
        height: 40px;
    }

    .product-card-bottom .qty-input {
        width: 50px !important;
        height: 40px !important;
    }

    /* Order cards */
    .order-card-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .order-item-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 1rem;
    }

    .order-actions {
        padding: 1rem;
        flex-wrap: wrap;
    }

    /* Stats bar — 2 columns */
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .shop-stat-card {
        padding: 1.25rem;
    }

    .shop-stat-card .value {
        font-size: 2rem;
    }

    /* Warehouse tabs */
    .warehouse-tabs {
        gap: 0.25rem;
        padding: 0.35rem;
    }

    .w-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Modal */
    .modal-overlay {
        padding: 0.75rem;
    }

    .modal-card {
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.25rem;
    }

    /* Toast — full width */
    .toast-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .toast {
        min-width: unset;
        width: 100%;
    }

    /* Table responsive — horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    th, td {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Grid cards for dashboard etc */
    .grid-cards {
        grid-template-columns: 1fr;
    }

    /* Cart checkout area */
    .mt-5 {
        flex-direction: column !important;
    }

    /* Pending orders grid */
    .order-card-body > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem;
    }
}

/* ===== 480px: Small phone — single column everything ===== */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    #page-content {
        padding: 0.75rem;
    }

    /* Split layout at small phone — match 0.75rem page padding */
    .page-split-layout {
        margin: -0.75rem;
    }
    .page-split-header {
        padding: 0.5rem 0.75rem 0.5rem 0.75rem;
    }
    .page-split-scroll {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    }

    .page-header {
        margin-bottom: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .product-card-img {
        height: 180px;
    }

    .product-card-title {
        font-size: 1rem;
    }

    .product-card-meta {
        font-size: 0.8rem;
    }

    .product-card-bottom .btn {
        font-size: 0.75rem !important;
        height: 44px;
    }

    .product-card-bottom .qty-input {
        width: 60px !important;
        height: 44px !important;
    }

    /* Stats bar single column */
    .stats-bar {
        grid-template-columns: 1fr;
    }

    /* Order item rows stack fully */
    .order-item-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    /* Login card */
    .login-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    /* Filter inputs */
    .filter-group label {
        font-size: 0.7rem;
    }

    .filter-group input,
    .filter-group select {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Topbar actions tighter */
    .topbar-actions {
        gap: 0.5rem;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    /* Cart customer details grid single column */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

#pos-grid {
    overflow-x: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

#pos-grid::-webkit-scrollbar {
    width: 6px;
}

#pos-grid::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

.badge-count {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    margin-left: 6px;
}

.qty-input {
    width: 70px !important;
    height: 44px !important;
    text-align: center;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-main) !important;
    outline: none;
    transition: var(--transition);
}

.qty-input:focus {
    border-color: var(--primary) !important;
}

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

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

.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
    transition: opacity 0.3s;
}

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

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

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

/* Cart Modal Alignment Fix */
.cart-modal table td {
    vertical-align: middle;
}

.cart-modal .btn-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.cart-modal .btn-sm:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.cart-modal .btn-sm:hover i {
    color: #fff !important;
}

/* Dynamically Added Styles */
.btn-outline-primary {
    background: transparent;
    border: 1px solid transparent;
    /* Reverted to transparent as requested */
    color: var(--primary);
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
}