* {
    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%);
    padding: 0;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

html {
    height: 100%;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-header {
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: white;
}

.sidebar-header p {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    position: relative;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(102, 126, 234, 0.1);
    transition: width 0.3s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #667eea;
    color: white;
    padding-left: 25px;
    transform: translateX(5px);
}

.menu-item:hover::before {
    width: 100%;
}

.menu-item:hover i {
    transform: scale(1.2);
    transition: transform 0.3s ease;
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.2);
    border-left-color: #667eea;
    color: white;
}

.menu-item i {
    margin-right: 12px;
    font-size: 20px;
    width: 24px;
    text-align: center;
    display: inline-block;
}

.menu-item span {
    font-size: 15px;
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.menu-item-logout {
    color: rgba(255, 255, 255, 0.9) !important;
    border-left: 3px solid transparent !important;
}

.menu-item-logout:hover {
    background: rgba(220, 53, 69, 0.2) !important;
    border-left-color: #dc3545 !important;
    color: #ffcccc !important;
}

.menu-item-logout i {
    color: #ff6b6b;
}

/* Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    display: none;
}

.sidebar-toggle:hover {
    background: #5568d3;
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 0;
    transition: margin-left 0.3s ease;
    background: white;
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}

.container {
    width: 100%;
    margin: 0;
    background: white;
    padding: 30px;
    box-sizing: border-box;
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        padding: 20px 15px;
    }

    .sidebar-header h2 {
        font-size: 20px;
    }

    .sidebar-header p {
        font-size: 11px;
    }

    .menu-item {
        padding: 14px 15px;
        font-size: 14px;
    }

    .menu-item i {
        font-size: 18px;
        margin-right: 10px;
    }

    .sidebar-footer {
        position: relative;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-content {
        margin-left: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .sidebar-toggle {
        display: block;
        top: 15px;
        right: 15px;
        padding: 10px 13px;
        font-size: 18px;
    }

    /* Container */
    .container {
        padding: 15px 12px;
    }

    /* Typography */
    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
        padding-top: 50px;
    }

    h2 {
        font-size: 1.25em;
        margin-bottom: 15px;
    }

    /* Dashboard Cards */
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .card {
        padding: 20px;
    }

    .card-header {
        margin-bottom: 12px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-icon {
        font-size: 24px;
    }

    .card-value {
        font-size: 26px;
    }

    .card-footer {
        font-size: 11px;
    }

    /* Toolbar */
    .toolbar {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 15px;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .search-box input {
        padding: 12px 40px 12px 15px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .filter-group .btn {
        width: 100%;
    }

    /* Table */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }

    #data-table {
        font-size: 13px;
        min-width: 1200px;
    }

    #data-table th,
    #data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    #data-table th {
        font-size: 12px;
    }

    /* Form */
    .form-section {
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group {
        width: 100%;
    }

    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        box-sizing: border-box;
    }

    .form-group textarea {
        min-height: 80px;
        resize: vertical;
    }

    /* Buttons */
    .btn-group {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Settings */
    .settings-section {
        padding: 20px 15px;
    }

    .settings-section h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .info-card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-card {
        padding: 15px;
    }

    .info-card-icon {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .info-card-value {
        font-size: 16px;
    }

    /* Account Actions Grid */
    .account-actions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .account-action-card {
        padding: 20px 15px;
    }

    /* Statistics */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .summary-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-item {
        padding: 12px;
    }

    .chart-container {
        padding: 15px;
    }

    .chart-body {
        height: 250px;
    }

    /* Login History */
    .login-history-section h3 {
        font-size: 16px;
    }

    .login-history-item-card {
        padding: 12px;
    }

    /* Modal */
    .modal-content {
        width: 90%;
        max-width: 400px;
        margin: 20px auto;
        padding: 20px;
    }

    .modal-header {
        padding-bottom: 15px;
        margin-bottom: 15px;
    }

    .modal-body {
        padding: 15px 0;
    }

    .modal-footer {
        padding-top: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .modal-btn {
        width: 100%;
    }

    /* Tabs */
    .settings-tabs,
    .tab-btn {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        flex: 1;
        min-width: 0;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .btn-sm {
        width: 100%;
        padding: 10px;
    }

    .btn-icon-action {
        width: 100%;
        min-width: auto;
        height: auto;
        padding: 10px;
    }

    /* Thu Chi Page */
    #tab-list,
    #tab-statistics {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    /* Pagination */
    #thu-chi-pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    /* Settings Tabs Container */
    .settings-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    /* Settings Utilities and Account sections */
    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }

    /* Table action buttons on mobile */
    #data-table .action-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    #data-table .btn-sm {
        width: auto;
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Login History */
    .login-history-item-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .login-history-icon {
        align-self: flex-start;
    }

    /* Chart responsive */
    .chart-legend {
        flex-direction: column;
        gap: 10px;
    }

    /* Summary items */
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .summary-value {
        font-size: 16px;
    }

    /* Thu Chi Stats Table */
    .thu-chi-stats-wrapper {
        margin: 0 -12px;
        border-radius: 0;
    }

    .thu-chi-stats-table {
        font-size: 12px;
        min-width: 800px;
    }

    .thu-chi-stats-table th,
    .thu-chi-stats-table td {
        padding: 10px 8px;
    }

    /* Form section mobile spacing */
    .form-section {
        margin-bottom: 20px;
    }

    /* Remove hover transforms on mobile for better touch */
    .card:hover,
    .info-card:hover,
    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    /* Better touch targets */
    .menu-item,
    .btn,
    input,
    select,
    textarea {
        min-height: 44px; /* Minimum touch target size */
    }

    /* Stats header mobile */
    .stats-header {
        padding: 20px 15px !important;
        margin: -15px -12px 20px -12px !important;
    }

    .stats-title {
        font-size: 20px !important;
    }

    /* Filter controls mobile */
    .filter-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .filter-select,
    .filter-date {
        width: 100%;
        min-width: auto;
        padding: 12px;
        font-size: 16px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        max-width: 280px;
    }

    .container {
        padding: 12px 10px;
    }

    h1 {
        font-size: 1.25em;
        padding-top: 45px;
    }

    .card-value {
        font-size: 22px;
    }

    .info-card {
        flex-direction: column;
        text-align: center;
    }

    .info-card-icon {
        margin: 0 auto;
    }

    .table-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }

    #data-table {
        font-size: 11px;
    }

    #data-table th,
    #data-table td {
        padding: 8px 5px;
    }
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
    margin-top: 0;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-left: 4px solid #667eea;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(102, 126, 234, 0.5);
    border-left-color: #667eea;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3), 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.card-title {
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.card-icon {
    font-size: 30px;
    opacity: 0.7;
}

