/* ===== CSS RESET & VARIABLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary palette — Deep Indigo */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Neutral */
    --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;

    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 60px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-family: 'Inter', system-ui, sans-serif;
    --font-brand: 'Outfit', sans-serif;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    font-size: 32px;
    color: var(--primary-400);
    background: rgba(99, 102, 241, 0.15);
    padding: 8px;
    border-radius: var(--radius-md);
}

.sidebar-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-brand);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-300), var(--primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--gray-400);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.93rem;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-item .material-icons-round {
    font-size: 22px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-data-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    color: var(--gray-400);
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
}

.sidebar-data-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-data-btn .material-icons-round {
    font-size: 18px;
}

.sidebar-footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 8px;
}

.sidebar-footer-info .material-icons-round {
    font-size: 16px;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--header-height);
    background: var(--gray-900);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
}

.mobile-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-300), var(--primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(4px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    max-width: 1400px;
}

/* ===== PAGE ===== */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

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

.page-header h2 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.93rem;
    margin-top: 4px;
}

.date-display {
    font-size: 0.9rem;
    color: var(--gray-500);
    background: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-weight: 500;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}

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

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

.stat-icon .material-icons-round {
    font-size: 26px;
}

.stat-card--primary .stat-icon {
    background: var(--primary-100);
    color: var(--primary-600);
}
.stat-card--primary::after { background: var(--primary-600); }

.stat-card--success .stat-icon {
    background: var(--success-light);
    color: var(--success);
}
.stat-card--success::after { background: var(--success); }

.stat-card--info .stat-icon {
    background: var(--info-light);
    color: var(--info);
}
.stat-card--info::after { background: var(--info); }

.stat-card--warning .stat-icon {
    background: var(--warning-light);
    color: var(--warning);
}
.stat-card--warning::after { background: var(--warning); }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-link {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.card-link:hover {
    color: var(--primary-700);
}

.card-body {
    padding: 20px 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn .material-icons-round {
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.btn-ghost:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-ghost.active {
    background: var(--primary-50);
    color: var(--primary-600);
    border-color: var(--primary-200);
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-icon.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ===== TABLE ===== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    flex: 1;
    max-width: 400px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary-400);
    background: white;
}

.search-box .material-icons-round {
    color: var(--gray-400);
    font-size: 20px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--gray-800);
    width: 100%;
}

.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--gray-700);
    background: var(--gray-50);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--primary-400);
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

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

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

.data-table .actions-cell {
    display: flex;
    gap: 4px;
}

/* Stock badges */
.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.stock-badge.in-stock {
    background: var(--success-light);
    color: #059669;
}

.stock-badge.low-stock {
    background: var(--warning-light);
    color: #d97706;
}

.stock-badge.out-of-stock {
    background: var(--danger-light);
    color: var(--danger);
}

.total-stock {
    font-weight: 700;
    color: var(--gray-900);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--gray-400);
}

.empty-state .material-icons-round {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.empty-state.small {
    padding: 32px 16px;
}

.empty-state.small .material-icons-round {
    font-size: 40px;
    margin-bottom: 8px;
}

/* ===== POS LAYOUT ===== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

.pos-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.pos-search-bar .material-icons-round {
    color: var(--primary-500);
    font-size: 24px;
}

.pos-search-bar input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--gray-800);
    width: 100%;
    background: transparent;
}

.pos-search-results {
    max-height: 300px;
    overflow-y: auto;
}

.pos-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-50);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.pos-search-item:hover {
    background: var(--primary-50);
}

.pos-search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-search-item-name {
    font-weight: 600;
    color: var(--gray-800);
}

.pos-search-item-details {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.pos-search-item-price {
    font-weight: 700;
    color: var(--primary-600);
    font-size: 1.05rem;
}

.pos-search-item .size-pills {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.size-pill {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.size-pill.available {
    background: var(--success-light);
    color: #059669;
    cursor: pointer;
}

.size-pill.available:hover {
    border-color: var(--success);
    transform: scale(1.05);
}

.size-pill.out {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Cart */
.pos-cart-card {
    margin-top: 20px;
}

.pos-cart-items {
    max-height: 350px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    animation: slideIn 0.2s ease;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.cart-item-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px;
}

.cart-item-qty button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--gray-600);
}

.cart-item-qty button:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.cart-item-qty span {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cart-item-price {
    font-weight: 700;
    color: var(--gray-900);
    min-width: 80px;
    text-align: right;
}

.cart-item-remove {
    margin-left: 8px;
}

/* Summary Panel */
.pos-summary-card {
    position: sticky;
    top: 32px;
    padding: 24px;
}

.pos-summary-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.93rem;
    color: var(--gray-600);
}

