* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f5f8;
    color: #1f2937;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.topbar {
    background: #1f2a44;
    color: #fff;
    padding: 14px 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topnav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.topnav-link {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
}

.topnav-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.user-name {
    font-size: 14px;
}

.page-content {
    padding-top: 24px;
    padding-bottom: 40px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 6px 0;
}

.muted {
    color: #6b7280;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    margin-bottom: 20px;
}

.auth-wrapper {
    min-height: calc(100vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.filters-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.filters-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

label {
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    background: #fff;
}

textarea {
    resize: vertical;
}

.field-help {
    font-size: 12px;
    color: #6b7280;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: #1f2a44;
    color: #fff;
}

.btn-light {
    background: #e5e7eb;
    color: #111827;
}

.btn-success {
    background: #15803d;
    color: #fff;
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
}

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

.btn-full {
    width: 100%;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.content-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.project-card-link:hover {
    transform: translateY(-2px);
}

.project-title {
    font-size: 18px;
    font-weight: 700;
}

.table-wrapper {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
}

.flash-list {
    margin-bottom: 16px;
}

.flash {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.text-success {
    color: #16a34a;
    font-weight: 700;
}

.text-danger {
    color: #dc2626;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-income {
    background: #dcfce7;
    color: #166534;
}

.badge-expense {
    background: #fee2e2;
    color: #991b1b;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-link {
    color: #1d4ed8;
    text-decoration: none;
    font-size: 14px;
    word-break: break-word;
}

.file-link:hover {
    text-decoration: underline;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form input {
    min-width: 170px;
}

.actions-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .topbar-inner {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .topbar-right {
        width: 100%;
        align-items: flex-start;
    }

    .topnav {
        width: 100%;
    }

    .stat-value {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .filters-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .file-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
