:root {
    --primary-color: #d4af37; /* Gold */
    --secondary-color: #2c2c2c; /* Charcoal */
    --bg-color: #fdfbf7; /* Cream */
    --text-color: #006a4e;
    --white: #ffffff;
    --transition: all 0.4s ease;
    --in-stock: #2e7d32;
    --low-stock: #f57c00;
    --out-of-stock: #c62828;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
}

/* Navigation & Brands Bar (Consistent Luxury Header) */
nav {
    display: flex;
    justify-content: space-between;
    padding: 12px 6%;
    align-items: center;
    min-height: 85px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.charges-section {
    margin: 20px 0;
    padding: 20px;
    background: #111;
    color: #fff;
    border-radius: 12px;
}

.section-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    margin-top: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.charge-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.charge-form input[type="text"], 
.charge-form input[type="number"] {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
}

.charge-value-row {
    display: flex;
    gap: 10px;
}

.charge-type-toggle, .automation-toggle {
    display: flex;
    background: #222;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.type-btn, .auto-btn {
    border: none;
    background: transparent;
    color: #888;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.type-btn.active, .auto-btn.active {
    background: #444;
    color: #fff;
}

.charge-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: #444;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.scope-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scope-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    border: 1px solid #333;
}

.scope-item input {
    display: none;
}

.scope-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.scope-title {
    font-weight: bold;
    font-size: 0.95rem;
}

.scope-desc {
    font-size: 0.8rem;
    color: #888;
}

.check-icon {
    display: none;
    color: #fff;
    margin-left: 10px;
}

.scope-item input:checked ~ .check-icon {
    display: block;
}

.full-width {
    width: 100%;
}

.applied-charges {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.charge-pill {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #222;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #eee;
}

.charge-pill .remove-charge {
    color: #ff4d4d;
    cursor: pointer;
    font-size: 1.2rem;
}


.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover, .nav-links a.active-link {
    color: var(--text-color);
}

.nav-links a:hover::after, .nav-links a.active-link::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
}

