* {
    box-sizing: border-box;
}

:root {
    color-scheme: light dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: #f4f7fb;
    color: #172033;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 32px;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-size: 40px;
    margin-bottom: 12px;
}

h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

p {
    color: #5d6b82;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    background: #2563eb;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 18px;
}

button:hover {
    background: #1d4ed8;
}

.button-link,
.secondary-link {
    border-radius: 10px;
    display: inline-block;
    font-weight: 700;
    padding: 12px 18px;
    text-decoration: none;
}

.button-link {
    background: #2563eb;
    color: #ffffff;
}

.button-link:hover {
    background: #1d4ed8;
}

.secondary-link {
    background: #e2e8f0;
    color: #1e293b;
}

.secondary-link:hover {
    background: #cbd5e1;
}

.auth-controls {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

.auth-controls span {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-layout {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 64px);
}

.login-card {
    max-width: 560px;
    width: 100%;
}

input,
select,
textarea {
    background: #ffffff;
    border: 1px solid #d6deeb;
    border-radius: 10px;
    color: #172033;
    margin-top: 8px;
    padding: 12px;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

label {
    color: #334155;
    display: block;
    font-weight: 700;
}

hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 28px 0;
}

hr.document-entry-split {
    margin: 18px 0 14px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 14px;
    text-align: left;
}

th {
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
}

.page-header {
    align-items: center;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    border-radius: 24px;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 40px;
}

.page-header p,
.page-header .eyebrow {
    color: #dbeafe;
}

.subtitle {
    font-size: 18px;
    max-width: 780px;
}

.eyebrow {
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.main-nav {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 8px;
    max-width: 100%;
}

.main-nav a {
    border-radius: 12px;
    color: #475569;
    font-weight: 700;
    padding: 12px 16px;
    text-decoration: none;
}

.brand-item {
    align-items: center;
    color: #1e293b;
    display: flex;
    font-weight: 800;
    gap: 10px;
    padding: 8px 12px;
}

.brand-logo {
    align-items: center;
    background: #dbeafe;
    border-radius: 50%;
    color: #1d4ed8;
    display: flex;
    font-size: 12px;
    height: 32px;
    justify-content: center;
    overflow: hidden;
    width: 32px;
}

.brand-logo img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.nav-toggle {
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 4px;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 46px;
}

.nav-toggle:hover {
    background: #dbeafe;
}

.nav-toggle span {
    background: #1d4ed8;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 20px;
}

.main-nav a:hover,
.main-nav a.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.card,
.stat-card,
.feature-card,
.status-column,
.project-card,
.resource-card,
.user-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.card {
    margin-bottom: 24px;
    padding: 28px;
}

.section-heading,
.button-row,
.custom-item {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-heading-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-collapsible-panel.is-collapsed {
    display: none;
}

.project-form-section-toggle {
    flex-shrink: 0;
}

.resource-form-toggle {
    flex-shrink: 0;
}

.button-row.compact {
    justify-content: flex-end;
    margin-bottom: 0;
}

.project-board-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.project-board-controls .project-search {
    flex: 1 1 220px;
    margin-bottom: 0;
}

.project-sort {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 1 280px;
    font-weight: 600;
}

.project-sort select {
    font-weight: normal;
}

.project-sort-hint {
    font-weight: normal;
    font-size: 0.85rem;
    color: var(--muted-fg, #64748b);
}

.project-search {
    margin-bottom: 20px;
}

.project-form-bottom-actions .page-action-buttons {
    justify-content: flex-start;
}

@media (min-width: 640px) {
    .project-form-bottom-actions .page-action-buttons {
        justify-content: flex-end;
    }
}

.page-action-card {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.page-action-card h2,
.page-action-card p {
    margin-bottom: 0;
}

.page-action-buttons {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.page-action-card .form-message {
    grid-column: 1 / -1;
}

.dashboard-toolbar {
    margin-bottom: 20px;
    padding: 16px 20px;
}

.dashboard-toolbar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: flex-end;
}

.dashboard-time-range {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 1 240px;
    font-weight: 600;
}

.dashboard-time-range-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-fg, #64748b);
}

.dashboard-time-range select {
    font-weight: normal;
}

.dashboard-time-range-hint {
    flex: 1 1 280px;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--muted-fg, #64748b);
}

.dashboard-time-range-hint strong {
    font-weight: 600;
    color: var(--text-color, inherit);
}

.stats-grid,
.feature-grid,
.status-board,
.resource-grid,
.project-status-board {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

#mainDashboard .stats-grid {
    gap: 10px;
    margin-bottom: 18px;
}

#mainDashboard .stats-grid .stat-card {
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.055);
    padding: 12px 14px;
}

#mainDashboard .stats-grid .stat-card span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.25;
    text-transform: uppercase;
}

#mainDashboard .stats-grid .stat-card strong {
    font-size: clamp(18px, 2.2vw, 26px);
    margin: 6px 0;
}