.card-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.card-footer {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Table Total Row */
.total-row {
    background: #f8f9fa;
    font-weight: 600;
}

.total-row td {
    border-top: 2px solid #667eea;
    padding: 15px 12px;
    font-weight: 600;
    color: #333;
}

.total-row:hover {
    background: #e9ecef;
}

/* Search and Filter */
.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group select,
.filter-group input {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Statistics Section */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 5px;
    color: #999;
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.settings-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 600;
    color: #333;
}

.settings-value {
    color: #666;
}

/* Settings Info System Card Layout */
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.info-card-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.info-card-icon.version {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.info-card-icon.records {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.info-card-icon.created {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.info-card-content {
    flex: 1;
    min-width: 0;
}

.info-card-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.info-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    word-break: break-word;
}

.login-history-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-history-section h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.login-history-section h3 i {
    color: #667eea;
}

.login-history-list {
    display: grid;
    gap: 10px;
}

.login-history-item-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.login-history-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.login-history-icon {
    font-size: 20px;
    color: #28a745;
    flex-shrink: 0;
}

.login-history-details {
    flex: 1;
    min-width: 0;
}

.login-history-time {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin-bottom: 2px;
}

.login-history-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.login-history-ip {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.login-history-ip i {
    color: #667eea;
    font-size: 11px;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

input[type="date"],
input[type="number"],
input[type="text"],
textarea {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="date"]:focus,
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.5);
}

.btn-success:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.5);
}

.btn-danger:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.5);
}

.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(108, 117, 125, 0.4);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.5);
}

.btn-info:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(23, 162, 184, 0.4);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.5);
}

.btn-warning:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 193, 7, 0.4);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

th:last-child, td:last-child {
    border-right: none;
}

tr:hover {
    background: #f8f9fa;
}

.readonly {
    background: #e9ecef;
    font-weight: 600;
}

.copyable {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    user-select: none;
}

.copyable:hover {
    background: #d4edda !important;
}

.copyable:active {
    background: #c3e6cb !important;
}

td.copyable {
    padding-right: 12px;
}

td.team-cell {
    font-weight: bold;
    color: #0066cc;
}

td.ut-cell {
    font-weight: bold;
    color: #cc6600;
}

