:root {
    color-scheme: light;
    --ink: #172033;
    --muted: #667085;
    --line: #d7dde6;
    --surface: #ffffff;
    --page: #f5f7fa;
    --accent: #0f766e;
    --accent-strong: #0b5f59;
    --danger: #c2410c;
    --warning: #b7791f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 24px;
    min-height: 64px;
    padding: 0 28px;
}

.brand {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.page {
    margin: 0 auto;
    max-width: 1180px;
    padding: 32px 24px;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading.compact {
    margin-bottom: 18px;
}

.eyebrow {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
    text-transform: uppercase;
}

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

h1 {
    font-size: 34px;
    margin-bottom: 10px;
}

.page-heading p:not(.eyebrow),
.work-panel p {
    color: var(--muted);
    line-height: 1.55;
    max-width: 760px;
}

.metric-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.metric,
.work-panel,
.floorplan-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric {
    padding: 18px;
}

.metric span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 30px;
}

.work-panel {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

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

.admin-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 8px;
    padding: 18px;
    text-decoration: none;
}

.admin-card:hover {
    border-color: var(--accent);
}

.admin-card span {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-card strong {
    font-size: 20px;
}

.admin-card p {
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

.onedrive-steps {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.onedrive-steps article {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.onedrive-steps span {
    align-items: center;
    background: var(--accent);
    border-radius: 50%;
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.onedrive-steps strong {
    color: var(--ink);
}

.onedrive-steps p,
.onedrive-config-panel p {
    color: var(--muted);
    line-height: 1.45;
    margin: 0;
}

.onedrive-config-panel {
    margin-top: 18px;
}

.onedrive-connect-panel {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.onedrive-connect-panel h2 {
    margin-bottom: 6px;
}

.button {
    background: var(--accent);
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    padding: 11px 15px;
    text-decoration: none;
}

.button:hover {
    background: var(--accent-strong);
}

.button.danger {
    background: var(--danger);
    border: 0;
    cursor: pointer;
}

.button.danger:hover {
    background: #9a3412;
}

.danger-panel {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    margin-top: 18px;
    padding: 18px;
}

.danger-panel h2 {
    color: var(--danger);
    font-size: 20px;
    margin-bottom: 8px;
}

.danger-panel p {
    color: #7c2d12;
    line-height: 1.45;
}

.danger-panel form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, 1fr) auto;
}

.floorplan-shell {
    overflow: hidden;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 160px);
    place-items: center;
}

.auth-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 430px;
    padding: 28px;
    width: 100%;
}

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

.form-stack .button {
    border: 0;
    cursor: pointer;
    justify-content: center;
    min-height: 44px;
}

.auth-link {
    color: var(--accent);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.notice {
    border-radius: 6px;
    line-height: 1.4;
    margin-bottom: 18px;
    padding: 12px;
}

.notice.error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.notice.success {
    background: #ecfdf3;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.action-row {
    align-items: center;
    display: flex;
    gap: 14px;
    margin: 0 0 18px;
}

.text-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.data-panel,
.form-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    padding: 18px;
}

.data-panel h2 {
    font-size: 20px;
    margin-bottom: 14px;
}

.project-section {
    margin-bottom: 18px;
}

.muted {
    color: var(--muted);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.tabs a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
    padding: 9px 12px;
    text-decoration: none;
}

.tabs a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.project-tab-panel {
    margin-bottom: 18px;
}

.inline-form {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 18px;
}

.inline-form h3,
.task-item h3,
.list-item h3 {
    font-size: 17px;
    margin: 0 0 10px;
}

.task-item,
.list-item {
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 14px;
}

.task-item > div:first-child,
.list-item > div:first-child {
    flex: 1;
}

.task-side {
    display: grid;
    gap: 10px;
    min-width: 180px;
}

.list-stack {
    margin-top: 18px;
}

.checkbox-line {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.checkbox-line input {
    min-height: auto;
}

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

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
}

.data-table th {
    color: var(--muted);
    font-size: 13px;
}

.data-table a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.defect-list-heading {
    margin-bottom: 10px;
}

.defect-list-heading p {
    background: #eeeeee;
    color: #333333;
    margin: -32px -24px 14px;
    padding: 16px 24px;
}

.defect-list-heading h1 {
    color: #333333;
    font-size: 26px;
    font-weight: 400;
    margin-bottom: 10px;
}

.defect-list-panel {
    overflow: auto;
}

.defect-filter-bar {
    align-items: end;
    background: #ffffff;
    border: 1px solid #dedede;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(130px, 1fr)) auto;
    margin-bottom: 12px;
    padding: 12px;
}

.defect-filter-bar label {
    color: #555555;
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 5px;
}

.defect-filter-bar input,
.defect-filter-bar select {
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    color: #333333;
    font: inherit;
    min-height: 36px;
    padding: 6px 8px;
}

.defect-filter-actions,
.defect-row-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.defect-list-count {
    color: #555555;
    font-size: 13px;
    margin-bottom: 6px;
}

.defect-list-table {
    border-collapse: collapse;
    color: #333333;
    min-width: 920px;
    width: 100%;
}

.defect-list-table th {
    background: #e9e9e9;
    color: #333333;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 8px;
    text-align: left;
}

.defect-list-table th a {
    color: inherit;
    text-decoration: none;
}

.defect-list-table td {
    border-right: 1px solid #dddddd;
    font-size: 16px;
    padding: 10px 8px;
    vertical-align: middle;
}

.defect-list-table td.defect-urgency {
    background: #f1ff00;
    color: #111111;
    font-weight: 700;
    min-width: 104px;
}

.defect-list-table tr.defect-row-low td {
    background: #fffde6;
}

.defect-list-table tr.defect-row-medium td {
    background: #fff2cc;
}

.defect-list-table tr.defect-row-high td {
    background: #ffe0e0;
}

.defect-list-table tr.defect-row-low:nth-child(even) td {
    background: #fff9bf;
}

.defect-list-table tr.defect-row-medium:nth-child(even) td {
    background: #ffe7a3;
}

.defect-list-table tr.defect-row-high:nth-child(even) td {
    background: #ffcfcf;
}

.defect-list-table tr.defect-row-low:hover td,
.defect-list-table tr.defect-row-medium:hover td,
.defect-list-table tr.defect-row-high:hover td {
    filter: brightness(.97);
}

.defect-list-table tr.defect-row-low td.defect-urgency {
    background: #f1ff00;
}

.defect-list-table tr.defect-row-medium td.defect-urgency {
    background: #ffce45;
}

.defect-list-table tr.defect-row-high td.defect-urgency {
    background: #ff7d7d;
}

.defect-list-table td.defect-urgency-high,
.defect-list-table tr.defect-row-high .report-urgency {
    color: #9f1239;
}

.defect-list-table td.defect-urgency-medium,
.defect-list-table tr.defect-row-medium .report-urgency {
    color: #92400e;
}

.defect-summary {
    min-width: 240px;
}

.defect-summary strong {
    display: block;
}

.defect-edit-button,
.defect-view-button {
    background: #b8325f;
    border-radius: 4px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    min-height: 34px;
    padding: 7px 12px;
    text-decoration: none;
}

.defect-edit-button {
    background: #486b72;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 12px;
}

.pagination a {
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #333333;
    font-weight: 700;
    min-width: 34px;
    padding: 7px 10px;
    text-align: center;
    text-decoration: none;
}

.pagination a.active {
    background: #b8325f;
    border-color: #b8325f;
    color: #ffffff;
}

.pagination a.disabled {
    color: #999999;
    pointer-events: none;
}

.defect-floorplan-panel {
    grid-column: 1 / -1;
}

.defect-floorplan-view {
    border: 1px solid #dddddd;
    display: inline-block;
    line-height: 0;
    max-width: 720px;
    position: relative;
}

.defect-floorplan-view img {
    display: block;
    max-width: 100%;
}

.defect-marker {
    background: #d13d6a;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
    height: 22px;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 22px;
}

.defect-notes-section {
    margin-top: 18px;
}

.defect-note-add-form,
.defect-note-row {
    background: #ffffff;
    border: 1px solid #dedede;
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
}

.defect-note-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.defect-note-meta span {
    color: #6b7280;
    font-size: 13px;
}

.defect-note-actions {
    justify-content: flex-end;
}

.defect-view-button {
    background: linear-gradient(#c94173, #ad285d);
    border-radius: 4px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 700;
    padding: 11px 14px;
    text-decoration: none;
}

.reports-button {
    background: #2d7d5c;
    border-radius: 4px;
    bottom: 14px;
    color: #ffffff;
    font-weight: 700;
    padding: 13px 16px;
    position: fixed;
    right: 16px;
    text-decoration: none;
}

.report-builder-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
}

.report-builder-panel {
    background: #ffffff;
    border: 1px solid #dedede;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.report-builder-panel fieldset {
    border: 1px solid #dedede;
    margin: 0;
    padding: 12px;
}

.report-builder-panel legend {
    color: #444444;
    font-weight: 700;
    padding: 0 6px;
}

.report-checkbox-list {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-checkbox-list.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.saved-report-row {
    border-bottom: 1px solid #eeeeee;
    color: #333333;
    display: grid;
    gap: 4px;
    padding: 10px 0;
    text-decoration: none;
}

.saved-report-row span,
.report-criteria-summary {
    color: #555555;
}

.report-table-panel {
    margin-top: 8px;
}

.report-urgency {
    color: #d13d6a;
    font-weight: 700;
}

.report-actions {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

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

.form-grid .wide {
    grid-column: 1 / -1;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}

.floorplan-current {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    padding: 10px 12px;
}

.floorplan-current span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.defect-wizard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.wizard-topline {
    background: #f2f2f2;
    padding: 18px 20px;
}

.wizard-topline h1 {
    font-size: 24px;
    margin: 0;
}

.wizard-steps {
    display: flex;
    gap: 14px;
    padding: 24px 20px 4px;
}

.wizard-steps button {
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 50%;
    color: #333333;
    cursor: pointer;
    font: inherit;
    height: 28px;
    width: 28px;
}

.wizard-steps button.active {
    background: #cc3e70;
    border-color: #cc3e70;
    color: #ffffff;
    font-weight: 700;
}

.wizard-step {
    padding: 14px 20px 90px;
}

.wizard-step h2 {
    color: #333333;
    font-size: 24px;
    font-weight: 400;
}

.wizard-step h3 {
    color: #333333;
    font-size: 22px;
    font-weight: 400;
    margin: 28px 0 14px;
}

.choice-grid {
    display: grid;
    gap: 8px;
}

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

.choice-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-card {
    align-items: center;
    border: 1px solid #d83b72;
    border-radius: 4px;
    color: #cc3e70;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    font-size: 15px;
    font-weight: 700;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 16px;
}

.choice-card input {
    accent-color: #cc3e70;
    height: 24px;
    min-height: auto;
    order: 2;
    width: 24px;
}

.defect-plan-picker {
    margin-top: 18px;
}

.defect-plan-surface {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 260px;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}

.defect-plan-surface img {
    display: block;
    height: auto;
    width: 100%;
}

.defect-plan-marker {
    background: #cc3e70;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
    height: 28px;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 28px;
}

.review-panel {
    display: grid;
    gap: 10px;
}

.review-panel div {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 3px;
    padding: 8px 0;
}

.review-panel span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.wizard-footer {
    align-items: center;
    background: #ffffff;
    border-top: 1px solid var(--line);
    bottom: 0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    left: 0;
    padding: 12px 20px;
    position: sticky;
    right: 0;
}

.button.secondary {
    background: #64748b;
}

.floorplan-toolbar {
    align-items: end;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr);
    padding: 16px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    font-weight: 700;
    gap: 6px;
}

input {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
}

select,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    padding: 8px 10px;
}

select {
    min-height: 40px;
}

textarea {
    resize: vertical;
}

.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
}

.detail-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.detail-panel dl {
    display: grid;
    gap: 10px;
    grid-template-columns: 120px 1fr;
    margin: 0;
}

.detail-panel dt {
    color: var(--muted);
    font-weight: 700;
}

.detail-panel dd {
    margin: 0;
}

.status-pill {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    text-transform: capitalize;
}

.floorplan {
    background: #eef2f6;
    line-height: 0;
    position: relative;
}

.floorplan img {
    display: block;
    height: auto;
    width: 100%;
}

.marker {
    align-items: center;
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgb(15 23 42 / 24%);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    min-width: 34px;
    padding: 0 9px;
    position: absolute;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.marker-high {
    background: var(--danger);
}

.marker-medium {
    background: var(--warning);
}

.marker-low,
.marker-new {
    background: var(--accent);
}

.project-ui {
    color: #2c3e50;
}

.project-ui .project-section-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 25px;
}

.project-ui .project-section-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.project-ui .project-section-header p {
    color: #7f8c8d;
    margin: 0;
}

.project-ui .button {
    align-items: center;
    background: #ffffff;
    border: 2px solid #95a5a6;
    border-radius: 6px;
    color: #2c3e50;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    text-decoration: none;
    transition: all 0.2s;
}

.project-ui .button:hover {
    background: #ecf0f1;
    border-color: #7f8c8d;
}

.project-ui .button.primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgb(52 152 219 / 30%);
    color: #ffffff;
}

.project-ui .button.primary:hover {
    background: linear-gradient(135deg, #3498db 0%, #2471a3 100%);
    box-shadow: 0 6px 16px rgb(52 152 219 / 35%);
    transform: translateY(-1px);
}

.project-ui .button.danger {
    border-color: #c2410c;
    color: #c2410c;
}

.project-ui .button.danger:hover {
    background: #fff7ed;
    border-color: #9a3412;
}

.project-ui .button.compact {
    min-height: 34px;
    padding: 6px 10px;
}

.project-ui .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tab-group {
    border-bottom: 2px solid #ecf0f1;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 25px;
}

.project-tab {
    background: transparent;
    border-bottom: 3px solid transparent;
    color: #7f8c8d;
    font-weight: 600;
    padding: 15px 25px;
    text-decoration: none;
}

.project-tab.active,
.project-tab:hover {
    border-bottom-color: #3498db;
    color: #3498db;
}

.project-tab-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgb(0 0 0 / 7%);
    display: block;
    padding: 25px;
}

.project-list .project-tab-content {
    display: none;
}

.project-list .project-tab-content.active {
    display: block;
}

.project-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.project-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgb(0 0 0 / 7%);
    padding: 25px;
    transition: all 0.25s;
}

