/* ============================================
   QLBH Employee App - Stylesheet
   Màu chủ đạo: #34495e (Dark Blue-Gray)
   ============================================ */

:root {
    --primary-color: #34495e;
    --primary-dark: #2c3e50;
    --primary-light: #5d6d7e;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --bg-light: #ecf0f1;
    --bg-white: #ffffff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: var(--text-color);
    line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-card h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 28px;
}

.login-card p {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 14px;
}

.login-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.1);
}

.login-button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    display: none;
    font-size: 14px;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.header {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    border-bottom: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.year-selector:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}

.year-selector .fa-calendar-alt {
    font-size: 1rem;
    opacity: 0.9;
}

.current-year {
    font-weight: 600;
    font-size: 1.05rem;
    min-width: 40px;
    text-align: center;
}

.year-selector .dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.85;
}

.year-selector.active .dropdown-arrow {
    transform: rotate(180deg);
}

.year-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    min-width: 240px;
    display: none;
    z-index: 1100;
    overflow: hidden;
    animation: fadeInDown 0.2s ease;
    color: var(--text-color);
}

.year-selector.active .year-dropdown {
    display: block;
}

.year-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.year-dropdown-list {
    max-height: 260px;
    overflow-y: auto;
    background: white;
}

.year-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.year-dropdown-item:last-child {
    border-bottom: none;
}

.year-dropdown-item:hover {
    background-color: rgba(52, 73, 94, 0.08);
}

.year-dropdown-item.active {
    background: rgba(52, 152, 219, 0.12);
    font-weight: 600;
    color: var(--primary-dark);
}

.year-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.year-item-note {
    font-size: 0.75rem;
    color: var(--text-light);
}

