html,
body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: #f4f6f8;
    color: #0f172a;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #111827;
    color: #f8fafc;
}

a {
    color: #2563eb;
}

.mud-button {
    letter-spacing: 0;
    text-transform: none;
    font-weight: 650;
}

.mud-icon-button {
    border-radius: 7px;
}

.app-topbar {
    height: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-inline: 12px;
}

.app-wordmark {
    font-weight: 750;
}

.tenant-chip {
    background: rgba(37, 99, 235, .12);
    border-color: rgba(125, 211, 252, .55) !important;
    color: #dbeafe !important;
}

.user-strip {
    align-items: center;
    color: #f8fafc;
    display: flex;
    gap: 8px;
    margin-left: 6px;
}

.user-strip-link {
    border-radius: 7px;
    padding: 4px 8px;
    text-decoration: none;
}

.user-strip-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
}

.logout-form {
    display: flex;
    margin: 0;
}

.app-drawer {
    border-right: 1px solid #e2e8f0;
}

.app-main {
    background:
        linear-gradient(180deg, #f8fafc 0, #f4f6f8 220px);
}

.app-content {
    box-sizing: border-box;
    padding: 22px 24px 70px;
}

.app-statusbar {
    align-items: center;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #dbe3ec;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(15, 23, 42, .05);
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: .76rem;
    gap: 8px 14px;
    left: 0;
    min-height: 34px;
    padding: 6px 14px;
    position: fixed;
    right: 0;
    z-index: 1250;
}

.app-status-item {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    min-width: 0;
}

.app-status-label {
    color: #94a3b8;
    font-weight: 650;
}

.app-status-item strong {
    color: #334155;
    font-weight: 750;
}

html[data-theme="dark"] a {
    color: #93c5fd;
}

html[data-theme="dark"] .app-drawer,
html[data-theme="dark"] .app-main {
    background: #111827;
}

html[data-theme="dark"] .app-main {
    background: linear-gradient(180deg, #111827 0, #0f172a 220px);
}

html[data-theme="dark"] .app-statusbar,
html[data-theme="dark"] .propilot-grid-pager {
    background: rgba(15, 23, 42, .98);
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .app-status-label,
html[data-theme="dark"] .billing-detail-table td:first-child,
html[data-theme="dark"] .billing-mini-row small,
html[data-theme="dark"] .tenant-control-table td small,
html[data-theme="dark"] .customer-field span,
html[data-theme="dark"] .customer-field small,
html[data-theme="dark"] .document-metadata-table td span,
html[data-theme="dark"] .document-metadata-table td small,
html[data-theme="dark"] .metadata-table td span,
html[data-theme="dark"] .customer-timeline-item span,
html[data-theme="dark"] .customer-timeline-item p,
html[data-theme="dark"] .report-template-button small,
html[data-theme="dark"] .report-source-card small,
html[data-theme="dark"] .report-field-list small,
html[data-theme="dark"] .mail-message-link small,
html[data-theme="dark"] .user-admin-summary small,
html[data-theme="dark"] .role-checkbox small,
html[data-theme="dark"] .entity-user-cell small,
html[data-theme="dark"] .entity-mobile-row small,
html[data-theme="dark"] .entity-detail-table td:first-child,
html[data-theme="dark"] .entity-empty-detail,
html[data-theme="dark"] .propilot-grid-empty,
html[data-theme="dark"] .propilot-grid-pager-controls label,
html[data-theme="dark"] .propilot-grid-card-heading small,
html[data-theme="dark"] .propilot-grid-card-row span {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .app-status-item strong,
html[data-theme="dark"] .nav-meta .mud-typography-body2,
html[data-theme="dark"] .customer-field strong,
html[data-theme="dark"] .customer-field a,
html[data-theme="dark"] .report-template-button,
html[data-theme="dark"] .report-source-card,
html[data-theme="dark"] .report-field-list label,
html[data-theme="dark"] .mail-message-link,
html[data-theme="dark"] .role-checkbox strong,
html[data-theme="dark"] .entity-mobile-row,
html[data-theme="dark"] .propilot-data-table-native td,
html[data-theme="dark"] .propilot-grid-card-title,
html[data-theme="dark"] .propilot-grid-card-row strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .decision-panel,
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .form-panel,
html[data-theme="dark"] .propilot-grid,
html[data-theme="dark"] .billing-panel,
html[data-theme="dark"] .customer-tabs,
html[data-theme="dark"] .report-builder-panel,
html[data-theme="dark"] .mail-outbox-list,
html[data-theme="dark"] .mail-preview-panel,
html[data-theme="dark"] .user-admin-panel,
html[data-theme="dark"] .entity-list-panel,
html[data-theme="dark"] .entity-detail-panel,
html[data-theme="dark"] .propilot-grid-toolbar,
html[data-theme="dark"] .propilot-data-table-native,
html[data-theme="dark"] .propilot-grid-card,
html[data-theme="dark"] .report-template-button {
    background: #1f2937;
    border-color: #334155;
    box-shadow: none;
}

html[data-theme="dark"] .customer-field,
html[data-theme="dark"] .customer-group-pill,
html[data-theme="dark"] .customer-note-item,
html[data-theme="dark"] .customer-planned-card,
html[data-theme="dark"] .workorder-planned-card,
html[data-theme="dark"] .tenant-control-summary,
html[data-theme="dark"] .billing-mini-row,
html[data-theme="dark"] .report-source-card,
html[data-theme="dark"] .report-field-list label,
html[data-theme="dark"] .mail-message-link,
html[data-theme="dark"] .user-admin-card,
html[data-theme="dark"] .role-checkbox,
html[data-theme="dark"] .propilot-view-mode-toggle {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .propilot-data-table-native thead,
html[data-theme="dark"] .propilot-data-table-native th,
html[data-theme="dark"] .report-preview-table th {
    background: #111827;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .propilot-column-resizer::after {
    background: #475569;
}

html[data-theme="dark"] .propilot-data-table-native td,
html[data-theme="dark"] .report-preview-table td,
html[data-theme="dark"] .propilot-grid-card-fields,
html[data-theme="dark"] .customer-detail-section,
html[data-theme="dark"] .mail-preview-tabs {
    border-color: #334155;
}

html[data-theme="dark"] .customer-note-item-warning {
    background: #261c0b;
    border-color: #8a5f1c;
}

html[data-theme="dark"] .customer-group-pill strong,
html[data-theme="dark"] .customer-note-body {
    color: #e2e8f0;
}

html[data-theme="dark"] .auth-form label,
html[data-theme="dark"] .data-form span,
html[data-theme="dark"] .report-input-label,
html[data-theme="dark"] .user-admin-edit-form label > span,
html[data-theme="dark"] .user-active-toggle span {
    color: #cbd5e1;
}

html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .data-form input,
html[data-theme="dark"] .data-form select,
html[data-theme="dark"] .data-form textarea,
html[data-theme="dark"] .report-input-label input,
html[data-theme="dark"] .report-input-label select,
html[data-theme="dark"] .report-filter-row input,
html[data-theme="dark"] .report-filter-row select,
html[data-theme="dark"] .user-admin-edit-form input[type="text"],
html[data-theme="dark"] .user-admin-edit-form input:not([type]),
html[data-theme="dark"] .propilot-page-size {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

html[data-theme="dark"] .nav-shell .mud-nav-link,
html[data-theme="dark"] .nav-shell .mud-nav-group .mud-nav-group-button {
    color: #cbd5e1;
}

html[data-theme="dark"] .nav-shell .mud-nav-link.active,
html[data-theme="dark"] .nav-shell .mud-nav-link:hover,
html[data-theme="dark"] .nav-shell .mud-nav-group .mud-nav-group-button:hover,
html[data-theme="dark"] .report-template-button:hover,
html[data-theme="dark"] .report-template-button.is-active,
html[data-theme="dark"] .mail-message-link:hover,
html[data-theme="dark"] .mail-message-link.is-active,
html[data-theme="dark"] .entity-click-row.is-selected,
html[data-theme="dark"] .entity-mobile-row.is-selected,
html[data-theme="dark"] .saved-view-switch-item.is-active,
html[data-theme="dark"] .propilot-data-table-native tbody tr:hover {
    background: #172554;
    color: #dbeafe;
}

html[data-theme="dark"] .saved-view-switch-count {
    background: rgba(226, 232, 240, .12);
}

.nav-shell {
    min-height: 100%;
    padding: 18px 12px 14px;
}

.nav-brand {
    padding: 0 10px 10px;
}

.nav-brand .mud-typography-h6 {
    font-size: .98rem;
    font-weight: 750;
}

.nav-shell .mud-nav-link {
    border-radius: 7px;
    color: #334155;
    margin-block: 1px;
    min-height: 38px;
}

.nav-shell .mud-nav-link.active,
.nav-shell .mud-nav-link:hover {
    background: #eef4ff;
    color: #1d4ed8;
}

.nav-shell .mud-nav-link .mud-nav-link-icon {
    color: inherit;
}

.nav-shell .mud-nav-group .mud-nav-link {
    min-height: 34px;
    padding-left: 28px;
}

.nav-shell .mud-nav-group .mud-nav-group-button {
    border-radius: 7px;
    color: #334155;
    min-height: 36px;
}

.nav-shell .mud-nav-group .mud-nav-group-button:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav-divider {
    opacity: .65;
}

.nav-meta {
    padding: 8px 10px 0;
}

.nav-meta .mud-typography-caption {
    color: #64748b;
}

.nav-meta .mud-typography-body2 {
    color: #0f172a;
    font-weight: 650;
}

.page-heading {
    gap: 16px;
    margin-bottom: 4px;
    min-width: 0;
}

.page-actions {
    min-height: 38px;
    min-width: 0;
}

.dashboard-actions,
.saved-view-strip {
    flex-wrap: wrap;
}

.saved-view-strip .mud-button-root,
.saved-view-switch-list .mud-button-root {
    min-width: 96px;
}

.saved-view-switch {
    display: flex;
    min-width: 0;
}

.saved-view-switch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.saved-view-switch-menu {
    display: none;
    min-width: 0;
}

.saved-view-switch-item .mud-menu-item-label {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 168px;
}

.saved-view-switch-item.is-active {
    background: #eff6ff;
}

.saved-view-switch-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-view-switch-menu-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.saved-view-switch-count {
    background: rgba(15, 23, 42, .08);
    border-radius: 999px;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    line-height: 1;
    margin-left: 6px;
    min-width: 22px;
    padding: 4px 6px;
}

.metric-card,
.decision-panel,
.settings-panel,
.auth-panel,
.form-panel,
.propilot-grid {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.metric-card {
    min-height: 96px;
    padding: 16px;
}

.metric-card-warn {
    border-color: #fecaca;
    background: #fffafa;
}

.metric-card-ok {
    border-color: #bbf7d0;
    background: #f7fff9;
}

.billing-panel {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-height: 100%;
    padding: 16px;
}

.billing-panel-heading {
    gap: 12px;
    margin-bottom: 12px;
    min-width: 0;
}

.billing-action-form {
    display: inline-flex;
    margin: 0;
    min-width: 0;
}

.mud-alert .mud-alert-message {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.billing-detail-table td:first-child {
    color: #64748b;
    width: 154px;
}

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

.billing-table th,
.billing-table td,
.tenant-control-table th,
.tenant-control-table td {
    vertical-align: middle;
}

.tenant-control-table td strong,
.tenant-control-table td small {
    display: block;
}

.tenant-control-table td small {
    color: #64748b;
    font-size: .75rem;
    margin-top: 2px;
}

.billing-mini-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.billing-mini-row {
    align-items: center;
    border: 1px solid #edf2f7;
    border-radius: 7px;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
}

.billing-mini-row strong,
.billing-mini-row small {
    display: block;
}

.billing-mini-row small {
    color: #64748b;
    font-size: .76rem;
    margin-top: 2px;
}

.tenant-control-shell {
    grid-template-columns: minmax(0, 1.25fr) minmax(420px, .95fr);
}

.tenant-detail-heading {
    padding: 0;
}

.tenant-control-summary {
    border: 1px solid #edf2f7;
    border-radius: 7px;
    min-height: 78px;
    padding: 12px;
}

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

.tenant-control-wide {
    grid-column: 1 / -1;
}

.customer-heading {
    align-items: flex-start !important;
}

.customer-title-wrap {
    min-width: 0;
}

.customer-title-line {
    flex-wrap: wrap;
}

.customer-tabs {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.customer-tab-content {
    padding: 16px;
}

.customer-observation {
    border-radius: 7px;
}

.customer-section-heading {
    gap: 12px;
}

.customer-detail-section {
    border-bottom: 1px solid #e6edf5;
    padding: 16px 0;
}

.customer-detail-section:first-child {
    padding-top: 0;
}

.customer-detail-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.customer-detail-section-heading {
    gap: 12px;
    margin-bottom: 12px;
}

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

.customer-field {
    align-content: start;
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 7px;
    display: grid;
    gap: 3px;
    min-height: 62px;
    padding: 10px 12px;
}

.customer-field span {
    color: #64748b;
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.2;
}

.customer-field strong,
.customer-field a {
    color: #0f172a;
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.customer-field small {
    color: #64748b;
    font-size: .7rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.customer-field-highlight {
    background: #f7fbff;
    border-color: #bfdbfe;
}

.custom-field-section-label {
    display: block;
    font-weight: 700;
    margin: 14px 0 7px;
    text-transform: uppercase;
}

.customer-note-section {
    min-height: 180px;
}

.customer-contact-table td {
    vertical-align: top;
}

.customer-contact-table td > span {
    color: #64748b;
    display: block;
    font-size: .78rem;
    margin-top: 2px;
}

.customer-contact-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

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

.customer-group-pill {
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 7px;
    display: grid;
    gap: 4px;
    min-height: 108px;
    padding: 12px;
}

.customer-group-pill strong {
    color: #0f172a;
    font-size: .92rem;
}

.customer-group-pill span,
.customer-group-pill small {
    color: #64748b;
    line-height: 1.35;
}

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

.customer-note-form {
    border: 1px solid #edf2f7;
    border-radius: 7px;
    grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr) minmax(120px, .7fr) auto;
    margin-top: 12px;
    padding: 12px;
}

.customer-note-form-body {
    grid-column: 1 / -1;
}

.customer-note-form-pin {
    align-items: center;
    display: flex !important;
    gap: 8px;
    min-height: 40px;
}

.customer-note-form-pin input {
    height: 17px;
    width: 17px;
}

.workorder-entry-form,
.ticket-entry-form,
.product-create-form,
.document-metadata-form,
.integration-create-form {
    border: 1px solid #edf2f7;
    border-radius: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 12px;
    padding: 12px;
}

.workorder-entry-check {
    align-items: center;
    display: flex !important;
    gap: 8px;
    min-height: 40px;
}

.workorder-entry-check input {
    height: 17px;
    width: 17px;
}

.workorder-entry-actions {
    align-items: end;
    display: flex;
    justify-content: flex-end;
}

.customer-note-item {
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 7px;
    display: grid;
    gap: 8px;
    padding: 12px;
}

.customer-note-item-warning {
    background: #fff8eb;
    border-color: #f8cf8a;
}

.customer-note-heading {
    gap: 10px;
}

.customer-note-body {
    color: #334155;
    line-height: 1.45;
}

.customer-note-meta {
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: .76rem;
    font-weight: 650;
    gap: 10px;
}

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

.customer-timeline-item {
    align-items: center;
    border: 1px solid #edf2f7;
    border-radius: 7px;
    display: grid;
    gap: 12px;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    padding: 10px 12px;
}

.customer-timeline-item span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 650;
}

.customer-timeline-item p {
    color: #475569;
    margin: 2px 0 0;
}

.customer-mini-table th,
.customer-mini-table td {
    white-space: nowrap;
}

.metadata-table td {
    vertical-align: top;
}

.metadata-table td span {
    color: #64748b;
    display: block;
    font-size: .76rem;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 340px;
}

.document-metadata-table td {
    vertical-align: top;
}

.document-metadata-table td span,
.document-metadata-table td small {
    color: #64748b;
    display: block;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-planned-card {
    align-content: start;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    display: grid;
    gap: 10px;
    min-height: 190px;
    padding: 16px;
}

.workorder-heading {
    align-items: flex-start !important;
}

.workorder-status-panel {
    min-height: 100%;
}

.status-action-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.status-action-strip form {
    margin: 0;
}

.workorder-planned-card {
    align-content: start;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    display: grid;
    gap: 10px;
    min-height: 180px;
    padding: 16px;
}

.report-heading {
    align-items: flex-start !important;
}

.report-export-actions,
.inline-form {
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    margin: 0;
}

.lifecycle-menu-form {
    display: flex;
    margin: 0;
    min-width: 190px;
}

.lifecycle-menu-form .mud-button-root {
    justify-content: flex-start;
    width: 100%;
}

.report-builder-layout {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.report-builder-panel {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 16px;
}

.report-template-list,
.report-source-list,
.report-field-list,
.report-filter-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.report-template-button,
.report-source-card,
.report-field-list label {
    align-items: start;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    color: #111827;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 10px 12px;
    text-align: left;
}

.report-template-button {
    background: #ffffff;
    cursor: pointer;
    width: 100%;
}

.report-template-button:hover,
.report-template-button.is-active {
    border-color: #93c5fd;
    background: #f8fbff;
}

.report-template-button small,
.report-source-card small,
.report-field-list small {
    color: #64748b;
    display: block;
    font-size: .75rem;
    margin-top: 2px;
}

.report-source-card input,
.report-field-list input {
    margin-top: 3px;
}

.report-field-list {
    max-height: 360px;
    overflow: auto;
    padding-right: 4px;
}

.report-field-list label {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 8px 10px;
}

.report-input-label {
    color: #374151;
    display: grid;
    font-size: .82rem;
    font-weight: 650;
    gap: 6px;
}

.report-input-label input,
.report-input-label select,
.report-filter-row input,
.report-filter-row select {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    background: #fbfdff;
    color: #111827;
}

.report-checkbox-label input {
    justify-self: start;
    min-height: 18px;
    width: 18px;
}

.report-section-heading {
    gap: 12px;
}

.report-filter-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .7fr) minmax(180px, 1fr) auto;
}

.report-empty-preview {
    align-items: center;
    display: grid;
    justify-items: center;
    min-height: 260px;
    text-align: center;
}

.report-preview-table-wrap {
    margin-top: 12px;
    max-height: 520px;
    overflow: auto;
}

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

.report-preview-table th,
.report-preview-table td {
    border-bottom: 1px solid #edf2f7;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

.report-preview-table th {
    background: #f8fafc;
    color: #334155;
    font-size: .76rem;
    font-weight: 750;
    position: sticky;
    top: 0;
}

.report-chart {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.report-chart-row {
    display: grid;
    gap: 6px;
}

.report-chart-row span,
.report-chart-row strong {
    color: #334155;
    font-size: .8rem;
}

.report-chart-row div {
    background: #eef2f7;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.report-chart-row i {
    background: #2563eb;
    display: block;
    height: 100%;
}

.mail-outbox-list,
.mail-preview-panel {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-height: 560px;
    padding: 16px;
}

.mail-message-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.mail-message-link {
    align-items: center;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    color: #111827;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
    text-decoration: none;
}

.mail-message-link:hover,
.mail-message-link.is-active {
    border-color: #93c5fd;
    background: #f8fbff;
}

.mail-message-link strong,
.mail-message-link small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-message-link small {
    color: #64748b;
    font-size: .75rem;
    margin-top: 2px;
}

.mail-preview-heading {
    gap: 16px;
    margin-bottom: 12px;
}

.mail-preview-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mail-open-link {
    align-items: center;
    border: 1px solid #93c5fd;
    border-radius: 7px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 750;
    min-height: 30px;
    padding: 5px 10px;
    text-decoration: none;
}

.mail-open-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.mail-preview-tabs {
    border-top: 1px solid #e2e8f0;
}

.mail-html-frame {
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    height: 620px;
    margin-top: 12px;
    width: 100%;
}

.mail-text-preview {
    background: #0f172a;
    border-radius: 7px;
    color: #e2e8f0;
    font: 13px/1.55 "Cascadia Mono", "Consolas", monospace;
    margin: 12px 0 0;
    overflow: auto;
    padding: 16px;
    white-space: pre-wrap;
}

.user-admin-panel {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 16px;
}

.user-admin-heading {
    gap: 12px;
    margin-bottom: 12px;
}

.user-admin-list {
    display: grid;
    gap: 12px;
}

.user-admin-card {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 190px;
    padding: 14px;
}

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

.user-admin-summary {
    align-items: center;
    display: flex;
    gap: 10px;
}

.user-admin-summary strong,
.user-admin-summary small {
    display: block;
}

.user-admin-summary small,
.role-checkbox small {
    color: #64748b;
    font-size: .75rem;
    line-height: 1.35;
}

.user-admin-edit-form label:not(.role-checkbox):not(.user-active-toggle) {
    display: grid;
    gap: 6px;
}

.user-admin-edit-form label > span,
.user-active-toggle span {
    color: #374151;
    font-size: .82rem;
    font-weight: 650;
}

.user-admin-edit-form input[type="text"],
.user-admin-edit-form input:not([type]) {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
}

.role-checkbox-grid {
    display: grid;
    gap: 8px;
}

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

.role-checkbox {
    align-items: start;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    display: grid;
    gap: 9px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px 10px;
}

.role-checkbox input,
.user-active-toggle input[type="checkbox"] {
    height: 17px;
    margin-top: 2px;
    width: 17px;
}

.role-checkbox strong {
    color: #111827;
    display: block;
    font-size: .82rem;
}

.user-active-toggle {
    align-items: center;
    display: flex;
    gap: 8px;
}

.user-admin-meta {
    align-content: start;
    display: grid;
    gap: 8px;
}

.decision-panel,
.settings-panel,
.auth-panel,
.form-panel {
    padding: 18px;
}

.settings-action-cell {
    text-align: right;
    white-space: nowrap;
}

.settings-action-cell form {
    display: inline-flex;
    justify-content: flex-end;
    margin: 0;
}

.auth-panel {
    max-width: 460px;
    margin-top: 40px;
}

.auth-form,
.data-form {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.auth-form label,
.data-form span {
    color: #374151;
    font-size: .82rem;
    font-weight: 650;
}

.auth-form input,
.data-form input,
.data-form select,
.data-form textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 11px;
    background: #fbfdff;
    color: #111827;
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.auth-form input:focus,
.data-form input:focus,
.data-form select:focus,
.data-form textarea:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .11);
}

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

.form-grid label {
    display: grid;
    gap: 6px;
}

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

.propilot-grid {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: calc(100dvh - 156px);
    overflow: hidden;
}

.propilot-grid-toolbar {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.propilot-grid-title {
    min-width: 0;
}

.propilot-grid-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.propilot-view-mode-toggle {
    align-items: center;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    display: flex;
    min-height: 38px;
    padding: 2px;
}

.propilot-column-menu-row {
    align-items: center;
    display: grid;
    gap: 2px;
    grid-template-columns: minmax(180px, 1fr) auto auto auto;
    min-width: 332px;
    padding: 0 4px;
}

.propilot-column-menu-row .mud-checkbox {
    min-width: 0;
}

.propilot-column-menu-actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px;
}

.propilot-column-menu-width {
    color: #64748b;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    min-width: 46px;
    text-align: right;
}

.propilot-grid-search {
    width: 280px;
}

.propilot-grid-table {
    display: block;
    min-height: 0;
    overflow: auto;
}

.propilot-data-table-native {
    border-collapse: collapse;
    background: #ffffff;
    min-width: 100%;
    table-layout: fixed;
    width: max-content;
}

.propilot-data-table-native thead {
    background: #f8fafc;
}

.propilot-data-table-native th {
    background: #f8fafc;
    border-bottom: 1px solid #dbe3ec;
    color: #334155;
    font-size: .76rem;
    font-weight: 750;
    padding: 6px 10px;
    position: sticky;
    text-align: left;
    top: 0;
    white-space: nowrap;
    z-index: 2;
}

.propilot-data-table-native td {
    border-bottom: 1px solid #edf2f7;
    color: #1f2937;
    overflow: hidden;
    padding: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propilot-column-header {
    align-items: center;
    display: flex;
    min-width: 0;
    position: relative;
}

.propilot-column-sort {
    justify-content: flex-start;
    max-width: calc(100% - 10px);
    min-width: 0;
    padding-inline: 0 6px !important;
}

.propilot-column-sort .mud-button-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propilot-column-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    padding-right: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propilot-column-resizer {
    background: transparent;
    border: 0;
    bottom: -6px;
    cursor: col-resize;
    padding: 0;
    position: absolute;
    right: -11px;
    top: -6px;
    touch-action: none;
    width: 16px;
    z-index: 4;
}

.propilot-column-resizer::after {
    background: #cbd5e1;
    border-radius: 999px;
    content: "";
    display: block;
    height: 100%;
    margin-inline: auto;
    opacity: 0;
    transition: opacity .12s ease, background .12s ease;
    width: 2px;
}

.propilot-column-resizer:hover::after,
.propilot-column-resizer:focus-visible::after,
.propilot-column-resizing .propilot-column-resizer::after {
    background: #2563eb;
    opacity: 1;
}

.propilot-column-resizing {
    cursor: col-resize;
    user-select: none;
}

.propilot-data-table-native.is-dense td {
    padding-bottom: 7px;
    padding-top: 7px;
}

.propilot-data-table-native tbody tr:hover {
    background: #f8fbff;
}

.propilot-grid-mode-list .propilot-grid-table {
    display: block;
}

.propilot-grid-mode-list .propilot-grid-cards {
    display: none;
}

.propilot-grid-mode-cards .propilot-grid-table {
    display: none;
}

.propilot-grid-mode-cards .propilot-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.entity-admin-shell {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, .85fr);
}

.entity-list-panel,
.entity-detail-panel {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    min-width: 0;
}

.entity-list-panel {
    overflow: hidden;
}

.entity-detail-panel {
    padding: 16px;
    position: sticky;
    top: 68px;
}

.entity-detail-backdrop {
    display: none;
}

.entity-panel-heading {
    gap: 12px;
    padding: 14px 16px;
}

.entity-panel-tools {
    min-width: 0;
}

.entity-detail-panel > .mud-stack > .entity-panel-heading {
    padding: 0;
}

.entity-search {
    width: 260px;
}

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

.entity-table {
    table-layout: fixed;
}

.entity-table th:nth-child(1) {
    width: 42%;
}

.entity-table th:nth-child(2) {
    width: 88px;
}

.entity-table th:nth-child(3) {
    width: auto;
}

.entity-table th:nth-child(4) {
    width: 128px;
}

.entity-table th,
.entity-table td {
    vertical-align: middle;
    white-space: normal;
}

.entity-click-row {
    cursor: pointer;
}

.entity-click-row.is-selected,
.entity-mobile-row.is-selected {
    background: #eff6ff;
}

.entity-user-cell,
.entity-detail-title {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.entity-detail-title {
    min-width: 220px;
}

.entity-detail-heading-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.entity-detail-close-button {
    margin-right: -6px;
}

.entity-user-cell strong,
.entity-user-cell small,
.entity-detail-title span {
    display: block;
}

.entity-user-cell span,
.entity-mobile-row > span {
    min-width: 0;
}

.entity-user-cell small {
    color: #64748b;
    font-size: .75rem;
}

.entity-row-action-strip {
    align-items: center;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.desktop-row-actions {
    min-width: 138px;
    text-align: right !important;
}

.entity-mobile-list {
    display: none;
}

.entity-mobile-row {
    align-items: start;
    background: #ffffff;
    border: 0;
    border-top: 1px solid #edf2f7;
    color: #111827;
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
    padding: 12px 14px;
    text-align: left;
    width: 100%;
}

.entity-mobile-row strong,
.entity-mobile-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-mobile-row small {
    color: #64748b;
    font-size: .78rem;
}

.entity-detail-table td:first-child {
    color: #64748b;
    width: 112px;
}

.entity-role-chip-list,
.entity-detail-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-empty-detail {
    align-items: center;
    color: #64748b;
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 320px;
    padding: 28px;
    text-align: center;
}

.blazor-form {
    margin-top: 0;
}

.propilot-grid-empty {
    color: #6b7280 !important;
    padding: 22px 16px !important;
    text-align: center;
}

.propilot-grid-pager {
    align-items: center;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 10px 16px;
    z-index: 3;
}

.propilot-grid-pager-controls {
    align-items: center;
    display: flex;
    gap: 8px;
}

.propilot-grid-pager-controls label {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: .76rem;
    gap: 6px;
}

.propilot-page-size {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #111827;
    min-height: 30px;
    padding: 3px 8px;
}

.propilot-grid-cards {
    display: none;
    padding: 12px;
    gap: 10px;
    min-height: 0;
    overflow: auto;
}

.propilot-grid-card {
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #ffffff;
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.propilot-grid-card:hover {
    border-color: #b9c8dc;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.propilot-grid-card-header {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.propilot-grid-card-icon {
    align-items: center;
    background: #eef4ff;
    border: 1px solid #d7e3f8;
    border-radius: 7px;
    color: #1d4ed8;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.propilot-grid-card-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.propilot-grid-card-title {
    color: #0f172a !important;
    display: -webkit-box;
    font-size: .96rem;
    font-weight: 750;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
}

.propilot-grid-card-heading small {
    color: #64748b;
    font-size: .78rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propilot-grid-card-badge {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 999px;
    color: #0f766e;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    max-width: 132px;
    overflow: hidden;
    padding: 6px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.propilot-grid-card-fields {
    border-top: 1px solid #edf2f7;
    display: grid;
    gap: 0;
    padding-top: 8px;
}

.propilot-grid-card-row {
    display: grid;
    grid-template-columns: minmax(88px, 38%) minmax(0, 1fr);
    gap: 12px;
    padding: 6px 0;
}

.propilot-grid-card-row span {
    color: #6b7280;
    font-size: .76rem;
    font-weight: 650;
}

.propilot-grid-card-row strong {
    color: #111827;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 1180px) {
    .customer-field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .app-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding: 14px;
    }

    .app-topbar .tenant-chip,
    .user-strip-link .mud-typography {
        display: none;
    }

    .page-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .page-heading > .mud-stack,
    .page-heading > div[role="group"],
    .page-heading .mud-typography {
        max-width: calc(100vw - 28px);
        min-width: 0;
        overflow-wrap: break-word;
        white-space: normal;
    }

    .page-heading > div[role="group"] {
        width: 100%;
    }

    .customer-title-wrap {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .page-actions {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .billing-panel-heading {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .page-actions > .mud-button-root,
    .page-actions .billing-action-form,
    .page-actions .billing-action-form .mud-button-root,
    .billing-panel-heading .billing-action-form,
    .billing-panel-heading .billing-action-form .mud-button-root {
        width: 100%;
    }

    .saved-view-switch {
        width: 100%;
    }

    .saved-view-switch-list {
        display: none;
    }

    .saved-view-switch-menu {
        display: block;
        width: 100%;
    }

    .saved-view-switch-menu .mud-button-root {
        justify-content: flex-start;
        width: 100%;
    }

    .saved-view-switch-popover {
        max-width: calc(100vw - 28px);
        min-width: min(320px, calc(100vw - 28px));
    }

    .page-actions .mud-chip-container {
        align-self: flex-start;
    }

    .billing-panel-heading .mud-chip-container {
        align-self: flex-start;
    }

    .propilot-grid-toolbar {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .propilot-grid-toolbar > .mud-stack-row,
    .propilot-grid-tools {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .propilot-view-mode-toggle {
        align-self: flex-start;
    }

    .propilot-grid-search,
    .propilot-grid-search .mud-input-control,
    .propilot-grid-tools .mud-button-root {
        width: 100%;
    }

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

    .propilot-grid-mode-list .propilot-grid-table {
        display: block;
        overflow: auto;
    }

    .propilot-grid-mode-list .propilot-grid-cards {
        display: none;
    }

    .propilot-grid-mode-list .propilot-data-table-native,
    .propilot-grid-mode-list .propilot-data-table-native tbody,
    .propilot-grid-mode-list .propilot-data-table-native tr,
    .propilot-grid-mode-list .propilot-data-table-native td {
        display: block;
    }

    .propilot-grid-mode-list .propilot-data-table-native thead {
        display: none;
    }

    .propilot-grid-mode-list .propilot-data-table-native tr {
        border-top: 1px solid #edf2f7;
        padding: 11px 14px;
    }

    .propilot-grid-mode-list .propilot-data-table-native td {
        border-bottom: 0;
        color: #1f2937;
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(84px, 34%) minmax(0, 1fr);
        padding: 3px 0;
        white-space: normal;
    }

    .propilot-grid-mode-list .propilot-data-table-native td:nth-child(n+5) {
        display: none;
    }

    .propilot-grid-mode-list .propilot-data-table-native td::before {
        color: #64748b;
        content: attr(data-label);
        font-size: .76rem;
        font-weight: 650;
    }

    .propilot-grid-mode-cards .propilot-grid-table {
        display: none;
    }

    .propilot-grid-mode-cards .propilot-grid-cards {
        display: grid;
        grid-template-columns: 1fr;
    }

    .propilot-grid-pager {
        align-items: stretch;
        flex-direction: column;
    }

    .propilot-grid-pager-controls {
        justify-content: space-between;
    }

    .customer-tab-content {
        padding: 12px;
    }

    .customer-field-grid {
        grid-template-columns: 1fr;
    }

    .customer-note-form {
        grid-template-columns: 1fr;
    }

    .customer-note-form-body {
        grid-column: auto;
    }

    .workorder-entry-form,
    .ticket-entry-form,
    .product-create-form,
    .document-metadata-form,
    .integration-create-form {
        grid-template-columns: 1fr;
    }

    .workorder-entry-actions,
    .workorder-entry-actions .mud-button-root {
        width: 100%;
    }

    .customer-chip-list {
        grid-template-columns: 1fr;
    }

    .customer-detail-section-heading {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .customer-section-heading {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .status-action-strip,
    .status-action-strip form,
    .status-action-strip .mud-button-root {
        width: 100%;
    }

    .report-builder-layout {
        grid-template-columns: 1fr;
    }

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

    .mail-outbox-list,
    .mail-preview-panel {
        min-height: auto;
    }

    .mail-message-link {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .mail-preview-heading {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .mail-html-frame {
        height: 560px;
    }

    .entity-admin-shell {
        grid-template-columns: 1fr;
    }

    .entity-detail-panel {
        display: none;
    }

    .entity-detail-panel.is-open {
        background: #ffffff;
        border: 0;
        border-radius: 0;
        bottom: 0;
        box-shadow: none;
        display: block;
        left: 0;
        min-height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 14px;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1300;
    }

    .entity-detail-backdrop {
        background: rgba(15, 23, 42, .22);
        border: 0;
        bottom: 0;
        display: block;
        left: 0;
        padding: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1290;
    }

    .entity-detail-heading-actions {
        justify-content: space-between;
    }

    .entity-panel-heading {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .entity-panel-tools {
        align-items: stretch !important;
        width: 100%;
    }

    .entity-search,
    .entity-search .mud-input-control {
        width: 100%;
    }

    .entity-table-wrap {
        display: none;
    }

    .entity-mobile-list {
        display: grid;
    }

    .entity-mobile-row .mud-chip-container,
    .entity-mobile-row .mud-chip {
        justify-self: start;
        width: auto;
    }

    .desktop-row-actions {
        display: none;
    }

    .entity-detail-actions,
    .entity-detail-actions .mud-button-root {
        width: 100%;
    }

    .billing-mini-row,
    .tenant-control-form {
        grid-template-columns: 1fr;
    }

    .tenant-control-wide {
        grid-column: auto;
    }

    .user-admin-card,
    .user-role-grid {
        grid-template-columns: 1fr;
    }

    .report-export-actions .mud-button-root,
    .inline-form {
        width: 100%;
    }

    .customer-timeline-item {
        align-items: start;
        grid-template-columns: 1fr;
    }
}
