* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background: #f2f2f7; 
    padding-bottom: 75px; 
    color: #1c1c1e; 
}

/* Header */
.header { 
    background: #d35400; 
    color: #fff; 
    padding: 14px 16px; 
    text-align: center; 
    font-size: 18px; 
    font-weight: bold; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
}

.container { 
    padding: 12px; 
    max-width: 600px; 
    margin: 0 auto; 
}

/* Tabs */
.tab-content { 
    display: none; 
}

.tab-content.active { 
    display: block; 
}

.card { 
    background: #fff; 
    padding: 14px; 
    border-radius: 12px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    margin-bottom: 14px; 
}

h2 { 
    font-size: 16px; 
    margin-bottom: 10px; 
    color: #d35400; 
    border-bottom: 2px solid #f39c12; 
    padding-bottom: 4px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

/* Search Box */
.search-box { 
    display: flex; 
    align-items: center; 
    position: relative; 
    margin-bottom: 5px; 
}

.search-input { 
    width: 100%; 
    padding: 12px 14px 12px 38px; 
    border: 1px solid #c7c7cc; 
    border-radius: 10px; 
    font-size: 15px; 
    outline: none; 
    background: #f2f2f7; 
    transition: 0.2s; 
}

.search-input:focus { 
    background: #fff; 
    border-color: #d35400; 
    box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.15); 
}

.search-icon { 
    position: absolute; 
    left: 12px; 
    font-size: 16px; 
    color: #8e8e93; 
    pointer-events: none; 
}

/* Menu Grid & Thẻ món ăn */
.category-title { 
    font-weight: bold; 
    font-size: 14px; 
    color: #2c3e50; 
    margin: 14px 0 6px 0; 
    padding-left: 6px; 
    border-left: 4px solid #d35400; 
}

.menu-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
}

.menu-item { 
    background: #fff8f0; 
    border: 1px solid #f5d6b3; 
    border-radius: 10px; 
    padding: 10px 8px; 
    text-align: center; 
    cursor: pointer; 
    position: relative;
}

.menu-item:active { 
    background: #fde3cf; 
}

.menu-item .name { 
    font-size: 13px; 
    font-weight: 600; 
    line-height: 1.2; 
    padding-right: 15px; 
}

.menu-item .price { 
    font-size: 13px; 
    font-weight: bold; 
    color: #e67e22; 
    margin-top: 4px; 
}

/* Nút 3 chấm & Dropdown Popup Sửa/Xóa */
.menu-dots-btn, .action-dots-btn, .stock-dots-btn {
    font-size: 16px;
    color: #8e8e93;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
}

.menu-dots-btn {
    position: absolute;
    top: 6px;
    right: 8px;
}

.menu-dots-btn:hover, .action-dots-btn:hover, .stock-dots-btn:hover {
    background: #f5d6b3;
    color: #d35400;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 28px;
    right: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    overflow: hidden;
    flex-direction: column;
}

.menu-dropdown.show {
    display: flex;
}

/* Popup Thao Tác Trong Báo Cáo & Kho Nguyên Liệu Xổ Lên Phía Trên */
.action-dropdown, .stock-dropdown {
    display: none;
    position: absolute;
    bottom: 25px;
    top: auto;
    right: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
    flex-direction: column;
}

.action-dropdown.show, .stock-dropdown.show {
    display: flex;
}

