:root {
    /* Premium Color Palette */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.1);
    --secondary: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* Design Tokens */
    --sidebar-width: 280px;
    --header-height: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Light Mode */
    --bg-color: #f8fafc;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #1e1b4b;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Dashboard Specific Colors */
    --dash-red-bg: #fff1f2;
    --dash-red-icon: #f43f5e;
    --dash-green-bg: #f0fdf4;
    --dash-green-icon: #22c55e;
    --dash-blue-bg: #f0f9ff;
    --dash-blue-icon: #0ea5e9;
    --dash-yellow-bg: #fffbeb;
    --dash-yellow-icon: #f59e0b;
}

/* Dashboard Redesign Styles */
.dash-header { margin-bottom: 2.5rem; }
.dash-header h1 { margin: 0; font-weight: 800; font-size: 1.85rem; color: var(--text-main); letter-spacing: -1px; }
.dash-header p { margin-top: 0.4rem; font-size: 0.95rem; font-weight: 500; color: var(--text-muted); }
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.summary-card { display: flex; align-items: center; padding: 1.5rem; border-radius: var(--radius-lg); border: none; transition: var(--transition); }
.summary-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05); }
.summary-card.red { background-color: var(--dash-red-bg); }
.summary-card.green { background-color: var(--dash-green-bg); }
.summary-card.blue { background-color: var(--dash-blue-bg); }
.summary-card.yellow { background-color: var(--dash-yellow-bg); }
.summary-icon-box { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; margin-right: 1.25rem; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); }
.summary-card.red .summary-icon-box { background-color: var(--dash-red-icon); }
.summary-card.green .summary-icon-box { background-color: var(--dash-green-icon); }
.summary-card.blue .summary-icon-box { background-color: var(--dash-blue-icon); }
.summary-card.yellow .summary-icon-box { background-color: var(--dash-yellow-icon); }
.summary-details { flex: 1; }
.summary-title { font-size: 0.85rem; font-weight: 600; color: var(--text-main); opacity: 0.7; margin-bottom: 0.25rem; }
.summary-value { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.1rem; }
.summary-trend { font-size: 0.75rem; font-weight: 700; }
.summary-trend.up { color: var(--success); }
.summary-trend.down { color: var(--danger); }
.metric-card { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius-lg); padding: 1.5rem; position: relative; transition: var(--transition); }
.metric-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.metric-icon-top { position: absolute; top: 1.5rem; right: 1.5rem; width: 32px; height: 32px; background: var(--bg-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--dash-red-icon); border: 1px solid var(--panel-border); font-size: 1rem; }
.metric-value { font-size: 1.75rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.25rem; }
.metric-title { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-bottom: 1.5rem; }
.metric-footer { display: flex; justify-content: space-between; align-items: center; }
.metric-link { font-size: 0.75rem; font-weight: 700; color: var(--dash-red-icon); text-decoration: none; border-bottom: 1px solid transparent; }
.metric-link:hover { border-bottom-color: currentColor; }
.overall-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; }
.info-item { text-align: center; padding: 1rem; }
.info-item-value { font-size: 1.5rem; font-weight: 800; color: var(--text-main); display: block; }
.info-item-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.badge-percent { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; color: white; background: var(--success); margin-left: 8px; }

body.dark-mode {
    --bg-color: #020617;
    --panel-bg: #0f172a;
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #020617;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: rgba(99, 102, 241, 0.15);
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Glassmorphism & Cards */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

.card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.25rem;
    margin: 0.2rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
}

.nav-link.active {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 600;
}

/* Content */
.content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 2rem;
    min-height: 100vh;
    transition: var(--transition);
}

