* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--sidebar-bg);
    color: var(--md-on-accent);
    border-right: 1px solid var(--sidebar-border);
    padding: 18px 14px;
    transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease;
    overflow-x: hidden;
}
.brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 6px 8px 18px 8px;
    border-bottom: 1px solid var(--sidebar-border);
}
.brand-logo { display: flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 10px; background: var(--primary); font-weight: 700; }
.brand-title { font-size: 17px; font-weight: 700; }
.brand-subtitle { color: var(--md-sidebar-muted); font-size: 12px; margin-top: 3px; }
.menu { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.menu-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--md-sidebar-text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    white-space: nowrap;
}
.menu-link:hover, .menu-link.active { background: var(--md-sidebar-overlay); color: var(--md-on-accent); }
.menu-link-admin { border: 1px solid var(--md-sidebar-border); }
.content { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; background: var(--md-surface); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 24px; font-weight: 600; }
.page-subtitle { margin-top: 4px; color: var(--muted); }
.topbar-actions, .toolbar, .actions { display: flex; align-items: center; gap: 8px; }
.page { padding: 10px; }
.view { display: none; }
.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 18px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
/*.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; }*/
.metric-card { padding: 18px; }
.metric-title { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 10px; font-size: 30px; font-weight: 700; }
.card-header h2 { margin: 0; font-size: 18px; }
.card-subtitle { margin-top: 4px; color: var(--muted); font-size: 13px; }
.form-body { display: flex; flex-direction: column; gap: 9px; padding: 18px; }
.form-body label { color: var(--muted); font-weight: 600; font-size: 12px; }
.input { min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--md-surface); color: var(--text); padding: 8px 10px; }
.textarea { min-height: 96px; font-family: monospace; }
.table-wrapper { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table tr:hover { background: var(--md-surface-soft); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.badge-info { background: var(--md-info-soft); color: var(--md-info); }
.badge-success {
    background: var(--md-success-soft);
    color: var(--md-success);
}

.badge-muted {
    background: var(--md-surface-soft);
    color: var(--muted);
}

.status-firing { color: var(--danger) !important; font-weight: 700; }
.status-acknowledged { color: var(--warning); font-weight: 700; }
.status-resolved { color: var(--success); font-weight: 700; }
.status-silenced { color: var(--muted); font-weight: 700; }
.btn { border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--primary); color: var(--md-on-accent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-small { padding: 6px 9px; font-size: 12px; margin-right: 5px;}
.btn-warning { background: var(--warning); color: var(--md-on-accent); }
.btn-success { background: var(--success); color: var(--md-on-accent); }

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

details {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--md-surface-soft);
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--muted);
}

.btn-danger {
    background: var(--danger);
    color: var(--md-on-accent);
}

.btn-info {
    background: var(--info);
    color: var(--md-on-accent);
}

.help-text {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}


.token-box {
    border: 1px dashed var(--primary);
    background: var(--md-surface-hover);
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}


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

.detail-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--md-surface-soft);
}

.detail-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-value {
    word-break: break-word;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--md-surface-soft);
}


.login-body {
    background: var(--bg);
}

.login-page {
    width: min(520px, calc(100vw - 32px));
    margin: 80px auto;
}

.btn-resolve {
    background: var(--success);
    color: var(--md-on-accent);
    border: 1px solid var(--md-success);
}

.btn-resolve:hover {
    filter: brightness(0.95);
}

.menu-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--sidebar-border);
}