.burger div {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

.brands-bar {
    background: linear-gradient(90deg, #181d1a 0%, #242b26 50%, #181d1a 100%);
    color: #e5e5e5;
    padding: 11px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    overflow-x: auto;
    white-space: nowrap;
}

.brands-bar > span {
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brands-bar > span::before {
    content: "✦";
    color: var(--primary-color);
}

.brands-scroll {
    display: flex;
    gap: 30px;
    color: var(--primary-color);
}

.brands-scroll span {
    color: #dedede;
    transition: color 0.25s ease;
    cursor: pointer;
}

.brands-scroll span:hover {
    color: var(--primary-color);
}

/* App Layout with Modern Luxury Sidebar */
.app-wrapper {
    display: flex;
    min-height: 92vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #18201a 0%, #101412 100%);
    color: var(--white);
    padding: 24px 0;
    flex-shrink: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(212, 175, 55, 0.18);
}

.sidebar-header {
    padding: 0 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.sidebar-header h3 {
    color: var(--primary-color);
    font-size: 1.35rem;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 0 10px;
}

.sidebar-nav li {
    padding: 13px 18px;
    margin-bottom: 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d1d5db;
}

.sidebar-nav li:hover {
    background: rgba(212, 175, 55, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-nav li.active {
    background: linear-gradient(135deg, #dfbc45 0%, #c49d28 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    font-weight: 600;
}

.burger {
    display: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.32);
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.burger img {
    filter: none;
    transition: transform 0.3s ease;
}

.burger.toggle {
    background: rgba(212, 175, 55, 0.25);
    border-color: #d4af37;
}

.burger.toggle img {
    transform: rotate(90deg) scale(0.95);
}

.content-area {
    flex-grow: 1;
    padding: 35px 40px;
    background-color: var(--bg-color);
    overflow-y: auto;
}

/* Module Control */
.module {
    display: none;
    animation: fadeIn 0.4s ease;
}

.module.active {
    display: block;
}

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

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 18px;
}

.module-header h2 {
    font-size: 2.2rem;
    color: var(--text-color);
    margin: 0;
}

/* Mini Summary (Modern SaaS Metric Cards) */
.dashboard-mini-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.mini-card {
    background: #ffffff;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: var(--transition);
}

.mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(212, 175, 55, 0.45);
}

.mini-card span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    font-weight: 600;
}

.mini-card strong {
    font-size: 1.6rem;
    color: var(--text-color);
    font-family: 'Playfair Display', serif;
}

.mini-card.alert {
    border-left: 5px solid var(--out-of-stock);
}

.notification-bell {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 9px;
    border-radius: 50%;
    transition: var(--transition);
}

.notification-bell:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.notification-bell .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid #18201a;
}

/* Forms & Grids */
.sale-grid {
    display: grid;
    grid-template-columns: 1fr 400px 300px;
    gap: 20px;
    margin-bottom: 40px;
}

.pos-history-section {
    margin-top: 20px;
    padding: 15px !important;
}

.pos-history-section h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mini-history-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

.mini-history-item {
    width: 100%;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mini-history-item .header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.mini-history-item .details {
    font-size: 0.75rem;
    color: #444;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-history-item .total {
    text-align: right;
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

.mini-history-item .actions {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}

.btn-mini {
    padding: 3px 10px;
    font-size: 0.7rem;
    border-radius: 4px;
}

.sale-form-box, .invoice-box, /* Zuru App Style - Store Management */
.zuru-style {
    background: #252525;
    color: #006a4e;
    padding: 20px;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.zuru-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.zuru-header h2 {
    flex-grow: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #006a4e;
    margin: 0;
}

.zuru-back-btn {
    background: none;
    border: none;
    color: #006a4e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.zuru-input-group {
    margin-bottom: 25px;
}

.zuru-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.zuru-sublabel {
    display: block;
    font-size: 0.9rem;
    color: #888888;
    margin-bottom: 15px;
}

.zuru-input {
    width: 100%;
    background: #ffffff;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 15px;
    color: #111111;
    font-size: 1rem;
    outline: none;
}

.zuru-input::placeholder {
    color: #353535;
}

.zuru-permission-card {
    background: #ffffff;
    border: 1px solid #333333;
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 20px;
}

.zuru-permission-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #1c1c1e;
}

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

.zuru-permission-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    accent-color: #34c759;
    background: transparent;
    border: 1px solid #555555;
    border-radius: 50%;
    cursor: pointer;
}

.zuru-permission-icon {
    margin-right: 15px;
    font-size: 1.2rem;
    color: #888888;
    width: 24px;
    text-align: center;
}

.zuru-permission-name {
    flex-grow: 1;
    font-size: 1rem;
    color: #000000;
}

.zuru-submit-btn {
    width: 100%;
    background: #000000;
    color: #34c759;
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.zuru-submit-btn:hover {
    background: #253d32;
}

.zuru-create-role-btn {
    width: 100%;
    background: transparent;
    border: 1px solid #34c759;
    color: #34c759;
    border-radius: 12px;
    padding: 15px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.admin-card.zuru-style h3 {
    color: #000000;
    font-family: inherit;
    font-weight: 700;
    margin-bottom: 20px;
}

.admin-card.zuru-style {
    box-shadow: none;
    margin-bottom: 30px;
}

.zuru-role-select {
    width: 100%;
    background: #ffffff;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 15px;
    color: #000000;
    font-size: 1rem;
    outline: none;
    appearance: none;
    margin-bottom: 10px;
}

.zuru-role-list, .zuru-staff-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.zuru-item {
    background: #000000;
    padding: 15px 5px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.zuru-item-info strong {
    display: block;
    color: #ffffff;
}

.zuru-item-info small {
    color: #888888;
}

#rolesList, #staffList {
    background: #ffffff;
    padding: 10px 0;
}

#rolesList li, #staffList li {
    background: #1c1c1e;
    color: #ffffff;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#rolesList li button, #staffList li button {
    margin-left: 10px;
}

.zuru-item-actions {
    display: flex;
    align-items: center;
}

.admin-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.customer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.customer-info #paidFields {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
}

.customer-info #paidFields select {
    width: 100%;
    min-width: 0;
}

.sale-list-container {
    margin-top: 20px;
}

.sale-total-display {
    text-align: right;
    margin: 20px 0;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card.profit {
    border-left: 5px solid #2e7d32;
}

/* Image Preview */
.image-upload {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#imagePreview {
    border-radius: 4px;
    border: 1px solid #ddd;
    object-fit: cover;
}

.prod-img-small {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

/* Table Responsive */
.table-container {
    margin-top: 10px;
    overflow-x: auto;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

/* Invoice Styles */
.invoice-box {
    border: 1px solid #ddd;
}

.invoice-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.invoice-total {
    border-top: 1px dashed #333;
    margin-top: 10px;
    padding-top: 10px;
    font-weight: bold;
}

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-wrapper {
    position: relative;
    display: inline-block;
}

#inventorySearch {
    padding: 12px 20px;
    width: 350px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: var(--transition);
}

#inventorySearch:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 2px;
}

.search-results-dropdown.hidden {
    display: none;
}

.searchable-select-container {
    position: relative;
    width: 100%;
}

.searchable-select-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    background-color: #fff;
    color: #333;
}

.highlight-row {
    background-color: #fff9c4 !important;
    transition: background-color 0.5s ease;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

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

.search-result-item:hover {
    background-color: #fdf7e7;
}

.search-result-item img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    background: #eee;
}

.search-result-info {
    flex: 1;
}

.search-result-info h5 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.search-result-info p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: #777;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

/* Smart Scanner Styling */
.smart-scanner-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px dashed var(--primary-color);
}

.scanner-input-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#barcodeScannerInput {
    flex: 1;
    min-width: 280px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

#barcodeScannerInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

#camera-reader {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.stock-control button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

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

.btn-stock-out {
    background-color: var(--out-of-stock);
    color: white;
}

.btn-stock-in:hover, .btn-stock-out:hover {
    opacity: 0.8;
}

/* Form Styling */
.product-form {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.product-form h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.full-width {
    grid-column: 1 / -1;
}

.product-form input, .product-form textarea, .product-form select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    background-color: #fff;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M10.293%203.293L6%207.586%201.707%203.293A1%201%200%2000.293%201.707L5.293%206.707a1%201%200%20001.414%200l5-5a1%201%200%2010-1.414-1.414z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

/* --- POS MODULE STYLES --- */
.pos-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 15px;
    align-items: start;
}

.pos-module-header{
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.pos-search-section {
    position: relative;
}

.btn-scan {
    padding: 12px 20px;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--secondary-color); 
    color: var(--white);
}
.search-input-group {
    position: relative;
}

#posBarcodeSearch {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    transition: var(--transition);
}

#posBarcodeSearch:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.hint {
    font-size: 0.8rem;
    color: #888;
    margin-top: 8px;
}