.summary-row.summary-total {
    padding-top: 16px;
    border-top: 2px solid var(--gray-200);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gray-900);
}

.discount-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.discount-input-group input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: right;
    outline: none;
}

.discount-input-group input:focus {
    border-color: var(--primary-400);
}

.discount-input-group select {
    padding: 4px 6px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

/* Payment Method */
.payment-method {
    margin-bottom: 20px;
}

.payment-method label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
    display: block;
}

.payment-options {
    display: flex;
    gap: 8px;
}

.payment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-500);
    transition: all var(--transition-fast);
    text-align: center;
}

.payment-option input {
    display: none;
}

.payment-option:hover {
    border-color: var(--primary-300);
}

.payment-option.active {
    border-color: var(--primary-500);
    background: var(--primary-50);
    color: var(--primary-600);
}

.payment-option .material-icons-round {
    font-size: 22px;
}

/* Customer info */
.customer-info {
    margin-bottom: 24px;
}

.customer-info label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    display: block;
    margin-top: 12px;
}

.customer-info label:first-child {
    margin-top: 0;
}

.customer-info input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.customer-info input:focus {
    border-color: var(--primary-400);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

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

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--gray-100);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.size-inputs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.size-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.size-input-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 2px 12px;
    border-radius: 20px;
}

.size-input-group input {
    width: 70px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.size-input-group input:focus {
    border-color: var(--primary-400);
}

/* ===== RECENT LIST / DASHBOARD LISTS ===== */
.recent-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-50);
}

.recent-list-item:last-child {
    border: none;
}

.recent-list-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-list-item-primary {
    font-weight: 600;
    color: var(--gray-800);
}

.recent-list-item-secondary {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.recent-list-item-value {
    font-weight: 700;
    color: var(--gray-900);
}

.recent-list-item-value.danger {
    color: var(--danger);
}

/* ===== REPORTS ===== */
.reports-period {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Size chart in reports */
.size-chart-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.size-chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-chart-label {
    font-weight: 700;
    color: var(--gray-600);
    min-width: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.size-chart-track {
    flex: 1;
    height: 32px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.size-chart-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: fit-content;
}

.size-chart-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* ===== INVOICE ===== */
.invoice {
    padding: 8px;
}

.invoice-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--gray-300);
}

.invoice-header h2 {
    font-size: 1.4rem;
    color: var(--gray-900);
}

.invoice-header p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.invoice-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.invoice-meta dt {
    color: var(--gray-500);
    font-weight: 500;
}

.invoice-meta dd {
    color: var(--gray-800);
    font-weight: 600;
    text-align: right;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-table th {
    background: var(--gray-50);
    padding: 10px 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.invoice-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.invoice-totals {
    margin-left: auto;
    width: 250px;
}

.invoice-totals .row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.invoice-totals .row.total {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gray-900);
    border-top: 2px solid var(--gray-300);
    padding-top: 12px;
    margin-top: 8px;
}

/* Payment badge */
.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-badge.cash {
    background: var(--success-light);
    color: #059669;
}

.payment-badge.upi {
    background: var(--info-light);
    color: var(--info);
}

.payment-badge.card {
    background: #fae8ff;
    color: #a855f7;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--gray-900);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    animation: toastSlide 0.3s ease;
    min-width: 280px;
    max-width: 420px;
}

.toast.success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-exit {
    animation: toastExit 0.3s ease forwards;
}

@keyframes toastExit {
    to { opacity: 0; transform: translateX(30px); }
}

/* ===== FORM SECTIONS ===== */
.form-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section-label:first-child,
.form-section-label:first-of-type {
    margin-top: 0;
}

.form-section-label .material-icons-round {
    font-size: 18px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
    font-weight: 400;
}

.readonly-input {
    background: var(--gray-50) !important;
    color: var(--primary-600) !important;
    font-weight: 600 !important;
    cursor: default;
    border-color: var(--gray-200) !important;
}

.text-muted {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Shop barcode badge in tables */
.shop-barcode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-50), #e0e7ff);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
    letter-spacing: 0.3px;
}

.vendor-barcode-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-family: monospace;
}

/* ===== RESTOCK MODAL ===== */
.restock-scan-row {
    display: flex;
    gap: 8px;
}

.restock-scan-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.restock-scan-row input:focus {
    border-color: var(--primary-400);
}

.restock-product-info {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.restock-product-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.restock-product-header strong {
    font-size: 1.05rem;
    color: var(--gray-900);
}

.restock-product-header .text-muted {
    display: block;
    margin-top: 2px;
}

.restock-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.restock-size-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    flex: 1;
    min-width: 180px;
}