.menu-section-title {
    color: var(--md-sidebar-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    text-transform: uppercase;
}

.menu-sub-link {
    margin-left: 8px;
}

.view-visible {
    display: block !important;
}

.is-hidden {
    display: none !important;
}

.data-table td.actions {
    display: table-cell;
}
.icon-sprite {
    display: none;
}


.sidebar.is-collapsed {
    width: 72px;
    flex-basis: 72px;
    padding-left: 10px;
    padding-right: 10px;
}


.brand-link {
    display: flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.brand-logo-full {
    display: block;
    width: 210px;
    height: 56px;
    object-fit: contain;
}

.brand-logo-icon {
    display: none;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.sidebar-toggle {
    position: absolute;
    right: -6px;
    top: 15px;
    width: 24px;
    height: 24px;
    border: 1px solid var(--sidebar-border);
    border-radius: 999px;
    background: var(--md-sidebar-bg-2);
    color: var(--md-on-accent);
    cursor: pointer;
    line-height: 1;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--md-surface-hover);
}


.menu-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-icon path,
.menu-icon circle {
    vector-effect: non-scaling-stroke;
}

.menu-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.is-collapsed .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.is-collapsed .brand-link {
    justify-content: center;
}

.sidebar.is-collapsed .brand-logo-full {
    display: none;
}

.sidebar.is-collapsed .brand-logo-icon {
    display: block;
}

.sidebar.is-collapsed .sidebar-toggle {
    right: -2px;
}

.sidebar.is-collapsed .menu-link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.is-collapsed .menu-text,
.sidebar.is-collapsed .menu-section-title {
    display: none;
}

.sidebar.is-collapsed .menu-sub-link {
    margin-left: 0;
}

.sidebar.is-collapsed .menu-section {
    padding-top: 10px;
}

@media (max-width: 980px) {
    .layout {
        flex-direction: column;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar,
    .sidebar.is-collapsed {
        width: 100%;
        flex-basis: auto;
        padding: 18px 14px;
    }

    .sidebar.is-collapsed .brand-logo-full {
        display: block;
    }

    .sidebar.is-collapsed .brand-logo-icon {
        display: none;
    }

    .sidebar.is-collapsed .menu-link {
        justify-content: flex-start;
        gap: 11px;
        padding: 10px 12px;
    }

    .sidebar.is-collapsed .menu-text,
    .sidebar.is-collapsed .menu-section-title {
        display: inline;
    }

    .sidebar-toggle {
        display: none;
    }
}
/* Reusable summary cards */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 14px;
}

.summary-grid.summary-grid-5 {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

/*.summary-card {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    gap: 14px;*/
/*    min-height: 112px;*/
/*    padding: 18px;*/
/*    border: 1px solid var(--border);*/
/*    border-radius: 16px;*/
/*    background: var(--md-surface);*/
/*    box-shadow: var(--shadow);*/
/*}*/

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    font-size: 22px;
    font-weight: 800;
}

.summary-primary .summary-icon {
    color: var(--md-primary);
    background: var(--md-primary-soft);
}

.summary-success .summary-icon {
    color: var(--md-success);
    background: var(--md-success-soft);
}

.summary-warning .summary-icon {
    color: var(--md-warning);
    background: var(--md-warning-soft);
}

.summary-danger .summary-icon {
    color: var(--md-danger);
    background: var(--md-danger-soft);
}

.summary-info .summary-icon {
    color: var(--md-info);
    background: var(--md-info-soft);
}

.summary-muted .summary-icon {
    color: var(--md-text-soft);
    background: var(--md-surface-soft);
}

.summary-title {
    color: var(--md-text-soft);
    font-size: 13px;
    font-weight: 700;
}

.summary-value {
    margin-top: 4px;
    color: var(--md-text);
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.summary-hint {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1300px) {
    .summary-grid,
    .summary-grid.summary-grid-5 {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 760px) {
    .summary-grid,
    .summary-grid.summary-grid-5 {
        grid-template-columns: 1fr;
    }
}
/*.page-toolbar {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    gap: 10px;*/
/*    padding: 14px 18px;*/
/*    border-top: 1px solid var(--border);*/
/*    border-bottom: 1px solid var(--border);*/
/*    background: var(--md-surface-soft);*/
/*}*/

.page-toolbar-search {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.page-toolbar-search .input {
    width: 100%;
    padding-left: 34px;
}

.page-toolbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.page-toolbar-filter {
    min-width: 90px;
}
.first-div-page-layout {
    display: flex;
    flex-direction: column;
}

@media (max-width: 900px) {
    .page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .page-toolbar-search,
    .page-toolbar-filter {
        width: 100%;
        min-width: 100%;
    }
}
.page-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}
.page-details-card {
    position: sticky;
    top: 18px;
}

@media (max-width: 1300px) {
    .page-layout-grid {
        grid-template-columns: 1fr;
    }

    .page-details-card {
        position: static;
    }
}
.card-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: max-content;
}

.card-header-actions .btn {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .card-header-actions {
        justify-content: flex-start;
        width: 100%;
    }
}
.details-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.details-item {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--md-surface-soft);
}

.details-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.details-value {
    margin-top: 4px;
    color: var(--md-text);
    font-size: 13px;
    font-weight: 800;
    word-break: break-word;
}

.details-empty {
    padding: 16px;
    border-radius: 14px;
    color: var(--muted);
    background: var(--md-surface-soft);
    font-size: 13px;
    line-height: 1.45;
}

.details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.details-header {
    padding: 16px 18px;
}
.details-body {
    padding: 16px 18px 18px;
}
.details-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.details-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    color: var(--md-on-accent);
    background: var(--md-brand-gradient);
    font-weight: 800;
}

.details-name {
    color: var(--md-text);
    font-size: 18px;
    font-weight: 800;
}

.details-code {
    margin-top: 6px;
    padding: 10px;
    border-radius: 10px;
    background: var(--md-code-bg);
    color: var(--md-code-text);
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
@media (max-width: 1300px) {
    .details-card {
        position: static;
    }
}
.row-disabled {
    opacity: 0.65;
}
.pill,
.team-pill,
.status-pill,
.token-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.pill {
    color: var(--md-primary);
    background: var(--md-primary-soft);
}

.token-pill {
    color: var(--md-text-soft);
    background: var(--md-surface-soft);
}

.status-enabled {
    color: var(--md-success);
    background: var(--md-success-soft);
}

.status-disabled {
    color: var(--md-text-soft);
    background: var(--md-surface-soft);
}
.status-active,
.escalation-enabled {
    color: var(--md-success);
    background: var(--md-success-soft);
}
.status-expired {
    color: var(--md-warning);
    background: var(--md-warning-soft);
}
.status-inactive,
.escalation-disabled {
    color: var(--md-text-soft);
    background: var(--md-surface-soft);
}

.role-rw {
    color: var(--md-primary);
    background: var(--md-primary-soft);
}

.app-modal-dialog-small {
    width: min(460px, calc(100vw - 32px));
}

.app-dialog-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.app-dialog-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.app-dialog-message {
    color: var(--text);
    line-height: 1.5;
    white-space: pre-line;
}

.app-dialog-error .app-dialog-icon {
    background: var(--md-danger-soft);
    color: var(--danger);
}

.app-dialog-warning .app-dialog-icon {
    background: var(--md-warning-soft);
    color: var(--md-warning);
}

.app-dialog-success .app-dialog-icon {
    background: var(--md-success-soft);
    color: var(--md-success);
}

.app-dialog-info .app-dialog-icon {
    background: var(--md-primary-soft);
    color: var(--primary);
}
.sortable-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-table th[data-sort]:hover {
    text-decoration: underline;
}

.sortable-table th[data-sort] .sort-indicator {
    opacity: 0.45;
    font-size: 0.85em;
}

.sortable-table th[data-sort].is-sorted .sort-indicator {
    opacity: 1;
    font-weight: 700;
}
.clickable-summary-card {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.clickable-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.clickable-summary-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.clickable-summary-card:active {
    transform: translateY(0);
}
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon i {
    pointer-events: none;
}

.actions,
.table-actions,
.details-actions {
    gap: 6px;
    /*padding-top: 10px;*/
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.empty-cell {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--md-text-soft);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}
.row-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}
@keyframes app-scroll-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.45);
        border-color: var(--primary);
        background: var(--md-surface-hover);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(74, 144, 226, 0);
    }

    100% {
        box-shadow: inherit;
    }
}

