*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #1f2933;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Touch-friendly tap targets */
button,
a,
input[type="checkbox"],
.multiselect-display {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(90deg, #155e75, #0369a1);
    color: #f9fafb;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.25);
}

.top-bar .brand {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.top-bar nav a {
    color: #e0f2fe;
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.top-bar nav a.primary {
    background: #f97316;
    color: #111827;
    font-weight: 600;
}

.container {
    max-width: 100%;
    margin: 1.5rem auto 3rem;
    padding: 0 1.5rem;
}

.filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.download-btn {
    border-radius: 999px;
    border: 1px solid #0369a1;
    color: #0369a1;
    padding: 0.4rem 1rem;
    background: #ecfeff;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filters .upload-form {
    margin-top: 0.25rem;
}

.filters form + form {
    margin-top: 0.25rem;
}

.danger-all {
    background: #b91c1c;
    color: #fee2e2;
}

.top-bar .user-label {
    margin-left: 1rem;
    font-size: 0.8rem;
    color: #bae6fd;
}

.muted {
    color: #9ca3af;
    font-size: 0.8rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    flex: 1;
}

label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

input,
select,
textarea {
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.6rem;
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Multi-select component styles */
.multiselect-wrapper {
    position: relative;
    width: 100%;
}

.multiselect-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.6rem;
    background: white;
    cursor: pointer;
    min-height: 2.5rem;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.multiselect-display:hover {
    border-color: #0369a1;
}

.multiselect-display.active {
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.multiselect-placeholder {
    color: #9ca3af;
    flex: 1;
}

.multiselect-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}

.multiselect-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #0369a1;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}

.multiselect-tag-remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.25rem;
}

.multiselect-tag-remove:hover {
    opacity: 0.8;
}

.multiselect-arrow {
    color: #6b7280;
    font-size: 0.75rem;
    transition: transform 0.2s;
    margin-left: 0.5rem;
}

.multiselect-display.active .multiselect-arrow {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow: hidden;
    flex-direction: column;
}

.multiselect-dropdown.active {
    display: flex;
}

.multiselect-search {
    padding: 0.5rem 0.75rem;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    font-size: 0.9rem;
}

.multiselect-search:focus {
    outline: none;
    border-bottom-color: #0369a1;
}

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

.multiselect-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

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

.multiselect-option input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}

.multiselect-option span {
    flex: 1;
    user-select: none;
}

.multiselect-option.hidden {
    display: none;
}

button,
.form-actions a,
.top-bar nav a.primary {
    cursor: pointer;
}

button {
    border-radius: 999px;
    border: none;
    background: #0369a1;
    color: #e5f3ff;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
}

.button {
    display: inline-block;
    text-decoration: none;
    border-radius: 999px;
    border: none;
    background: #0369a1;
    color: #e5f3ff;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
}

.button.small {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.button.danger {
    background: #dc2626;
    color: #ffffff;
}

.button.secondary {
    background: #6b7280;
    color: #ffffff;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

th,
td {
    padding: 0.5rem 0.75rem;
    font-size: 0.86rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

th {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
}

.num {
    text-align: right;
    white-space: nowrap;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.actions a,
.actions .link {
    border: none;
    background: none;
    padding: 0;
    color: #0369a1;
    text-decoration: none;
    font-size: 0.8rem;
}

.actions .danger {
    color: #b91c1c;
}

.progress-bar {
    width: 100px;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-label {
    font-size: 0.7rem;
    color: #4b5563;
}

.empty {
    text-align: center;
    color: #9ca3af;
    padding: 1.5rem 0.75rem;
}

tbody tr:nth-child(odd) {
    background-color: #f9f9fb;
}

tbody tr:hover {
    background-color: #eef2ff;
}

.truncate {
    display: inline-block;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 1rem;
}

/* Indicators page layout - single column full width inside container */
.indicators-page {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hero-header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.hero-header p {
    margin: 0.35rem 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

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

.card {
    background: #ffffff;
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.card-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0f172a;
}

.card-total {
    border-left: 4px solid #0ea5e9;
}

.card-budget {
    border-left: 4px solid #22c55e;
}

.card-used {
    border-left: 4px solid #f97316;
}

.card-progress {
    border-left: 4px solid #a855f7;
}

.status-summary {
    background: #ffffff;
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.status-summary h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.status-row {
    transition: background-color 0.15s ease;
}

.status-row:hover {
    background-color: #f3f4f6;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pill.status-planned {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-pill.status-in-progress {
    background: #ecfeff;
    color: #0369a1;
}

.status-pill.status-completed {
    background: #ecfdf3;
    color: #166534;
}

.status-pill.status-on-hold {
    background: #fffbeb;
    color: #b45309;
}

.status-pill.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.status-pill.status-unknown {
    background: #e5e7eb;
    color: #374151;
}

.form-card {
    margin-top: 1.5rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.form-card h1 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.form-actions .primary {
    background: #0369a1;
    color: #e5f3ff;
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    border: none;
}

.form-actions .secondary {
    text-decoration: none;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    color: #374151;
    background: #ffffff;
}

.flash-container {
    margin-bottom: 1rem;
}

.flash {
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.86rem;
    margin-bottom: 0.5rem;
}

.flash.success {
    background: #ecfdf3;
    color: #166534;
}

.flash.error {
    background: #fef2f2;
    color: #b91c1c;
}

.flash.info {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Compact Table Styles */
.table-section {
    margin-top: 2rem;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.table-header {
    margin-bottom: 1rem;
}

.table-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    color: #0f172a;
}

.table-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #6b7280;
}

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

.compact-table {
    width: 100%;
    min-width: 800px;
}

.compact-table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
    padding: 0.75rem 0.5rem;
}

.compact-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
}

/* Sortable column headers */
.compact-table th.sortable {
    white-space: nowrap;
}

.compact-table .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
    padding: 0.1rem 0;
}

.compact-table .sort-link:hover {
    color: #0369a1;
    text-decoration: underline;
}

.compact-table .sort-arrow {
    font-size: 0.7em;
    opacity: 0.8;
}

.activity-row {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.activity-row:hover {
    background-color: #eef2ff !important;
    transform: translateX(2px);
}

.activity-row:focus {
    outline: 2px solid #0369a1;
    outline-offset: -2px;
}

.truncate-text {
    display: inline-block;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-container .progress-bar {
    width: 80px;
    margin-bottom: 0;
}

.progress-container .progress-label {
    font-size: 0.8rem;
    min-width: 35px;
}

.budget-used {
    font-weight: 600;
    color: #f97316;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6b7280;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.pagination-prev,
.pagination-next,
.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.pagination-prev:hover,
.pagination-next:hover,
.pagination-page:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.pagination-page.current {
    background: #0369a1;
    color: #fff;
    border-color: #0369a1;
    pointer-events: none;
}

.pagination-prev.disabled,
.pagination-next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 0 0.25rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.icon-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    align-items: center;
}

.icon-button {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    padding: 0;
    transition: all 0.2s ease;
}

.icon-button svg {
    width: 14px;
    height: 14px;
}

.icon-button-view {
    background: #0369a1;
    color: #ffffff;
}

.icon-button-view:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.icon-button-edit:hover {
    background: #e5e7eb;
}

.icon-button-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.icon-button-delete:hover {
    background: #fecaca;
}

.btn-view-details,
.btn-edit,
.btn-delete {
    padding: 0.35rem 0.75rem;
    border-radius: 0.4rem;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-view-details {
    background: #0369a1;
    color: #ffffff;
    font-weight: 500;
}

.btn-view-details:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.btn-edit {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-edit:hover {
    background: #e5e7eb;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #ffffff;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #0f172a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0369a1;
    color: #ffffff;
    font-weight: 500;
}

.btn-primary:hover {
    background: #0284c7;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Detail Grid Styles */
.detail-grid {
    display: grid;
    gap: 1.5rem;
}

.detail-section {
    background: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.detail-section.full-width {
    grid-column: 1 / -1;
}

.detail-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: #0369a1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #0369a1;
    padding-bottom: 0.5rem;
}

.detail-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: start;
}

.detail-item.full-width {
    grid-template-columns: 1fr;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item label {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}

.detail-item span {
    color: #1f2933;
    word-break: break-word;
}

.detail-text {
    color: #1f2933;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-content {
    background: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    color: #1f2933;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 80px;
}

.budget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.budget-item {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.budget-item label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.budget-item .num {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    display: block;
}

.budget-item.budget-total {
    border-color: #22c55e;
    background: #ecfdf3;
}

.budget-item.budget-total .num {
    color: #166534;
}

.budget-item.budget-used {
    border-color: #f97316;
    background: #fff7ed;
}

.budget-item.budget-used .num {
    color: #b45309;
}

.budget-item.budget-remaining {
    border-color: #0ea5e9;
    background: #eff6ff;
}

.budget-item.budget-remaining .num {
    color: #0369a1;
}

/* Responsive Design for Small Screens */
@media (max-width: 768px) {
    /* Top bar - stack navigation */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
    }

    .top-bar .brand {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .top-bar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .top-bar nav a {
        margin-left: 0;
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .top-bar .user-label {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        font-size: 0.75rem;
    }

    /* Container padding */
    .container {
        padding: 0 0.75rem;
        margin: 1rem auto 2rem;
    }

    /* Dashboard layout */
    .dashboard {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
        margin-top: 1rem;
    }

    /* Cards - stack vertically */
    .cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .card {
        padding: 0.75rem;
    }

    .card-value {
        font-size: 1.1rem;
    }

    /* Hero header */
    .hero-header h1 {
        font-size: 1.1rem;
    }

    .hero-header p {
        font-size: 0.85rem;
    }

    /* Filters form - stack fields */
    .filters form {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .filters form button,
    .filters form .download-btn {
        width: 100%;
        text-align: center;
        padding: 0.6rem 1rem;
    }

    .field-group {
        min-width: 100%;
        width: 100%;
    }

    /* Multi-select adjustments */
    .multiselect-dropdown {
        max-height: 250px;
    }

    /* Table section */
    .table-section {
        padding: 1rem;
        margin-top: 1rem;
    }

    .table-header h2 {
        font-size: 1rem;
    }

    .table-hint {
        font-size: 0.8rem;
    }

    .table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .compact-table {
        min-width: 700px;
        font-size: 0.85rem;
    }

    .compact-table th,
    .compact-table td {
        padding: 0.5rem 0.35rem;
        font-size: 0.8rem;
    }

    /* Actions column - stack buttons */
    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .btn-view-details,
    .btn-edit,
    .btn-delete {
        width: 100%;
        text-align: center;
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Truncate text - shorter on mobile */
    .truncate-text {
        max-width: 150px;
    }

/* Indicators page - wider table */
.indicators-section .compact-table {
    min-width: 1200px;
}

@media (max-width: 1024px) {
    .indicators-section .compact-table {
        min-width: 900px;
    }
}

/* Narrow numeric columns for indicators baseline/targets */
.indicators-section .compact-table th.col-small,
.indicators-section .compact-table td.col-small {
    width: 80px;
    max-width: 80px;
    text-align: right;
}

/* In indicators table, allow full text display with wrapping */
.indicators-section .compact-table td {
    white-space: normal;
    word-wrap: break-word;
    max-width: none;
}

.indicators-section .compact-table td:not(.col-small):not(.actions):not(.col-tiny):not(.col-status):not(.col-actions) {
    min-width: 200px;
}

/* Progress table - extra compact columns */
.indicators-section .compact-table th.col-tiny,
.indicators-section .compact-table td.col-tiny {
    width: 60px;
    min-width: 60px;
    text-align: center;
    padding: 0.5rem 0.4rem;
    font-size: 0.75rem;
}


.indicators-section .compact-table th.col-status,
.indicators-section .compact-table td.col-status {
    width: 50px;
    min-width: 50px;
    text-align: center;
    padding: 0.5rem 0.4rem;
}

.indicators-section .compact-table th.col-actions,
.indicators-section .compact-table td.col-actions {
    width: 70px;
    min-width: 70px;
    padding: 0.5rem 0.4rem;
    text-align: center;
}

/* Progress table - use fixed layout for consistent column sizing */
.indicators-section .compact-table {
    width: 100%;
    table-layout: fixed;
    min-width: 1400px;
}

/* Ensure indicator column in progress table matches indicators page */
.indicators-section .compact-table td:first-child {
    min-width: 200px;
    white-space: normal;
    word-wrap: break-word;
}

/* Smaller progress bars in progress table */
.indicators-section .compact-table .progress-bar {
    height: 8px;
    min-height: 8px;
}

.indicators-section .compact-table .progress {
    height: 8px;
}

    /* Progress container */
    .progress-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .progress-container .progress-bar {
        width: 100%;
    }

    /* Modal - full screen on mobile */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 1rem 1rem 0 0;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    /* Detail grid - stack on mobile */
    .detail-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .detail-item label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    .budget-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Form card */
    .form-card {
        padding: 1rem;
        margin-top: 1rem;
    }

    .form-card h1 {
        font-size: 1.1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

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

    .form-actions .primary,
    .form-actions .secondary {
        width: 100%;
        text-align: center;
    }

    /* Status summary table */
    .status-summary {
        padding: 0.75rem;
    }

    .status-summary h2 {
        font-size: 0.95rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }

    /* Flash messages */
    .flash {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .top-bar {
        padding: 0.5rem 0.75rem;
    }

    .top-bar .brand {
        font-size: 0.85rem;
    }

    .top-bar nav a {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .hero-header h1 {
        font-size: 1rem;
    }

    .card-value {
        font-size: 1rem;
    }

    .card-label {
        font-size: 0.75rem;
    }

    .compact-table {
        min-width: 600px;
        font-size: 0.75rem;
    }

    .compact-table th,
    .compact-table td {
        padding: 0.4rem 0.25rem;
        font-size: 0.75rem;
    }

    .truncate-text {
        max-width: 100px;
    }

    .modal-header h2 {
        font-size: 1rem;
    }

    .detail-section {
        padding: 0.75rem;
    }

    .detail-section h3 {
        font-size: 0.9rem;
    }
}

/* Landscape orientation on small screens */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 98vh;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
    }
}

/* Status badges for challenges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-completed {
    background: #d1fae5;
    color: #065f46;
}

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

/* ---- Reports ---- */
.reports-page .reports-header { margin-bottom: 1rem; }
.reports-page .reports-hint { color: #6b7280; font-size: 0.9rem; margin-top: 0.25rem; }
.reports-filters .reports-filter-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.reports-filters .filter-actions { display: flex; gap: 0.5rem; align-items: flex-end; }
.reports-table .activity-name { display: block; font-weight: normal; color: #6b7280; font-size: 0.85rem; margin-top: 0.15rem; }
.reports-page .reports-back { margin-top: 1.5rem; }
.report-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.report-view-page .report-view-header { margin-bottom: 1.5rem; }
.report-view-title { font-size: 1.1rem; color: #475569; margin: 0.5rem 0; }
.report-meta { color: #9ca3af; font-size: 0.85rem; margin: 0.25rem 0; }
.report-view-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.report-view-content.report-document {
    background: #fff;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    line-height: 1.6;
}
.report-document h1, .report-document h2, .report-document h3 { margin-top: 1.25rem; margin-bottom: 0.5rem; }
.report-document ul, .report-document ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.report-document p { margin: 0.5rem 0; }
.report-document a { color: #0369a1; text-decoration: underline; }


