.tempo-dashboard,
.tempo-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: #13201e;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.tempo-page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding: 1.15rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background:
        radial-gradient(circle at 86% 12%, rgba(245, 178, 79, 0.22), transparent 28%),
        linear-gradient(135deg, #f7fbfa 0%, #eef7f4 52%, #fffaf0 100%);
    box-shadow: 0 12px 28px rgba(19, 32, 30, 0.08);
}

.tempo-page-hero h1,
.tempo-page-hero p,
.tempo-section-heading h2 {
    margin: 0;
}

.tempo-page-hero h1 {
    max-width: 760px;
    font-size: 2rem;
    line-height: 1.12;
    color: #13201e;
}

.tempo-page-hero p {
    max-width: 740px;
    margin-top: 0.45rem;
    color: #536662;
}

.tempo-eyebrow,
.tempo-section-heading span,
.tempo-task-card__header span,
.tempo-insight-list span,
.tempo-capacity-card span,
.tempo-project-stack > span,
.tempo-stats__pulse span {
    color: #0b766c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tempo-hero-actions,
.tempo-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.tempo-button,
.tempo-icon-button {
    border: 1px solid #123f3a;
    border-radius: 8px;
    color: #fff;
    background: #123f3a;
    font-weight: 800;
    min-height: 2.35rem;
}

.tempo-button {
    padding: 0.5rem 0.9rem;
}

.tempo-button--secondary,
.tempo-icon-button {
    color: #123f3a;
    background: #fff;
}

.tempo-icon-button {
    display: grid;
    place-items: center;
    width: 2.35rem;
    padding: 0;
    font-size: 1.35rem;
}

.tempo-dashboard__metrics,
.tempo-stats__metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.tempo-metric {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    padding: 0.95rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(19, 32, 30, 0.05);
}

.tempo-metric span,
.tempo-metric small {
    color: #60716d;
}

.tempo-metric span {
    font-size: 0.78rem;
    font-weight: 800;
}

.tempo-metric strong {
    color: #13201e;
    font-size: 1.55rem;
    line-height: 1.05;
}

.tempo-metric--primary {
    border-color: #a7d8d1;
    background: linear-gradient(135deg, #ecfaf7, #fff);
}

.tempo-metric--danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff1f2, #fff);
}

.tempo-dashboard__workspace {
    display: grid;
    grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.6fr) minmax(230px, 0.7fr);
    gap: 0.85rem;
    align-items: start;
    min-width: 0;
}

.tempo-day-rail,
.tempo-day-board,
.tempo-insight-panel,
.tempo-stats-filters,
.tempo-analytics-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(19, 32, 30, 0.06);
}

.tempo-section-heading {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.tempo-section-heading h2 {
    font-size: 1.1rem;
    line-height: 1.2;
}

.tempo-section-heading--inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.tempo-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.65rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.tempo-day-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.tempo-day-button {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.2rem 0.5rem;
    min-height: 3.4rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background: #f8fbfa;
    color: #13201e;
    text-align: left;
}

.tempo-day-button span,
.tempo-day-button small {
    color: #60716d;
    font-size: 0.75rem;
}

.tempo-day-button strong {
    justify-self: end;
    grid-row: span 2;
    font-size: 1.25rem;
}

.tempo-day-button--today {
    border-color: #a7d8d1;
    background: #ecfaf7;
}

.tempo-day-button--selected {
    border-color: #123f3a;
    background: #123f3a;
    color: #fff;
}

.tempo-day-button--selected span,
.tempo-day-button--selected small {
    color: #dbeee9;
}

.tempo-day-button--scheduled:not(.tempo-day-button--selected) {
    box-shadow: inset 3px 0 0 #f5b24f;
}

.tempo-week-sparkline {
    display: flex;
    align-items: end;
    gap: 0.32rem;
    height: 72px;
    margin-top: 1rem;
    padding: 0.6rem;
    border-radius: 8px;
    background: #f6f8f7;
}

.tempo-week-sparkline span {
    flex: 1;
    min-height: 6px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(180deg, #0b766c, #8fd8cd);
}

.tempo-empty-state {
    display: grid;
    place-items: center;
    gap: 0.25rem;
    min-height: 220px;
    padding: 1.5rem;
    border: 1px dashed #c8d4d1;
    border-radius: 8px;
    background: #f8fbfa;
    color: #60716d;
    text-align: center;
}

.tempo-empty-state strong {
    color: #13201e;
}

.tempo-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.tempo-task-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.9rem;
    border: 1px solid #d7e0dd;
    border-left: 4px solid #0b766c;
    border-radius: 8px;
    background: #fff;
}

.tempo-task-card--priority {
    border-left-color: #f5b24f;
}

.tempo-task-card--complete {
    border-left-color: #22a36b;
    background: #fbfefd;
}

.tempo-task-card__time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 72px;
    border-radius: 8px;
    color: #0b766c;
    background: #ecfaf7;
    font-weight: 800;
}

