﻿/* assets/css/style.css */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --radius-md: 10px;
    --radius-lg: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================
   AUTHENTICATION PAGES (Login / Register)
   ========================================= */
body.auth-page {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    justify-content: center;
    align-items: center;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember input {
    margin-right: 5px;
}

.forgot-pwd {
    color: var(--primary-color);
    text-decoration: none;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.auth-footer {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert-success {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* =========================================
   MAIN APP LAYOUT (Sidebar + Content)
   ========================================= */

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-dark);
    color: #fff;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background-color: rgba(0, 0, 0, 0.2);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

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

.toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.toggle-btn:hover {
    opacity: 1;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #a0a0b5;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu a i {
    margin-right: 15px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* POS Link Button in Sidebar */
.pos-link-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    justify-content: center !important;
    border-radius: 12px !important;
    margin: 10px 15px 20px 15px !important;
    padding: 15px !important;
    border: none !important;
    font-weight: 800 !important;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3) !important;
    letter-spacing: 1px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.pos-link-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4) !important;
}

.pos-link-btn i {
    color: #fff !important;
    font-size: 20px !important;
    margin-right: 12px !important;
}

.sidebar.collapsed .pos-link-btn {
    margin: 10px 8px 20px 8px !important;
    padding: 15px 0 !important;
}

/* Submenu Styles */
.sidebar-menu li.has-submenu>a {
    position: relative;
}

.sidebar-menu a .arrow {
    position: absolute;
    right: 20px;
    margin-right: 0;
    font-size: 12px;
    transition: transform 0.3s;
}

.sidebar-menu li.has-submenu.open>a .arrow {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.15);
}

.sidebar-menu li.has-submenu.open .submenu,
.sidebar-menu li.has-submenu:hover .submenu {
    max-height: 500px;
}

.sidebar-menu li.has-submenu.open>a .arrow,
.sidebar-menu li.has-submenu:hover>a .arrow {
    transform: rotate(180deg);
}

.submenu li a {
    padding: 10px 20px 10px 55px;
    font-size: 14px;
    color: #a0a0b5;
    border-left: 4px solid transparent;
}

.submenu li a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.02);
    border-left-color: var(--primary-color);
}

.user-profile {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.user-avatar {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #fff;
    margin-right: 15px;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
}

.user-role {
    font-size: 12px;
    color: #a0a0b5;
}

.logout-btn {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 16px;
    margin-left: 10px;
}

/* Sidebar Collapsed States */
.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .sidebar-menu a i {
    margin-right: 0;
    font-size: 20px;
}

.sidebar.collapsed .arrow {
    display: none;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .user-profile {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
    margin-bottom: 10px;
}

.sidebar.collapsed .logout-btn {
    margin-left: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 30px;
    background-color: #f4f6fa;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

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

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #2b2b36;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-right: 15px;
}

.icon-blue {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    /* Changed to green theme */
}

.icon-green {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.icon-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.card-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 5px;
}

.card-info .value {
    font-size: 22px;
    font-weight: 700;
    color: #2b2b36;
}

/* Layout section */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.panel {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.panel-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 16px;
}

/* Table styling for recent orders */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    /* Prevent text wrapping in mobile tables */
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
}

table td {
    font-size: 14px;
}

.status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.success {
    background: #dcfce7;
    color: #15803d;
}

.status.pending {
    background: #fef3c7;
    color: #d97706;
}

.mock-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #a7f3d0 0%, #10b981 100%);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
}

/* =========================================
   RESPONSIVE DESIGN / MOBILE
   ========================================= */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 15px 20px;
    margin: -30px -30px 30px -30px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-topbar .logo-text {
    font-size: 20px;
    font-weight: 700;
}

