* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-header-left h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #374151;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #374151;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
    touch-action: manipulation;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle:active {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

.mobile-menu-toggle .menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
    height: 16px;
    justify-content: space-between;
}

.mobile-menu-toggle .hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #374151;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role-text {
    color: #3b82f6;
    font-weight: 500;
    font-size: 14px;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fbbf24;
    color: #1f2937;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-dropdown-btn:hover {
    background: #f59e0b;
}

.user-dropdown-btn .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-dropdown-btn .crown-icon {
    font-size: 16px;
}

.user-dropdown.open .user-dropdown-btn .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-info {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.user-dropdown-name {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 4px;
}

.user-dropdown-role {
    font-size: 12px;
    color: #6b7280;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.user-dropdown-item {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 14px;
    transition: background 0.2s;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
}

.user-dropdown-item:first-of-type {
    border-radius: 8px 8px 0 0;
}

.user-dropdown-item:last-of-type {
    border-radius: 0 0 8px 8px;
}

.user-dropdown-item:only-of-type {
    border-radius: 8px;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    height: calc(100vh - 70px);
    position: fixed;
    left: 0;
    top: 70px;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: white;
}

.sidebar-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.5em;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-item {
    width: 100%;
    padding: 15px 25px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1em;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left-color: #667eea;
}

.sidebar-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
    font-weight: 600;
}

.sidebar-item .icon {
    font-size: 1.3em;
    width: 30px;
    text-align: center;
}

.sidebar-item .text {
    flex: 1;
}

.sidebar-item .dropdown-arrow {
    font-size: 0.8em;
    transition: transform 0.3s;
    margin-left: auto;
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-dropdown {
    position: relative;
}

.sidebar-dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-dropdown.open .sidebar-dropdown-menu {
    max-height: 500px;
}

.sidebar-sub-item {
    padding-left: 60px !important;
    font-size: 0.9em;
}

.sidebar-sub-item .icon {
    font-size: 1.1em;
}

.sidebar-item-danger {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.sidebar-item-danger:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-left-color: #ef4444 !important;
}

.sidebar-item-danger.active {
    background: rgba(239, 68, 68, 0.3) !important;
    border-left-color: #ef4444 !important;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    margin-top: 70px;
    flex: 1;
    min-height: calc(100vh - 70px);
    padding: 0;
    transition: margin-left 0.3s ease;
    background: white;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    padding: 0;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.action-bar h2 {
    margin: 0;
    color: #374151;
    font-size: 1.8em;
}

@keyframes highlight {
    0% {
        background: rgba(102, 126, 234, 0.3);
        transform: scale(1);
    }
    50% {
        background: rgba(102, 126, 234, 0.5);
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Chốt Sổ Tab Styles */
.chotso-container {
    padding: 20px;
}

.chotso-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    flex-wrap: wrap;
}

.chotso-tab-btn {
    padding: 12px 24px;
    background: #f3f4f6;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

.chotso-tab-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.chotso-tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.chotso-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chotso-panel {
    display: none;
}

.chotso-panel.active {
    display: block;
}

.chotso-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chotso-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chotso-summary-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.chotso-summary-card .value {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.chotso-summary-card.positive .value {
    color: #4ade80;
}

.chotso-summary-card.negative .value {
    color: #f87171;
}

.chotso-summary-card.neutral .value {
    color: #60a5fa;
}

.summary-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-card .label {
    font-size: 0.9em;
    opacity: 0.9;
}

.summary-card .value {
    font-size: 1.5em;
    font-weight: bold;
}

.thu-value {
    color: #4ade80;
}

.chi-value {
    color: #f87171;
}

.conlai-value {
    color: #60a5fa;
}


.tab-content {
    display: none;
    padding: 20px 20px 20px 20px;
}

.tab-content.active {
    display: block;
}

.action-bar {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#thongkeTab .table-container {
    background: transparent;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#tableThongKe {
    background: transparent;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    transition: background-color 0.2s ease;
}

td strong {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.05em;
}

tbody tr:hover {
    background: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.separator-row {
    border-top: 3px solid #667eea;
}

.separator-row td {
    padding-top: 20px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Tổng Hợp Tab Styles */
.summary-by-type {
    padding: 20px 0;
}

.summary-by-type h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: #374151;
    text-align: center;
}

.summary-by-type .table-container {
    margin-top: 20px;
}

.summary-by-type table {
    width: 100%;
}

.summary-by-type thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.summary-by-type th {
    padding: 15px;
    font-weight: 600;
    text-align: center;
}

.summary-by-type td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.summary-by-type tbody tr:hover {
    background: #f9fafb;
}

.summary-by-type tbody tr:last-child td {
    border-bottom: none;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Number formatting */
.number {
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 8px 12px;
}

.number.positive {
    color: #059669;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.06) 100%);
    border-radius: 6px;
    font-weight: 600;
}

.number.negative {
    color: #dc2626;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.06) 100%);
    border-radius: 6px;
    font-weight: 600;
}

/* Special styling for thống kê table */
#tableThongKe {
    border-collapse: separate;
    border-spacing: 0;
}

#tableThongKe th,
#tableThongKe td {
    border-left: none !important;
    border-right: none !important;
}

#tableThongKe .number {
    font-size: 1.08em;
    padding: 12px 16px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
}

#tableThongKe .number.positive {
    color: #047857;
}

#tableThongKe .number.negative {
    color: #b91c1c;
}

#tableThongKe tbody tr:hover .number {
    transform: none;
    box-shadow: none;
}

#tableThongKe td strong {
    font-weight: 700;
    color: #111827;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

#tableThongKe td {
    padding: 14px 16px;
}