.cart-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
}

#posCartTable {
    width: 100%;
    border-collapse: collapse;
}

#posCartTable th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #eee;
    color: #666;
    font-size: 0.9rem;
}

#posCartTable td {
    padding: 10px 8px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-controls button {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-controls button:hover {
    background: #f5f5f5;
}

.pos-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
}

.grand-total {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.grand-total strong {
    color: var(--primary-color);
}

.pos-checkout-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.pos-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.full-width {
    width: 100%;
}

/* Receipt Modal Styles */
.receipt-content {
    max-width: 320px !important;
    margin: 10px auto;
}

#receiptPrintArea {
    font-family: 'Courier New', Courier, monospace;
    padding: 1px;
    color: #000;
    box-sizing: border-box;
    width: 100%;
}

.receipt-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.receipt-header p {
    margin: 2px 0;
    font-size: 0.8rem;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    min-width: auto;
    table-layout: fixed;
}

.receipt-table th {
    text-align: left;
    border-bottom: 1px dashed #000;
    font-size: 0.75rem;
    padding: 2px 0;
}

.receipt-table th:nth-child(1),
.receipt-table td:nth-child(1) {
    width: 36%;
    text-align: left;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
    width: 10%;
    text-align: center;
    white-space: nowrap;
}

.receipt-table th:nth-child(3),
.receipt-table td:nth-child(3) {
    width: 27%;
    text-align: right;
    white-space: nowrap;
}

