html,
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #111827;
}

a,
.btn-link {
    color: #2563eb;
}

h1:focus {
    outline: none;
}

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

.page-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 1.3rem + 0.7vw, 1.9rem);
}

.page-header p {
    margin: 0.35rem 0 0;
    color: #4b5563;
}

.placeholder-panel {
    border: 1px dashed #94a3b8;
    background: #ffffff;
    border-radius: 0.65rem;
    padding: 1rem;
}

.placeholder-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 0.75rem;
}

.placeholder-card p {
    margin: 0.35rem 0 0.75rem;
}

html,
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #111827;
}

a,
.btn-link {
    color: #2563eb;
}

h1:focus {
    outline: none;
}

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

.page-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 1.3rem + 0.7vw, 1.9rem);
}

.page-header p {
    margin: 0.35rem 0 0;
    color: #4b5563;
}

.placeholder-panel {
    border: 1px dashed #94a3b8;
    background: #ffffff;
    border-radius: 0.65rem;
    padding: 1rem;
}

.placeholder-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 0.75rem;
}

.placeholder-card p {
    margin: 0.35rem 0 0.75rem;
}

/* Jobs master-detail */
.jobs-master-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    min-height: 60vh;
}

.jobs-list-panel {
    min-width: 0;
}

.jobs-detail-panel {
    min-width: 0;
    background: #fff;
    border-radius: 0.65rem;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    overflow: auto;
}

.jobs-detail-panel .detail-placeholder {
    color: #64748b;
}

.job-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.job-row.selected {
    background: #eff6ff;
    margin: 0 -0.9rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
}

.job-row .job-meta,
.job-card .job-meta {
    color: #64748b;
    font-size: 0.9rem;
}

.job-card strong {
    display: block;
}

.job-card p {
    margin: 0.35rem 0 0.75rem;
    color: #475569;
    font-size: 0.95rem;
}

.job-link {
    justify-self: start;
}

/* State messages */
.state-message {
    padding: 1rem;
    color: #64748b;
}

.state-loading {
    font-style: italic;
}

.state-error {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 0.5rem;
}

.state-empty {
    color: #64748b;
}

/* Job detail panel */
.job-detail-header {
    margin-bottom: 1rem;
}

.job-detail-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
}