.year-loading,
.year-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.year-dropdown-footer {
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.header-info span {
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 1rem;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-tabs {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    margin: 0;
    border-top: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav-tabs-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.nav-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #f8f9fa;
}

/* ============================================
   SUB NAVIGATION TABS
   ============================================ */

.sub-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.sub-nav-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s;
    white-space: nowrap;
}

.sub-nav-tab:hover {
    color: var(--primary-color);
}

.sub-nav-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* ============================================
   MODULE CONTENT
   ============================================ */

.module-content {
    display: none;
}

.module-content.active {
    display: block;
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-section {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    position: relative;
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-section-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.btn-remove-section {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-remove-section:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.form-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.1);
}

.form-group input[readonly] {
    background-color: var(--bg-light);
    cursor: not-allowed;
    color: var(--text-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

.form-group input.input-error {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

.form-group input.input-error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

/* Hoàn Kho Product Info - Badge/Tag Style */
.hoan-kho-info-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.hoan-kho-badge-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* Hoàn Kho Form Grid - 1/3 và 2/3 layout */
.hoan-kho-form-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.hoan-kho-imei-group {
    width: 100%;
}

.hoan-kho-info-group {
    width: 100%;
}

.hoan-kho-badge {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.hoan-kho-badge-label {
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.hoan-kho-badge-value {
    color: var(--primary-color);
    font-weight: 600;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}

.hoan-kho-year-options {
    margin-top: 16px;
    padding: 16px;
    border-radius: 10px;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hoan-kho-year-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--warning-color);
    font-weight: 600;
}

.hoan-kho-year-alert i {
    line-height: 1;
    margin-top: 2px;
}

.hoan-kho-year-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-color);
}

.hoan-kho-year-checkbox input {
    width: 18px;
    height: 18px;
}

.hoan-kho-year-hint {
    color: var(--text-light);
    font-size: 12px;
}

.input-error-message {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-error-message::before {
    content: '⚠';
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
    justify-content: flex-start;
}

.form-actions .btn {
    min-width: 200px;
}

.form-actions-container {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
    justify-content: flex-start;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-actions-container .btn {
    min-width: 200px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 73, 94, 0.3);
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

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

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   TABLE STYLES
   ============================================ */

.table-container {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.table-responsive table {
    min-width: 800px;
    margin-bottom: 0;
}

/* Custom scrollbar for better UX */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

table thead {
    background-color: #f8f9fa;
    color: #495057;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e1e5e9;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

table tbody tr:hover {
    background-color: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

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

.data-table thead {
    background-color: #f8f9fa;
    color: #495057;
}

.data-table th {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e1e5e9;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.2s ease;
}

.data-table th.sortable::after {
    content: '\2195';
    font-size: 0.7rem;
    margin-left: 0.35rem;
    color: #adb5bd;
    display: inline-block;
    transform: translateY(-1px);
}

.data-table th.sortable.sorted-asc::after {
    content: '▲';
    color: #2980b9;
}

.data-table th.sortable.sorted-desc::after {
    content: '▼';
    color: #2980b9;
}

.data-table th.sortable.sorted {
    color: #2980b9;
}

.data-table th.sortable:hover {
    color: #1e5f8f;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .text-center {
    text-align: center;
}

/* Mobile-specific table improvements */
@media (max-width: 768px) {
    .table-responsive {
        border: 2px solid #007bff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .table-responsive::-webkit-scrollbar {
        height: 12px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: #007bff;
        border-radius: 6px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #0056b3;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.year-warning-banner {
    margin-bottom: 1rem;
    font-weight: 600;
}

.year-warning-banner i {
    margin-right: 6px;
}

/* ============================================
   LOADING
   ============================================ */

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.spinner {
    border: 3px solid var(--bg-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .form-actions-container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .form-actions-container .btn {
        width: 100%;
        min-width: auto;
    }
    
    .sub-nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs-content {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   TÊN CHUẨN MODULE
   ============================================ */

.tenchuan-sections-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 2rem;
}

.tenchuan-section {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.tenchuan-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.tenchuan-sort-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.tenchuan-sort-buttons .btn {
    flex: 1;
    font-size: 13px;
    padding: 6px 12px;
}

.tenchuan-controls {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tenchuan-list {
    flex: 1;
    margin-top: 0.5rem;
    min-height: 200px;
}

.tenchuan-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tenchuan-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.3s;
    cursor: move;
}

.tenchuan-item:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tenchuan-item.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
    background: #fff;
}

.tenchuan-item.drag-over {
    border-top: 3px solid var(--primary-color);
    background: #e8f4f8;
}

.tenchuan-item-handle {
    cursor: grab;
    color: var(--text-light);
    padding: 4px 8px;
    font-size: 14px;
    user-select: none;
}

.tenchuan-item-handle:active {
    cursor: grabbing;
}

.tenchuan-item-handle:hover {
    color: var(--primary-color);
}

.tenchuan-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.tenchuan-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .tenchuan-sections-container {
        grid-template-columns: 1fr;
    }
    
    .hoan-kho-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hoan-kho-info-badges {
        gap: 6px;
    }
    
    .hoan-kho-badge-row {
        flex-direction: column;
        gap: 6px;
    }
    
    .hoan-kho-badge {
        font-size: 11px;
        padding: 5px 10px;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .hoan-kho-badge-label {
        white-space: normal;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================
   XUẤT BÁN STYLES
   ============================================ */

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 35px;
}

/* Auto-filled info box */
.auto-filled-info {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.auto-filled-info .info-header {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

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

.auto-filled-info .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auto-filled-info .info-item label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.auto-filled-info .info-item span {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .auto-filled-info .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-dialog {
    transform: scale(1);
}

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

.modal-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.modal-header .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-header .btn-close:hover {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

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

/* IMEI selection table */
.imei-selection-table {
    margin-top: 15px;
    overflow-x: auto;
}

.imei-selection-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.imei-selection-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.imei-selection-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.imei-selection-table tr:hover {
    background-color: var(--bg-light);
}

.imei-selection-table .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .modal-dialog {
        width: 95%;
        max-height: 95vh;
    }
    
    .imei-selection-table {
        font-size: 0.8rem;
    }
    
    .imei-selection-table th,
    .imei-selection-table td {
        padding: 8px;
    }
}

/* Section-specific message */
.section-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.section-message.hidden {
    display: none !important;
}

/* Auto-load info (badge style) */
.auto-load-info {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.auto-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.auto-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-color);
    white-space: nowrap;
}

.auto-info-badge i {
    color: var(--primary-color);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.auto-info-badge span {
    color: var(--text-color);
    font-weight: 500;
}

@media (max-width: 768px) {
    .auto-info-badges {
        flex-direction: column;
    }
    
    .auto-info-badge {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Collapsible field (Mô tả bán) */
.collapsible-field {
    width: 100%;
}

.collapsible-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: 0;
}

.collapsible-label:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.collapsible-label span {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.collapsible-label i {
    color: var(--primary-color);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.collapsible-content {
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MODULE HEADER & FILTERS (for Xem Dữ Liệu)
   ============================================ */

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.module-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

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

.month-selector-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.month-selector-inline label {
    font-weight: 500;
    color: var(--text-color);
}

.large-selector {
    min-width: 280px;
}

.large-selector .multiselect-btn {
    min-height: 56px;
}

.large-selector .multiselect-dropdown {
    min-width: 280px;
}

.last-update {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    white-space: nowrap;
    margin-left: 10px;
}

.filters-mobile {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    /* background: #f8f9fa; */
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.btn-clear-filters {
    width: 100%;
    padding: 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: none; /* Hidden by default, shown when filters are active */
    margin-top: 10px;
}

.btn-clear-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.filter-card {
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-width: 200px;
}

.filter-input-group {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s;
    height: 48px;
    box-sizing: border-box;
}

.filter-input-group:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.filter-input-number {
    flex: 1;
    height: 100%;
    padding: 0 15px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.filter-input-number::placeholder {
    color: var(--text-light);
}

.filter-count {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mobile-multiselect {
    position: relative;
    background: transparent;
    border-radius: 8px;
    flex: 1;
    min-width: 200px;
}

.multiselect-btn {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
}

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

.multiselect-btn i {
    margin-right: 8px;
}

.multiselect-btn .count {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    margin-right: 10px;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    display: none;
    z-index: 1000;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
}

.multiselect-dropdown.show {
    display: block;
}

.multiselect-options {
    padding: 0;
    overflow-y: auto;
    max-height: 200px;
}

/* Custom scrollbar for multiselect dropdown */
.multiselect-options::-webkit-scrollbar {
    width: 8px;
}

.multiselect-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.multiselect-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.multiselect-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.multiselect-summary {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

.multiselect-summary .selected-values {
    color: var(--primary-color);
    font-weight: 600;
}

.multiselect-search {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.multiselect-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.multiselect-search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Multiselect option styles - for search month dropdown */
.multiselect-option {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option:hover {
    background: #f8f9fa;
}

.multiselect-option label {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.multiselect-option input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
}

.multiselect-option span {
    flex: 1;
    font-size: 14px;
    color: #495057;
    font-weight: 400;
}

/* Legacy checkbox-label support */
.checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    flex: 1;
    font-size: 14px;
    color: var(--text-color);
}

.multiselect-actions {
    padding: 12px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.multiselect-actions button {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multiselect-actions button:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.multiselect-actions button:active {
    transform: translateY(0);
}

.btn-clear-filters {
    width: auto;
    padding: 12px 20px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: none;
    flex: 0 0 auto;
    align-self: flex-start;
}

.btn-clear-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.filter-summary {
    padding: 10px 15px;
    background: #e7f3ff;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #004085;
}

.filter-summary small {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #0056b3;
    font-size: 14px;
    font-weight: 500;
}

.total-records-info {
    margin: 10px 0 15px 0;
    padding: 8px 15px;
    background: #e7f3ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.total-records-info small {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #0056b3;
    font-size: 13px;
    font-weight: 500;
}

.total-records-info span {
    color: #004085;
}

.info-divider {
    display: inline-block;
    width: 3px;
    height: 20px;
    background-color: var(--primary-color);
    flex-shrink: 0;
    align-self: center;
}

.pagination {
    margin-top: 20px;
    padding: 15px;
    /* background: var(--bg-white); */
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-selector label {
    font-weight: 500;
    color: var(--text-color);
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--text-color);
}

.page-input {
    width: 60px;
    text-align: center;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.page-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.1);
}

.page-input::-webkit-inner-spin-button,
.page-input::-webkit-outer-spin-button {
    opacity: 1;
    cursor: pointer;
}

/* Mobile Responsive for Filters and Summary */
@media (max-width: 767px) {
    .filters-mobile {
        flex-direction: column;
    }
    
    .btn-clear-filters {
        width: 100%;
        margin-top: 10px;
    }
}

/* Desktop: Đảm bảo nút "Xóa bộ lọc" luôn ở hàng dưới */
@media (min-width: 768px) {
    .filters-mobile {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .btn-clear-filters {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Mobile Responsive for Filters and Summary */
@media (max-width: 767px) {
    .filter-card,
    .mobile-multiselect {
        min-width: 100%;
        width: 100%;
    }
    
    .filter-summary small,
    .total-records-info small {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }
    
    .filter-summary,
    .total-records-info {
        padding: 8px 12px;
    }
    
    .info-divider {
        display: none;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .page-size-selector,
    .page-navigation {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   SEARCH MODULE STYLES (for Tìm Kiếm)
   ============================================ */

.search-form {
    margin-bottom: 1.5rem;
}

.search-controls-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-filter-item {
    min-width: 300px;
    flex: 1;
}

/* IMEI search input - narrower width on desktop */
.search-filter-item.imei-search-item {
    flex: 0 0 auto;
    min-width: auto;
    max-width: 400px;
    width: 400px;
}

.search-filter-item .filter-input-group {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s;
    height: 48px;
    box-sizing: border-box;
}

.search-filter-item .filter-input-group:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.search-filter-item .filter-input-number {
    flex: 1;
    height: 100%;
    padding: 0 15px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.search-filter-item .filter-input-number::placeholder {
    color: #6c757d;
}

.search-filter-item .mobile-multiselect {
    height: 48px;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s;
    box-sizing: border-box;
}

.search-filter-item .mobile-multiselect:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.search-filter-item .mobile-multiselect .multiselect-btn {
    height: 48px;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background: transparent;
    min-height: 48px;
}

.search-filter-item .mobile-multiselect .multiselect-btn:hover {
    background: transparent;
}

.btn-search-customer {
    padding: 0 24px;
    font-size: 15px;
    font-weight: 500;
    height: 48px;
    white-space: nowrap;
}

.search-section {
    margin-bottom: 2rem;
}

.total-records-info {
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.total-records-info .info-divider {
    margin: 0 1rem;
    color: #dee2e6;
}

@media (max-width: 767px) {
    .search-controls-group {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-filter-item {
        min-width: auto;
        width: 100%;
    }
    
    .search-filter-item.imei-search-item {
        max-width: 100%;
        width: 100%;
    }
    
    .btn-search-customer {
        width: 100%;
        height: 56px;
    }
    
    .search-filter-item .filter-input-group {
        height: 56px;
    }
    
    .search-filter-item .mobile-multiselect {
        height: 56px;
    }
    
    .search-filter-item .mobile-multiselect .multiselect-btn {
        height: 56px;
        min-height: 56px;
    }
    
    .search-filter-item .filter-input-number {
        font-size: 16px;
        padding: 0 15px;
    }
}

