/* This file contains the shared detail pages styles used by more than one page. */

/* From incidents/incident_details */

.detail-facts-bar .status-chip {
    font-size: 12px;
    padding: 1px 10px;
}

.detail-facts-bar .status-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tab-bar {
    display: flex !important;
    align-items: flex-end;
    gap: 4px;
    padding: 0 12px !important;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-bar .switch-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 46px;
    padding: 0 10px !important;
    margin: 0;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent !important;
    font: 600 13px var(--font) !important;
    color: var(--muted) !important;
    white-space: nowrap;
    cursor: pointer;
    transition: color 120ms ease;
}

.tab-bar .switch-tab:hover {
    color: var(--text) !important;
}

.tab-bar .switch-tab.active {
    color: var(--text) !important;
    border-bottom-color: var(--accent) !important;
}

.tab-bar .switch-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -4px;
    border-radius: 6px;
}

.tab-item-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font: 600 11px/1 var(--font);
    font-variant-numeric: tabular-nums;
}

.switch-tab.active .tab-item-count {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

/* facts under the title */
.detail-facts-bar .detail-fact-label {
    color: var(--muted);
    font-weight: 500;
}

.detail-fact-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.detail-fact-group > .detail-fact-label {
    margin-right: 2px;
    white-space: nowrap;
}

.detail-fact-group > .detail-fact-label::after {
    content: ":";
}

.detail-facts-bar .detail-fact-link {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    height: 24px;
    padding: 0 9px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font: 600 12.5px/1 var(--font);
    color: var(--accent-ink) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
}

.detail-facts-bar .detail-fact-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.detail-fact-none {
    color: var(--faint);
}

@media (max-width: 767.98px) {
    .detail-fact-group {
        flex-wrap: wrap;
    }
}

/* From routines/routine_details */

/* Routine details */

/* full width */
:is(html.routine-details-page, html.policy-details-page) .page-frame {
    max-width: none;
}

:is(html.routine-details-page, html.policy-details-page) main {
    min-width: 0;
}

/* header */
:is(html.routine-details-page, html.policy-details-page) main .page-header {
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    margin-bottom: 16px !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}

.page-header-titles {
    min-width: 0;
    flex: 1 1 auto;
}

.page-header-titles .pg-back-text {
    display: block;
    margin: 0 0 6px !important;
}

.page-header-titles .pg-back-text a {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.page-header-titles .pg-back-text a:hover .back-arrow-icon {
    transform: translateX(-2px);
}

.page-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.page-header-title .h-class {
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(html.routine-edit-mode, html.policy-edit-mode) .page-header-title .edit-pill-button {
    display: inline-flex;
}

.page-header-actions {
    padding-top: 22px;
}

.page-header-actions > div {
    display: flex;
    align-items: center;
    gap: 8px;
    height: auto !important;
}

.page-header-actions > div[hidden] {
    display: none !important;
}

:is(html.routine-edit-mode, html.policy-edit-mode) main .page-header {
    position: sticky;
    top: var(--top-h);
    z-index: 25;
    margin-left: calc(var(--gutter) * -1) !important;
    margin-right: calc(var(--gutter) * -1) !important;
    padding: 12px var(--gutter) 14px !important;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* sections */
.details-section {
    margin: 0 0 20px !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none;
}

.details-section-head {
    display: flex;
    align-items: baseline;
    gap: 4px 12px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}

.details-section-head h2 {
    margin: 0;
    font: 700 15px/1.3 var(--font);
    letter-spacing: -0.01em;
    color: var(--text);
}

.details-section-head p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* details */
html.routine-details-page:not(.routine-edit-mode) .routine-details-section,
html.policy-details-page:not(.policy-edit-mode) .routine-details-section {
    display: none !important;
}

.routine-details-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-xs);
}

.routine-details-field {
    margin: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
}

.routine-details-field[hidden] {
    display: none !important;
}

.routine-details-field label {
    display: block;
    margin: 0 0 6px !important;
    font: 600 12.5px/1.3 var(--font) !important;
    color: var(--text-2) !important;
}

.routine-details-field .form-control,
.routine-details-field .form-select {
    height: 38px;
    font: 500 14px var(--font) !important;
    color: var(--text) !important;
}

@media (max-width: 767.98px) {
    :is(html.routine-details-page, html.policy-details-page) main .page-header {
        flex-wrap: wrap !important;
        gap: 12px;
    }

    .page-header-actions > div {
        width: 100%;
    }

    .facts-bar .detail-fact-group {
        flex-wrap: wrap;
    }

    .routine-details-form {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px 16px !important;
    }
}

/* From services/service_details */

.details-fact-link:hover {
    background: var(--surface-3);
}

.details-fact-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.details-fact-link b {
    font-weight: 600;
    color: var(--text);
}

.details-fact-link .detail-fact-label {
    color: var(--muted);
    font-weight: 500;
}

/* tabs */
.details-tab-row {
    margin: 12px 0 20px !important;
}

.details-tabs {
    padding: 0 !important;
    margin: 0 !important;
    gap: 8px;
    background: transparent !important;
}

.details-tabs .switch-tab {
    height: 42px;
    padding: 0 4px !important;
    margin-right: 12px;
}

.details-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-xs);
    min-width: 0;
}