/* Thống Kê Tổng table - bỏ hiệu ứng */
#tableThongKeTong {
    border-collapse: separate;
    border-spacing: 0;
}

#tableThongKeTong th,
#tableThongKeTong td {
    border-left: none !important;
    border-right: none !important;
}

#tableThongKeTong .number {
    font-size: 1.08em;
    padding: 12px 16px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
}

#tableThongKeTong .number.positive {
    color: #047857;
}

#tableThongKeTong .number.negative {
    color: #b91c1c;
}

#tableThongKeTong tbody tr:hover .number {
    transform: none;
    box-shadow: none;
}

/* Thống Kê Theo Năm table - bỏ hiệu ứng */
#tableThongKeNam {
    border-collapse: separate;
    border-spacing: 0;
}

#tableThongKeNam th,
#tableThongKeNam td {
    border-left: none !important;
    border-right: none !important;
}

#tableThongKeNam .number {
    font-size: 1.08em;
    padding: 12px 16px;
    margin: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: none;
}

#tableThongKeNam .number.positive {
    color: #047857;
}

#tableThongKeNam .number.negative {
    color: #b91c1c;
}

#tableThongKeNam tbody tr:hover .number {
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        top: 70px;
        height: calc(100vh - 70px);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        margin-top: 70px;
        padding: 0;
    }

    .container {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .top-header {
        padding: 0 15px;
        height: 60px;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .top-header-left {
        gap: 8px;
    }

    .top-header-left h1 {
        font-size: 1.1em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .user-role-text {
        display: none;
    }

    .user-dropdown-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }

    .user-dropdown-btn .crown-icon {
        font-size: 14px;
    }

    .user-dropdown-menu {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    .main-content.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        pointer-events: auto;
    }

    header h1 {
        font-size: 1.8em;
    }

    .summary {
        flex-direction: column;
        gap: 10px;
    }

    .summary-card {
        width: 100%;
        padding: 15px;
    }

    .tab-content {
        padding: 15px 10px;
    }

    .tab-content h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .action-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .action-bar .btn {
        width: 100%;
    }

    .table-container {
        font-size: 0.85em;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -10px;
        padding: 0 10px;
        position: relative;
    }

    .table-container::-webkit-scrollbar {
        height: 8px;
    }

    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }

    .table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    table {
        min-width: 800px;
    }

    th, td {
        padding: 8px 6px;
        font-size: 0.9em;
    }

    th {
        font-size: 0.85em;
        white-space: nowrap;
    }

    .action-buttons {
        flex-direction: row;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-small {
        padding: 8px 14px;
        font-size: 0.85em;
        min-width: 60px;
        touch-action: manipulation;
    }

    .btn {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal {
        padding: 10px;
    }

    .modal-header h2 {
        font-size: 1.3em;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .pagination-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .pagination-controls > div {
        width: 100%;
    }

    #paginationButtons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .chotso-modal-body {
        padding: 20px 15px;
    }

    .chotso-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chotso-title-badge {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chotso-title-badge .btn-copy-log-header {
        width: 100%;
    }

    .user-dropdown-info {
        padding: 10px 12px;
    }

    .user-dropdown-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    .summary-card .value {
        font-size: 1.3em;
    }

    .summary-card .label {
        font-size: 0.85em;
    }

    .pagination-controls {
        padding: 10px;
    }

    #itemsPerPageSelect {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .top-header {
        height: 55px;
        padding: 0 10px;
    }

    .top-header-left h1 {
        font-size: 1em;
        max-width: 120px;
    }

    .mobile-menu-toggle {
        font-size: 1.4em;
        padding: 5px 8px;
        min-width: 36px;
        min-height: 36px;
    }

    .user-dropdown-btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    .user-dropdown-btn span:first-child {
        display: none;
    }

    .sidebar {
        width: 100%;
        max-width: 320px;
    }

    .sidebar-header {
        padding: 20px 15px;
    }

    .sidebar-item {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .sidebar-item .icon {
        font-size: 1.2em;
        width: 25px;
    }

    .tab-content {
        padding: 10px 5px;
    }

    .tab-content h2 {
        font-size: 1.3em;
    }

    table {
        min-width: 700px;
    }

    th, td {
        padding: 6px 4px;
        font-size: 0.8em;
    }

    .modal-content {
        width: 100%;
        margin: 5% auto;
        border-radius: 10px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    .chotso-modal-body {
        padding: 15px 10px;
    }

    .summary-card {
        padding: 12px;
    }

    .summary-card .value {
        font-size: 1.2em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 0.8em;
        min-width: 55px;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .chotso-stat-card {
        padding: 15px;
    }

    .chotso-stat-value {
        font-size: 1.2em;
    }

    .action-bar {
        padding: 10px 0;
    }
}

/* Chốt Sổ Modal Styles */
.chotso-modal-body {
    padding: 30px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.chotso-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.chotso-title-badge {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    justify-content: space-between;
}

.chotso-title-content {
    flex: 1;
}

.chotso-title-icon {
    font-size: 2.5em;
    line-height: 1;
}

.chotso-title-label {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chotso-title-name {
    margin: 5px 0 0 0;
    color: white;
    font-size: 1.5em;
    font-weight: 700;
}

.chotso-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.chotso-stat-card {
    background: white;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.chotso-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.chotso-stat-card.chotso-stat-positive {
    border-color: #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
}

.chotso-stat-card.chotso-stat-negative {
    border-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.chotso-stat-card.chotso-stat-info {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.chotso-stat-card.chotso-stat-warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}

.chotso-stat-icon {
    font-size: 2em;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.chotso-stat-info {
    flex: 1;
    min-width: 0;
}

.chotso-stat-label {
    margin: 0 0 5px 0;
    color: #6b7280;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chotso-stat-value,
.chotso-stat-value-final {
    margin: 0;
    color: #1f2937;
    font-size: 1.3em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chotso-warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.chotso-warning-icon {
    font-size: 1.8em;
    flex-shrink: 0;
    margin-top: 2px;
}

.chotso-warning-text {
    margin: 0;
    color: #92400e;
    font-weight: 500;
    line-height: 1.6;
    flex: 1;
}

.chotso-log-section {
    margin-bottom: 0;
}

.chotso-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chotso-log-label {
    margin: 0;
    color: #374151;
    font-size: 1em;
    font-weight: 600;
}

.chotso-log-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #f9fafb;
    resize: vertical;
    color: #1f2937;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.chotso-log-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-copy-log-header {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875em;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-copy-log-header:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chotso-modal-footer {
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e5e7eb;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    border-radius: 0 0 20px 20px;
}

.btn-outline {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-gradient {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    font-weight: 600;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875em;
}

@media (max-width: 768px) {
    .chotso-stats-grid {
        grid-template-columns: 1fr;
    }

    .chotso-modal-footer {
        flex-direction: column-reverse;
    }

    .chotso-modal-footer .btn {
        width: 100%;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.3;
}

.toast.toast-success {
    border-left-color: #10b981;
    color: #065f46;
}

.toast.toast-success .toast-icon {
    background: #d1fae5;
    color: #10b981;
}

.toast.toast-error {
    border-left-color: #ef4444;
    color: #991b1b;
}

.toast.toast-error .toast-icon {
    background: #fee2e2;
    color: #ef4444;
}

.toast.toast-warning {
    border-left-color: #f59e0b;
    color: #92400e;
}

.toast.toast-warning .toast-icon {
    background: #fef3c7;
    color: #f59e0b;
}

.toast.toast-info {
    border-left-color: #3b82f6;
    color: #1e40af;
}

.toast.toast-info .toast-icon {
    background: #dbeafe;
    color: #3b82f6;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    margin: 0 0 4px 0;
    font-weight: 600;
    font-size: 1em;
    color: #1f2937;
}

.toast-message {
    margin: 0;
    font-size: 0.875em;
    color: #6b7280;
    line-height: 1.5;
}

.toast-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.toast-hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}