body.fullscreen-mode .content {
    margin-left: 0;
    width: 100%;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

.top-nav {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* POS Redesign Styles */
.pos-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
}

.pos-top-nav {
    background: #1e293b;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.pos-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.pos-sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.pos-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.pos-filters {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.pos-product-card {
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    position: relative;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    cursor: pointer;
    text-align: center;
}

.pos-product-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.pos-product-image {
    height: 100px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.pos-qty-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 800;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr 0.5fr;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.pos-cart-footer {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.pos-action-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-pos-action {
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.btn-pos-action:hover { opacity: 0.9; }
.btn-pos-hold { background: #ef4444; }
.btn-pos-zaad { background: #10b981; }
.btn-pos-cash { background: #3b82f6; }
.btn-pos-edahab { background: #8b5cf6; }
.btn-pos-loan { background: #f59e0b; }

/* Modals */
.pos-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Buttons (General) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #f1f5f9; color: var(--text-main); border-color: #e2e8f0; }
.btn-danger { background: var(--danger); color: white; }

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control:focus { outline: none; border-color: var(--primary); }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-1 { margin-left: 0.25rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }

.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-4xl { font-size: 2.25rem; }
.text-muted { color: #64748b; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-dark { color: #1e293b; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shadow-xl { box-shadow: var(--shadow-xl); }
.bg-light { background-color: #f8fafc; }
.bg-white { background-color: white; }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 12px; }
.inline-flex { display: inline-flex; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-dashed { border-style: dashed; }

/* Table Fixes & Missing Utilities */
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.divide-y > * + * { border-top: 1px solid #f1f5f9; }
.uppercase { text-transform: uppercase; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.object-cover { object-fit: cover; }
.bg-rose-50 { background-color: #fff1f2; }
.text-rose-600 { color: #e11d48; }
.border-rose-100 { border-color: #ffe4e6; }
.bg-emerald-50 { background-color: #ecfdf5; }
.text-emerald-600 { color: #059669; }
.border-emerald-100 { border-color: #d1fae5; }
.bg-indigo-50 { background-color: #eef2ff; }
.text-indigo-600 { color: #4f46e5; }
.bg-slate-50 { background-color: #f8fafc; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.border-slate-200 { border-color: #e2e8f0; }

/* Max Width Utilities */
.max-w-sm { max-width: 24rem; } /* 384px */
.max-w-md { max-width: 28rem; } /* 448px */
.max-w-lg { max-width: 32rem; } /* 512px */
.max-w-xl { max-width: 36rem; } /* 576px */
.max-w-2xl { max-width: 42rem; } /* 672px */

table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { text-align: left; vertical-align: middle; }

/* Arbitrary Tailwind Font Size Utility Classes */
.text-\[0\.5rem\] { font-size: 0.5rem !important; }
.text-\[0\.55rem\] { font-size: 0.55rem !important; }
.text-\[0\.6rem\] { font-size: 0.6rem !important; }
.text-\[0\.65rem\] { font-size: 0.65rem !important; }
.text-\[0\.7rem\] { font-size: 0.7rem !important; }
.text-\[0\.72rem\] { font-size: 0.72rem !important; }
.text-\[0\.75rem\] { font-size: 0.75rem !important; }
.text-\[0\.8rem\] { font-size: 0.8rem !important; }
.text-\[0\.85rem\] { font-size: 0.85rem !important; }
.text-\[0\.9rem\] { font-size: 0.9rem !important; }
.text-\[0\.95rem\] { font-size: 0.95rem !important; }
.text-\[1\.1rem\] { font-size: 1.1rem !important; }
.text-\[1\.2rem\] { font-size: 1.2rem !important; }
.text-\[1\.25rem\] { font-size: 1.25rem !important; }
.text-\[1\.3rem\] { font-size: 1.3rem !important; }
.text-\[1\.5rem\] { font-size: 1.5rem !important; }
.text-\[1\.75rem\] { font-size: 1.75rem !important; }
.text-\[1\.8rem\] { font-size: 1.8rem !important; }
.text-\[1\.85rem\] { font-size: 1.85rem !important; }
.text-\[2rem\] { font-size: 2rem !important; }
.text-\[2\.25rem\] { font-size: 2.25rem !important; }
.text-\[2\.5rem\] { font-size: 2.5rem !important; }