.mobile-topbar .btn-icon {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 992px) {
    .mobile-topbar {
        display: flex !important;
    }

    .sidebar,
    .sidebar.collapsed {
        transform: translateX(-100%) !important;
        width: 280px !important;
        transition: transform 0.3s ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
    }

    .sidebar-header .toggle-btn {
        display: none;
        /* Hide desktop toggle */
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0 !important;
        padding: 20px;
    }

    .mobile-topbar {
        margin: -20px -20px 20px -20px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    /* Reset collapsed states to full width behavior on mobile */
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .user-info {
        display: block;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: space-between;
        padding: 0 20px;
    }

    .sidebar.collapsed .arrow {
        display: block;
    }

    .sidebar.collapsed .sidebar-menu a {
        justify-content: flex-start;
        padding: 12px 20px;
    }

    .sidebar.collapsed .user-profile {
        flex-direction: row;
        justify-content: flex-start;
        padding: 20px;
    }

    .sidebar.collapsed .user-avatar {
        margin-right: 15px;
        margin-bottom: 0;
    }

    .sidebar.collapsed .submenu {
        position: static;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        display: block;
        max-height: 0;
        overflow: hidden;
    }

    .sidebar.collapsed li.has-submenu.open .submenu {
        max-height: 300px;
    }

    /* Transform table to card list on mobile */
    .table-responsive {
        overflow-x: visible;
        /* disable horizontal scroll */
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        white-space: normal;
    }

    thead tr {
        display: none;
    }

    tr {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: 15px;
        background: #fff;
    }

    td {
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding: 12px 15px 12px 45% !important;
        text-align: right !important;
        min-height: 45px;
    }

    td:last-child {
        border-bottom: none;
    }

    td:before {
        position: absolute;
        top: 12px;
        left: 15px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 13px;
        text-transform: uppercase;
    }
}

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

/* ==========================================================================
   MODAL COMPONENT (GLOBAL)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

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

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   AUTHENTICATION PAGES (LOGIN/REGISTER)
   ========================================================================== */
.auth-page {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: #fff;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 14px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.form-options .remember {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-main);
    cursor: pointer;
}

.form-options .forgot-pwd {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Placeholder Pages Styling */
.placeholder-container {
    text-align: center;
    padding: 100px 20px;
}

.placeholder-icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 30px;
    opacity: 0.3;
}

.placeholder-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

.placeholder-desc {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 30px;
}

/* Choices.js Custom Styles */
.choices {
    margin-bottom: 0;
}

.choices .choices__inner {
    background-color: #fff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    min-height: 44px !important;
    padding: 5px 10px !important;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.choices__list--dropdown {
    z-index: 1000 !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--border-color) !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.choices[data-type*="select-one"] .choices__inner {
    padding-bottom: 5px !important;
}

.choices__list--single {
    padding: 0 16px 0 0 !important;
    width: 100%;
}

.choices__placeholder {
    opacity: 0.7;
}

/* Settings Page Styles */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theme-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.theme-card.active {
    border-color: var(--primary-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 20px;
}

/* Toggle Switch Style */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    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: #ccc;
    transition: .4s;
}

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

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

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

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

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

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

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

/* =========================================
   PRINT & INVOICE STYLES
   ========================================= */
#invoice-print-area {
    display: none;
}

@media print {

    /* Hide UI elements */
    .sidebar,
    .mobile-topbar,
    .topbar,
    .page-header,
    .panel,
    .modal-overlay,
    .btn,
    .mobile-overlay,
    .no-print {
        display: none !important;
    }

    /* Reset layout for printing */
    body,
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: #fff !important;
        height: auto !important;
    }

    .main-content>*:not(#invoice-print-area) {
        display: none !important;
    }

    #invoice-print-area {
        display: block !important;
        width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Bảo vệ styles bên trong khu vực in hóa đơn */
    #invoice-print-area * {
        font-family: Arial, Helvetica, sans-serif !important;
        color: #000 !important;
        background: transparent !important;
    }

    #invoice-print-area table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: none !important;
    }

    #invoice-print-area th,
    #invoice-print-area td {
        padding: 3px 0 !important;
        text-align: left !important;
        font-size: 11px !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #invoice-print-area th:last-child,
    #invoice-print-area td:last-child {
        text-align: right !important;
    }

    #invoice-print-area .total-row p {
        margin: 2px 0 !important;
        font-size: 11px !important;
    }

    #invoice-print-area .total-final {
        font-size: 14px !important;
        font-weight: bold !important;
    }

    #invoice-print-area .line {
        border-top: 1px dashed #000 !important;
        margin: 8px 0 !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
    }
}

