:root {
    --color-bg-page: #f3f6fa;
    --color-bg-surface: #fff;
    --color-bg-subtle: #f8fafc;
    --color-bg-muted: #edf2f7;
    --color-bg-hover: #f6f9fc;
    --color-border: #cbd6e2;
    --color-border-light: #e4ebf2;
    --color-text: #172033;
    --color-text-muted: #66758a;
    --color-text-heading: #243044;
    --color-primary: #2563eb;
    --color-primary-hover: #1e4fd0;
    --color-primary-light: #eaf2ff;
    --color-primary-soft: #f2f7ff;
    --color-danger: #d92d20;
    --color-danger-hover: #b42318;
    --color-danger-light: #fff4f2;
    --color-success: #168a4a;
    --color-success-light: #effaf3;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-bg-page) 240px);
}

a {
    color: var(--color-primary);
}

a:hover {
    text-decoration: none;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-nav a {
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text-heading);
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-nav a:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.app-nav a.brand {
    color: var(--color-primary);
    padding-left: 0;
    background: transparent;
}

.app-nav a.brand:hover {
    background: transparent;
    color: var(--color-primary);
}

.app-nav a.brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.75rem;
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.card.card-full {
    max-width: none;
}

.card-narrow {
    max-width: 480px;
    margin: 0 auto;
}

.card-wide {
    max-width: 640px;
}

h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--color-text-heading);
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-heading);
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
    width: 100%;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--color-bg-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
.textarea:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    width: 100%;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-sm {
    width: auto;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
}

.btn-outline {
    background: var(--color-bg-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-hover);
}

.btn-outline-danger {
    background: var(--color-bg-surface);
    color: var(--color-danger);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-outline-danger:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger-hover);
}

.btn-sm.btn-outline,
.btn-sm.btn-outline-danger {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.actions-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.inline-form {
    display: inline;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
}

.form-check input {
    width: auto;
    accent-color: var(--color-primary);
}

.field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.toolbar {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.empty-state {
    color: var(--color-text-muted);
    padding: 1.25rem;
    background: var(--color-bg-subtle);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--color-border-light);
    text-align: left;
}

.data-table thead th {
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-bg-muted) 100%);
    border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:hover {
    background: var(--color-bg-hover);
}

