:root {
    --sidebar-width: 250px;
    --sidebar-bg: #2c3e50;
    --sidebar-color: #ecf0f1;
    --topbar-height: 50px;
    --accent-color: #3498db;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: width 0.3s;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.menu-item {
    border-bottom: 1px solid #34495e;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-color);
    text-decoration: none;
    transition: background 0.2s;
    cursor: pointer;
}

.menu-link:hover {
    background-color: #34495e;
}

.menu-link i {
    width: 30px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-text {
    margin-left: 10px;
    white-space: nowrap;
    flex-grow: 1;
}

.sidebar.collapsed .menu-text, 
.sidebar.collapsed .submenu-toggle {
    display: none;
}

/* Nested Menu */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #34495e;
    display: none;
}

.submenu.open {
    display: block;
}

.submenu-link {
    padding: 10px 15px 10px 45px;
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
}

.submenu-link:hover {
    color: white;
    background-color: #3d566e;
}

.sidebar.collapsed .submenu {
    display: none !important;
}

.container-fluid {
    width: 100%;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    height: var(--topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.top-bar-left, .top-bar-right {
    display: flex;
    align-items: center;
}

.top-bar-right .cart-link {
    position: relative;
    margin-left: 20px;
}

.top-bar-right .cart-link a {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.top-bar-right .cart-link .badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 14px;
    text-align: center;
}

.content-area {
    padding: 0px;
    overflow-y: auto;
}

.lang-picker {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.user-info-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info-top a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-info-top a:hover {
    color: var(--accent-color);
}

.lang-picker a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
}

.lang-picker a:hover {
    color: var(--accent-color);
}

#toggle-sidebar {
    background: none;
    border: none;
    color: var(--sidebar-color);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Common UI Elements */
.btn {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0069d9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.85em;
}

.btn-outline-primary {
    border: 1px solid #007bff;
    color: #007bff;
    background: white;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.btn-outline-success {
    border: 1px solid #28a745;
    color: #28a745;
    background: white;
}

.btn-outline-success:hover {
    background: #28a745;
    color: white;
}

.btn-outline-warning {
    border: 1px solid #ffc107;
    color: #856404;
    background: white;
}

.btn-outline-warning:hover {
    background: #ffc107;
    color: #212529;
}

.btn-outline-info {
    border: 1px solid #17a2b8;
    color: #17a2b8;
    background: white;
}

.btn-outline-info:hover {
    background: #17a2b8;
    color: white;
}

.btn-outline-secondary {
    border: 1px solid #6c757d;
    color: #6c757d;
    background: white;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

.btn-outline-danger {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: white;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
}

/* Table and Sorting */
.sort-icon {
    text-decoration: none;
    color: #999;
    margin-left: 5px;
}

.sort-icon.active {
    color: #007bff;
    font-weight: bold;
}

.filter-row input, .filter-row select {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    font-size: 0.9em;
}

/* Card Styles (if used) */
.card {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
    background: #fff;
}

.card-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.card-body {
    padding: 15px;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination a, .pagination span {
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
}

.pagination .active {
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
}

/* Utils */
.mb-20 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 5px; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }
.mt-5 { margin-top: 5px; }
.p-5 { padding: 5px; }
.white-nowrap { white-space: nowrap; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-100 { width: 100%; }

/* Form styles */
.form-group { margin-bottom: 15px; }
.form-label { display: block; margin-bottom: 5px; font-weight: bold; }
.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.span-2 {
    grid-column: span 2;
}

.bg-light { background-color: #f8f9fa; }
.bg-warning { background-color: #fff3cd; }
.border-warning { border: 1px solid #ffeeba; }
.badge { padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: white; display: inline-block; }
.badge-danger { background-color: #dc3545; }
.badge-warning { background-color: #ffc107; color: black; }
.badge-info { background-color: #17a2b8; }
.badge-success { background-color: #28a745; }
.text-primary { color: #007bff; }
.text-secondary { color: #6c757d; }
.flex-wrap { flex-wrap: wrap; }
.align-baseline { align-items: baseline; }
.align-end { align-items: flex-end; }
.gap-5 { gap: 5px; }
.gap-2 { gap: 2px; }
.mt-15 { margin-top: 15px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.br-4 { border-radius: 4px; }
.overflow-hidden { overflow: hidden; }
.border-color-dee2e6 { border-color: #dee2e6; }
.p-20 { padding: 20px; }
.br-8 { border-radius: 8px; }
.border { border: 1px solid #dee2e6; }
.border-top { border-top: 1px solid #eee; }
.border-top-dashed { border-top: 1px dashed #ccc; }

/* Dashboard cards */
.dash-card {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
}

.dash-card-blue {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
}

.dash-card-blue h2 {
    color: #1976d2;
}

.dash-card-orange {
    background: #fff3e0;
    border-left: 5px solid #ff9800;
}

.dash-card-orange h2 {
    color: #e65100;
}

.progress-bar {
    background: #eee;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: #4caf50;
    height: 100%;
    transition: width 0.5s;
}

.bg-white { background-color: white; }
.br-10 { border-radius: 10px; }
.p-8 { padding: 8px; }
.p-2-5 { padding: 2px 5px; }
.mt-0 { margin-top: 0; }
.mr-10 { margin-right: 10px; }

/* Receipt styles */
.receipt-box {
    width: 300px;
    border: 1px solid #000;
    padding: 15px;
    font-family: monospace;
    background: white;
    margin: 0 auto;
}

@media print {
    .no-print { display: none !important; }
    .sidebar { display: none !important; }
    .top-bar { display: none !important; }
    .content-area { padding: 0 !important; }
    body { background: white !important; }
    hr { border-top: 1px dashed black !important; }
}

/* POS specific styles */
.pos-toast {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

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

.pos-toast.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.box-shadow {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tile-item {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 0.85em;
    align-items: center;
    transition: background 0.2s;
}

.tile-item:hover {
    background-color: #f1f1f1;
}

.pos-sidebar {
    width: 350px;
    background: #eee;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 85vh;
    overflow-y: auto;
}

.pos-sidebar .form-group {
    margin-bottom: 8px;
}

.pos-table th {
    padding: 10px;
    text-align: left;
    color: #666;
    border-bottom: 2px solid #eee;
}

.pos-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
