:root {
    --bg: #f4f6f8;
    --sidebar-bg: #202936;
    --sidebar-border: #2f3b4c;
    --card-bg: #ffffff;
    --text: #263238;
    --muted: #75808a;
    --border: #dfe4ea;
    --primary: #4a90e2;
    --primary-hover: #357abd;
    --danger: #d9534f;
    --warning: #f0ad4e;
    --success: #5cb85c;
    --info: #5bc0de;
    --shadow: 0 8px 24px rgba(20, 30, 45, 0.08);
}

* { 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; background: var(--sidebar-bg); color: #fff; border-right: 1px solid var(--sidebar-border); padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px 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: #aeb9c5; font-size: 12px; margin-top: 3px; }
.menu { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.menu-link { display: block; color: #d7e0ea; text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.menu-link:hover, .menu-link.active { background: #2b3646; color: #fff; }
.menu-link-admin { border: 1px solid #465366; }
.content { flex: 1; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; background: #fff; 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: 24px 28px; }
.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 { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.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: #fff; color: var(--text); padding: 8px 10px; }
.textarea { min-height: 96px; font-family: monospace; }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8fafc; color: #52616f; text-align: left; font-weight: 600; padding: 12px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:hover { background: #fbfcfe; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; }
.badge-info { background: #e8f2ff; color: #1d65a6; }
.badge-success {
    background: #edf8ed;
    color: #2f7d32;
}

.badge-muted {
    background: #f2f4f7;
    color: var(--muted);
}

.row-disabled {
    opacity: 0.65;
}
.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: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-small { padding: 6px 9px; font-size: 12px; margin-right: 5px;}
.btn-warning { background: var(--warning); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
@media (max-width: 980px) { .layout { flex-direction: column; } .sidebar { width: 100%; } .topbar { flex-direction: column; align-items: flex-start; } }

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

details {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #fbfcfe;
}

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

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-info {
    background: var(--info);
    color: #ffffff;
}

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

.menu-link.active {
    background: #2b3646;
    color: #ffffff;
}

.token-box {
    border: 1px dashed var(--primary);
    background: #f8fbff;
    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: #fbfcfe;
}

.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: #fbfcfe;
}


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

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

.btn-resolve {
    background: var(--success);
    color: #ffffff;
    border: 1px solid #3f9b3f;
}

.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: #aeb9c5;
    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 {
    width: 250px;
    flex: 0 0 250px;
    transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease;
    overflow-x: hidden;
}

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

.brand {
    position: relative;
    min-height: 58px;
    padding: 6px 8px 18px 8px;
}

.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: #263244;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: #344258;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 11px;
    white-space: nowrap;
}

.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) {
    .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: #ffffff;
    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: #175cd3;
    background: #d1e9ff;
}

.summary-success .summary-icon {
    color: #039855;
    background: #d1fadf;
}

.summary-warning .summary-icon {
    color: #dc6803;
    background: #ffead5;
}

.summary-danger .summary-icon {
    color: #d92d20;
    background: #fee4e2;
}

.summary-info .summary-icon {
    color: #088ab2;
    background: #cff9fe;
}

.summary-muted .summary-icon {
    color: #475467;
    background: #f2f4f7;
}

.summary-title {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.summary-value {
    margin-top: 4px;
    color: #101828;
    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: #fbfcfe;
}

.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: 170px;
}
.first-div-page-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@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 {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .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: #fbfcfe;
}

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

.details-value {
    margin-top: 4px;
    color: #101828;
    font-size: 13px;
    font-weight: 800;
    word-break: break-word;
}

.details-empty {
    padding: 16px;
    border-radius: 14px;
    color: var(--muted);
    background: #f8fafc;
    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: #ffffff;
    background: linear-gradient(135deg, #0b6cff, #001f4d);
    font-weight: 800;
}

.details-name {
    color: #101828;
    font-size: 18px;
    font-weight: 800;
}

.details-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.details-code {
    margin-top: 6px;
    padding: 10px;
    border-radius: 10px;
    background: #101828;
    color: #f9fafb;
    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: #175cd3;
    background: #d1e9ff;
}

.token-pill {
    color: #344054;
    background: #f2f4f7;
}

.status-enabled {
    color: #027a48;
    background: #d1fadf;
}

.status-disabled {
    color: #475467;
    background: #f2f4f7;
}
.status-active,
.escalation-enabled {
    color: #027a48;
    background: #d1fadf;
}
.status-expired {
    color: #b54708;
    background: #fef0c7;
}
.status-inactive,
.escalation-disabled {
    color: #475467;
    background: #f2f4f7;
}

.role-rw {
    color: #175cd3;
    background: #d1e9ff;
}

.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: #fff0f0;
    color: var(--danger);
}

.app-dialog-warning .app-dialog-icon {
    background: #fff8ec;
    color: #b46a00;
}

.app-dialog-success .app-dialog-icon {
    background: #edf8ed;
    color: #2f7d32;
}

.app-dialog-info .app-dialog-icon {
    background: #eef5ff;
    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: #344054;
    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;
}