.receipt-table th:nth-child(4),
.receipt-table td:nth-child(4) {
    width: 27%;
    text-align: right;
    white-space: nowrap;
    padding-right: 2px;
}

.receipt-table td {
    padding: 5px 0;
    font-size: 0.75rem;
    word-wrap: break-word;
    vertical-align: top;
}

.receipt-summary {
    text-align: right;
    margin-top: 10px;
    font-size: 0.85rem;
}

.receipt-footer {
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    font-size: 0.75rem;
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 5px;
    transition: var(--transition);
}

.btn-text.danger {
    color: var(--out-of-stock);
}

.btn-text.danger:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.input-with-action {
    display: flex;
    gap: 10px;
}

.input-with-action input {
    flex-grow: 1;
    padding: 10px;
}

.btn-sm {
    background-color: #000;
    color: white;
    border: none;
    border-top-left-radius: none;
    border-bottom-left-radius: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 1px 8px;
    font-size: 0.8rem;
    position: relative;
    font-family: 'Montserrat', sans-serif;
    right: 4px;
}

.search-item:hover {
    background: #fdf7e7;
}

/* --- NEW POS CALCULATOR STYLES --- */
.pos-summary-item-input {
    margin-bottom: 12px;
}

.pos-summary-item-input label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.input-group-row {
    display: flex;
    gap: 5px;
}

.input-group-row input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 600;
}

