/* System Variables for Colors and Layout */
:root {
    --bg-dark-primary: #0f172a;    /* Slate 900 */
    --bg-dark-secondary: #1e293b;  /* Slate 800 */
    --bg-dark-tertiary: #334155;   /* Slate 700 */
    --text-primary: #f8fafc;       /* Slate 50 */
    --text-secondary: #94a3b8;     /* Slate 400 */
    --accent-color: #10b981;       /* Emerald 500 */
    --accent-hover: #059669;       /* Emerald 600 */
    --accent-glow: rgba(16, 185, 129, 0.2);
    --border-dark: #334155;        /* Slate 700 */
    --danger-color: #f43f5e;       /* Rose 500 */
    --danger-hover: #e11d48;       /* Rose 600 */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-receipt: 'Inter', 'Times New Roman', Times, serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg-dark-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Application Layout Container */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dark-primary);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--bg-dark-secondary);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-color), #3b82f6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
}

.logo-text span {
    color: var(--accent-color);
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-btn i {
    font-size: 18px;
}

.menu-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.04);
}

.menu-btn.active {
    color: white;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.menu-btn.active i {
    color: var(--accent-color);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Main Workspace Area */
.main-content {
    flex-grow: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    padding: 24px;
}

.view-section {
    display: none;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

/* POS Screen Split Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: 100%;
}

/* Left Panel: Product Catalog */
.catalog-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: rgba(30, 41, 59, 0.5);
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.25s;
}

.search-box input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.catalog-tabs {
    display: flex;
    gap: 8px;
    background-color: var(--bg-dark-primary);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
}

.tab-btn {
    flex-grow: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    background-color: var(--bg-dark-secondary);
    color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Products Grid */
.products-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-content: start;
}

.product-card {
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 240px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.4);
}

.product-card:hover::before {
    opacity: 1;
}

.product-info {
    margin-bottom: 14px;
}

.prod-warranty-badge {
    align-self: flex-start;
    font-size: 9px;
    font-weight: 700;
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.product-desc {
    font-size: 11px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.add-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--bg-dark-tertiary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.product-card:hover .add-btn {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.add-btn:active {
    transform: scale(0.95);
}

/* Right Panel: Checkout / Cart */
.cart-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-cart-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.clear-cart-btn:hover {
    color: var(--danger-hover);
}

/* Customer Fields Form */
.customer-form {
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    padding: 8px 12px;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-color);
}

/* POS Pricing Settings (Toggle & VAT) */
.cart-settings {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 41, 59, 0.4);
    border: 1px dashed var(--border-dark);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    gap: 12px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-toggle-group {
    display: flex;
    background-color: var(--bg-dark-primary);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-dark);
}

.price-toggle-group .toggle-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.price-toggle-group .toggle-btn.active {
    background-color: var(--accent-color);
    color: white;
}

/* Switch Toggle Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-dark-tertiary);
    transition: .3s;
}

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

input:checked + .slider {
    background-color: var(--accent-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--accent-color);
}

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

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

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

/* Cart Items Container */
.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    padding-right: 4px;
}

.cart-item {
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.cart-item:hover {
    border-color: rgba(16, 185, 129, 0.2);
}

.item-desc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.item-price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 12px;
}

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

.qty-btns {
    display: flex;
    align-items: center;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 2px;
}

.qty-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.qty-btn:hover {
    background-color: var(--bg-dark-tertiary);
}

.qty-val {
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.del-item-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.del-item-btn:hover {
    color: var(--danger-hover);
}

/* Payment Summary Block */
.cart-summary {
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-row.total-row {
    border-top: 1px solid var(--border-dark);
    padding-top: 8px;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 800;
    color: white;
}

.summary-row.total-row span:last-child {
    color: var(--accent-color);
}

/* POS Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 0.9fr;
    gap: 8px;
}

.action-buttons button, .btn-primary, .btn-secondary {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.btn-preview:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-export-pdf {
    background-color: #3b82f6; /* Blue 500 */
    color: white;
}

.btn-export-pdf:hover {
    background-color: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-export-img {
    background-color: #f59e0b; /* Amber 500 */
    color: white;
}

.btn-export-img:hover {
    background-color: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Import Screen Styling */
.import-panel, .settings-panel {
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.glass-card {
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.import-help {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.paste-area-wrapper {
    flex-grow: 1;
    min-height: 200px;
}

.paste-area-wrapper textarea {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 16px;
    color: white;
    font-family: monospace;
    font-size: 13px;
    resize: none;
    outline: none;
}

.paste-area-wrapper textarea:focus {
    border-color: var(--accent-color);
}

.import-actions, .settings-form button {
    display: flex;
    gap: 12px;
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: var(--bg-dark-tertiary);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.import-status {
    font-size: 13px;
    font-weight: 500;
}

/* Settings Form Panel */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-form .form-group input {
    background-color: var(--bg-dark-primary);
    padding: 12px;
    font-size: 14px;
}

/* MODAL PREVIEW OVERLAY & CONTAINER */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    width: 95vw;
    max-width: 950px;
    height: 90vh;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-actions-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-dark);
    background-color: var(--bg-dark-secondary);
}

.modal-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action.btn-pdf { background-color: #3b82f6; color: white; }
.btn-action.btn-img { background-color: #f59e0b; color: white; }
.btn-action.btn-print { background-color: #10b981; color: white; }
.btn-close {
    background-color: var(--bg-dark-tertiary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.modal-scroll-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px 20px;
    background-color: #334155; /* Neutral background to make page stand out */
    display: block;
}

/* ==========================================================
   TỜ BÁO GIÁ A4 ĐỂ IN VÀ XUẤT FILE (RECEIPT PRINTABLE)
   ========================================================== */
.receipt-printable-a4 {
    width: 210mm; /* A4 width */
    min-height: 297mm; /* A4 height */
    padding: 15mm;
    background-color: white;
    color: #1e293b; /* Dark grey for professional rendering */
    font-family: var(--font-receipt);
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    position: relative;
    font-size: 13px;
    line-height: 1.5;
    box-sizing: border-box;
    margin: 0 auto;
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.receipt-header-left {
    display: flex;
    flex-direction: column;
}

.corp-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.corp-logo svg {
    flex-shrink: 0;
}

.corp-title-box h1 {
    font-family: var(--font-ui);
    font-size: 17px;
    font-weight: 800;
    color: #ea580c; /* Orange like the brand logo */
    letter-spacing: -0.2px;
    margin-bottom: 4px;
}

.corp-desc {
    font-size: 11px;
    color: #475569;
    max-width: 580px;
}

.receipt-contact-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #475569;
    margin-top: 4px;
    background-color: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.receipt-divider {
    height: 1px;
    background-color: #cbd5e1;
    margin: 14px 0;
}

/* Document Title */
.receipt-doc-title {
    text-align: center;
    margin-bottom: 20px;
}

.receipt-doc-title h2 {
    font-family: var(--font-ui);
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.receipt-meta-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 11px;
    color: #475569;
}

.receipt-meta-grid span {
    font-weight: 600;
    color: #0f172a;
}

.receipt-expiry {
    font-style: italic;
    color: #e11d48 !important; /* Expiry warning in red */
    font-weight: 500 !important;
}

/* Client & Info block */
.receipt-client-section {
    margin-bottom: 20px;
}

.greeting-text {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: justify;
    color: #334155;
}

.client-info-table {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
    background-color: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.client-info-row {
    display: flex;
    align-items: baseline;
}

.client-info-row:nth-child(3) {
    grid-column: span 2;
}

.info-label {
    min-width: 140px;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
}

.info-val {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
}

/* Tabular Receipt List */
.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 11.5px;
}

.receipt-table th {
    background-color: #0f172a;
    color: white;
    font-family: var(--font-ui);
    font-weight: 600;
    padding: 8px 10px;
    border: 1px solid #1e293b;
    font-size: 11px;
    text-transform: uppercase;
}

.receipt-table td {
    padding: 10px;
    border: 1px solid #cbd5e1;
    vertical-align: top;
    line-height: 1.4;
}

.receipt-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.receipt-table tr {
    page-break-inside: avoid;
}

.table-item-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 12px;
    margin-bottom: 4px;
}

.table-item-desc {
    color: #475569;
    font-size: 10.5px;
    white-space: pre-wrap;
    padding-left: 6px;
    border-left: 2px solid #e2e8f0;
}

.receipt-table td.align-center { text-align: center; }
.receipt-table td.align-right { text-align: right; font-weight: 500; }

/* Totals calculation table */
.receipt-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 24px;
    page-break-inside: avoid;
}

.total-line {
    display: grid;
    grid-template-columns: 180px 140px;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
}

.total-line .total-label {
    text-align: right;
    padding-right: 15px;
    color: #475569;
}

.total-line .total-val {
    text-align: right;
    font-weight: 700;
    color: #0f172a;
}

.grand-total-line {
    border-bottom: 2px double #0f172a;
    font-size: 14px;
    padding: 8px 0;
}

.grand-total-line .total-label {
    font-weight: 800;
    color: #0f172a;
}

.grand-total-line .total-val {
    color: #047857;
    font-size: 16px;
}

.total-words-line {
    width: 100%;
    text-align: right;
    margin-top: 10px;
    font-size: 12px;
    color: #334155;
}

/* Notes section */
.receipt-notes {
    margin-bottom: 30px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    page-break-inside: avoid;
}

.receipt-notes h3 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #0f172a;
    text-transform: uppercase;
}

.receipt-notes ul {
    list-style-type: none;
    padding-left: 0;
}

.receipt-notes li {
    font-size: 11px;
    margin-bottom: 6px;
    padding-left: 14px;
    position: relative;
    color: #475569;
}

.receipt-notes li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: #047857;
    font-weight: bold;
}

.bank-highlight {
    background-color: #f0fdf4;
    border: 1px solid #dcfce7;
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 8px;
}

.closing-thanks {
    margin-top: 12px;
    font-style: italic;
    font-weight: 600;
    color: #0f172a;
    font-size: 11.5px;
    text-align: center;
}

/* Signature & Stamp Section */
.receipt-signature {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    page-break-inside: avoid;
}

.sig-col {
    width: 45%;
    text-align: center;
}

.sig-title {
    font-weight: 700;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 4px;
}

.sig-subtitle {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
    margin-bottom: 20px;
}

.sig-stamp-container {
    position: relative;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hand Written Simulation Signature */
.hand-signature {
    font-family: 'Playfair Display', cursive, serif;
    font-size: 32px;
    font-style: italic;
    color: #1e3a8a; /* Deep blue ink style */
    opacity: 0.85;
    position: absolute;
    transform: rotate(-10deg) translate(-20px, -20px);
    z-index: 10;
}

/* Pure CSS Corporate Stamp */
.red-stamp {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(220, 38, 38, 0.82); /* Stamp red color */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transform: rotate(5deg) scale(0.9);
    background-color: rgba(255, 255, 255, 0.05);
    user-select: none;
    pointer-events: none;
    box-shadow: inset 0 0 1px rgba(220,38,38,0.3);
}

.red-stamp::after {
    content: '';
    position: absolute;
    width: 106px;
    height: 106px;
    border: 1px dashed rgba(220, 38, 38, 0.7);
    border-radius: 50%;
}

.stamp-outer-text {
    position: absolute;
    width: 100%;
    height: 100%;
    font-size: 7.2px;
    font-weight: 800;
    color: rgba(220, 38, 38, 0.82);
    text-transform: uppercase;
    text-align: center;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.1px;
    /* Create rotated text layout (we will adjust in JS or write basic curves) */
    animation: rotateStampText 0s linear infinite;
}

/* A simpler neat internal stamp box since exact curved text needs canvas/svg */
.stamp-inner {
    text-align: center;
    color: rgba(220, 38, 38, 0.82);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
}

.stamp-mst {
    font-size: 6.5px;
    font-weight: 800;
    border-top: 1px solid rgba(220, 38, 38, 0.82);
    border-bottom: 1px solid rgba(220, 38, 38, 0.82);
    padding: 1px 0;
    width: 100%;
    letter-spacing: -0.1px;
}

.stamp-star {
    font-size: 11px;
    margin: 1px 0;
}

.stamp-city {
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.5px;
}


/* ==========================================================
   PRINT MEDIA RULES - CRITICAL FOR DIRECT WINDOW.PRINT()
   ========================================================== */
@media print {
    /* Hide everything on the page */
    body, .app-container, .sidebar, .main-content, .modal-actions-top, .modal-scroll-area {
        background: white !important;
        color: black !important;
        overflow: visible !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .app-container, .sidebar, .modal-actions-top, .view-section, .pos-layout, .modal-overlay:not(.active) {
        display: none !important;
    }
    
    /* Show ONLY the modal overlay active state with receipt block */
    .modal-overlay.active {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        display: block !important;
        opacity: 1 !important;
        z-index: 9999 !important;
    }

    .modal-container {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        width: 100% !important;
        height: auto !important;
        transform: none !important;
        overflow: visible !important;
    }

    .modal-scroll-area {
        background: transparent !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }

    .receipt-printable-a4 {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 15mm !important;
        width: 210mm !important;
        min-height: 297mm !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure colors print correctly */
    .corp-title-box h1 {
        color: #ea580c !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .stamp-outer-text, .stamp-inner, .red-stamp {
        color: rgba(220, 38, 38, 1) !important;
        border-color: rgba(220, 38, 38, 1) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .receipt-notes {
        background-color: #f8fafc !important;
        border-color: #cbd5e1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bank-highlight {
        background-color: #f0fdf4 !important;
        border-color: #bbf7d0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ==========================================================
   IMAGE & LOGO LAYOUT STYLES
   ========================================================== */
.company-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.receipt-logo-img {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

/* Product Card Layout with Image */
.product-card-body {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    align-items: flex-start;
}

.product-card-img-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 2px;
    overflow: hidden;
}

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

.product-card-details {
    flex-grow: 1;
    min-width: 0;
}

/* Receipt Item Image */
.table-item-img {
    max-height: 50px;
    max-width: 70px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px;
    background-color: #ffffff;
}

/* ==========================================================
   NOTES CONFIGURATION PANEL STYLES (NEW)
   ========================================================== */
/* Collapsible Notes Config Accordion */
.notes-config-details {
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.notes-config-summary {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.notes-config-summary::-webkit-details-marker {
    display: none;
}

.notes-config-summary .arrow-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.notes-config-details[open] .notes-config-summary .arrow-icon {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.notes-config-content {
    padding: 0 12px 12px 12px;
    border-top: 1px solid var(--border-dark);
    padding-top: 10px;
}

.notes-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}

/* Custom Checkbox Styling */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 24px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    user-select: none;
    line-height: 1.4;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 16px;
    width: 16px;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.notes-config-details textarea {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: white;
    font-family: var(--font-ui);
    font-size: 12px;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
}

.notes-config-details textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}



/* ==========================================================
   CATEGORY FILTERS PILLS (NEW)
   ========================================================== */
.category-filters {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.category-filters::-webkit-scrollbar {
    height: 4px;
}

.category-filters::-webkit-scrollbar-thumb {
    background-color: var(--border-dark);
    border-radius: 4px;
}

.cat-filter-btn {
    padding: 6px 12px;
    background-color: var(--bg-dark-primary);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cat-filter-btn:hover {
    color: white;
    border-color: var(--text-secondary);
}

.cat-filter-btn.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* ==========================================================
   SYNC STATUS BADGES (NEW)
   ========================================================== */
.sync-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.sync-status-badge.syncing {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.sync-status-badge.syncing i {
    animation: fa-spin 2s linear infinite;
}

.sync-status-badge.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sync-status-badge.offline {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sync-status-badge.error {
    background-color: rgba(244, 63, 94, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ==========================================================
   BẢNG NHẬP BÁO GIÁ TRỰC TIẾP (EDITABLE QUOTATION GRID)
   ========================================================== */
.quote-table-wrapper {
    margin-top: 12px;
    margin-bottom: 12px;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    background-color: var(--bg-dark-primary);
    max-height: 480px; /* Vùng cuộn mượt mà giúp thấy nhiều sản phẩm */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quote-editor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-light-primary);
    table-layout: fixed; /* Cố định kích thước để co giãn cột chuẩn */
}

.quote-editor-table th, 
.quote-editor-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-dark);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-editor-table th {
    background-color: var(--bg-dark-secondary);
    font-weight: 700;
    color: var(--text-light-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-dark);
}

.quote-editor-table tbody tr {
    transition: background-color 0.15s ease;
}

.quote-editor-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Định dạng các ô nhập liệu phẳng không viền */
.quote-editor-table input,
.quote-editor-table textarea {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: inherit;
    padding: 4px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    transition: all 0.2s ease;
}

.quote-editor-table input:hover,
.quote-editor-table textarea:hover {
    border-color: var(--border-dark);
    background-color: rgba(255, 255, 255, 0.01);
}

.quote-editor-table input:focus,
.quote-editor-table textarea:focus {
    background-color: var(--bg-dark-secondary);
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.2);
}

.quote-editor-table textarea {
    resize: vertical;
    min-height: 46px;
    height: auto;
    line-height: 1.4;
}

/* Các căn chỉnh cụ thể cho từng cột */
.quote-editor-table td.text-center,
.quote-editor-table th.text-center {
    text-align: center;
}

.quote-editor-table td.text-right,
.quote-editor-table th.text-right {
    text-align: right;
    font-weight: 600;
}

/* Container hình ảnh ô bảng sửa */
.quote-editor-table .row-image-container {
    width: 50px;
    height: 50px;
    border: 1px dashed var(--border-dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.15);
}

.quote-editor-table .row-image-container:hover {
    border-color: var(--accent-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.quote-editor-table .row-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.quote-editor-table .row-image-container .image-placeholder-icon {
    font-size: 14px;
    color: var(--text-light-muted);
}

.quote-editor-table .row-image-container:hover .image-placeholder-icon {
    color: var(--accent-color);
}

.quote-editor-table .row-image-container::after {
    content: "DÁN/MỞ";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
    font-size: 7px;
    text-align: center;
    padding: 1px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-weight: 700;
}

.quote-editor-table .row-image-container:hover::after {
    opacity: 1;
}

/* Nút xóa dòng */
.quote-editor-table .row-del-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 auto;
}

.quote-editor-table .row-del-btn:hover {
    color: #fff;
    background-color: var(--danger-color);
}

/* Nút thêm sản phẩm tự nhập */
.table-actions-bottom {
    margin-top: 8px;
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-start;
}

.btn-add-custom {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--accent-color);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-add-custom:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-style: solid;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.btn-add-custom:active {
    transform: translateY(0);
}

/* ==========================================
   MÀN HÌNH ĐĂNG NHẬP ADMIN CHUYÊN NGHIỆP
   ========================================== */
.admin-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 30% 30%, #1e293b, #0f172a, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    padding: 20px;
    box-sizing: border-box;
}

.login-box {
    width: 420px;
    max-width: 100%;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.login-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.login-logo-area h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
}

.login-logo-area h2 span {
    color: #3b82f6;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.login-header p {
    margin: 8px 0 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
}

.login-form label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.8);
    color: white;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.password-input-wrapper input:focus {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: white;
}

.error-msg {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.btn-login:active {
    transform: translateY(1px);
}

.btn-back-pos {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-back-pos:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.login-footer {
    text-align: center;
    margin-top: 35px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.login-footer p {
    margin: 4px 0 0;
    font-size: 11px;
    color: #64748b;
}

/* Hide mobile-only layout elements on desktop */
.mobile-top-bar,
.mobile-pos-tabs,
.sidebar-backdrop {
    display: none;
}

/* ==========================================================
   MOBILE RESPONSIVENESS (max-width: 768px)
   ========================================================== */
@media (max-width: 768px) {
    /* Mobile Layout Container */
    .app-container {
        flex-direction: column !important;
        overflow: hidden;
    }

    /* Mobile Top Bar */
    .mobile-top-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        height: 56px;
        background-color: var(--bg-dark-secondary);
        border-bottom: 1px solid var(--border-dark);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 900;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-brand img {
        height: 30px;
        width: auto;
        object-fit: contain;
    }

    .mobile-brand span {
        font-size: 16px;
        font-weight: 800;
        color: white;
        letter-spacing: 0.5px;
    }

    .mobile-menu-btn {
        background: transparent;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.2s;
    }

    .mobile-menu-btn:hover {
        color: var(--accent-color);
    }

    /* Sidebar Drawer Style */
    .sidebar {
        position: fixed;
        left: -270px;
        top: 0;
        bottom: 0;
        width: 260px;
        height: 100vh;
        z-index: 1001;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background-color: var(--bg-dark-secondary);
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1000;
        display: none;
    }

    /* Main Workspace Adjustment */
    .main-content {
        margin-top: 56px;
        height: calc(100vh - 56px);
        padding: 12px !important;
        overflow-y: auto;
    }

    /* POS Mobile Tabbed View */
    .mobile-pos-tabs {
        display: flex !important;
        width: 100%;
        background-color: var(--bg-dark-secondary);
        border: 1px solid var(--border-dark);
        border-radius: 12px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .pos-tab-btn {
        flex: 1;
        padding: 12px;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
    }

    .pos-tab-btn.active {
        background: rgba(16, 185, 129, 0.1);
        color: var(--accent-color);
        box-shadow: inset 0 -2px 0 var(--accent-color);
    }

    .cart-badge-count {
        background-color: var(--danger-color);
        color: white;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
    }

    .pos-layout {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        height: calc(100% - 60px) !important;
    }

    .pos-layout .catalog-panel {
        display: flex;
    }

    .pos-layout .cart-panel {
        display: none;
    }

    .pos-layout.show-cart .catalog-panel {
        display: none;
    }

    .pos-layout.show-cart .cart-panel {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        overflow-y: auto !important; /* Allow the entire cart panel to scroll on mobile */
    }

    /* Cart Items list optimization on mobile */
    .cart-items {
        overflow-y: visible !important;
        min-height: auto !important;
        max-height: none !important;
        flex-grow: 0 !important;
        padding-right: 0 !important;
    }

    /* Cart Item card vertical layout to prevent overflow on mobile */
    .cart-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .cart-item .item-desc {
        width: 100% !important;
    }

    .cart-item .item-name {
        -webkit-line-clamp: 2 !important;
        white-space: normal !important;
        font-size: 13px !important;
    }

    .cart-item .item-control {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 4px;
        border-top: 1px dashed rgba(255, 255, 255, 0.1);
        padding-top: 6px;
    }

    /* Grid layout for action buttons on mobile (2 columns x 2 rows) */
    .action-buttons {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-top: 12px;
    }

    /* Products Grid optimization */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        padding: 10px !important;
        gap: 10px !important;
    }

    .product-card {
        padding: 10px !important;
        min-height: 190px !important;
    }

    .product-name {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin-bottom: 2px !important;
    }

    .product-desc {
        display: none !important; /* Hide description to fit on grid on small screens */
    }

    .product-price {
        font-size: 13px !important;
    }

    .add-btn {
        width: 28px !important;
        height: 28px !important;
        border-radius: 6px !important;
    }

    /* Customer Form inside Cart */
    .customer-form .form-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Dialog/Modal Container on Mobile */
    .modal-container {
        width: 95% !important;
        max-height: 90% !important;
        padding: 15px !important;
    }

    .modal-actions-top {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .modal-buttons {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px !important;
    }

    .modal-buttons .btn-close {
        grid-column: span 2;
        margin-left: 0 !important;
    }

    /* Admin View optimization */
    .import-panel {
        padding: 12px !important;
    }

    .import-panel h2 {
        font-size: 16px !important;
    }
    
    /* Fullscreen Admin Login Screen optimization */
    .login-box {
        padding: 24px 20px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 340px !important;
    }
    .login-logo-area {
        margin-bottom: 15px !important;
    }
    .login-logo-area h2 {
        font-size: 20px !important;
    }
    .login-header {
        margin-bottom: 20px !important;
    }
    .login-header h3 {
        font-size: 16px !important;
    }
    .login-header p {
        font-size: 12px !important;
    }
    .password-input-wrapper input {
        padding: 10px 40px 10px 14px !important;
        font-size: 14px !important;
    }
    .btn-login {
        padding: 12px !important;
        font-size: 14px !important;
    }
    .btn-back-pos {
        padding: 10px !important;
        font-size: 13px !important;
    }
}