#mainDashboard .stats-grid .stat-card small {
    font-size: 11px;
    line-height: 1.35;
}

.dashboard-visual-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dashboard-panel {
    min-width: 0;
}

.dashboard-panel--full-width {
    grid-column: 1 / -1;
}

.dashboard-chart-placeholder {
    min-height: 180px;
}

.dashboard-pipeline-chart-root {
    min-height: 0;
}

.dashboard-pipeline-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-pipeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.dashboard-pipeline-legend-item {
    align-items: center;
    color: #475569;
    display: inline-flex;
    font-size: 12px;
    gap: 8px;
}

.dashboard-pipeline-legend-marker {
    border-radius: 3px;
    flex-shrink: 0;
    height: 10px;
    width: 10px;
}

.dashboard-pipeline-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.dashboard-panel--full-width .dashboard-chart-caption {
    font-size: 12px;
    line-height: 1.4;
    margin: -4px 0 10px;
}

.dashboard-pipeline-area-svg {
    display: block;
    height: auto;
    max-width: none;
    width: 100%;
}

.dashboard-pipeline-area-grid line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.dashboard-pipeline-area-ytick {
    fill: #94a3b8;
}

.dashboard-pipeline-area-xlabel {
    fill: #64748b;
}

.dashboard-pipeline-area-layer {
    transition: opacity 0.15s ease;
}

.dashboard-pipeline-area-layer:hover {
    opacity: 1;
}

.dashboard-chart-caption {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    margin: -4px 0 12px;
}

.dashboard-wip-empty-hint {
    max-width: 42em;
}

.dashboard-wip-empty-hint strong {
    color: #334155;
    font-weight: 700;
}

.workload-share-donut--currency .dashboard-donut-center {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 76px;
    position: relative;
    text-align: center;
    z-index: 1;
}

