/* General */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    background: #f0f2f5;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-toggle {
    padding: 15px;
    cursor: pointer;
    text-align: center;
}

.tab-link {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s ease;
}

.tab-link:hover, .tab-link.active {
    background: #34495e;
}

.tab-link i {
    margin-right: 10px;
    width: 20px;
}

.tab-link span {
    display: inline-block;
}

.sidebar.collapsed .tab-link span {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
    transition: all 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
}

.tab-content {
    display: none;
}

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

.form-container {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

h2 {
    margin: 0 0 20px;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

/* Notification */
.notification {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1001;
}

.notification.success {
    background: #27ae60;
    color: #fff;
}

.notification.error {
    background: #e74c3c;
    color: #fff;
}

/* Form nhập liệu (Danh sách dự án) */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.inline-form input,
.inline-form select,
.inline-form textarea {
    padding: 10px;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
    flex: 1;
    min-width: 150px;
}

.inline-form input[type="date"] {
    min-width: 120px;
}

.inline-form textarea {
    min-height: 60px;
    resize: vertical;
}

.inline-form button {
    background: #3498db;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.inline-form button:hover {
    background: #2980b9;
}

/* Table (Thống kê và Danh sách dự án) */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

th:last-child, td:last-child {
    border-right: none;
}

th {
    background: #34495e;
    font-weight: 600;
    color: #ecf0f1;
    text-transform: uppercase;
    font-size: 13px;
}

td {
    color: #2c3e50;
    font-size: 14px;
}

tr:hover {
    background: #f9fbfc;
}

.date-column {
    white-space: nowrap;
}

.expense-list div {
    padding: 5px 0;
    position: relative;
}

/* Note Toggle */
.note-toggle, .expense-note-toggle {
    cursor: pointer;
    color: #3498db;
    font-size: 14px;
    margin-right: 5px;
}

.note-content, .expense-note-content {
    display: none;
    background: #f0f2f5;
    padding: 10px;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 13px;
    color: #2c3e50;
    white-space: pre-wrap; /* Giữ xuống dòng */
}

.expense-note-toggle {
    margin-left: 5px;
    font-size: 16px;
    vertical-align: middle;
}

.expense-note-content {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 10;
    width: 200px;
}

/* Buttons and Actions */
.add-expense-btn, .edit, .delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.add-expense-btn:hover { color: #27ae60; }
.edit:hover { color: #3498db; }
.delete:hover { color: #e74c3c; }

.project-actions, .expense-actions {
    display: inline-flex;
    gap: 5px;
}

.stats-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.stats-btn:hover {
    background: #2980b9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #7f8c8d;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #e74c3c;
}

.modal-content h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 500;
}

.modal-content form input,
.modal-content form select,
.modal-content form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

.modal-content form textarea {
    min-height: 60px;
    resize: vertical;
}

.modal-content form button {
    background: #3498db;
    color: #fff;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}

.modal-content form button:hover {
    background: #2980b9;
}

/* Autocomplete */
.autocomplete-suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    max-height: 150px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
}

.autocomplete-suggestions div {
    padding: 10px;
    cursor: pointer;
}

.autocomplete-suggestions div:hover {
    background: #f0f2f5;
}

/* Status Dots */
.status-dot-unpaid, .expense-dot-unpaid {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot-paid, .expense-dot-paid {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #27ae60;
    border-radius: 50%;
    margin-right: 5px;
}

.late-days {
    color: #e74c3c;
    font-size: 12px;
    margin-left: 5px;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    padding: 8px 12px;
    margin: 0 5px;
    text-decoration: none;
    color: #3498db;
    border: 1px solid #dfe6e9;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination a.active {
    background: #3498db;
    color: #fff;
}

.pagination a:hover:not(.active) {
    background: #f0f2f5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
}

.footer a {
    color: #7f8c8d;
    margin: 0 10px;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #3498db;
}

/* Calendar */
#calendar-display {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }

    .sidebar.collapsed {
        width: 60px;
    }

    .sidebar .tab-link span {
        display: none;
    }

    .inline-form {
        flex-direction: column;
    }

    .inline-form input,
    .inline-form select,
    .inline-form textarea {
        width: 100%;
        min-width: unset;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        min-width: 100px;
    }

    .expense-note-content {
        width: 100%;
        position: static;
    }
}