.app-scroll-highlight {
    animation: app-scroll-highlight 1.45s ease-out;
}

.app-sticky-x-scroll {
    position: fixed;
    left: 0;
    right: auto;
    bottom: 0;
    height: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 2500;
    background: var(--md-surface-glass);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(20, 30, 45, 0.08);
}

.app-sticky-x-scroll.is-hidden {
    display: none !important;
}

.app-sticky-x-scroll-inner {
    height: 1px;
}

body.has-app-sticky-x-scroll {
    padding-bottom: 18px;
}
.alerts-escalation-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}
.status-scheduled {
    background: var(--md-warning-soft);
    color: var(--md-warning);
    border: 1px solid var(--md-warning-border);
}
.filters-row,
.toolbar-filters,
.page-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-search {
    flex: 1 1 320px;
    min-width: 240px;
}

.filter-select {
    flex: 0 1 260px;
    min-width: 220px;
}

@media (max-width: 768px) {
    .filter-search,
    .filter-select {
        flex: 1 1 100%;
        width: 100%;
    }
}
.service-context {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.service-context-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-context-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.service-context-header h3 {
    margin: 0;
    font-size: 14px;
}

.service-context-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-context-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--md-surface-soft);
}

.service-context-item-main {
    min-width: 0;
}

.service-context-item-title,
.service-context-item-main a {
    color: var(--md-text);
    font-weight: 800;
    text-decoration: none;
    word-break: break-word;
}

.service-context-item-main a:hover {
    text-decoration: underline;
}
.alert-service-context {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--md-surface-soft);
}

.alert-service-context-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.alert-service-context-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}

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

.alert-service-context-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.alert-service-context-section h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--md-text-soft);
}

.alert-service-context-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-service-context-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--md-surface);
    color: var(--md-text);
    text-decoration: none;
}

.alert-service-context-link:hover {
    border-color: var(--md-primary);
    background: var(--md-surface-hover);
}

.alert-service-context-title {
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-service-context-meta {
    color: var(--md-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .alert-service-context-grid {
        grid-template-columns: 1fr;
    }
}
/* Services page tabs */

.page-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--md-surface-soft);
    overflow-x: auto;
}