.details-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 14px 20px;
    border-bottom: 1px solid var(--border);
}

.details-card-head h2 {
    margin: 0;
    font: 700 15px/1.3 var(--font);
    letter-spacing: -0.01em;
    color: var(--text);
}

.details-card-head p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

/* summary rows */
.summary-list {
    margin: 0;
    padding: 4px 0;
    list-style: none;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
}

.summary-item + .summary-item {
    border-top: 1px solid var(--border);
}

.summary-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--text-2);
}

.summary-item.is-warn .summary-icon {
    background: var(--warn-soft);
    color: var(--warn);
}

.summary-row-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.summary-row-text > b {
    font: 650 14px/1.3 var(--font);
    color: var(--text);
}

.summary-row-text > span {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
}

.summary-row-text > span b {
    font-weight: 600;
    color: var(--text-2);
}

.summary-row-value {
    flex: none;
    max-width: 45%;
    display: flex;
    justify-content: flex-end;
}

.service-support-days {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 14px !important;
}

.service-support-days .btn-group-days {
    flex: none;
    min-width: 46px;
    height: 32px;
    padding: 0 10px !important;
    border-radius: 7px !important;
    border: 1px solid var(--border-strong) !important;
    background: var(--surface) !important;
    color: var(--text-2) !important;
    font: 600 12.5px var(--font) !important;
}

.service-support-days .btn-group-days.active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--on-accent) !important;
}

.service-details-table,
#divTblIntegrations {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto;
}

.service-details-table .tc-table,
#divTblIntegrations .tc-table {
    table-layout: fixed;
    min-width: 760px;
}

.service-details-table .tc-table th,
.service-details-table .tc-table td,
#divTblIntegrations .tc-table th,
#divTblIntegrations .tc-table td {
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-details-table .tc-table td,
#divTblIntegrations .tc-table td {
    height: 48px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: none !important;
}

.service-details-table .no-results,
#divTblIntegrations .no-results {
    display: block !important;
    margin: 0 !important;
    padding: 22px 20px !important;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r);
    font: 500 13px var(--font) !important;
    font-style: normal !important;
    color: var(--muted) !important;
    text-align: left !important;
}

/* recent changes */
#divTblRecentChanges th:nth-child(1) {
    width: 52px;
}

#divTblRecentChanges th:nth-child(3) {
    width: 186px;
}

#divTblRecentChanges th:nth-child(4) {
    width: 150px;
}

#divTblRecentChanges th:nth-child(5) {
    width: 120px;
}

#tbl_recent_changes td:first-child > span {
    height: 22px !important;
    padding: 0 !important;
}

#tbl_recent_changes td {
    white-space: nowrap !important;
}

#tbl_recent_changes td:nth-child(3) {
    white-space: nowrap !important;
}