.workload-share-donut--currency .dashboard-donut-center strong {
    font-size: clamp(11px, 2.4vw, 14px);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.workload-share-donut--currency .dashboard-donut-center small {
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
}

.dashboard-donut-layout {
    align-items: stretch;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    justify-items: center;
}

.dashboard-donut-layout .workload-legend {
    justify-self: stretch;
    width: 100%;
}

.dashboard-donut-layout .workload-legend-item span:last-child {
    max-width: none;
}

.dashboard-value-row {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.dashboard-value-label {
    align-items: baseline;
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.dashboard-value-label strong {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-value-label span {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-value-bar {
    background: #e2e8f0;
    border-radius: 999px;
    height: 7px;
    overflow: hidden;
}

.dashboard-value-bar span {
    border-radius: inherit;
    display: block;
    height: 100%;
}

.dashboard-alert-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
}

.stat-card {
    min-width: 0;
    padding: 22px;
}

.stat-card span,
.stat-card small {
    color: #64748b;
    display: block;
}

.stat-card strong {
    display: block;
    font-size: clamp(24px, 3vw, 36px);
    margin: 10px 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.feature-card {
    display: block;
    padding: 20px;
    text-decoration: none;
}

.feature-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.status-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-column {
    background: #f8fafc;
    padding: 16px;
}

.project-status-board {
    align-items: start;
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 16px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.project-status-board .status-column {
    flex: 0 0 380px;
    scroll-snap-align: start;
}

.project-status-board.dashboard-recent-projects {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    overflow-x: visible;
    padding: 0;
    scroll-snap-type: none;
}

.project-status-board.dashboard-recent-projects .project-card {
    margin-top: 0;
}

.column-heading {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.column-heading h3 {
    margin-bottom: 0;
}

.mini-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-top: 12px;
    padding: 14px;
}

.two-column-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.secondary-button {
    background: #e2e8f0;
    color: #1e293b;
}

.secondary-button:hover {
    background: #cbd5e1;
}

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

.danger-button:hover {
    background: #fecaca;
}

.table-button {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 8px 12px;
}

.compact-table-button {
    font-size: 12px;
    padding: 6px 10px;
}

.secondary-table-button {
    background: #f1f5f9;
    color: #475569;
}

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

.table-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-table-link {
    word-break: break-word;
    font-size: 0.92em;
    font-weight: 500;
}

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

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.badge.muted {
    background: #f1f5f9;
    color: #475569;
}

.badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.badge.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.type-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 10px;
}

.type-badge {
    font-size: 11px;
}

.status-actions,
.project-list,
.checklist,
.timeline,
.user-list {
    display: grid;
    gap: 12px;
}

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

.status-actions button {
    border-radius: 999px;
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1.2;
    min-height: 0;
    padding: 6px 9px;
    width: auto;
}

.project-card,
.user-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 16px;
}

.project-status-board .project-card,
.static-card {
    align-items: flex-start;
    color: inherit;
    display: block;
    margin-top: 10px;
    min-width: 240px;
    padding: 10px 12px;
    text-decoration: none;
}

.project-status-board .project-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.project-status-board .project-card .project-avatar {
    border-radius: 12px;
    font-size: 14px;
    height: 44px;
    margin-bottom: 8px;
    width: 44px;
}

.project-status-board .project-card h4 {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 2px;
}

.project-status-board .project-card .type-badge-list {
    gap: 4px;
    margin: 4px 0 6px;
}

.project-status-board .project-card .type-badge {
    font-size: 10px;
}

.project-status-board .project-card .project-card-description {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #64748b;
    display: -webkit-box;
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 0;
    overflow: hidden;
}

.project-status-board .project-card > p:not(.project-card-description) {
    font-size: 12px;
    margin-bottom: 4px;
}

.project-status-board .project-card .card-meta {
    font-size: 12px;
    margin-top: 8px;
}

.project-status-board .project-card .project-card-unpaid {
    display: block;
    font-weight: 600;
    margin-top: 4px;
}

.project-status-board .project-card .pic-display {
    font-size: 12px;
    margin-top: 6px;
}

.project-status-board .project-card .project-card-alert {
    font-size: 11px;
    margin-top: 8px;
    padding: 4px 8px;
}

.project-card h4,
.user-row h3 {
    margin-bottom: 4px;
}

.project-card p,
.user-row p {
    margin-bottom: 0;
}

.project-status-board .project-card p {
    margin-bottom: 8px;
}

.card-meta {
    color: #64748b;
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-top: 12px;
}

.empty-state,
.form-message {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 0;
}

.form-message {
    font-weight: 700;
    min-height: 20px;
}

.error-text {
    color: #b91c1c;
}

.hidden {
    display: none !important;
}

.global-alert-widget {
    left: 16px;
    position: fixed;
    top: 16px;
    z-index: 20;
}

.alert-bell {
    align-items: center;
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    display: flex;
    gap: 8px;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.alert-bell.has-alerts {
    background: #b45309;
    border-color: #92400e;
    color: #ffffff;
}

.alert-bell strong {
    background: #ffffff;
    border-radius: 999px;
    color: #92400e;
    font-size: 12px;
    line-height: 1;
    padding: 4px 7px;
}

.alert-dot {
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25);
    display: inline-block;
    height: 10px;
    width: 10px;
}

.alert-dot.idle {
    background: #94a3b8;
    box-shadow: none;
}

.global-alert-panel {
    margin-top: 10px;
    max-width: 320px;
    width: calc(100vw - 32px);
}

.follow-up-alert-section {
    border-color: #fbbf24;
}

.follow-up-alert-list {
    display: grid;
    gap: 12px;
}

.follow-up-alert-card {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 16px;
    padding: 16px;
}

.follow-up-alert-card.compact {
    box-shadow: 0 16px 40px rgba(146, 64, 14, 0.18);
}

.follow-up-alert-card h3 {
    margin-bottom: 6px;
}

.follow-up-alert-card p {
    color: #92400e;
    margin-bottom: 8px;
}

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

.project-card-alert {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 999px;
    color: #92400e;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    margin-top: 12px;
    padding: 6px 10px;
}

.progress-update-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 18px;
}

.progress-update-panel .section-heading {
    margin-bottom: 18px;
}

.paid-terms-panel {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin: 18px 0;
    padding: 16px;
}

.compact-heading {
    margin-bottom: 12px;
}

.paid-term-list {
    display: grid;
    gap: 10px;
}

.paid-term-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(140px, 1.2fr) minmax(130px, 1fr) minmax(130px, 0.9fr) auto;
}

.paid-term-row .danger-button {
    padding: 10px 12px;
}

.progress-table-wrap {
    margin-top: 0;
}

.checklist label {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: flex;
    gap: 10px;
    padding: 14px;
}

.checklist input {
    margin: 0;
    width: auto;
}

.custom-item {
    margin-bottom: 0;
    margin-top: 18px;
}

.custom-item input {
    flex: 1;
    margin-top: 0;
}

.timeline-item {
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr;
}

.timeline-item p {
    margin-bottom: 0;
}

.follow-up-saved-rules-toolbar {
    margin-bottom: 10px;
}

.follow-up-saved-rules-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.follow-up-saved-rules-empty {
    color: #64748b;
    font-size: 13px;
}

.follow-up-saved-rule-button {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.follow-up-saved-rule-button.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgb(37 99 235 / 25%);
}

.global-alert-panel-scroll {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
}

.dot {
    background: #2563eb;
    border-radius: 50%;
    height: 12px;
    margin-top: 4px;
    width: 12px;
}

.resource-card-section {
    margin-top: 24px;
}

.resource-grid {
    align-items: stretch;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.resource-card {
    min-width: 0;
    padding: 16px;
}

.completed-project-summary {
    display: grid;
    gap: 8px;
}

.completed-project-summary p {
    font-weight: 800;
}

.completed-project-type-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.resource-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.resource-filter {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 20px;
}

.workload-dashboard {
    margin-bottom: 16px;
    padding: 18px;
}

.workload-dashboard .section-heading {
    margin-bottom: 10px;
}

.workload-list {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.workload-overview {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.workload-overview-title {
    font-size: 15px;
    margin-bottom: 0;
}

.workload-overview-caption {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    margin: -2px 0 0;
}

.workload-overview-body {
    align-items: stretch;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    justify-items: center;
}

.workload-overview-body .workload-legend {
    justify-self: stretch;
    width: 100%;
}

.workload-overview-body .workload-legend-item span:last-child {
    max-width: none;
}

.workload-share-donut {
    align-items: center;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    flex: 0 0 auto;
    height: 120px;
    justify-content: center;
    position: relative;
    width: 120px;
}

.workload-share-donut::after {
    background: #ffffff;
    border-radius: 50%;
    content: "";
    height: 72px;
    position: absolute;
    width: 72px;
}

.workload-share-donut span {
    font-size: 20px;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.workload-legend {
    display: grid;
    gap: 3px;
}

.workload-legend-item {
    align-items: center;
    column-gap: 6px;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px 6px;
    line-height: 1.2;
    min-width: 0;
}

.workload-legend-marker {
    border-radius: 50%;
    flex-shrink: 0;
    height: 7px;
    width: 7px;
}

.workload-legend-item strong {
    flex: 1 1 auto;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workload-legend-item span:last-child {
    flex: 0 1 auto;
    font-size: 11px;
    line-height: 1.2;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .workload-list {
        grid-template-columns: 1fr;
    }

    .workload-overview-body {
        gap: 14px;
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .workload-overview-body .workload-legend {
        justify-self: stretch;
        width: 100%;
    }

    .workload-legend {
        width: 100%;
    }

    .workload-legend-item {
        flex-wrap: wrap;
    }

    .workload-legend-item span:last-child {
        flex-basis: 100%;
        margin-left: 13px;
        max-width: none;
    }
}

.avatar,
.project-avatar {
    align-items: center;
    background: #dbeafe;
    border-radius: 50%;
    color: #1d4ed8;
    display: flex;
    font-weight: 800;
    height: 48px;
    justify-content: center;
    margin-bottom: 12px;
    width: 48px;
}

.avatar img,
.project-avatar img {
    border-radius: inherit;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.avatar-small {
    flex: 0 0 auto;
    font-size: 12px;
    height: 34px;
    margin-bottom: 0;
    width: 34px;
}

.avatar-tiny {
    flex: 0 0 auto;
    font-size: 11px;
    height: 26px;
    margin-bottom: 0;
    width: 26px;
}

.project-avatar {
    border-radius: 18px;
    font-size: 18px;
    height: 72px;
    width: 72px;
}

.project-avatar-large {
    height: 112px;
    margin-bottom: 16px;
    width: 112px;
}

.pic-select-row,
.pic-display {
    align-items: center;
    display: flex;
    gap: 10px;
}

.pic-select-row select {
    margin-top: 0;
}

.pic-display {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    margin-top: 12px;
}

.pic-display-compact {
    font-size: 12px;
    margin-top: 8px;
}

.assistant-field {
    display: grid;
    gap: 12px;
}

.assistant-list {
    display: grid;
    gap: 10px;
}

.assistant-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.assistant-row select {
    margin-top: 0;
}

.assistant-remove-button {
    padding: 10px 12px;
}

.assistant-display {
    display: grid;
    gap: 6px;
}

.preference-list {
    display: grid;
    gap: 10px;
}

.preference-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.preference-row input {
    margin-top: 0;
}

.preference-card .section-heading {
    align-items: flex-start;
}

@media (max-width: 1100px) {
    .stats-grid,
    .feature-grid,
    .status-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .two-column-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    body {
        padding: 16px;
    }

    h1 {
        font-size: 28px;
        line-height: 1.15;
    }

    h2 {
        font-size: 21px;
    }

    .subtitle {
        font-size: 15px;
    }

    .page-header,
    .card {
        border-radius: 18px;
        padding: 20px;
    }

    .page-header {
        align-items: flex-start;
        display: block;
    }

    .main-nav {
        align-items: center;
        flex-wrap: wrap;
        overflow-x: visible;
        padding: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-toggle {
        display: inline-flex;
        flex: 0 0 46px;
        order: 2;
    }

    .main-nav a {
        flex: 1 1 calc(50% - 8px);
        order: 4;
        padding: 10px 14px;
        text-align: center;
        white-space: nowrap;
    }

    .main-nav:not(.is-open) a,
    .main-nav:not(.is-open) .auth-controls {
        display: none;
    }

    .brand-item {
        flex: 1 1 calc(100% - 56px);
        order: 1;
    }

    .auth-controls {
        flex: 1 0 100%;
        order: 3;
    }

    .brand-item {
        justify-content: flex-start;
        min-width: 0;
    }

    .auth-controls {
        justify-content: space-between;
        margin-left: 0;
    }

    .auth-controls .secondary-button {
        flex: 0 0 auto;
        width: auto;
    }

    .section-heading,
    .button-row,
    .custom-item,
    .page-action-card,
    .page-action-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .page-action-card {
        display: flex;
    }

    .button-row.compact {
        align-items: stretch;
    }

    button,
    .button-link,
    .secondary-link {
        text-align: center;
        width: 100%;
    }

    .alert-bell {
        width: auto;
    }

    .stats-grid,
    .feature-grid,
    .status-board,
    .dashboard-donut-layout,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-donut-layout {
        justify-items: center;
    }

    .project-status-board {
        gap: 14px;
        margin-left: -4px;
        margin-right: -4px;
        padding: 4px 4px 12px;
        scroll-snap-type: x mandatory;
    }

    .project-status-board.dashboard-recent-projects {
        gap: 12px;
        grid-template-columns: 1fr;
        margin-left: 0;
        margin-right: 0;
        overflow-x: visible;
        padding: 0;
        scroll-snap-type: none;
    }

    .project-status-board .status-column {
        flex-basis: calc(100vw - 56px);
        max-width: 420px;
    }

    .status-board .status-column {
        min-width: 0;
    }

    .project-card,
    .user-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-filter {
        grid-template-columns: 1fr;
    }

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

    .assistant-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .assistant-remove-button {
        grid-column: 2;
        width: auto;
    }

    .paid-term-row {
        grid-template-columns: 1fr;
    }

    .table-wrap table {
        min-width: 520px;
    }

    .custom-item input {
        flex: none;
    }
}

@media (max-width: 420px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 24px;
    }

    .page-header,
    .card {
        padding: 16px;
    }

    .stat-card strong {
        font-size: 30px;
    }

    #mainDashboard .stats-grid .stat-card strong {
        font-size: clamp(16px, 5.5vw, 22px);
    }

    input,
    select,
    textarea {
        padding: 11px;
    }

    .project-status-board .status-column {
        flex-basis: calc(100vw - 48px);
        max-width: 380px;
    }

    .status-actions {
        gap: 6px;
    }

    .status-actions button {
        font-size: 11px;
        padding: 5px 8px;
    }
}

html[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] p {
    color: #94a3b8;
}

html[data-theme="dark"] button {
    background: #3b82f6;
}

html[data-theme="dark"] button:hover {
    background: #2563eb;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}

html[data-theme="dark"] label {
    color: #cbd5e1;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: #334155;
}

html[data-theme="dark"] th {
    color: #94a3b8;
}

html[data-theme="dark"] .page-header {
    background: linear-gradient(135deg, #1e1b4b, #1d4ed8);
}

html[data-theme="dark"] .main-nav,
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .status-column,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .resource-card,
html[data-theme="dark"] .user-row {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .project-status-board .project-card .project-card-description {
    color: #94a3b8;
}

html[data-theme="dark"] .main-nav a {
    color: #cbd5e1;
}

html[data-theme="dark"] .brand-item {
    color: #e2e8f0;
}

html[data-theme="dark"] .brand-logo {
    background: #1e3a8a;
    color: #dbeafe;
}

html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a.active {
    background: #1e3a8a;
    color: #dbeafe;
}

html[data-theme="dark"] .secondary-link,
html[data-theme="dark"] .secondary-button {
    background: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .secondary-link:hover,
html[data-theme="dark"] .secondary-button:hover {
    background: #475569;
}

html[data-theme="dark"] .danger-button {
    background: #7f1d1d;
    color: #fecaca;
}

html[data-theme="dark"] .danger-button:hover {
    background: #991b1b;
}

html[data-theme="dark"] .table-button {
    background: #1e3a8a;
    color: #dbeafe;
}

html[data-theme="dark"] .secondary-table-button {
    background: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .danger-table-button {
    background: #7f1d1d;
    color: #fecaca;
}

html[data-theme="dark"] .badge.muted {
    background: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .badge.warning {
    background: #713f12;
    color: #fde68a;
}

html[data-theme="dark"] .badge.info {
    background: #1e3a8a;
    color: #dbeafe;
}

html[data-theme="dark"] .badge.success {
    background: #14532d;
    color: #bbf7d0;
}

html[data-theme="dark"] .status-column,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .progress-update-panel,
html[data-theme="dark"] .paid-terms-panel,
html[data-theme="dark"] .workload-dashboard,
html[data-theme="dark"] .workload-overview,
html[data-theme="dark"] .checklist label {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .dashboard-wip-empty-hint strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .workload-share-donut::after {
    background: #111827;
}

html[data-theme="dark"] .dashboard-chart-caption {
    color: #94a3b8;
}

html[data-theme="dark"] .dashboard-chart-caption strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .workload-overview-caption {
    color: #94a3b8;
}

html[data-theme="dark"] .workload-share-donut--currency .dashboard-donut-center strong {
    color: #f1f5f9;
}

html[data-theme="dark"] .workload-share-donut--currency .dashboard-donut-center small {
    color: #94a3b8;
}

html[data-theme="dark"] .workload-legend-item strong {
    color: #e2e8f0;
}

html[data-theme="dark"] .dashboard-value-label strong {
    color: #f1f5f9;
}

html[data-theme="dark"] .card-meta,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .form-message {
    color: #94a3b8;
}

html[data-theme="dark"] .error-text {
    color: #fca5a5;
}

html[data-theme="dark"] .alert-bell {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .alert-bell.has-alerts {
    background: #b45309;
    border-color: #d97706;
}

html[data-theme="dark"] .follow-up-alert-section,
html[data-theme="dark"] .follow-up-alert-card {
    border-color: #d97706;
}

html[data-theme="dark"] .follow-up-alert-card {
    background: #422006;
}

html[data-theme="dark"] .follow-up-alert-card.compact {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .follow-up-alert-card p,
html[data-theme="dark"] .project-card-alert {
    color: #fde68a;
}

html[data-theme="dark"] .project-card-alert {
    background: #713f12;
    border-color: #d97706;
}

html[data-theme="dark"] .avatar,
html[data-theme="dark"] .project-avatar {
    background: #1e3a8a;
    color: #dbeafe;
}

html[data-theme="dark"] .pic-display {
    color: #94a3b8;
}

/* —— Project form: team chat (under Current Preview) —— */

.project-team-chat {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.project-team-chat-heading {
    margin-bottom: 0.35rem;
}

.project-team-chat-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.project-team-chat-hint {
    margin: 0 0 0.65rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--muted-text, #64748b);
}

.project-team-chat-hint code {
    font-size: 0.78em;
    padding: 0.05rem 0.25rem;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.2);
}

.project-team-chat--disabled .project-chat-compose textarea {
    opacity: 0.6;
}

.project-chat-messages {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0;
}

.project-chat-bubble {
    align-self: flex-start;
    max-width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.45;
}

.project-chat-bubble--mine {
    align-self: flex-end;
    background: #dbeafe;
    border-color: #93c5fd;
}

.project-chat-bubble--mention-you:not(.project-chat-bubble--mine) {
    border-left: 3px solid #d97706;
    padding-left: 0.55rem;
}

.project-chat-meta {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.project-chat-body .chat-mention {
    font-weight: 600;
    color: #1d4ed8;
}

.project-chat-compose textarea {
    width: 100%;
    resize: vertical;
    min-height: 4rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.project-chat-compose-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.project-chat-compose-row select {
    flex: 1 1 12rem;
    min-width: 8rem;
}

.project-chat-compose-row .primary-button {
    flex-shrink: 0;
}

html[data-theme="dark"] .project-team-chat {
    border-top-color: rgba(71, 85, 105, 0.6);
}

html[data-theme="dark"] .project-team-chat-hint {
    color: #94a3b8;
}

html[data-theme="dark"] .project-team-chat-hint code {
    background: rgba(71, 85, 105, 0.65);
    color: #e2e8f0;
}

html[data-theme="dark"] .project-chat-bubble {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme="dark"] .project-chat-bubble--mine {
    background: #1e3a5f;
    border-color: #2563eb;
}

html[data-theme="dark"] .project-chat-bubble--mention-you:not(.project-chat-bubble--mine) {
    border-left-color: #fbbf24;
}

html[data-theme="dark"] .project-chat-meta {
    color: #94a3b8;
}

html[data-theme="dark"] .project-chat-body .chat-mention {
    color: #93c5fd;
}