td.ghi-chu-cell {
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-sm:hover {
    transform: translateY(-2px);
}

.btn-sm:active {
    transform: translateY(0);
}

.btn-icon-action {
    padding: 6px 8px;
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-icon-action i {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.btn-icon-action:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon-action:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon-action.btn-success:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-icon-action.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.hidden {
    display: none;
}

.btn-copy {
    background: #17a2b8;
    color: white;
}

.btn-copy:hover {
    background: #138496;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.5);
}

.btn-copy:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(23, 162, 184, 0.4);
}

.table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 300px); /* Đủ để hiển thị 1 tháng (31 ngày) */
    overflow-y: auto;
    min-height: 400px;
}

/* Đảm bảo mỗi dòng có chiều cao đủ */
#data-table tbody tr {
    height: auto;
    min-height: 40px;
}

/* Thu Chi Statistics Table - Professional Styling */
.thu-chi-stats-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    background: white;
}

.thu-chi-stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.thu-chi-stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.thu-chi-stats-table th {
    padding: 16px 14px;
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
}

.thu-chi-stats-table th:last-child {
    border-right: none;
}

.thu-chi-stats-table th.text-right {
    text-align: right;
}

.thu-chi-stats-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.thu-chi-stats-table tbody tr:last-child {
    border-bottom: none;
}

.thu-chi-stats-table tbody tr:hover:not(.total-row):not(.empty-row) {
    background: #f8f9ff;
    transform: scale(1.002);
}

.thu-chi-stats-table tbody tr.empty-row {
    background: #fafafa;
    opacity: 0.7;
}