.menu-dropdown-item {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.menu-dropdown-item:active {
    background: #f2f2f7;
}

.menu-dropdown-item.edit { color: #3498db; }
.menu-dropdown-item.print { color: #27ae60; }
.menu-dropdown-item.view { color: #2c3e50; }
.menu-dropdown-item.delete { color: #e74c3c; border-top: 1px solid #eee; }

/* Dòng chứa 2 ô chọn Từ ngày - Đến ngày nằm ngang hàng */
.date-range-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-range-row input[type="date"] {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    font-size: 12px;
}

/* Thanh tiêu đề ngày có tính năng Ẩn/Hiện chi tiết */
.day-toggle-header {
    background: #fff8f0; 
    padding: 8px 10px; 
    border-radius: 6px; 
    margin: 10px 0 4px 0; 
    font-weight: bold; 
    font-size: 13px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-left: 4px solid #d35400;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.day-toggle-header.stock-header {
    background: #f8f9fa;
    border-left-color: #34c759;
}

.day-toggle-header:active {
    background: #fde3cf;
}

.day-toggle-icon {
    font-size: 12px;
    color: #8e8e93;
    margin-left: 6px;
}

/* Hiển thị số lượng nguyên liệu tĩnh */
.stock-qty-display {
    font-weight: bold;
    font-size: 13px;
    color: #2c3e50;
    text-align: center;
}

/* Khung hiển thị biểu đồ */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
    background: #fff8f0;
    border: 1px solid #f5d6b3;
    border-radius: 10px;
    padding: 10px;
}

/* Forms & Inputs */
.info-form { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-bottom: 12px; 
}

.form-row { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.form-row label { 
    font-weight: bold; 
    font-size: 13px; 
    width: 85px; 
    white-space: nowrap; 
    color: #2c3e50; 
}

.form-row input, .form-row select { 
    flex: 1; 
    padding: 9px 10px; 
    border: 1px solid #c7c7cc; 
    border-radius: 8px; 
    font-size: 13px; 
    outline: none; 
    background: #fff; 
}

.form-row input:focus, .form-row select:focus { 
    border-color: #d35400; 
}

/* Tables */
.bill-table, .report-table, .stock-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 12px; 
    table-layout: fixed; 
}

.bill-table th, .bill-table td, .report-table th, .report-table td, .stock-table th, .stock-table td { 
    padding: 10px 4px; 
    border-bottom: 1px solid #e5e5ea; 
    font-size: 13px; 
    vertical-align: middle; 
}

.bill-table th, .report-table th, .stock-table th { 
    background: #f2f2f7; 
    font-weight: 600; 
}

.col-name { width: 28%; text-align: left; font-weight: 500; }
.col-qty { width: 24%; text-align: center; }
.col-price { width: 26%; text-align: center; font-weight: 600; cursor: pointer; user-select: none; }
.col-note { width: 22%; text-align: center; }

.qty-control { display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.qty-btn { 
    width: 28px; 
    height: 28px; 
    border: 1px solid #c7c7cc; 
    background: #f2f2f7; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 15px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

.qty-number { font-weight: bold; min-width: 16px; text-align: center; font-size: 14px; }
.note-input { width: 100%; padding: 6px; border: 1px solid #d1d1d6; border-radius: 6px; font-size: 11px; outline: none; }

.price-input-edit {
    width: 100%;
    padding: 4px;
    border: 1px solid #d35400;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: right;
    outline: none;
    background: #fff;
}

/* Totals Summary */
.total-summary { text-align: right; margin: 10px 0; font-size: 14px; }
.total-summary .sub-total { color: #7f8c8d; margin-bottom: 4px; }
.total-summary .discount-val { color: #e67e22; margin-bottom: 4px; }
.total-summary .final-total { font-size: 18px; font-weight: bold; color: #c0392b; }

/* Buttons */
.btn { padding: 12px 14px; border: none; border-radius: 8px; font-weight: bold; font-size: 14px; cursor: pointer; text-align: center; }
.btn-bt { background: #007aff; color: #fff; width: 100%; font-size: 15px; margin-bottom: 8px; }
.btn-primary { background: #d35400; color: #fff; }
.btn-print { background: #34c759; color: #fff; width: 100%; font-size: 16px; }
.btn-clear { background: #ff3b30; color: #fff; width: 100%; font-size: 14px; }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 11px; border-radius: 6px; }

.summary-box { background: #e8f8f5; border: 1px solid #a3e4d7; border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.summary-item { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.summary-item:last-child { margin-bottom: 0; font-weight: bold; color: #27ae60; font-size: 16px; }

/* Navigation Bar */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    height: 60px; 
    background: #fff; 
    border-top: 1px solid #d1d1d6; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    z-index: 200; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); 
}

.nav-item { 
    flex: 1; 
    text-align: center; 
    color: #8e8e93; 
    font-size: 10px; 
    font-weight: 500; 
    padding: 6px 0; 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2px; 
}

.nav-item.active { color: #d35400; font-weight: bold; }
.nav-icon { font-size: 17px; }

.cart-sticky-bar { 
    position: fixed; 
    bottom: 65px; 
    left: 12px; 
    right: 12px; 
    background: #2c3e50; 
    color: white; 
    border-radius: 10px; 
    padding: 12px 16px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: bold; 
    font-size: 14px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); 
    z-index: 150; 
    cursor: pointer; 
}

/* Modal xem chi tiết đơn & nguyên liệu */
.modal {
    display: none; 
    position: fixed; 
    z-index: 300; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 16px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover { color: #000; }

/* CSS In Bill */
#receipt-print { display: none; }
@media print {
    @page { size: auto; margin: 0mm; }
    body { margin: 0; padding: 0; background: #fff; }
    body * { visibility: hidden; }
    #receipt-print, #receipt-print * { visibility: visible; }
    #receipt-print { 
        display: block !important; 
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 100%; 
        padding: 5px; 
        font-family: 'Courier New', Courier, monospace; 
        font-size: 12px; 
        color: #000; 
    }
    .receipt-header, .receipt-footer { text-align: center; margin-bottom: 6px; }
    .receipt-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
    .receipt-table th, .receipt-table td { text-align: left; padding: 2px 0; font-size: 11px; vertical-align: top; }
    .receipt-table .num { text-align: right; }
    .receipt-note { font-size: 10px; font-style: italic; color: #333; padding-left: 5px; }
    .line { border-bottom: 1px dashed #000; margin: 4px 0; }
}

/* Order Tabs UI */
.order-tabs-container { display: flex; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px; border-bottom: 2px solid #ecf0f1; }
.order-tab { padding: 8px 15px; margin-right: 8px; background: #ecf0f1; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; font-weight: 500; color: #7f8c8d; flex-shrink: 0; }
.order-tab.active { background: #d35400; color: white; }
.order-tab-close { font-size: 16px; font-weight: bold; cursor: pointer; padding: 0 4px; border-radius: 50%; line-height: 1; }
.order-tab-close:hover { background: rgba(0,0,0,0.1); }
.btn-add-order { background: #27ae60; color: white; border: none; padding: 8px 12px; border-radius: 8px 8px 0 0; cursor: pointer; font-weight: bold; flex-shrink: 0; }


/* Modern Auth UI */
.auth-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-shape-1 {
    position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(211,84,0,0.15) 0%, rgba(211,84,0,0) 70%);
    top: -100px; right: -100px; border-radius: 50%; z-index: 0;
}
.auth-shape-2 {
    position: absolute; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(243,156,18,0.15) 0%, rgba(243,156,18,0) 70%);
    bottom: -150px; left: -150px; border-radius: 50%; z-index: 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    z-index: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
    position: relative;
}

.auth-card:hover { transform: translateY(-5px); box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12); }

.auth-logo-container { text-align: center; margin-bottom: 30px; }
.auth-logo-icon { font-size: 48px; margin-bottom: 10px; display: inline-block; animation: float 3s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.auth-card h2 { color: #d35400; font-size: 28px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.auth-card p.subtitle { color: #7f8c8d; font-size: 14px; margin-bottom: 25px; text-align: center; }

.auth-input-group { margin-bottom: 20px; position: relative; text-align: left; }
.auth-input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #2c3e50; font-size: 14px; }
.auth-input-group input { width: 100%; padding: 12px 16px; border: 2px solid #ecf0f1; border-radius: 12px; font-size: 15px; transition: all 0.2s ease; outline: none; background: #fff; box-sizing: border-box; }
.auth-input-group input:focus { border-color: #d35400; box-shadow: 0 0 0 4px rgba(211,84,0,0.1); }

.auth-btn-submit { width: 100%; padding: 14px; background: linear-gradient(135deg, #d35400 0%, #f39c12 100%); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; margin-top: 10px; box-shadow: 0 4px 15px rgba(211,84,0,0.3); }
.auth-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(211,84,0,0.4); }
.auth-btn-submit:active { transform: translateY(1px); }

.auth-toggle-mode { text-align: center; margin-top: 25px; font-size: 14px; color: #7f8c8d; }
.auth-toggle-mode span { color: #d35400; font-weight: 600; cursor: pointer; transition: color 0.2s ease; }
.auth-toggle-mode span:hover { color: #e67e22; text-decoration: underline; }

#authLoadingOverlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); display: none; justify-content: center; align-items: center; border-radius: 24px; z-index: 10; }
.auth-spinner { width: 40px; height: 40px; border: 4px solid #ecf0f1; border-top: 4px solid #d35400; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