#tbl_recent_changes td > div > a {
    display: inline !important;
    padding: 0 !important;
}

/* integrations */
#divTblIntegrations th:nth-child(1) {
    width: 90px;
}

#divTblIntegrations th:nth-child(2) {
    width: 34%;
}

@media (max-width: 767.98px) {
    .summary-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px 14px;
        padding: 14px 16px;
    }

    .summary-row-text {
        flex: 1 1 0;
    }

    .summary-row-value {
        flex: 0 0 100%;
        max-width: 100%;
        justify-content: flex-start !important;
        padding-left: 48px;
        min-width: 0;
    }

    .details-card-head {
        padding: 12px 12px 12px 16px;
    }
}

/* From users/user_list */

/* Users and teams lists */

html.list-page main .list-page-header.page-heading-bar {
    align-items: center !important;
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

html.list-page .page-frame {
    min-height: calc(100vh - var(--top-h) - 1px);
    min-height: calc(100dvh - var(--top-h) - 1px);
}

@media (max-width: 767.98px) {
    html.list-page main .list-page-header.page-heading-bar {
        flex-wrap: wrap !important;
        row-gap: 12px;
    }
}

/* From conditional_routing/conditional_routing_details */

/* Conditional routing details (shared by the other editors) */

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .page-frame {
    max-width: none;
}

.form-page-head .details-status-chip[hidden] {
    display: none;
}

.form-page-head .edit-pill-button.is-on {
    display: inline-flex;
}

@media (max-width: 767.98px) {
    :is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .service-support-days .btn-group-days {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 !important;
    }
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-page-head .pg-back-text,
:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-page-head .pg-back-text a {
    font-size: 10.5px !important;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-card .details-card-head h2 {
    font-size: 14px;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-card .details-card-head p {
    font-size: 11.5px;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-card .summary-row-text > b {
    font-size: 13px;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-card .summary-row-text > span {
    font-size: 11.5px;
}

/* left column: smaller text */
:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) :is(.form-column, .form-view) .details-card-head h2 {
    font-size: 13px !important;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) :is(.form-column, .form-view) .details-card-head p {
    font-size: 11px !important;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-view .summary-row-text > b {
    font-size: 12.5px !important;
}

:is(html.conditional-routing-page, html.workflow-page, html.heartbeat-page, html.status-pages-page, html.team-page) .form-view .summary-row-text > span {
    font-size: 11px !important;
}

/* From escalation_policies/escalation_policy_details */

/* Escalation policy details */

.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 0 !important;
    padding: 0 !important;
    width: auto !important;
}

.tag-chip-list:empty {
    display: none;
}

.tag-chip-list .tag {
    margin: 0 !important;
    background: var(--surface-3) !important;
    color: var(--text-2) !important;
    border: 1px solid var(--border) !important;
}

/* From custom_actions/custom_actions_list */

/* Custom actions list (shared list layout) */

html:is(.custom-actions-page, .tags-list-page, .services-list-page, .escalation-policies-page, .business-services-page, .recent-changes-page, .conference-bridges-page, .api-keys-page, .live-call-routing-list-page, .shared-list-page, .groups-list-page) main .shared-list-head.page-heading-bar {
    align-items: center !important;
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

html:is(.custom-actions-page, .tags-list-page, .services-list-page, .escalation-policies-page, .business-services-page, .recent-changes-page, .conference-bridges-page, .api-keys-page, .live-call-routing-list-page, .shared-list-page, .groups-list-page) .page-frame {
    min-height: calc(100vh - var(--top-h) - 1px);
    min-height: calc(100dvh - var(--top-h) - 1px);
}

@media (max-width: 767.98px) {
    html:is(.custom-actions-page, .tags-list-page, .services-list-page, .escalation-policies-page, .business-services-page, .recent-changes-page, .conference-bridges-page, .api-keys-page, .live-call-routing-list-page, .shared-list-page, .groups-list-page) main .shared-list-head.page-heading-bar {
        flex-wrap: wrap !important;
        row-gap: 12px;
    }
}

/* From teams/team_details */

html.team-details-page main {
    min-width: 0;
}

html.team-details-page main .team-details-header {
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    margin-bottom: 4px !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}

.team-details-header .pg-back-text {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    margin: 0 0 6px !important;
    text-decoration: none;
}

html.team-details-editing .team-details-header .edit-pill-button {
    display: inline-flex;
}

html.team-details-editing main .team-details-header {
    position: sticky;
    top: var(--top-h);
    z-index: 25;
    margin-left: calc(var(--gutter) * -1) !important;
    margin-right: calc(var(--gutter) * -1) !important;
    padding: 12px var(--gutter) 14px !important;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

html.team-details-editing .team-details-header :is(.facts-bar, .tag-chip-list) {
    display: none;
}

#divTeamFacts:empty {
    display: none;
}

@media (max-width: 767.98px) {
    html.team-details-page main .team-details-header {
        flex-wrap: wrap !important;
        gap: 12px;
    }
}

/* From teams/team_new */

/* New team */

/* layout */
html.team-page .page-frame {
    max-width: none;
}

.create-form-header .edit-pill-button.is-on {
    display: inline-flex;
}

.create-form-side .summary-row-text > b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* From services/service_list */

.service-status-tile {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.service-status-tile.is-ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.service-status-tile.is-bad {
    background: var(--crit-soft);
    color: var(--crit);
}

/* From analytics/postmortems/postmortem_report */

.postmortem-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.postmortem-facts b {
    font-weight: 600;
    color: var(--text-2);
}

.postmortem-facts a {
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: none;
}

.postmortem-facts a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.postmortem-facts i {
    font-style: normal;
    color: var(--faint);
}

.postmortem-facts:empty {
    display: none;
}

.postmortem-more-menu .dropdown-menu {
    min-width: 200px;
}

.postmortem-more-menu .danger-action {
    background: transparent !important;
    border: 0 !important;
    color: var(--crit) !important;
}

.postmortem-more-menu .danger-action .app-icon {
    color: var(--crit);
}

/* timeline */
.postmortem-timeline {
    display: block;
    margin: 0 !important;
    padding: 4px 0 0 !important;
    border: 0 !important;
}

.postmortem-timeline > .timeline-event:last-child {
    padding-bottom: 4px !important;
}

/* From itsm/broadcasts/broadcast_details */

.broadcast-details-list {
    margin: 0;
    border-top: 1px solid var(--border);
}

.broadcast-details-list > div {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 6px 20px;
    align-items: center;
    padding: 12px 20px;
}

.broadcast-details-list > div + div {
    border-top: 1px solid var(--border);
}

.broadcast-details-list dt {
    margin: 0;
    font: 600 12px/1.3 var(--font);
    color: var(--muted);
}

.broadcast-details-list dd {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    min-width: 0;
    font-size: 13px;
    color: var(--text);
}

@media (max-width: 767.98px) {
    .broadcast-details-list > div {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 16px;
    }
}

/* From organization/organization */

.org-tab-row {
    margin: 16px 0 20px !important;
}

.org-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.org-tab-panel[hidden] {
    display: none !important;
}

.org-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (min-width: 1200px) {
    .org-card-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    }
}

.org-card-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.org-card-actions:empty {
    display: none;
}

.org-settings-card :is(.outline-action-button, .primary-action, .org-close-account-button) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    margin: 0 !important;
    font-size: 12.5px !important;
    white-space: nowrap;
}

.org-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 0 0 var(--r) var(--r);
}

.org-card-footer[hidden] {
    display: none !important;
}

.org-table-name-cell {
    font-weight: 600;
    color: var(--text) !important;
}

@media (max-width: 767.98px) {
    .org-tab-row {
        margin: 12px 0 16px !important;
    }

    .org-settings-card .details-card-head {
        flex-wrap: wrap;
    }

    .org-card-actions {
        margin-left: 44px;
        flex-basis: calc(100% - 44px);
    }

    .org-card-footer {
        padding: 12px 16px;
    }
}