.job-detail-meta {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.back-button {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.back-button:hover {
    text-decoration: underline;
}

.job-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: #475569;
}

.task-list {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
}

.task-list .completed {
    text-decoration: line-through;
    color: #94a3b8;
}

.time-entries-list,
.attachments-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.time-entries-list li,
.attachments-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.attachment-name {
    font-weight: 500;
}

.attachment-meta {
    color: #64748b;
    margin-left: 0.5rem;
}

.attachment-category {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.attachment-download {
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.signed-off-badge {
    display: inline-block;
    margin: 0.5rem 0 0;
    padding: 0.25rem 0.6rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.sign-off-section {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.form-hint {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: #64748b;
}

.text-muted {
    color: #64748b;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

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

.btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.form-success {
    padding: 0.75rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Settings > Users list */
.settings-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-user-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.settings-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-user-name {
    font-size: 1rem;
}

.settings-user-email {
    font-size: 0.9rem;
    color: #64748b;
}

.settings-user-roles {
    font-size: 0.85rem;
    color: #475569;
}

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

.settings-role-select {
    min-width: 140px;
}

@media (max-width: 600px) {
    .settings-user-card {
        grid-template-columns: 1fr;
    }

    .settings-user-actions {
        flex-wrap: wrap;
    }
}

/* Modal: full screen with padding. Overlay does not capture clicks; backdrop and dialog do. */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    pointer-events: none;
}

.modal-overlay-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.modal-dialog {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    flex: 1 1 0%;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-dialog-wide {
    /* Same as base; full screen. Kept for any component that expects the class. */
}

.modal-dialog h3 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* Quotes: reuse jobs master-detail layout */
.quotes-master-detail .quote-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    align-items: center;
    gap: 0.75rem;
}

.converted-badge {
    background: #dbeafe;
    color: #1e40af;
}

.converted-job-link {
    margin-bottom: 1rem;
}

/* Customers & Sites: reuse jobs master-detail; extra row/card classes if needed */
.customers-master-detail .customer-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.75rem;
}

.sites-master-detail .site-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    align-items: center;
    gap: 0.75rem;
}

.badge-inactive {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.sites-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.site-list-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.site-list-item .site-link {
    font-weight: 500;
}

.site-location {
    display: block;
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.site-customer-link {
    font-weight: 500;
}

.required {
    color: #b91c1c;
}

/* Quote lines */
.quote-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.quote-lines-table th,
.quote-lines-table td {
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.quote-lines-table th {
    font-weight: 600;
    color: #475569;
}

.quote-lines-mobile {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.quote-line-card {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.quote-line-card p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

/* Create quote modal */
.modal-dialog-scroll {
    max-height: 85vh;
    overflow-y: auto;
}

.form-section-title {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    color: #475569;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.form-group.flex-1 { flex: 1; min-width: 6rem; }
.form-group.flex-2 { flex: 2; min-width: 10rem; }

.quote-line-editor {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.form-group-actions {
    display: flex;
    align-items: flex-end;
}

/* Quote totals summary */
.quote-totals-summary {
    margin: 1rem 0 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    max-width: 320px;
    margin-left: auto;
}

.quote-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.95rem;
    color: #475569;
}

.quote-totals-row.quote-totals-gross {
    border-top: 1px solid #e2e8f0;
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    font-weight: 600;
    color: #1e293b;
}

/* Mobile: quote lines */
@media (max-width: 700px) {
    .quote-lines-desktop {
        display: none;
    }

    .quote-lines-mobile {
        display: block;
    }

    .quotes-master-detail .quote-row {
        grid-template-columns: 1fr auto;
    }

    .quote-row .job-meta {
        grid-column: 1 / -1;
    }
}

/* Mobile: master-detail behavior */
@media (max-width: 700px) {
    .placeholder-row {
        grid-template-columns: 1fr;
    }

    .jobs-master-detail {
        grid-template-columns: 1fr;
    }

    .jobs-master-detail .jobs-list-panel {
        display: block;
    }

    .jobs-master-detail.has-selection .jobs-list-panel {
        display: none;
    }

    .jobs-master-detail.has-selection .jobs-detail-panel {
        min-height: 80vh;
    }

    .job-row {
        grid-template-columns: 1fr auto;
    }

    .job-row .job-meta {
        grid-column: 1 / -1;
    }
}

/* ── Schedule module styles ── */

.schedule-week-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.schedule-week-label {
    font-size: 0.95rem;
    color: #475569;
    white-space: nowrap;
}

.schedule-board-item {
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.schedule-board-item:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.schedule-board-item.selected {
    border-color: #2563eb;
    background: #eff6ff;
}

.schedule-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.schedule-item-meta,
.schedule-item-dates,
.schedule-item-assignees {
    font-size: 0.875rem;
    margin-top: 0.1rem;
}

.clash-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 0.35rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Unscheduled jobs panel */
.unscheduled-panel {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    margin-bottom: 1rem;
    overflow: hidden;
}

.unscheduled-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    user-select: none;
}

.unscheduled-panel-header:hover {
    background: #f1f5f9;
}

.unscheduled-panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.collapse-arrow {
    font-size: 0.8rem;
    color: #64748b;
}

.badge-warning {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid #fcd34d;
}

.unscheduled-search {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.unscheduled-hint {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem 0.5rem;
    margin: 0;
}

.unscheduled-empty {
    padding: 0.75rem;
}

/* ── Card grid for unscheduled stages ── */
.unscheduled-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.65rem;
    padding: 0.5rem 0.75rem 0.75rem;
    max-height: 50vh;
    overflow-y: auto;
}

.unscheduled-stage-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    cursor: grab;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 88px;
}

.unscheduled-stage-card:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.unscheduled-stage-card.highlighted {
    background: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.unscheduled-stage-card:active {
    cursor: grabbing;
}

.unscheduled-stage-card-body {
    flex: 1;
}

.unscheduled-stage-name {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.15rem;
    font-size: 0.875rem;
}

.unscheduled-stage-meta {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unscheduled-stage-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* ── Planner item remove (×) button ── */
.planner-item-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.planner-item-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0 1px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
    align-self: flex-start;
}

.planner-item:hover .planner-item-remove {
    opacity: 1;
}

.planner-item-remove:hover {
    color: #ef4444;
}

/* ── Job preview modal ── */
.job-preview-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.job-preview-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.job-preview-meta {
    font-size: 0.9rem;
    margin: 0.2rem 0;
    color: #475569;
}

.job-preview-description {
    font-size: 0.9rem;
    color: #334155;
    margin: 0.5rem 0;
    white-space: pre-wrap;
}

.job-preview-tasks {
    margin-top: 0.75rem;
}

.job-preview-tasks strong {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.job-preview-tasks ul {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0;
}

.job-preview-tasks li {
    font-size: 0.875rem;
    padding: 0.1rem 0;
    color: #334155;
}

.job-preview-tasks li.task-done {
    color: #94a3b8;
    text-decoration: line-through;
}

/* Job status badges */
.job-status-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.job-status-pending { background: #f1f5f9; color: #475569; }
.job-status-inprogress { background: #dbeafe; color: #1e40af; }
.job-status-completed { background: #dcfce7; color: #166534; }
.job-status-cancelled { background: #fee2e2; color: #991b1b; }
.job-status-signedoff { background: #d1fae5; color: #065f46; }

/* Scheduled list section */
.scheduled-list-section h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Unscheduled prompt (detail panel) */
.unscheduled-prompt {
    padding: 1rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    margin: 0.75rem 0;
}

.unscheduled-prompt p {
    margin: 0 0 0.5rem;
}

.unscheduled-prompt .btn {
    margin-right: 0.5rem;
}

/* Schedule detail header */
.schedule-detail-header {
    margin-bottom: 1rem;
}

.schedule-detail-header h2 {
    margin: 0.25rem 0 0.15rem;
    font-size: 1.35rem;
}

/* ── Calendar view ── */
.schedule-calendar {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 3.5rem repeat(7, 1fr);
    min-width: 560px;
}

.calendar-time-header {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.calendar-day-header {
    padding: 0.4rem 0.25rem;
    text-align: center;
    border-left: 1px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}

.calendar-day-header.today {
    background: #eff6ff;
    border-bottom-color: #2563eb;
}

.calendar-day-name {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-day-date {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.calendar-time-label {
    padding: 0.2rem 0.4rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    height: 3.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.calendar-slot {
    border-left: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    min-height: 3.5rem;
    padding: 0.1rem 0.15rem;
    position: relative;
    transition: background 0.1s;
}

.calendar-slot.droppable:hover,
.calendar-slot.drag-over {
    background: #eff6ff;
    outline: 2px dashed #93c5fd;
    outline-offset: -2px;
}

.calendar-event {
    background: #2563eb;
    color: #fff;
    border-radius: 0.25rem;
    padding: 0.15rem 0.3rem;
    margin-bottom: 0.15rem;
    cursor: pointer;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.2;
    transition: background 0.1s;
}

.calendar-event:hover {
    background: #1d4ed8;
}

.calendar-event.has-clash {
    background: #dc2626;
}

.calendar-event-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.calendar-event-meta {
    display: block;
    font-size: 0.7rem;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Schedule panel detail ── */
.job-schedule-panel {
    padding: 0.25rem;
}

.schedule-detail-sections {
    margin-top: 0.75rem;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.75rem;
    font-size: 0.95rem;
    margin: 0;
}

.detail-list dt {
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.detail-list dd {
    margin: 0;
    color: #1e293b;
}

.clash-list,
.assignment-list {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
}

.clash-item,
.assignment-item {
    padding: 0.3rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.clash-section {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.4rem;
    padding: 0.65rem;
}

.badge-primary {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stage-item {
    padding: 0.5rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    background: #f8fafc;
}

.stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.stage-status {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.stage-status-planned { background: #f1f5f9; color: #475569; }
.stage-status-ready { background: #dbeafe; color: #1e40af; }
.stage-status-inprogress { background: #fef3c7; color: #92400e; }
.stage-status-completed { background: #dcfce7; color: #166534; }
.stage-status-blocked { background: #fee2e2; color: #991b1b; }

.stage-dates,
.stage-assignees {
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* ── Mobile schedule ── */
@media (max-width: 700px) {
    .calendar-grid {
        grid-template-columns: 2.5rem repeat(7, 1fr);
        min-width: 480px;
    }

    .calendar-day-date {
        font-size: 0.8rem;
    }

    .unscheduled-card-grid {
        grid-template-columns: 1fr 1fr;
        max-height: 30vh;
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Auth pages */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f5f6f8;
}

.auth-page {
    width: 100%;
    max-width: 24rem;
}

.auth-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.auth-card-wide {
    max-width: 28rem;
}

.auth-page h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.auth-hint {
    margin: 0 0 1.25rem;
    color: #64748b;
    font-size: 0.95rem;
}

.auth-actions {
    margin-top: 1.25rem;
}

.auth-actions .btn {
    width: 100%;
    padding: 0.65rem;
}

.tenant-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tenant-list li {
    margin-bottom: 0.5rem;
}

.tenant-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.tenant-option:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.tenant-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f6f8;
    color: #64748b;
}

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

.tenant-name {
    font-size: 0.9rem;
    color: #475569;
    margin-right: 0.25rem;
}

.tenant-current-badge {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: 0.5rem;
    font-weight: normal;
}

.tenant-option.current {
    background: #eff6ff;
    border-color: #2563eb;
}

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

.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-section {
    margin-bottom: 0;
}

.dashboard-section-title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #475569;
    font-weight: 600;
}

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 1rem;
}

.dashboard-summary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 1rem;
    min-width: 0;
}

.dashboard-summary-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.dashboard-summary-card-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.dashboard-summary-card-action {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.dashboard-lists-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1.5rem;
}

.dashboard-list-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 1rem;
    min-width: 0;
}

.dashboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-list li:last-child {
    border-bottom: none;
}

.dashboard-list-link {
    font-weight: 500;
}

.dashboard-list-meta {
    font-size: 0.9rem;
    color: #64748b;
}

.dashboard-list-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.dashboard-quick-actions {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 1rem;
}

.dashboard-quick-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dashboard-quick-action {
    text-decoration: none;
}

@media (max-width: 700px) {
    .dashboard-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .dashboard-summary-card-value {
        font-size: 1.5rem;
    }
}

/* Inventory overview */
.inventory-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.inventory-quick-actions,
.inventory-links,
.inventory-recent-movements {
    margin-bottom: 1.5rem;
}

.inventory-quick-actions h2,
.inventory-links h2,
.inventory-recent-movements h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: #374151;
}

.inventory-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inventory-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.inventory-nav-links li {
    margin-bottom: 0.5rem;
}

/* Stock movement list */
.stock-movement-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}

.stock-movement-item {
    display: grid;
    grid-template-columns: auto auto 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.stock-movement-item:last-child {
    border-bottom: none;
}

.movement-type {
    font-weight: 500;
}

.movement-qty {
    font-variant-numeric: tabular-nums;
}

.movement-date {
    color: #64748b;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .stock-movement-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }

    .movement-date {
        grid-column: 1 / -1;
    }
}

/* Stock by location/product lists in detail panels */
.stock-by-location-list,
.stock-by-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.stock-by-location-item,
.stock-by-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.stock-qty {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.location-link,
.product-link {
    font-weight: 500;
}

/* Job material usage list */
.materials-summary {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #475569;
}

.material-usage-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.material-usage-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.material-product {
    font-weight: 500;
}

.material-qty {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: #1e40af;
}

.material-location {
    color: #475569;
}

.material-date {
    font-size: 0.85rem;
    color: #94a3b8;
}

@media (max-width: 600px) {
    .material-usage-item {
        grid-template-columns: 1fr auto;
        gap: 0.25rem;
    }

    .material-location {
        grid-column: 1 / -1;
        font-size: 0.88rem;
    }

    .material-date {
        grid-column: 1 / -1;
    }
}

/* Inline edit controls (job title, job status) */
.inline-edit-row {    
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
/* ─── Job Stages Panel ────────────────────────────────────────────────────── */

.job-stages-panel {
    margin-top: 1rem;
}

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

.stages-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.stages-empty {
    padding: 0.75rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.stages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stage-item {
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

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

.inline-title-input {
    flex: 1 1 200px;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.95rem;
    opacity: 0.6;
    line-height: 1;
    vertical-align: middle;
}

.btn-icon:hover {
    opacity: 1;
}

.form-control-inline {
    display: inline-block;
    width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.95rem;
}

.form-hint-error {
    color: #ef4444;
}

.stage-sequence {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.stage-name {
    flex: 1;
    font-size: 0.95rem;
    color: #1e293b;
}

.stage-duration {
    font-size: 0.85rem;
}

.stage-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.stage-desc {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    padding-left: 2rem;
}

/* ─── Stage cards on Schedule page ─────────────────────────────────────────── */

.stage-card {
    border-left: 3px solid #3b82f6;
}

.stage-sequence-badge {
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

.stage-chip {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 4px;
    padding: 0 0.35rem;
    font-size: 0.78rem;
    margin-right: 0.25rem;
    margin-bottom: 0.15rem;
}

.schedule-item-stages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

/* ─── Misc helpers ──────────────────────────────────────────────────────────── */

.flex-1 {
    flex: 1;
}

.form-row {
    display: flex;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .stage-header {
        flex-wrap: wrap;
    }
}

/* ─── Schedule view toggle ──────────────────────────────────────────────────── */

.schedule-view-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.schedule-view-btn {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: #f8fafc;
    border: none;
    border-right: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.schedule-view-btn:last-child {
    border-right: none;
}

.schedule-view-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.schedule-view-btn.active {
    background: #3b82f6;
    color: #fff;
}

/* ─── Employee Planner page layout ──────────────────────────────────────────── */

.employee-planner-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    height: calc(100vh - 180px);
    min-height: 400px;
}

.planner-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.planner-range-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    min-width: 180px;
    text-align: center;
}

.planner-setting-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.planner-grid-section {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}

.planner-unplanned-section {
    flex-shrink: 0;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* ─── Generic PlannerGrid table ─────────────────────────────────────────────── */

.planner-scroll-area {
    overflow: auto;
    height: 100%;
    width: 100%;
}

.planner-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
}

/* Month header row */
.planner-month-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    text-align: center;
    height: 2rem;
}

/* Day header row */
.planner-day-header {
    position: sticky;
    top: 2rem;
    z-index: 10;
    background: #f8fafc;
    padding: 0.2rem 0.25rem;
    text-align: center;
    min-width: 88px;
    width: 88px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    height: 3rem;
    vertical-align: middle;
}

.planner-day-today {
    background: #eff6ff;
    border-bottom: 2px solid #3b82f6;
}

.planner-day-num {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    line-height: 1.2;
}

.planner-day-name {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.2;
}

/* Corner: sticky top-left */
.planner-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    background: #f8fafc;
    min-width: 160px;
    width: 160px;
    text-align: left;
    border-right: 2px solid #e2e8f0;
}

/* Employee name column */
.planner-resource-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-right: 2px solid #e2e8f0;
    border-bottom: 3px solid #cbd5e1;
    min-width: 160px;
    width: 160px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    vertical-align: top;
    font-size: 0.875rem;
    color: #1e293b;
}

/* Day cells */
.planner-cell {
    border: 1px solid #f1f5f9;
    padding: 2px;
    vertical-align: top;
    min-width: 88px;
    width: 88px;
    /* Compact by default — grows to fit items; empty items-row cells stay small so the
       span bars directly below the header are the primary visual element. */
    min-height: 8px;
    transition: background 0.1s;
    background: #fff;
    position: relative;
}

/* When a drag is active, make the cell a comfortable minimum height so empty cells
   are always large enough to receive a drop. */
.planner-cell.droppable {
    min-height: 40px;
}

/* ── Drag-over highlight: connected rectangle across the full span ──────────────
   Each highlighted items-row cell contributes top+bottom inset lines.
   The left line is drawn only on the FIRST cell in the range (.drag-over-start)
   and the right line only on the LAST (.drag-over-end).
   Together they form one connected rectangle instead of N separate outline boxes. */
.planner-cell.drag-over {
    background: #eff6ff;
    box-shadow: inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6;
}

.planner-cell.drag-over.drag-over-start {
    box-shadow: inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6, inset 2px 0 0 #3b82f6;
}

.planner-cell.drag-over.drag-over-end {
    box-shadow: inset 0 2px 0 #3b82f6, inset 0 -2px 0 #3b82f6, inset -2px 0 0 #3b82f6;
}

.planner-cell.drag-over.drag-over-start.drag-over-end {
    /* Single-cell highlight → full box */
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.planner-span-cell.drag-over-sub {
    background: #eff6ff;
}

/* Empty state */
.planner-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-style: italic;
}

/* Planner item cards (single-day, in items row) */
.planner-item {
    display: flex;
    align-items: flex-start;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    padding: 0.2rem 0.45rem;
    margin: 2px 3px;
    font-size: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    transition: opacity 0.1s;
}

.planner-item:hover {
    opacity: 0.85;
}

.planner-item-title {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.planner-item-sub {
    display: block;
    color: #475569;
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-top: 1px;
}

/* Status variants */
.planner-item-planned {
    background: #dbeafe;
    border-color: #93c5fd;
}

.planner-item-ready {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.planner-item-inprogress {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #78350f;
}

.planner-item-completed {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.planner-item-blocked {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
}

/* ─── Items row (single-day items + drop targets) ───────────────────────────── */

/* Items row is the renamed planner-row — same visual rules. */
.planner-items-row > td.planner-cell {
    border-bottom: none; /* spans row provides the bottom divider */
}

/* ─── Spans row (multi-day stage bars) ──────────────────────────────────────── */

.planner-spans-row > .planner-span-cell,
.planner-spans-row > .planner-span-cell-empty {
    border: 1px solid #f1f5f9;
    border-top: none; /* merged visually with items row above */
    padding: 0;
    background: #fff;
    min-height: 36px;
    vertical-align: middle;
    transition: background 0.1s;
    /* Needed so the absolute drop-zone overlay is contained within the cell. */
    position: relative;
}

/* Thick bottom border on the last span lane of each employee — acts as a visual
   separator between employee rows so the grid is easier to scan. */
.planner-employee-last-row > .planner-span-cell,
.planner-employee-last-row > .planner-span-cell-empty {
    border-bottom: 3px solid #cbd5e1;
}

/* Multi-day span bar — full width of the colspan cell, rendered as a pill */
.planner-item-span {
    display: flex;
    align-items: flex-start;
    width: calc(100% - 4px);
    min-height: 32px;
    line-height: 1.3;
    border-radius: 4px;
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    margin: 2px;
    box-sizing: border-box;
}

.planner-item-span:active {
    cursor: grabbing;
}

/* Item being dragged: make semi-transparent so the drag ghost is clearly a copy */
.planner-item.dragging,
.planner-item-span.dragging {
    opacity: 0.35;
}

.planner-item-span:hover {
    opacity: 0.85;
}

/* Draggable cursor on all items */
.planner-item {
    cursor: grab;
}

.planner-item:active {
    cursor: grabbing;
}

/* ─── Mobile responsive ──────────────────────────────────────────────────────── */

@media (max-width: 700px) {
    .employee-planner-page {
        height: auto;
        max-height: none;
    }

    .planner-grid-section {
        min-height: 300px;
        max-height: 50vh;
        overflow: hidden;
    }

    .planner-unplanned-section {
        max-height: 180px;
    }

    .planner-day-header {
        min-width: 60px;
        width: 60px;
    }

    .planner-cell {
        min-width: 60px;
        width: 60px;
    }

    .planner-resource-cell,
    .planner-corner {
        min-width: 100px;
        width: 100px;
    }

    .schedule-view-toggle {
        width: 100%;
    }

    .schedule-view-btn {
        flex: 1;
        text-align: center;
    }
}

/* ── Role / Form action row (shared across Settings, Profile) ── */
.role-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ── Profile page ── */
.profile-danger-section {
    border-top: 2px solid #fee2e2;
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.profile-danger-section h3 {
    color: #dc2626;
}

/* TOTP setup */
.totp-qr-container {
    margin: 1rem 0;
    display: inline-block;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.totp-qr-image {
    display: block;
    width: 200px;
    height: 200px;
    image-rendering: pixelated;
}

.totp-secret {
    display: inline-block;
    padding: 0.4rem 0.65rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.totp-code-input {
    max-width: 14rem;
    font-size: 1.3rem;
    letter-spacing: 0.25em;
    text-align: center;
}

/* ── Profile landing page ── */
.profile-landing {
    padding: 0.5rem 0;
}

.profile-landing-links {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-landing-links li a {
    display: inline-block;
}