.thu-chi-stats-table tbody tr.total-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.thu-chi-stats-table tbody tr.total-row td {
    color: white;
    padding: 18px 14px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.thu-chi-stats-table td {
    padding: 14px;
    text-align: center;
    font-size: 14px;
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.thu-chi-stats-table td:last-child {
    border-right: none;
}

.thu-chi-stats-table td.text-right {
    text-align: right;
}

.thu-chi-stats-table tbody tr.total-row td {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.thu-chi-stats-table tbody tr.total-row td:last-child {
    border-right: none;
}

.thu-chi-stats-table .day-cell,
.thu-chi-stats-table .month-cell {
    font-weight: 600;
    color: #333;
    min-width: 80px;
}

.thu-chi-stats-table .thu-cell {
    color: #28a745;
    font-weight: 600;
}

.thu-chi-stats-table .chi-cell {
    color: #dc3545;
    font-weight: 600;
}

.thu-chi-stats-table .chenhlech-cell {
    font-weight: 600;
    font-size: 15px;
}

.thu-chi-stats-table .giao-dich-cell {
    color: #666;
    font-weight: 500;
}

.thu-chi-stats-table tbody tr.total-row td {
    font-size: 15px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header-icon {
    font-size: 32px;
}

.modal-header-text h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-header-text p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.modal-body {
    padding: 25px;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #dee2e6;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.modal-btn-confirm {
    background: #dc3545;
    color: white;
}

.modal-btn-confirm:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   STATISTICS PAGE STYLES
   ============================================ */

.statistics-page {
    padding: 0;
    background: #f5f7fa;
    min-height: 100vh;
}

/* Statistics Header */
.stats-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    margin: -30px -30px 30px -30px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.stats-header-content {
    flex: 1;
}

.stats-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stats-icon {
    font-size: 36px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.stats-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.stats-header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Pagination Styles */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover:not(.pagination-btn-disabled):not(.pagination-btn-active) {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.pagination-btn-active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
    cursor: default;
}

.pagination-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
}

.pagination-ellipsis {
    padding: 0 5px;
    color: #999;
    font-weight: 600;
}

/* Search Input Focus */
#searchGhiChu:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#clearSearchBtn:hover {
    color: #dc3545;
    background: #fee;
    border-radius: 50%;
}

/* Tab Styles */
.tab-btn {
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #667eea !important;
    border-bottom-color: #667eea !important;
}

.tab-btn.active {
    color: #667eea !important;
    border-bottom-color: #667eea !important;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Per Page Select Focus */
#perPageSelect:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Filter Toolbar */
.stats-toolbar {
    margin-bottom: 30px;
}

.filter-card {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.filter-icon {
    font-size: 20px;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-select,
.filter-date {
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    color: #333;
    min-width: 180px;
}

.filter-select:focus,
.filter-date:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Statistics Cards Grid */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card-background {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 0 0 0 100%;
    opacity: 0.1;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-card-background {
    opacity: 0.15;
    transform: scale(1.1);
}

.stat-card-content {
    position: relative;
    z-index: 1;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-card-value {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.stat-card-footer {
    font-size: 12px;
    color: #999;
}

.stat-card-label {
    display: block;
}

/* Card Color Variants */
.stat-card-primary .stat-card-background {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-primary .stat-card-value {
    color: #667eea;
}

.stat-card-primary:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3), 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.stat-icon-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-success .stat-card-background {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card-success .stat-card-value {
    color: #11998e;
}

.stat-card-success:hover {
    border-color: rgba(17, 153, 142, 0.5);
    box-shadow: 0 8px 30px rgba(17, 153, 142, 0.3), 0 0 0 4px rgba(17, 153, 142, 0.15);
}

.stat-icon-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card-info .stat-card-background {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card-info .stat-card-value {
    color: #4facfe;
}

.stat-card-info:hover {
    border-color: rgba(79, 172, 254, 0.5);
    box-shadow: 0 8px 30px rgba(79, 172, 254, 0.3), 0 0 0 4px rgba(79, 172, 254, 0.15);
}

.stat-icon-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card-warning .stat-card-background {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-warning .stat-card-value {
    color: #f5576c;
}

.stat-card-warning:hover {
    border-color: rgba(245, 87, 108, 0.5);
    box-shadow: 0 8px 30px rgba(245, 87, 108, 0.3), 0 0 0 4px rgba(245, 87, 108, 0.15);
}

.stat-icon-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-danger .stat-card-background {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card-danger .stat-card-value {
    color: #fa709a;
}

.stat-card-danger:hover {
    border-color: rgba(250, 112, 154, 0.5);
    box-shadow: 0 8px 30px rgba(250, 112, 154, 0.3), 0 0 0 4px rgba(250, 112, 154, 0.15);
}

.stat-icon-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card-purple .stat-card-background {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-card-purple .stat-card-value {
    color: #a8edea;
}

.stat-card-purple:hover {
    border-color: rgba(168, 237, 234, 0.6);
    box-shadow: 0 8px 30px rgba(168, 237, 234, 0.3), 0 0 0 4px rgba(168, 237, 234, 0.15);
}

.stat-icon-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.stat-card-teal .stat-card-background {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.stat-card-teal .stat-card-value {
    color: #30cfd0;
}

.stat-card-teal:hover {
    border-color: rgba(48, 207, 208, 0.5);
    box-shadow: 0 8px 30px rgba(48, 207, 208, 0.3), 0 0 0 4px rgba(48, 207, 208, 0.15);
}

.stat-icon-teal {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.stat-card-orange .stat-card-background {
    background: linear-gradient(135deg, #fad961 0%, #f76b1c 100%);
}

.stat-card-orange .stat-card-value {
    color: #f76b1c;
}

.stat-card-orange:hover {
    border-color: rgba(247, 107, 28, 0.5);
    box-shadow: 0 8px 30px rgba(247, 107, 28, 0.3), 0 0 0 4px rgba(247, 107, 28, 0.15);
}

.stat-icon-orange {
    background: linear-gradient(135deg, #fad961 0%, #f76b1c 100%);
}

.stat-card-green .stat-card-background {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

.stat-card-green .stat-card-value {
    color: #56ab2f;
}

.stat-card-green:hover {
    border-color: rgba(86, 171, 47, 0.5);
    box-shadow: 0 8px 30px rgba(86, 171, 47, 0.3), 0 0 0 4px rgba(86, 171, 47, 0.15);
}

.stat-icon-green {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.chart-wrapper {
    width: 100%;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header-content {
    flex: 1;
}

.chart-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 5px 0;
}

.chart-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.chart-body {
    height: 350px;
    position: relative;
}

/* Summary Section */
.summary-section {
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.summary-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.summary-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.summary-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 30px 20px;
        margin: -30px -30px 20px -30px;
    }

    .stats-title {
        font-size: 24px;
    }

    .stats-cards-grid {
        grid-template-columns: 1fr;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-body {
        height: 300px;
    }

    .filter-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        width: 100%;
    }

    .filter-select,
    .filter-date {
        width: 100%;
        min-width: auto;
    }

    .summary-content {
        grid-template-columns: 1fr;
    }
}

/* Red text color for specific input fields */
#goi_12,
#goi_3,
#goi_6 {
    color: rgba(255, 0, 0, 1);
    font-weight: 600;
}

/* Footer Styles */
.site-footer {
    background: white !important;
    background-color: white !important;
    color: #666;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    box-shadow: none;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    text-align: center;
}

.footer-text {
    margin: 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-text i {
    color: #999;
    font-size: 13px;
}

.footer-text strong {
    font-weight: 600;
    color: #333;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.footer-link i {
    font-size: 12px;
}

/* Footer responsive */
@media (max-width: 768px) {
    .site-footer {
        padding: 15px 0;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-text {
        font-size: 12px;
        gap: 6px;
    }
    
    .footer-text i,
    .footer-link i {
        font-size: 11px;
    }
}