.input-group-row select {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.amount-paid-section {
    margin-top: 15px;
    display: block !important;
}

.amount-paid-section label {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.highlight-input {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: var(--primary-color);
    border: 2px solid var(--primary-color) !important;
    background: #fffdf5 !important;
    text-align: right;
}

.balance-section {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
}

.balance-section strong {
    font-size: 1.1rem;
}

/* Quick Cash Buttons */
.quick-cash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0;
}

.btn-quick {
    padding: 10px 5px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-quick:hover {
    background: #f0f0f0;
    border-color: var(--primary-color);
}

.btn-quick.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Keypad Styles */
.pos-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.pos-keypad button {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid #eee;
    background: #fafafa;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.pos-keypad button:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.pos-keypad button:active {
    background: #e0e0e0;
}

.key-wide {
    grid-column: span 1.5;
}

.pos-keypad button.key-wide {
    grid-column: span 1.5;
}

/* Adjust grid if needed */
.pos-keypad {
    grid-template-columns: repeat(3, 1fr);
}

.pos-keypad button:nth-last-child(2),
.pos-keypad button:nth-last-child(1) {
    grid-column: span 1.5;
    background: #fff1f1;
    color: #c62828;
}

/* Table Styling (Modern Luxury Dashboard) */
.inventory-table-container,
.table-container {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

th {
    background: linear-gradient(90deg, #18201a 0%, #212c24 100%);
    color: #f3f4f6;
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    border-bottom: 2px solid var(--primary-color);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0eee6;
    vertical-align: middle;
    transition: background 0.2s ease;
}

tr:hover td {
    background-color: #fbf9f4;
}

.prod-info-cell h4 {
    color: var(--text-color);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.prod-info-cell p {
    font-size: 0.8rem;
    color: #777;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-in { 
    background-color: #e8f5e9; 
    color: #2e7d32; 
    border: 1px solid rgba(46, 125, 50, 0.25);
}
.badge-low { 
    background-color: #fff8e1; 
    color: #d97706; 
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.badge-out { 
    background-color: #ffebee; 
    color: #dc2626; 
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.stock-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stock-control input {
    width: 60px;
    padding: 5px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn.primary { background-color: var(--primary-color); color: var(--white); }
.btn.primary:hover { opacity: 0.8; }
.btn.secondary { background-color: var(--secondary-color); color: var(--white); }
.btn.danger { background-color: #c62828; color: var(--white); }

.hidden { display: none !important;}

/* Footer */
footer {
    padding: 60px 20px;
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
    padding-top: 20px;
    font-size: 0.8rem;
    color: #777;
}

/* Mobile Responsiveness */
/* Order Notifications */
.order-notification-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px;
    border-radius: 8px;
    z-index: 9999;
    animation: slideInRight 0.5s ease;
    max-width: 300px;
}
.alert-content { display: flex; align-items: center; gap: 15px; }
.alert-icon { font-size: 1.5rem; }
.alert-text strong { display: block; color: var(--secondary-color); }
.alert-text p { font-size: 0.8rem; margin: 5px 0 10px; color: #666; }
.order-notification-alert button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Admin and Management Styles */
.permissions-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.permissions-list label {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.admin-card ul {
    list-style: none;
    margin-top: 15px;
}

.admin-card ul li {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 0.6rem;
}

/* Comparative Analysis Dashboard Styles */
.dashboard-summary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.summary-card {
    padding: 20px;
    border-radius: 8px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.summary-card h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-family: 'Montserrat', sans-serif;
}

.summary-card p {
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-blue { background: linear-gradient(135deg, #3a7afe, #1a5adf); }
.card-teal { background: linear-gradient(135deg, #17c7d4, #0ca9b6); }
.card-orange { background: linear-gradient(135deg, #f09d38, #d68120); }
.card-green { background: linear-gradient(135deg, #4cc330, #38a51e); }
.card-teal-green { background: linear-gradient(135deg, #19b38c, #128d6d); }

.dashboard-main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
}

.dashboard-left-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chart-container-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.chart-container-box h3 {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

.dashboard-right-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.side-control-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.side-control-box h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #444;
}

.year-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.year-btn {
    padding: 10px;
    border: 1px solid #eee;
    background: #f9f9f9;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.year-btn.active {
    background: #3a7afe;
    color: white;
    border-color: #3a7afe;
}

.donut-wrapper {
    position: relative;
    height: 200px;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-center-text span {
    font-size: 1.8rem;
    font-weight: bold;
    color: #19b38c;
}
.donut-center-text p {
    font-size: 0.75rem;
    color: #777;
    margin-top: 5px;
}

/* Modal and Auth Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 90%;
    max-width: 450px;
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.auth-hidden {
    display: none !important;
}

.admin-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 10px 15px;
    border-radius: 30px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.admin-status .logout-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}

.admin-status .logout-btn:hover {
    background: #ff4d4d;
}

@media screen and (max-width: 1200px) {

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

@media screen and (max-width: 1024px) {
    .app-wrapper { 
        flex-direction: column; 
    }

    .sidebar { 
        width: 100%; 
        display: flex; 
        overflow-x: auto; 
        padding: 10px; 
    }

    .sidebar-header { 
        display: none; 
    }

    .sidebar-nav { 
        display: flex; 
    }

    .sidebar-nav li { 
        white-space: nowrap; 
        padding: 10px 25px; 
    }

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

@media screen and (max-width: 980px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .burger {
        display: flex;
        z-index: 1002;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 290px;
        max-width: 82vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 26px;
        padding-top: 100px;
        background: #ffffff;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid rgba(212, 175, 55, 0.32);
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.18);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.4s;
        z-index: 1001;
        visibility: hidden;
    }

    .nav-links.nav-active {
        transform: translateX(0);
        visibility: visible;
        transition-delay: 0s;
    }

    .nav-links a {
        color: #222222;
        font-family: 'Playfair Display', serif;
        font-size: 1.3rem;
        letter-spacing: 1px;
    }

    .app-wrapper {
        flex-direction: column;
        width: 100%;
        min-width: 0;
    }

    .sidebar {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

    .sidebar-header {
        padding: 5px 15px;
        margin-bottom: 5px;
        border-bottom: none;
    }

    .sidebar-header h3 {
        font-size: 1rem;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 5px 10px;
        gap: 10px;
        scrollbar-width: none; /* Firefox */
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .sidebar-nav li {
        display: flex !important; /* Ensure they are visible as flex items in the row */
        padding: 8px 15px;
        border-radius: 20px;
        white-space: nowrap;
        background: rgba(255,255,255,0.05);
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .sidebar-nav li[style*="display: none"] {
        display: none !important; /* Allow JS to still hide unauthorized ones */
    }

    .sidebar-nav li:hover, .sidebar-nav li.active {
        background-color: var(--primary-color);
    }

    .content-area {
        padding: 15px;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .module,
    .sales-history,
    .table-container,
    .inventory-table-container {
        min-width: 0;
        max-width: 100%;
    }

    .brands-bar {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 10px 20px;
        gap: 20px;
    }
    
    .brands-scroll{
        gap: 30px;
        font-size: 0.7rem;
    }

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

    .dashboard-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .btn-sm {
        background-color: #000;
        color: white;
        border: none;
        border-top-left-radius: none;
        border-bottom-left-radius: none;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        padding: 1px 2px;
        font-size: 0.8rem;
        position: relative;
        font-family: 'Montserrat', sans-serif;
        right: 8px;
    }
}

@media screen and (max-width: 780px) {
    .module-header {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 15px;
    }

    .inventory-container {
        padding: 20px 10px;
    }

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-summary-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 25px;
    }
    #inventorySearch {
        width: 100%;
    }

    .btn-sm {
        background-color: #000;
        color: white;
        border: none;
        border-top-left-radius: none;
        border-bottom-left-radius: none;
        border-top-right-radius: 6px;
        border-bottom-right-radius: 6px;
        padding: 1px 2px;
        font-size: 0.8rem;
        position: relative;
        font-family: 'Montserrat', sans-serif;
        right: 4px;
    }
}
@media screen and (max-width: 568px) {
    .module-header {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 15px;
    }

    .brands-bar {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 10px 20px;
        gap: 10px;
    }
    
    .brands-scroll{
        gap: 20px;
        font-size: 0.7rem;
    }

    .dashboard-summary-row {
        display: flex;
        flex-direction: column;
    }

    .btn-sm {
        background-color: #000;
        color: white;
        border: none;
        border-radius: 1px;
        padding: 1px 2px;
        font-size: 0.8rem;
        position: relative;
        font-family: 'Montserrat', sans-serif;
        right: 1px;
    }

    .pos-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .pos-main, .pos-sidebar {
        width: 100%;
    }

    .pos-sidebar {
        order: 2;
    }

    .pos-main {
        order: 1;
    }

    /* Stack search and scan button */
    .input-with-action {
        flex-direction: column;
        gap: 10px;
    }

    .btn-scan {
        width: 100%;
    }

    /* Make cart table scrollable horizontally */
    .cart-table-wrapper {
        overflow-x: auto;
    }

    #posCartTable {
        min-width: 500px;
    }

    .zuru-item {
        background: #000000;
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
    }

    .zuru-item-info {
        text-align: left;
        width: 100%;
    }

    .zuru-item-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 10px;
        margin-top: 10px;
    }
    /* Touch friendly keypad */
    .pos-keypad {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .pos-keypad button {
        padding: 20px 0;
        font-size: 1.2rem;
    }

    .quick-cash-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Responsive Charges Section */
    .charge-value-row {
        flex-direction: column;
    }

    .charge-type-toggle, .automation-toggle {
        width: 100%;
    }

    .type-btn, .auto-btn {
        padding: 12px;
    }

    .charge-discount-row {
        flex-direction: column;
    }

    .scope-item {
        padding: 15px;
    }

    .scope-title {
        font-size: 0.9rem;
    }

    .scope-desc {
        font-size: 0.75rem;
    }
}

/* Specific responsiveness for 500px and below to fix overlapping */
@media (max-width: 500px) {
    .content-area {
        padding: 8px !important;
    }

    .module-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .sale-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .sale-form-box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px 10px !important;
        margin: 0 auto !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    .form-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .searchable-select-container,
    .searchable-select-container input {
        width: 100% !important;
    }

    .customer-info {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 15px 0 !important;
        border-top: 1px solid rgba(255,255,255,0.1) !important;
    }

    .customer-info input, 
    .customer-info select, 
    .customer-info textarea,
    .form-grid input,
    .form-grid select {
        width: 100% !important;
        margin-bottom: 0 !important;
        height: 45px; /* Better touch targets */
    }

    .customer-info #paidFields {
        width: 100%;
        min-width: 0;
    }

    textarea#saleNote {
        height: 80px !important;
    }

    .charges-section {
        padding: 12px;
        margin: 15px 0;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .toggle-row {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        width: 100% !important;
        padding: 10px 0;
    }

    .charge-value-row {
        flex-direction: column !important;
        gap: 10px;
    }

    .charge-type-toggle, .automation-toggle {
        width: 100% !important;
    }

    .auto-btn {
        width: 100%;
        text-align: center !important;
    }

    .scope-options {
        width: 100% !important;
    }

    /* Fix table overlapping */
    .sale-list-container {
        overflow-x: auto;
        width: 100% !important;
        margin-top: 15px;
    }

    #saleListTable {
        min-width: 400px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }

    .form-actions button {
        width: 100% !important;
        padding: 12px !important;
    }
}

/* Extra small screens like 398px */
@media (max-width: 400px) {
    .sale-form-box h3 {
        font-size: 1.1rem;
        text-align: center;
    }

    .mini-card {
        padding: 10px;
    }
}

/* =============================================
   PRINT SYSTEM — A4 invoices
   Uses body.printing-invoice
   set by JS before calling window.print()
   ============================================= */

@media print {

    /* ---------- DEFAULT PAGE (fallback) ---------- */
    @page { size: auto; margin: 0; }

    /* ---------- INVOICE MODE: A4 portrait ---------- */
    @page invoice-page {
        size: A4 portrait;
        margin: 10mm;
    }

    body.printing-invoice {
        page: invoice-page;
    }

    /* ---- GLOBAL: Hide everything first ---- */
    body * {
        visibility: hidden;
    }

    /* ---- Hide all UI chrome unconditionally ---- */
    .modal-actions, .modal-overlay,
    nav, .sidebar, .brands-bar, .notification-bell,
    footer, .admin-status, .toast-container,
    header, .top-bar, button, .btn {
        display: none !important;
    }

    /* =======================================
       INVOICE PRINTING (A4 paper)
       ======================================= */
    body.printing-invoice #invoice-template,
    body.printing-invoice #invoice-template * {
        visibility: visible !important;
    }

    body.printing-invoice #invoice-template {
        position: absolute;
        left: 0;
        top: 0;
        width: 190mm !important;
        max-width: 190mm !important;
        margin: 0 !important;
        padding: 5mm !important;
        background: #fff !important;
        color: #333 !important;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
    }

    /* Invoice header */
    body.printing-invoice #invoice-template h1 {
        font-size: 18px !important;
        color: #000 !important;
    }
    body.printing-invoice #invoice-template h2 {
        font-size: 28px !important;
        color: #004936 !important;
    }

    /* Invoice tables */
    body.printing-invoice #invoice-template table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
        page-break-inside: avoid !important;
    }
    body.printing-invoice #invoice-template th {
        background: #333 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-size: 10px !important;
        padding: 8px !important;
    }
    body.printing-invoice #invoice-template td {
        font-size: 11px !important;
        padding: 8px !important;
        border-bottom: 1px solid #eee !important;
    }

    /* Invoice images */
    body.printing-invoice #invoice-template img {
        max-width: 80px !important;
        height: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Invoice QR */
    body.printing-invoice #invoice-qrcode {
        width: 55px !important;
        height: 55px !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body.printing-invoice #invoice-qrcode img,
    body.printing-invoice #invoice-qrcode canvas {
        width: 55px !important;
        height: 55px !important;
    }

    /* Prevent page breaks inside key sections */
    body.printing-invoice #invoice-template > div {
        page-break-inside: avoid !important;
    }

    /* Force background colors to print */
    body.printing-invoice * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* =======================================
       RECEIPT PRINTING (thermal / POS printer)
       ======================================= */
    @page receipt-page {
        size: 58mm auto;
        margin: 0;
    }

    body.printing-receipt {
        page: receipt-page;
        background: #fff !important;
    }

    body.printing-receipt #receiptModal {
        display: block !important;
        position: static !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 58mm !important;
        max-width: 58mm !important;
        height: auto !important;
    }

    body.printing-receipt #receiptModal .modal-content {
        display: block !important;
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 58mm !important;
        max-width: 58mm !important;
        overflow: visible !important;
    }

    body.printing-receipt #receiptPrintArea,
    body.printing-receipt #receiptPrintArea * {
        visibility: visible !important;
        color: #000000 !important;
        font-weight: 700 !important;
    }

    body.printing-receipt #receiptPrintArea {
        position: relative !important;
        margin: 0 0 0 1.5mm !important;
        width: 48mm !important;
        max-width: 48mm !important;
        padding: 2mm 1mm 4mm 1mm !important;
        background: #fff !important;
        color: #000000 !important;
        font: bold 10px/1.3 "Courier New", Courier, monospace !important;
        box-sizing: border-box !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-header h2 {
        margin: 2mm 0 !important;
        text-align: center !important;
        font: 900 15px Georgia, serif !important;
        color: #000000 !important;
        letter-spacing: 0.5px !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-header p {
        margin: 1mm 0 !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    body.printing-receipt #receiptPrintArea hr {
        border: 0 !important;
        border-top: 1.5px dashed #000000 !important;
        margin: 2mm 0 !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table {
        width: 100% !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table th {
        border-bottom: 1.5px dashed #000000 !important;
        text-align: left !important;
        font-size: 9.5px !important;
        font-weight: 900 !important;
        padding: 1mm 0.5mm !important;
        background: transparent !important;
        color: #000000 !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table td {
        padding: 1mm 0.5mm !important;
        vertical-align: top !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table th:nth-child(1),
    body.printing-receipt #receiptPrintArea .receipt-table td:nth-child(1) {
        width: 36% !important;
        text-align: left !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table th:nth-child(2),
    body.printing-receipt #receiptPrintArea .receipt-table td:nth-child(2) {
        width: 10% !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table th:nth-child(3),
    body.printing-receipt #receiptPrintArea .receipt-table td:nth-child(3) {
        width: 27% !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-table th:nth-child(4),
    body.printing-receipt #receiptPrintArea .receipt-table td:nth-child(4) {
        width: 27% !important;
        text-align: right !important;
        white-space: nowrap !important;
        padding-right: 2px !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-summary {
        text-align: right !important;
        padding-right: 2px !important;
        color: #000000 !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-summary p {
        margin: 1mm 0 !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-summary strong {
        font-size: 11.5px !important;
        font-weight: 900 !important;
        color: #000000 !important;
        white-space: nowrap !important;
    }

    body.printing-receipt #receiptPrintArea .receipt-footer {
        margin-top: 3mm !important;
        text-align: center !important;
        font-style: italic !important;
        font-size: 9.5px !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    /* Hide the modal chrome (buttons, overlay) — only the receipt area prints */
    body.printing-receipt .modal-actions,
    body.printing-receipt .modal-content::before,
    body.printing-receipt .modal-content::after {
        display: none !important;
    }
}

/* === Toast Notification System === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    animation: toastSlideIn 0.35s ease forwards;
    border-left: 4px solid var(--primary-color);
    overflow: hidden;
    position: relative;
}

.toast.toast-out {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-body {
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #9ca3af;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: #374151; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    animation: toastProgress var(--toast-duration, 4s) linear forwards;
}

/* Toast types */
.toast.success { border-left-color: #22c55e; }
.toast.success .toast-progress { background: #22c55e; }

.toast.error { border-left-color: #ef4444; }
.toast.error .toast-progress { background: #ef4444; }

.toast.warning { border-left-color: #f59e0b; }
.toast.warning .toast-progress { background: #f59e0b; }

.toast.info { border-left-color: #3b82f6; }
.toast.info .toast-progress { background: #3b82f6; }

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

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

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    .toast {
        min-width: unset;
        max-width: 100%;
    }
}

/* Keep the receipt & invoice modals dashboard-specific sizing when cart.css is shared. */
#loginModal.modal,
#receiptModal.modal,
#invoiceModal.modal {
    background: rgba(14, 18, 16, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    padding: 20px;
}

#loginModal .modal-content,
#receiptModal .modal-content {
    color: rgb(15, 15, 15);
    padding: 35px 30px;
    border-radius: 20px;
    width: 440px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.22);
}

#invoiceModal .modal-content {
    background: #fff !important;
    color: #333 !important;
    padding: 25px !important;
    border-radius: 16px !important;
    width: 820px !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3) !important;
}