.data-table th {
    font-weight: 600;
    color: var(--color-text-heading);
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table th.num,
.data-table td.num {
    text-align: right;
}

.data-table .actions {
    white-space: nowrap;
    text-align: right;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.header-bar h1 {
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.textarea {
    width: 100%;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 5rem;
    color: var(--color-text);
    background: var(--color-bg-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-link-danger {
    color: var(--color-danger);
}

.timer-start-row-tasks {
    grid-template-columns: 1fr 1fr 2fr auto;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--color-danger-light);
    color: var(--color-danger-hover);
    border: 1px solid #ffd0ca;
}

.alert-success {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid #bfe8cc;
}

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .timer-start-row-tasks {
        grid-template-columns: 1fr 1fr;
    }
}

.user-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.placeholder {
    padding: 1rem;
    background: var(--color-bg-subtle);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
}

.timer-running {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: var(--color-primary-soft);
    border: 1px solid #c7dcff;
    border-radius: var(--radius-md);
}

.timer-running-info {
    flex: 1;
    min-width: 200px;
}

.timer-desc {
    color: var(--color-text-muted);
}

.timer-elapsed {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 100px;
}

.btn-danger {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
}

.timer-start-form {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.timer-start-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 768px) {
    .timer-start-row {
        grid-template-columns: 1fr;
    }
}

.timer-start-btn .btn {
    width: auto;
}

.period-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.view-toggle a {
    margin-right: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--color-text-heading);
}

.view-toggle a.active {
    background: var(--color-primary);
    color: #fff;
}

.period-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.period-label {
    font-weight: 600;
    color: var(--color-text-heading);
}

.period-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}

.entry-group {
    margin-bottom: 2rem;
}

.entry-group-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.entry-group-total {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.row-running {
    background: var(--color-primary-soft);
}

input[type="datetime-local"] {
    width: 100%;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--color-bg-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* --- Tracker (Clockify-style time page) --- */

.tracker-page {
    padding: 1.25rem 1.5rem;
}

.tracker-recorder {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.25rem;
}

.tracker-recorder-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    min-height: 60px;
}

.tracker-recorder-empty {
    justify-content: space-between;
}

.tracker-empty-msg {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.tracker-recorder-input {
    flex: 1 1 200px;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 0.5rem 0.25rem;
    outline: none;
    color: var(--color-text);
}

.tracker-recorder-input:focus {
    outline: none;
    box-shadow: none;
}

.tracker-recorder-input:disabled {
    color: var(--color-text-heading);
    cursor: default;
}

.tracker-recorder-pickers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tracker-recorder-pickers-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.tracker-select {
    width: auto;
    min-width: 120px;
    max-width: 180px;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    background: var(--color-bg-surface);
}

.tracker-recorder-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.tracker-elapsed {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: center;
    color: var(--color-text);
}

.tracker-billable {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.35rem;
    border-radius: var(--radius-sm);
    user-select: none;
}

.tracker-billable.billable-on {
    color: var(--color-success);
    background: var(--color-success-light);
}

.tracker-billable.billable-off {
    color: #9aa8ba;
}

.tracker-manual-link {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.tracker-manual-link:hover {
    color: var(--color-primary);
}

.tracker-entries-list {
    margin-top: 0;
}

.tracker-week-section {
    margin-bottom: 1.5rem;
}

.tracker-week-section:last-child {
    margin-bottom: 0;
}

.tracker-week-amount {
    padding: 0.5rem 1rem 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.tracker-scroll-sentinel {
    height: 1px;
    width: 100%;
}

.tracker-scroll-loading,
.tracker-scroll-end {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.tracker-admin-amount {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.tracker-week-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.tracker-total-block {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.tracker-total-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.tracker-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tracker-day-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tracker-day-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-bg-muted) 100%);
}

.tracker-day-label {
    font-size: 1rem;
    font-weight: 600;
}

.tracker-day-header .tracker-total-value {
    font-size: 1.25rem;
}

.tracker-entry {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.tracker-entry:last-child {
    border-bottom: none;
}

.tracker-entry:hover {
    box-shadow: inset 0 0 0 1px var(--color-border-light);
    background: var(--color-bg-hover);
}

.tracker-entry-running {
    background: var(--color-primary-soft);
}

.tracker-entry-desc-col {
    flex: 1 1 180px;
    min-width: 0;
}

.tracker-entry-description {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.42rem 0.55rem;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tracker-entry-description:hover {
    border-color: var(--color-border-light);
    background: var(--color-bg-surface);
}

.tracker-entry-description:focus {
    border-color: var(--color-primary);
    background: var(--color-bg-surface);
    outline: none;
    box-shadow: var(--focus-ring);
}

.tracker-entry-description.tracker-save-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.tracker-entry-project-col {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 420px;
}

.tracker-project {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-size: 0.9rem;
}

.tracker-project-readonly {
    color: var(--color-text-heading);
}

.tracker-color-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.tracker-project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-heading);
    font-weight: 500;
}

.tracker-project-divider {
    flex-shrink: 0;
    width: 1px;
    height: 14px;
    background: var(--color-border);
    margin: 0 0.25rem;
}

.tracker-client-name {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracker-entry-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.tracker-time-block {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-heading);
}

.tracker-time-sep {
    color: var(--color-border);
}

.tracker-running-label {
    font-style: normal;
    color: var(--color-primary);
    font-size: 0.8rem;
}

.tracker-duration {
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 72px;
    text-align: center;
    color: var(--color-text);
}

.tracker-btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--color-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tracker-btn-play:hover {
    background: var(--color-primary-light);
    border-color: #c7dcff;
}

.tracker-entry-amount {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.tracker-day-amount {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
}

@media (max-width: 768px) {
    .tracker-recorder-form {
        flex-direction: column;
        align-items: stretch;
    }

    .tracker-recorder-actions {
        margin-left: 0;
        justify-content: flex-end;
        width: 100%;
    }

    .tracker-recorder-pickers {
        width: 100%;
    }

    .tracker-select {
        flex: 1;
        max-width: none;
    }

    .tracker-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .tracker-entry-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .tracker-entry-project-col {
        max-width: none;
    }
}

/* --- Project view (tabs, status, payments) --- */

.project-view {
    padding: 1.25rem 1.5rem;
}

.project-view.card {
    padding: 0;
    overflow: hidden;
}

.project-breadcrumb {
    padding: 1rem 1.5rem 0;
    font-size: 0.9rem;
}

.project-breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.project-breadcrumb a:hover {
    text-decoration: underline;
}

.project-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.5rem 1.15rem;
    border-bottom: 1px solid var(--color-border-light);
}

.project-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text-heading);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.project-client {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.project-tabs {
    display: flex;
    gap: 0;
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-bg-muted) 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1rem;
}

.project-tab {
    display: inline-block;
    padding: 0.85rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.project-tab:hover {
    color: var(--color-text-heading);
    background: rgba(255, 255, 255, 0.5);
}

.project-tab.active {
    color: var(--color-text-heading);
    background: var(--color-bg-surface);
    border-bottom-color: var(--color-primary);
    box-shadow: 0 -1px 0 var(--color-bg-surface) inset;
}

.project-tab-panel {
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--color-bg-surface);
}

.project-section-title {
    margin: 1.5rem 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.status-summary {
    margin-bottom: 0.5rem;
}

.status-summary-block {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem 1.5rem;
    padding: 1.25rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.status-stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.status-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-heading);
    font-variant-numeric: tabular-nums;
}

.status-stat-highlight .status-stat-value {
    color: var(--color-primary);
}

.payment-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.payment-summary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
}

.payment-summary-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-heading);
    font-variant-numeric: tabular-nums;
}

.payment-form {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.payment-form-row {
    display: grid;
    grid-template-columns: 120px 160px 1fr auto;
    gap: 1rem;
    align-items: end;
}

.payment-form .form-group {
    margin-bottom: 0;
}

.payment-form-submit .btn {
    width: auto;
}

input[type="date"] {
    width: 100%;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--color-bg-surface);
    color: var(--color-text-heading);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 768px) {
    .payment-form-row {
        grid-template-columns: 1fr 1fr;
    }

    .payment-form-note {
        grid-column: 1 / -1;
    }

    .payment-form-submit {
        grid-column: 1 / -1;
    }

    .project-tabs {
        overflow-x: auto;
        padding: 0 0.5rem;
    }

    .project-tab {
        white-space: nowrap;
        padding: 0.65rem 1rem;
    }
}

/* --- Reports & share --- */

.report-page,
.share-page {
    padding: 1.25rem 1.5rem;
}

.share-body {
    background: linear-gradient(180deg, #f8fbff 0%, var(--color-bg-page) 240px);
}

.report-period-label {
    margin: 0;
}

.report-filters {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.report-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.report-filter-submit .btn {
    width: auto;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-summary-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.report-summary-card {
    padding: 1rem 1.15rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.report-summary-highlight {
    border-color: #c7dcff;
    background: var(--color-primary-soft);
}

.report-summary-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.report-summary-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-heading);
    font-variant-numeric: tabular-nums;
}

.report-section {
    margin-bottom: 2rem;
}

.report-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.report-chart {
    padding: 1rem 1rem 0.5rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.report-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    min-height: 180px;
    padding-bottom: 0.5rem;
}

.report-chart-bar-wrap {
    flex: 1 1 0;
    min-width: 36px;
    max-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 160px;
}

.report-chart-bar {
    width: 100%;
    max-width: 48px;
    margin-top: auto;
    background: linear-gradient(180deg, #34d399 0%, #16a34a 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.report-chart-bar-label {
    margin-top: 0.35rem;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.report-day-section {
    margin-bottom: 1.5rem;
}

.report-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.report-day-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.report-day-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.report-entry-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}

.report-truncated-note {
    margin-bottom: 1rem;
}

.share-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
}

.share-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.75rem;
    color: var(--color-text-heading);
}

.share-subtitle {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted);
}

.share-meta {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.share-panel-intro {
    margin: 0 0 1.25rem;
    color: var(--color-text-muted);
    max-width: 640px;
}

.share-url-box {
    margin-bottom: 1rem;
}

.share-url-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.share-url-input {
    flex: 1 1 280px;
    min-width: 0;
    padding: 0.62rem 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--color-bg-surface);
    color: var(--color-text);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.share-enable-form {
    margin-bottom: 0.75rem;
}

.share-enable-form .btn {
    width: auto;
}

@media (max-width: 768px) {
    .report-filters-row {
        grid-template-columns: 1fr 1fr;
    }

    .report-filter-submit {
        grid-column: 1 / -1;
    }

    .report-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