.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--md-text-soft);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.page-tab:hover {
    background: var(--md-surface-hover);
    color: var(--md-text);
}

.page-tab.is-active {
    background: var(--md-surface);
    color: var(--md-text);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.page-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--md-primary-soft);
    color: var(--md-primary);
    font-size: 12px;
    font-weight: 900;
}

.page-layout-grid.is-full-width {
    grid-template-columns: minmax(0, 1fr) !important;
}

.services-tab-panel {
    min-width: 0;
}

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

.form-grid-3 > div {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

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

.form-grid-4 > div {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.table-cell-truncate,
.table-cell-truncate-wide {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-cell-truncate-wide {
    max-width: 360px;
}

.table-cell-truncate > *,
.table-cell-truncate-wide > * {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.name-button {
    display: inline;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--md-text);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

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

.json-editr {
    min-height: 160px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre;
}

@media (max-width: 900px) {
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}
#business-services-page-layout.is-full-width,
#services-page-layout.is-full-width {
    grid-template-columns: minmax(0, 1fr);
}

#business-services-page-layout.is-full-width .page-layout-main,
#services-page-layout.is-full-width .page-layout-main {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
}

#business-services-page-layout.is-full-width #service-details-card,
#services-page-layout.is-full-width #service-details-card {
    display: none !important;
}

#business-services-page-layout.is-full-width .services-tab-panel,
#services-page-layout.is-full-width .services-tab-panel {
    width: 100%;
    max-width: none;
}
.impact-row-major-outage {
    border-left: 4px solid var(--md-major-outage);
    background: var(--md-danger-soft);
}

.impact-row-partial-outage {
    border-left: 4px solid var(--md-partial-outage);
    background: var(--md-warning-soft);
}

.impact-row-degraded {
    border-left: 4px solid var(--md-degraded);
    background: var(--md-warning-soft);
}
.app-checkbox-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.app-checkbox-field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
}

.app-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-checkbox-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.app-checkbox-description {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}

.profile-oncall-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.profile-oncall-status-active {
    background: var(--md-success-soft);
    color: var(--md-success);
}

.profile-oncall-status-idle {
    background: var(--md-surface-soft);
    color: var(--md-text-soft);
}

.profile-oncall-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-oncall-next-header {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.profile-oncall-slot {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.profile-oncall-slot-title {
    color: var(--text);
    font-weight: 700;
}

.profile-oncall-slot-meta,
.profile-oncall-slot-time,
.profile-oncall-slot-reason,
.profile-oncall-empty {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.topbar-user-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.topbar-oncall-indicator {
    display: inline-flex;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid var(--md-surface);
    box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.16);
}

.topbar-oncall-active {
    background: var(--md-operational);
    color: var(--md-operational);
}

.topbar-oncall-idle,
.topbar-oncall-unknown {
    background: var(--md-muted);
    color: var(--md-muted);
}

.topbar-icon {
    width: 18px;
    height: 18px;
}
.topbar-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.topbar-icon-button:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.topbar-icon-button .fa-solid {
    font-size: 16px;
    line-height: 1;
}
.topbar-oncall-escalation {
    color: var(--md-partial-outage);
}
.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0;
}


.text-right {
    text-align: right;
}

.small {
    font-size: 0.875rem;
}

.muted {
    color: var(--text-muted);
}
.notification-center-mount {
    display: inline-flex;
    align-items: center;
}

.notification-center-root {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-center-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
}

.notification-center-button:hover {
    background: var(--surface-hover);
}

.notification-center-button i {
    font-size: 18px;
    line-height: 1;
}

.notification-center-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    color: var(--md-on-accent);
    background: var(--md-danger);
}

.notification-center-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(420px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 80px));
    overflow: auto;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.22));
    padding: 12px;
    z-index: 1200;
}

.notification-center-title {
    font-weight: 700;
    padding: 8px 8px 12px;
}

.notification-center-empty {
    padding: 16px 8px;
    color: var(--text-muted);
}

.notification-center-item {
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--surface-variant);
}

.notification-center-item-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.notification-center-item-body {
    font-size: 13px;
    margin-bottom: 8px;
}

.notification-center-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.notification-center-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.notification-center-open {
    display: inline-flex;
    font-size: 13px;
}

/* Heartbeats */
body.md-theme .heartbeat-form-dialog {
    width: min(980px, calc(100vw - 48px));
}

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

.form-grid-2 > .form-group,
.form-grid > .form-group,
.form-stack > .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-grid-2 label,
.form-stack label {
    font-weight: 750;
    color: var(--text);
}

.form-stack {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.form-row-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 650;
}

@media (max-width: 760px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}

#heartbeats-page-layout.is-full-width .page-layout-main {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
}

body.md-theme #heartbeats-page-layout .table-wrapper {
    width: 100%;
}