/* Paper Sizes and Page Rules */
.print-A4-page {
    width: 210mm !important;
}

.print-A5-page {
    width: 148mm !important;
}

.print-K80-page {
    width: 80mm !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

.print-K57-page {
    width: 57mm !important;
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Invoice Content Aesthetics */
#invoice-print-area {
    font-family: Arial, Helvetica, sans-serif !important;
    width: 100%;
    margin: 0 auto;
    padding: 5px;
    font-size: 11px;
    line-height: 1.2;
    color: #000;
}

.header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.header img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.header-info {
    flex: 1;
}

.header-info h2 {
    font-size: 16px;
    margin: 0;
    font-weight: bold;
    text-transform: none;
}

.header-info p {
    margin: 2px 0;
    font-size: 11px;
}

.line {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.bold {
    font-weight: bold;
}

.center {
    text-align: center;
    margin-top: 20px;
}

/* Centered Header for Invoices without Logo */
.header.centered {
    display: block !important;
    text-align: center !important;
}

.header.centered .header-info {
    text-align: center !important;
    margin: 0 auto !important;
}

.header.centered img {
    display: none !important;
}

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

.print-table th,
.print-table td {
    padding: 3px 0;
    text-align: left;
    font-size: 11px;
    border: none;
}

.print-table th:last-child,
.print-table td:last-child {
    text-align: right;
}

.print-table th {
    font-weight: bold;
}

.total-row {
    margin: 2px 0;
}

.total-row p {
    margin: 2px 0;
    font-size: 11px;
}

.total-final {
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
}

/* Specific @page overrides for thermal printers */
@media print {
    .print-K80-page-rule {
        @page {
            size: 80mm auto;
            margin: 0;
        }
    }

    .print-K57-page-rule {
        @page {
            size: 57mm auto;
            margin: 0;
        }
    }

    .print-A4-page-rule {
        @page {
            size: A4;
            margin: 0;
        }
    }

    .print-A5-page-rule {
        @page {
            size: A5;
            margin: 0;
        }
    }
}

/* =========================================
   PRODUCT MANAGEMENT PAGE
   ========================================= */
.table td[data-label="Tên Sản phẩm"] {
    white-space: normal !important;
    word-break: break-word;
    min-width: 200px;
    line-height: 1.5;
}

@media (max-width: 992px) {
    .table td[data-label="Tên Sản phẩm"] {
        text-align: right !important;
        padding-left: 45% !important;
    }
}

/* Smart Search Styles */
.smart-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.smart-search-container input {
    padding-right: 30px;
}

.smart-search-arrow {
    position: absolute;
    right: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 5;
}

.smart-search-container.active .smart-search-arrow {
    transform: rotate(180deg);
}

.smart-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.smart-search-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.smart-search-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.smart-search-item.no-result {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.smart-search-item.no-result:hover {
    background: transparent;
}

/* Filter Chips Styles */
.filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.filter-chip:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.filter-chip.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.filter-chip .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.filter-chip.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

/* Ð?nh d?ng riêng cho t?ng lo?i chip khi chua active */
.filter-near-expiry:not(.active) {
    color: #ea580c;
    border-color: #ffedd5;
}

.filter-near-expiry:not(.active) .count {
    background: #ffedd5;
    color: #ea580c;
}

.filter-low-stock:not(.active) {
    color: #ef4444;
    border-color: #fee2e2;
}

.filter-low-stock:not(.active) .count {
    background: #fee2e2;
    color: #ef4444;
}