.tempo-task-card__time small {
    color: #536662;
}

.tempo-task-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.tempo-task-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.tempo-task-card__header h3 {
    margin: 0.1rem 0 0;
    font-size: 1rem;
    line-height: 1.2;
}

.tempo-task-card p,
.tempo-task-note {
    margin: 0;
    color: #536662;
}

.tempo-task-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tempo-task-card__meta span,
.tempo-priority,
.tempo-health-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid #d7e0dd;
    border-radius: 999px;
    background: #f6f8f7;
    color: #536662;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.tempo-priority {
    color: #0b766c;
    background: #ecfaf7;
    border-color: #a7d8d1;
}

.tempo-priority--low {
    color: #52615e;
    background: #f6f8f7;
}

.tempo-priority--high {
    color: #8a6100;
    background: #fff7df;
    border-color: #f5d48f;
}

.tempo-priority--critical {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}

.tempo-task-note {
    padding: 0.65rem;
    border-left: 3px solid #0b766c;
    border-radius: 6px;
    background: #f8fbfa;
    white-space: pre-wrap;
}

.tempo-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.45rem;
    border-top: 1px solid #e5ecea;
}

.tempo-checklist__header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: #536662;
    font-size: 0.8rem;
    font-weight: 800;
}

.tempo-checklist small {
    color: #7a8b87;
}

.tempo-checklist__item {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
    color: #13201e;
}

.tempo-checklist__item span {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0.2rem;
    border: 2px solid #9aacaa;
    border-radius: 50%;
    background: #fff;
}

.tempo-checklist__item p {
    color: #13201e;
}

.tempo-checklist__item--complete {
    color: #60716d;
}

.tempo-checklist__item--complete span {
    border-color: #0b766c;
    background: #0b766c;
    box-shadow: inset 0 0 0 3px #fff;
}

.tempo-checklist__item--complete p {
    color: #60716d;
    text-decoration: line-through;
}

.tempo-insight-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tempo-insight-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tempo-insight-list > div,
.tempo-capacity-card,
.tempo-project-stack {
    padding: 0.75rem;
    border: 1px solid #e0e8e5;
    border-radius: 8px;
    background: #f8fbfa;
}

.tempo-insight-list > div,
.tempo-capacity-card > div:first-child,
.tempo-project-stack__row,
.tempo-stats__pulse > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.tempo-insight-list strong,
.tempo-capacity-card strong,
.tempo-project-stack__row strong,
.tempo-stats__pulse strong {
    color: #13201e;
    text-align: right;
}

.tempo-progress-track {
    height: 0.62rem;
    margin-top: 0.65rem;
    border-radius: 999px;
    background: #dfe8e5;
    overflow: hidden;
}

.tempo-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0b766c;
}

.tempo-progress-track__fill--healthy {
    background: #0b766c !important;
}

.tempo-progress-track__fill--warning {
    background: #f5b24f !important;
}

.tempo-progress-track__fill--critical {
    background: #dc2626 !important;
}

.tempo-project-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tempo-project-stack__row span {
    color: #536662;
    white-space: nowrap;
}

.tempo-stats-filters {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.tempo-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) minmax(190px, 0.8fr);
    gap: 0.75rem;
}

.tempo-filter-grid label,
.tempo-import-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.tempo-filter-grid label > span,
.tempo-import-control > span {
    color: #33403d;
    font-size: 0.8rem;
    font-weight: 800;
}

.tempo-filter-toggles {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.tempo-filter-toggles .form-check {
    flex-direction: row;
    align-items: center;
}

.tempo-stats__charts,
.tempo-stats__portfolio {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.tempo-analytics-panel--wide {
    grid-row: span 2;
}

.tempo-analytics-panel .statistics-chart-surface {
    min-height: 260px;
    margin-top: 0.9rem;
}

.tempo-project-analytics {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.tempo-project-analytics__row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 1fr) minmax(120px, auto);
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid #e0e8e5;
    border-radius: 8px;
    background: #f8fbfa;
}

.tempo-project-analytics__row--risk {
    border-color: #fecaca;
    background: #fff1f2;
}

.tempo-project-analytics__row > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tempo-project-analytics__row span,
.tempo-detail-table td span {
    color: #60716d;
    font-size: 0.78rem;
}

.tempo-stats__pulse {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.tempo-stats__pulse > div:not(.tempo-section-heading) {
    padding: 0.7rem 0;
    border-bottom: 1px solid #e0e8e5;
}

.tempo-stats__pulse > div:last-child {
    border-bottom: 0;
}

.tempo-table-shell {
    max-height: 520px;
    margin-top: 0.85rem;
    overflow: auto;
}

.tempo-detail-table {
    min-width: 820px;
}

.tempo-detail-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f8f7;
    color: #33403d;
    white-space: nowrap;
}

.tempo-detail-table td {
    vertical-align: middle;
}

.tempo-detail-table td strong {
    display: block;
    color: #13201e;
}

.tempo-health-badge {
    color: #047857;
    background: #d1fae5;
    border-color: #a7f3d0;
}

.tempo-health-badge--warning {
    color: #8a6100;
    background: #fff7df;
    border-color: #f5d48f;
}

.tempo-health-badge--danger {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}

.tempo-health-badge--muted {
    color: #52615e;
    background: #eef2f1;
    border-color: #d7e0dd;
}

.admin-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: #13201e;
    min-width: 0;
}