.restock-size-item .size-label {
    font-weight: 700;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    min-width: 40px;
    text-align: center;
}

.restock-size-item .current-stock {
    font-weight: 600;
    color: var(--gray-600);
    min-width: 24px;
    text-align: center;
}

.restock-size-item .arrow {
    color: var(--gray-400);
    font-size: 18px;
}

.restock-size-item input {
    width: 60px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.restock-size-item input:focus {
    border-color: var(--primary-400);
}

/* ===== BARCODE LABELS ===== */
.label-options {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.label-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.barcode-label {
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    text-align: center;
    background: white;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.barcode-label .label-name {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--gray-800);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barcode-label .label-size-price {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
}

.barcode-label .label-size {
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 1px 8px;
    border-radius: 10px;
}

.barcode-label .label-price {
    color: var(--gray-900);
    font-weight: 800;
}

.barcode-label svg {
    width: 100%;
    height: 50px;
}

/* ===== DISCOUNT PROFILES ===== */
.discount-profiles {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.discount-profiles > label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.profile-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-pill:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.profile-pill.active {
    border-color: var(--primary-500);
    background: var(--primary-500);
    color: white;
}

.profile-pill .profile-pct {
    opacity: 0.75;
}

.profile-pill-none {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-500);
}

.profile-pill-none:hover {
    border-color: var(--gray-400);
}

.profile-pill-none.active {
    border-color: var(--gray-600);
    background: var(--gray-600);
    color: white;
}

.profile-pill-settings {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all var(--transition-fast);
    font-size: 0;
}

.profile-pill-settings:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.profile-pill-settings .material-icons-round {
    font-size: 16px;
}

/* Profile Management */
.profile-manage-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
}

.profile-manage-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-manage-item-name {
    font-weight: 600;
    color: var(--gray-800);
}

.profile-manage-item-discount {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 2px 10px;
    border-radius: 20px;
}

/* ===== EXPENSES ===== */
.month-selector {
    display: flex;
    align-items: center;
    gap: 4px;
}

.month-label {
    font-weight: 700;
    color: var(--gray-700);
    min-width: 140px;
    text-align: center;
    font-size: 0.95rem;
}

.expense-category-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
}

.expense-category-bar:last-child {
    border-bottom: none;
}

.expense-cat-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
}

.expense-cat-info {
    flex: 1;
}

.expense-cat-name {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.expense-cat-bar-track {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.expense-cat-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    transition: width 0.5s ease;
}

.expense-cat-amount {
    font-weight: 700;
    color: var(--gray-800);
    font-size: 0.9rem;
    min-width: 80px;
    text-align: right;
}

.expense-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
}

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

.expense-list-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.expense-list-icon {
    font-size: 1.1rem;
}

.expense-list-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.expense-list-cat {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.88rem;
}

.expense-list-desc {
    font-size: 0.78rem;
    color: var(--gray-400);
}

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

.expense-list-amount {
    font-weight: 700;
    color: var(--danger);
    font-size: 0.9rem;
}

.recurring-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--info-light);
    color: var(--info);
    text-transform: uppercase;
}

.net-profit-positive {
    color: var(--success) !important;
}

.net-profit-negative {
    color: var(--danger) !important;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    
    .pos-summary-card {
        position: static;
    }
}

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

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

    .sidebar-overlay.open {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

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

    .stat-value {
        font-size: 1.25rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .page-header {
        flex-direction: column;
    }

    .payment-options {
        flex-direction: column;
    }

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

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

/* Print styles */
@media print {
    .sidebar,
    .mobile-header,
    .modal-footer,
    .toast-container {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }

    .modal-overlay.open {
        position: static;
        background: none;
        backdrop-filter: none;
    }

    .modal {
        box-shadow: none;
        max-width: none;
        border-radius: 0;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

/* Login Modal Premium Styling */
#loginModal {
    z-index: 10000;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(8px);
}

#loginModal .modal {
    padding: 40px;
    background: rgba(30, 32, 44, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-width: 420px;
    border-radius: 24px;
}

#loginModal .modal-header {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: none;
}

#loginModal .modal-header h3 {
    font-size: 1.75rem;
    font-family: var(--font-brand);
    background: linear-gradient(to right, #fff, var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

#loginModal .form-group label {
    color: var(--gray-400);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

#loginModal .form-group input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 16px;
    height: auto;
    font-size: 1rem;
    transition: all 0.2s ease;
}

#loginModal .form-group input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--prime);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

#loginModal .btn-primary {
    background: linear-gradient(135deg, var(--prime), #4f46e5);
    border: none;
    height: 54px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

#loginModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

/* Ensure smooth transition when blurring main content */
#sidebar, main {
    transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