.project-card:hover {
    box-shadow: 0 8px 20px rgb(0 0 0 / 15%);
    transform: translateY(-3px);
}

.project-card-header {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 15px;
}

.project-card-title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}

.project-card-location {
    color: #7f8c8d;
    font-size: 14px;
}

.project-status,
.status-badge {
    border-radius: 20px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

.project-card-metric,
.finance-card {
    background: #f8f9fa;
    border-radius: 6px;
    margin: 15px 0;
    padding: 15px;
}

.project-card-metric span,
.finance-card span,
.readonly-field span {
    color: #7f8c8d;
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

.project-card-metric strong,
.finance-card strong,
.readonly-field strong {
    color: #2c3e50;
    display: block;
    font-size: 20px;
}

.project-card-button {
    width: 100%;
}

.status-active {
    background: #cce5ff;
    color: #004085;
}

.status-planning {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed,
.status-complete {
    background: #d4edda;
    color: #155724;
}

.status-in-progress {
    background: #fff3cd;
    color: #856404;
}

.status-not-started {
    background: #e0e0e0;
    color: #666666;
}

.subsection-title {
    border-left: 4px solid #3498db;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 15px;
    padding-left: 10px;
}

.project-tab-content > .subsection-title:first-child {
    margin-top: 0;
}

.info-box {
    background: linear-gradient(135deg, #ebf5fb 0%, #d6eaf8 100%);
    border-left: 4px solid #3498db;
    border-radius: 8px;
    color: #2c3e50;
    margin: 0 0 20px;
    padding: 20px;
}

.info-box-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.stage-item,
.mockup-list-item {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 20px;
    transition: all 0.2s;
}

.stage-item:hover,
.mockup-list-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgb(52 152 219 / 10%);
}

.stage-header {
    align-items: center;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.stage-title {
    color: #2c3e50;
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.stage-status-form {
    flex: 0 0 auto;
    position: relative;
}

.status-select {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    padding-right: 24px;
}

.stage-status-form::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentcolor;
    content: "";
    pointer-events: none;
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
}

.stage-actions {
    margin-top: 15px;
}

.task-subtab-group {
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}

.task-subtab {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #7f8c8d;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px 9px;
}

.task-subtab.active,
.task-subtab:hover {
    border-bottom-color: #3498db;
    color: #2c3e50;
}

.task-subtab-panel[hidden] {
    display: none;
}

.task-note-add-form {
    border-top: 1px solid #ecf0f1;
    margin-top: 14px;
    padding-top: 14px;
}

.task-note-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.task-note-row {
    border-top: 1px solid #ecf0f1;
    display: grid;
    gap: 8px;
    padding-top: 10px;
}

.task-note-meta {
    align-items: center;
    color: #7f8c8d;
    display: flex;
    font-size: 13px;
    gap: 10px;
    justify-content: space-between;
}

.task-note-meta strong {
    color: #2c3e50;
}

.note-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.note-meta-inline {
    align-items: center;
    color: #7f8c8d;
    display: flex;
    font-size: 13px;
    gap: 10px;
}

.note-meta-inline strong {
    color: #2c3e50;
}

.note-action-controls {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.note-action-controls .checkbox-row {
    margin-right: 6px;
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -8px;
}

.tag-suggestions button {
    background: #eef6f5;
    border: 1px solid #c8dfdc;
    border-radius: 999px;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.tag-suggestions button:hover {
    background: #dcefeb;
}

.client-assignment-panel {
    display: grid;
    gap: 8px;
}

.client-assignment-row {
    align-items: center;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 8px 0;
}

.client-assignment-row input {
    min-height: auto;
}

.client-assignment-row small {
    color: #7f8c8d;
    display: block;
    font-weight: 400;
    margin-top: 2px;
}

.task-files-panel {
    margin-top: 4px;
}

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

.task-file-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 10px;
}

.task-file-upload {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) auto;
    margin-top: 10px;
}

.file-actions-inline {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.explorer-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.explorer-header .subsection-title {
    margin: 0;
}

.context-menu {
    position: relative;
}

.context-menu > summary {
    background: #ffffff;
    border: 1px solid #d7dde6;
    border-radius: 6px;
    color: #2c3e50;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    list-style: none;
    min-height: 28px;
    padding: 5px 8px;
}

.context-menu > summary::-webkit-details-marker {
    display: none;
}

.context-panel {
    background: #ffffff;
    border: 1px solid #d7dde6;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgb(0 0 0 / 16%);
    display: grid;
    gap: 10px;
    min-width: 260px;
    padding: 10px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.context-panel a,
.context-panel button {
    background: #ffffff;
    border: 1px solid #d7dde6;
    border-radius: 6px;
    color: #2c3e50;
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 9px;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.context-panel form {
    border-top: 1px solid #ecf0f1;
    display: grid;
    gap: 7px;
    padding-top: 8px;
}

.context-panel form:first-child {
    border-top: 0;
    padding-top: 0;
}

.context-panel label {
    color: #7f8c8d;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 4px;
}

.context-panel input,
.context-panel select {
    border: 1px solid #d7dde6;
    border-radius: 6px;
    color: #2c3e50;
    font: inherit;
    min-height: 32px;
    padding: 5px 7px;
}

.context-panel .danger-text {
    color: #c2410c;
}

.compact-select {
    max-width: 180px;
}

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

.mockup-form-grid .wide {
    grid-column: 1 / -1;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-label {
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 700;
}

.form-input {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    color: #2c3e50;
    font: inherit;
    min-height: 42px;
    padding: 10px;
    width: 100%;
}

.form-input:focus {
    border-color: #3498db;
    outline: 0;
}

.checkbox-group {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.checkbox-item {
    align-items: center;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    padding: 15px;
}

.checkbox-item.selected {
    background: #ebf5fb;
    border-color: #3498db;
}

.checkbox {
    border: 2px solid #3498db;
    border-radius: 4px;
    display: inline-block;
    flex: 0 0 auto;
    height: 22px;
    width: 22px;
}

.checkbox.checked {
    background: #3498db;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.stage-checkbox-form input:checked + .checkbox {
    background: #3498db;
    box-shadow: inset 0 0 0 4px #ffffff;
}

.stage-checkbox-form {
    cursor: pointer;
    justify-content: space-between;
}

.stage-checkbox-form > input {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.stage-checkbox-label {
    align-items: center;
    color: #2c3e50;
    display: flex;
    flex-direction: row;
    font-size: 14px;
    gap: 12px;
}

.stage-checkbox-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stage-selector-actions {
    margin-top: 18px;
}

.checkbox-row {
    align-items: center;
    color: #7f8c8d;
    display: flex;
    gap: 8px;
    font-weight: 700;
}

.note-heading {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.note-heading span {
    background: #ecf0f1;
    border-radius: 12px;
    color: #7f8c8d;
    font-size: 12px;
    padding: 4px 10px;
}

.mockup-list-item p {
    color: #7f8c8d;
    line-height: 1.5;
    margin: 0;
}

.note-edit-form {
    display: grid;
    gap: 12px;
}

.file-actions {
    margin-bottom: 25px;
}

.file-upload-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    display: grid;
    gap: 12px;
    margin-bottom: 25px;
    padding: 40px;
    text-align: center;
}

.file-upload-area:hover {
    background: linear-gradient(135deg, #ebf5fb 0%, #d6eaf8 100%);
    border-color: #3498db;
}

.file-icon {
    color: #7f8c8d;
    font-size: 20px;
    font-weight: 700;
}

.file-upload-area > span,
.file-row span {
    color: #7f8c8d;
    display: block;
    font-size: 13px;
    margin-top: 4px;
}

.file-upload-fields {
    margin-top: 10px;
}

.folder-form {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
    margin-bottom: 20px;
}

.folder-explorer {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
}

.folder-tree {
    display: grid;
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
}

.folder-tree > li {
    min-width: 0;
}

.folder-node summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 28px;
}

.folder-node summary::-webkit-details-marker {
    display: none;
}

.folder-node summary::marker {
    content: "";
}

.folder-node summary strong {
    flex: 1;
}

.tree-chevron {
    border-bottom: 4px solid transparent;
    border-left: 6px solid #7f8c8d;
    border-top: 4px solid transparent;
    height: 0;
    transition: transform 0.15s ease;
    width: 0;
}

.folder-node details[open] > summary .tree-chevron {
    transform: rotate(90deg);
}

.folder-node details {
    border-left: 2px solid #ecf0f1;
    padding-left: 8px;
}

.file-branch {
    margin-top: 8px;
}

.file-node {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 30px;
}

.file-node > span:nth-child(2) {
    flex: 1;
}

.file-node small {
    color: #7f8c8d;
    display: block;
    margin-top: 3px;
}

.tree-icon {
    flex: 0 0 auto;
    position: relative;
}

.folder-icon {
    background: #f6c453;
    border: 1px solid #d89f1d;
    border-radius: 3px;
    height: 14px;
    width: 18px;
}

.folder-icon::before {
    background: #f6c453;
    border: 1px solid #d89f1d;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
    content: "";
    height: 5px;
    left: 1px;
    position: absolute;
    top: -5px;
    width: 9px;
}

.file-icon-small {
    background: #ffffff;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    height: 18px;
    width: 14px;
}

.file-icon-small::after {
    border-color: #dbe3ee #f8f9fa #dbe3ee #dbe3ee;
    border-style: solid;
    border-width: 0 0 6px 6px;
    content: "";
    position: absolute;
    right: 0;
    top: 0;
}

.folder-delete-form {
    margin: 8px 0 10px 28px;
}

.file-row {
    align-items: center;
    display: flex;
    gap: 15px;
}

.file-row > div:nth-child(2) {
    flex: 1;
}

.row-action {
    margin-left: auto;
}

.file-kind {
    color: #3498db;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
    min-width: 54px;
}

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

.contact-search {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 560px;
}

.contact-table {
    background: #ffffff;
    border-collapse: collapse;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgb(0 0 0 / 7%);
    min-width: 820px;
    overflow: hidden;
    width: 100%;
}

.contact-table th,
.contact-table td {
    border-bottom: 1px solid #ecf0f1;
    padding: 15px;
    text-align: left;
}

.contact-table th {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.contact-table tbody tr:hover {
    background: #f8f9fa;
}

.category-pill {
    background: #d6eaf8;
    border-radius: 12px;
    color: #2c3e50;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
}

.table-input {
    border: 1px solid #d7dde6;
    border-radius: 6px;
    color: #2c3e50;
    font: inherit;
    min-height: 34px;
    min-width: 130px;
    padding: 6px 8px;
    width: 100%;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.finance-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.readonly-grid {
    margin-bottom: 10px;
}

.readonly-field {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.empty-state {
    background: #f8f9fa;
    border-radius: 8px;
    color: #7f8c8d;
    padding: 20px;
}

@media (max-width: 720px) {
    .topbar,
    .work-panel,
    .project-ui .project-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid,
    .floorplan-toolbar,
    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .task-item,
    .list-item {
        display: grid;
    }

    .page {
        padding: 24px 16px;
    }

    .project-tab {
        padding: 12px 14px;
    }

    .project-tab-content {
        padding: 18px;
    }

    .project-grid,
    .mockup-form-grid,
    .finance-grid,
    .folder-form,
    .defect-filter-bar,
    .task-file-upload {
        grid-template-columns: 1fr;
    }

    .task-file-row,
    .file-node {
        align-items: flex-start;
        display: grid;
    }

    .file-upload-area {
        padding: 24px;
    }

    .defect-wizard {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        margin: -24px -16px 0;
    }

    .wizard-topline,
    .wizard-step,
    .wizard-steps {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wizard-step h2 {
        font-size: 22px;
    }

    .wizard-step h3 {
        font-size: 20px;
    }

    .choice-grid.two,
    .choice-grid.three,
    .onedrive-steps,
    .report-builder-grid,
    .report-checkbox-list,
    .report-checkbox-list.compact,
    .report-date-grid,
    .admin-card-grid {
        grid-template-columns: 1fr;
    }

    .choice-card {
        min-height: 56px;
    }

    .defect-plan-surface {
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
        min-height: 240px;
    }

    .wizard-footer {
        box-shadow: 0 -6px 18px rgb(0 0 0 / 8%);
        padding: 10px 12px;
    }

    .wizard-footer .button {
        flex: 1;
        justify-content: center;
    }
}

/* Consistency pass: shared shell, controls, panels, and admin tables. */
:root {
    --accent: #c83d70;
    --accent-strong: #a92d5d;
    --accent-soft: #fff1f6;
    --teal: #2d7d6a;
    --teal-strong: #236554;
    --line: #dfe4ea;
    --page: #f6f7f9;
    --surface: #ffffff;
    --ink: #2f3440;
    --muted: #667085;
    --shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
    --shadow-md: 0 8px 24px rgb(16 24 40 / 9%);
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

.topbar {
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    gap: 22px;
    min-height: 58px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    min-width: max-content;
}

.brand::before {
    background: radial-gradient(circle at 35% 35%, #ffffff 0 22%, var(--accent) 24% 100%);
    border: 1px solid #f6b6ce;
    border-radius: 50%;
    content: "";
    height: 22px;
    width: 22px;
}

.nav {
    align-items: center;
    flex: 1;
    flex-wrap: wrap;
    gap: 4px;
}

.nav a {
    border-radius: 6px;
    color: #505967;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 10px;
}

.nav a:hover,
.nav a.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.nav-menu {
    position: relative;
}

.nav-menu summary {
    border-radius: 6px;
    color: #505967;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    list-style: none;
    padding: 8px 10px;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.nav-menu summary::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentcolor;
    content: "";
    margin-top: 7px;
}

.nav-menu[data-active] summary,
.nav-menu summary:hover,
.nav-menu[open] summary {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.nav-menu-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 4px;
    left: 0;
    min-width: 190px;
    padding: 8px;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 80;
}

.nav-menu-panel.align-right {
    left: auto;
    right: 0;
}

.nav-menu-panel a {
    color: #505967;
    padding: 9px 10px;
}

.nav-user {
    margin-left: auto;
}

.nav-user-meta {
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    padding: 6px 10px 10px;
}

.page {
    max-width: 1280px;
}

.page-heading,
.defect-list-heading,
.project-ui .project-section-header {
    background: transparent;
    margin-bottom: 18px;
}

.defect-list-heading p {
    background: #eef0f3;
    border-radius: 0;
    color: #505967;
    font-size: 14px;
    margin: -32px -24px 16px;
    padding: 14px 24px;
}

h1,
.defect-list-heading h1,
.project-ui .project-section-header h1 {
    color: var(--ink);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
}

.page-heading p:not(.eyebrow),
.project-ui .project-section-header p,
.defect-list-heading .report-criteria-summary {
    color: var(--muted);
}

.data-panel,
.form-panel,
.detail-panel,
.project-tab-content,
.project-card,
.admin-card,
.metric,
.work-panel,
.report-builder-panel,
.defect-note-add-form,
.defect-note-row,
.folder-explorer,
.contact-table,
.stage-item,
.mockup-list-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.button,
.project-ui .button,
.defect-edit-button,
.defect-view-button,
.reports-button {
    align-items: center;
    background: var(--teal);
    border: 1px solid transparent;
    border-radius: 6px;
    box-shadow: none;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.button:hover,
.project-ui .button:hover,
.reports-button:hover {
    background: var(--teal-strong);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.button.primary,
.project-ui .button.primary,
.defect-view-button {
    background: var(--accent);
    border-color: var(--accent);
}

.button.primary:hover,
.project-ui .button.primary:hover,
.defect-view-button:hover {
    background: var(--accent-strong);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.button.secondary,
.project-ui .button:not(.primary):not(.danger),
.defect-edit-button {
    background: #ffffff;
    border-color: var(--line);
    color: var(--ink);
}

.button.secondary:hover,
.project-ui .button:not(.primary):not(.danger):hover,
.defect-edit-button:hover {
    background: #f8fafc;
    border-color: #c9d2dc;
}

.button.compact,
.project-ui .button.compact,
.defect-edit-button,
.defect-view-button {
    min-height: 32px;
    padding: 6px 10px;
}

.button.danger,
.project-ui .button.danger {
    background: #c2410c;
    border-color: #c2410c;
    color: #ffffff;
}

.button-group,
.form-actions,
.action-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input,
select,
textarea,
.form-input,
.table-input {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    min-height: 40px;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus,
.table-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(200 61 112 / 12%);
    outline: 0;
}

label,
.form-label {
    color: #596272;
}

.data-table,
.defect-list-table,
.contact-table {
    background: #ffffff;
    border: 1px solid var(--line);
    border-collapse: separate;
    border-radius: 8px;
    border-spacing: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table th,
.defect-list-table th,
.contact-table th {
    background: #eef1f5;
    border-bottom: 1px solid var(--line);
    color: #3d4451;
    font-size: 13px;
    line-height: 1.2;
    text-transform: none;
}

.data-table td,
.defect-list-table td,
.contact-table td {
    border-bottom: 1px solid #edf0f4;
    border-right: 0;
    color: var(--ink);
    font-size: 14px;
}

.data-table tbody tr:hover td,
.contact-table tbody tr:hover td,
.defect-list-table tbody tr:hover td {
    filter: brightness(.98);
}

.defect-action-table th:last-child,
.defect-action-table td:last-child {
    box-shadow: -8px 0 18px rgb(16 24 40 / 5%);
    position: sticky;
    right: 0;
    z-index: 1;
}

.defect-action-table th:last-child {
    z-index: 2;
}

.defect-filter-bar {
    border-color: var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(130px, 1fr)) auto;
}

.defect-filter-pills {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
}

.defect-filter-pills > div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.defect-filter-pills span {
    color: #596272;
    font-size: 13px;
    font-weight: 800;
    min-width: 58px;
}

.filter-pill {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #505967;
    font-size: 13px;
    font-weight: 800;
    min-height: 30px;
    padding: 6px 11px;
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.filter-pill.urgency-low:not(.active) {
    background: #fffde6;
    border-color: #e4e86b;
}

.filter-pill.urgency-medium:not(.active) {
    background: #fff2cc;
    border-color: #f2c35b;
}

.filter-pill.urgency-high:not(.active) {
    background: #ffe0e0;
    border-color: #f3a4a4;
}

.reports-button {
    background: var(--teal);
    box-shadow: var(--shadow-md);
}

.project-tab-group {
    border-bottom-color: var(--line);
    gap: 4px;
}

.project-tab {
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    color: #596272;
    padding: 11px 14px;
}

.project-tab.active,
.project-tab:hover,
.task-subtab.active,
.task-subtab:hover {
    border-bottom-color: var(--accent);
    color: var(--accent-strong);
}

.subsection-title {
    border-left-color: var(--accent);
    color: var(--ink);
}

.info-box {
    background: #f3faf8;
    border-left-color: var(--teal);
}

.project-card:hover,
.admin-card:hover,
.stage-item:hover,
.mockup-list-item:hover {
    border-color: #cfd6df;
    box-shadow: var(--shadow-md);
    transform: none;
}

.status-active,
.status-in-progress,
.status-complete,
.status-completed,
.status-not-started,
.status-planning,
.category-pill,
.status-pill {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.empty-state {
    border: 1px dashed var(--line);
}

.dashboard-heading {
    margin-bottom: 20px;
}

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

.metric {
    border-left: 4px solid #cbd5e1;
}

.metric-warning {
    border-left-color: #f59e0b;
}

.metric-info {
    border-left-color: #3b82f6;
}

.metric-success {
    border-left-color: var(--teal);
}

.metric-neutral {
    border-left-color: var(--accent);
}

.dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    padding: 16px;
}

.dashboard-panel-heading {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: -2px 0 14px;
    padding-bottom: 12px;
}

.dashboard-panel-heading h2 {
    font-size: 18px;
    margin: 0;
}

.dashboard-pill-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-pill {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 8px;
    padding: 12px;
    text-decoration: none;
}

.dashboard-pill:hover {
    border-color: #c9d2dc;
    box-shadow: var(--shadow-sm);
}

.dashboard-pill span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-pill strong {
    font-size: 26px;
}

.dashboard-pill.urgency-high {
    background: #ffe0e0;
    border-color: #f3a4a4;
}

.dashboard-pill.urgency-medium {
    background: #fff2cc;
    border-color: #f2c35b;
}

.dashboard-pill.urgency-low {
    background: #fffde6;
    border-color: #e4e86b;
}

.dashboard-list {
    display: grid;
    gap: 8px;
}

.dashboard-list-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #edf0f4;
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
    padding: 10px 12px;
    text-decoration: none;
}

.dashboard-list-row:hover {
    background: #f8fafc;
}

.dashboard-list-row strong,
.dashboard-list-row span {
    display: block;
}

.dashboard-list-row strong {
    margin-bottom: 3px;
}

.dashboard-list-row span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-row-meta {
    align-items: flex-end;
    display: grid;
    flex: 0 0 auto;
    gap: 6px;
    justify-items: end;
}

.dashboard-row-meta small {
    color: var(--muted);
}

.dashboard-actions {
    margin-top: 4px;
}

@media (max-width: 720px) {
    .topbar {
        position: static;
    }

    .nav {
        width: 100%;
    }

    .nav a {
        padding: 7px 8px;
    }

    .nav-user {
        margin-left: 0;
    }

    .nav-menu-panel,
    .nav-menu-panel.align-right {
        left: 0;
        right: auto;
    }

    .defect-list-heading p {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .defect-action-table th:last-child,
    .defect-action-table td:last-child {
        position: static;
    }

    .report-actions {
        align-items: stretch;
        display: grid;
        gap: 10px;
    }

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

    .dashboard-list-row {
        align-items: flex-start;
        display: grid;
    }

    .dashboard-row-meta {
        align-items: start;
        justify-items: start;
    }
}

.stage-task-form {
    display: grid;
    gap: 14px;
}

.stage-task-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.stage-percent-control {
    align-items: center;
    color: #4b5563;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
}

.stage-percent-control input {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font: inherit;
    padding: 7px 8px;
    width: 72px;
}

.stage-progress-bar {
    background: #edf0f2;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.stage-progress-bar span {
    background: #2f855a;
    display: block;
    height: 100%;
}

.checkbox-fieldset {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
}

.property-assignment-list {
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.property-assignment-fieldset[hidden] {
    display: none;
}

.compact-note-form {
    align-items: end;
    gap: 10px;
}

.compact-note-form textarea {
    min-height: 84px;
}

.compact-note-row {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    padding: 12px;
}

.note-compact-head {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) auto;
}

.compact-note-row textarea {
    min-height: 76px;
}

.compact-note-row .note-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.assigned-property-list {
    display: grid;
    gap: 12px;
}

.assigned-property-card {
    background: #fff;
    border: 1px solid #d7dde6;
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 10px;
    padding: 14px;
    text-decoration: none;
}

.assigned-property-card:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 16px rgb(15 118 110 / 10%);
}

.assigned-property-head {
    align-items: start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.assigned-property-head strong {
    display: block;
}

.assigned-property-head span:not(.status-pill),
.assigned-property-stats {
    color: var(--muted);
    font-size: 13px;
}

.assigned-property-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.client-property-grid,
.client-property-section {
    margin-bottom: 18px;
}

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

.client-stage-row {
    background: #fff;
    border: 1px solid #d7dde6;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.client-stage-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.client-stage-head h3 {
    font-size: 15px;
    margin: 0;
}

.client-stage-meta {
    color: var(--muted);
    font-size: 13px;
}

.client-stage-row p {
    margin: 0;
}

.client-stage-notes {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: grid;
    gap: 5px;
    padding: 9px 10px;
}

.client-stage-notes strong {
    font-size: 13px;
}

.client-file-browser {
    background: transparent;
    border: 0;
    padding: 0;
}

.readonly-file-actions {
    display: inline-flex;
    gap: 10px;
    margin-left: auto;
}

.notice.danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.defect-timeline {
    display: grid;
    gap: 10px;
}

.timeline-item {
    background: #fff;
    border: 1px solid #d7dde6;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 11px 12px;
}

.timeline-item div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: space-between;
}

.timeline-item span {
    color: var(--muted);
    font-size: 13px;
}

.timeline-item p {
    margin: 0;
}