.admin-alert,
.admin-conflict-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid #d7e0dd;
    background: #fff;
}

.admin-alert {
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.admin-alert--success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.admin-alert--danger,
.admin-conflict-banner {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.admin-conflict-banner {
    margin-bottom: 1rem;
}

.admin-conflict-banner > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-page__grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(260px, 0.75fr) minmax(300px, 0.9fr);
    gap: 0.85rem;
    align-items: start;
    min-width: 0;
}

.admin-panel {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(19, 32, 30, 0.06);
}

.admin-panel--connection .xero-connection-card {
    margin-top: 0.9rem;
    padding: 0.85rem;
    border: 1px solid #e0e8e5;
    border-radius: 8px;
    background: #f8fbfa;
}

.admin-panel--connection h3,
.admin-panel--connection h4,
.admin-panel--connection p {
    margin-top: 0;
}

.admin-field,
.admin-readonly-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.9rem;
    min-width: 0;
}

.admin-field span,
.admin-readonly-field span,
.admin-sync-note span,
.admin-project-card span,
.admin-project-card__meta span {
    color: #60716d;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-readonly-field {
    padding: 0.75rem;
    border: 1px solid #e0e8e5;
    border-radius: 8px;
    background: #f8fbfa;
}

.admin-readonly-field strong {
    overflow-wrap: anywhere;
}

.admin-sync-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-top: 0.9rem;
}

.admin-sync-form .tempo-button {
    grid-column: 1 / -1;
}

.admin-sync-note {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f8fbfa;
}

.admin-projects-panel {
    overflow: hidden;
}

.admin-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.admin-project-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid #d7e0dd;
    border-left: 4px solid #0b766c;
    border-radius: 8px;
    background: #fff;
}

.admin-project-card h3 {
    margin: 0.15rem 0 0;
    color: #13201e;
    font-size: 1rem;
    line-height: 1.25;
}

.admin-project-card > small {
    color: #7a8b87;
    overflow-wrap: anywhere;
}

.admin-project-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.admin-project-card__meta > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.55rem;
    border-radius: 8px;
    background: #f8fbfa;
}

.admin-project-card__meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-conflict-modal .modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.admin-conflict-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.admin-conflict-card {
    padding: 1rem;
    border: 1px solid #d7e0dd;
    border-radius: 8px;
    background: #fff;
}

.admin-conflict-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.admin-conflict-card__header > div:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-conflict-card__header span {
    color: #60716d;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.admin-conflict-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.admin-conflict-diff {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e8e5;
    border-radius: 8px;
    overflow: hidden;
}

.admin-conflict-diff__heading,
.admin-conflict-diff__row {
    display: grid;
    grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.admin-conflict-diff__heading {
    background: #f6f8f7;
    color: #60716d;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-conflict-diff__row + .admin-conflict-diff__row {
    border-top: 1px solid #e0e8e5;
}

.admin-conflict-diff__row span {
    overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
    .tempo-dashboard__workspace,
    .tempo-stats__portfolio,
    .admin-page__grid {
        grid-template-columns: 1fr;
    }

    .tempo-day-list {
        grid-template-columns: repeat(7, minmax(90px, 1fr));
        overflow-x: auto;
    }
}

@media (max-width: 980px) {
    .tempo-dashboard__metrics,
    .tempo-stats__metrics,
    .tempo-stats__charts,
    .admin-page__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tempo-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tempo-analytics-panel--wide {
        grid-row: auto;
    }
}

@media (max-width: 640px) {
    .tempo-page-hero,
    .tempo-section-heading--inline,
    .tempo-hero-actions,
    .tempo-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tempo-page-hero h1 {
        font-size: 1.45rem;
    }

    .tempo-dashboard__metrics,
    .tempo-stats__metrics,
    .tempo-stats__charts,
    .tempo-filter-grid,
    .tempo-project-analytics__row,
    .admin-page__metrics,
    .admin-sync-form,
    .admin-project-card__meta,
    .admin-conflict-diff__heading,
    .admin-conflict-diff__row {
        grid-template-columns: 1fr;
    }

    .admin-alert,
    .admin-conflict-banner,
    .admin-conflict-card__header,
    .admin-sync-note {
        align-items: stretch;
        flex-direction: column;
    }

    .tempo-day-list {
        grid-template-columns: 1fr;
    }

    .tempo-task-card {
        grid-template-columns: 1fr;
    }

    .tempo-task-card__time {
        align-items: flex-start;
        min-height: auto;
        padding: 0.65rem;
    }

    .tempo-task-card__header {
        flex-direction: column;
    }
}
