/* PulseWatch - Modern SaaS Dark Theme */

/* ═══════════════════════════════════════════════════════
   TEXT COLOR UTILITIES
   ═══════════════════════════════════════════════════════ */
.text-dim { color: #8b949e; }
.text-dim-strong { color: #e0e0e0; }
.text-faint { color: #6b7280; }
.text-soft { color: #c9d1d9; }

/* ═══════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════ */
body {
    background-color: #0b0f19;
    color: #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   APP LAYOUT - Sidebar + Main
   ═══════════════════════════════════════════════════════ */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
.sidebar {
    width: 240px;
    min-width: 240px;
    background-color: #111827;
    border-right: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #1e2230;
    margin-bottom: 8px;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.sidebar-brand:hover {
    opacity: 0.85;
}

.sidebar-logo {
    width: 46px;
    height: 32px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 4px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link:hover {
    color: #e0e0e0;
    background-color: #1c2030;
}

.sidebar-link.active {
    color: #fff;
    background-color: #2563eb;
}

.sidebar-link.active svg {
    stroke: #fff;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-badge {
    position: absolute;
    right: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #1e2230;
}

/* Sidebar Status Indicator */
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.78rem;
    color: #22c55e;
    font-weight: 500;
}
.sidebar-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
}

/* Sidebar User Section */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid #1e2230;
    margin-top: 4px;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
    flex: 1;
}
.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e0e0e0;
}
.sidebar-user-role {
    font-size: 0.68rem;
    color: #6b7280;
}

/* Sidebar collapsed: hide user info text */
.sidebar.collapsed .sidebar-user-info {
    display: none;
}
.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 8px;
}
.sidebar.collapsed .sidebar-user button {
    display: none;
}
.sidebar.collapsed .sidebar-status span:not(.sidebar-status-dot) {
    display: none;
}
.sidebar.collapsed .sidebar-status {
    justify-content: center;
    padding: 8px;
}

/* Sidebar collapsed state */
.sidebar {
    transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 8px 16px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 4px 8px;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar.collapsed .sidebar-badge {
    position: static;
    margin-left: 0;
    font-size: 0.6rem;
    padding: 1px 4px;
    min-width: 14px;
}

.sidebar.collapsed .sidebar-link {
    position: relative;
}

.sidebar.collapsed .sidebar-footer {
    padding: 8px;
}

.sidebar.collapsed .sidebar-collapse-icon {
    transform: rotate(180deg);
}

.sidebar-collapse-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .sidebar-link[title] {
    overflow: visible;
}

/* ═══════════════════════════════════════════════════════
   MAIN AREA
   ═══════════════════════════════════════════════════════ */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   TOP HEADER
   ═══════════════════════════════════════════════════════ */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background-color: #111827;
    border-bottom: 1px solid #1f2937;
    min-height: 56px;
}

.header-search {
    position: relative;
    flex: 0 1 480px;
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.header-search-input {
    width: 100%;
    padding: 8px 14px 8px 40px;
    background-color: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}

.header-search-input::placeholder {
    color: #6b7280;
}

.header-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.search-results-dropdown .search-section-title {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.search-results-dropdown .search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #c9d1d9;
    font-size: 0.84rem;
    transition: background-color 0.1s;
}

.search-results-dropdown .search-result-item:hover,
.search-results-dropdown .search-result-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: #e0e0e0;
}

.search-results-dropdown .search-result-item .search-result-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.search-results-dropdown .search-result-item .search-result-meta {
    font-size: 0.72rem;
    color: #6b7280;
}

.search-results-dropdown .search-no-results {
    padding: 16px 14px;
    text-align: center;
    color: #6b7280;
    font-size: 0.84rem;
}

.search-results-dropdown .search-hint {
    padding: 8px 14px;
    text-align: center;
    font-size: 0.72rem;
    color: #4b5563;
    border-top: 1px solid #2a2f3f;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #8b949e;
    text-decoration: none;
    transition: all 0.15s;
}

.header-action-btn:hover {
    background-color: #1c2030;
    color: #e0e0e0;
}

.header-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #151820;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: default;
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.header-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e0;
}

.header-user-role {
    font-size: 0.72rem;
    color: #6b7280;
}

/* Header Live Indicator */
.header-live-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
}
.header-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
    animation: pulse 2s ease-in-out infinite;
}
.header-live-dot--disconnected {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.4);
}
.header-live-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #22c55e;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* Header Date/Time */
.header-datetime {
    font-size: 0.82rem;
    font-weight: 500;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background-color: #0b0f19;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════════ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #1f2937;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.page-header .page-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 0.8rem;
}

/* KPI Cards Row */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.kpi-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 18px 20px 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: #374151;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card--blue::before { background: #2563eb; }
.kpi-card--green::before { background: #22c55e; }
.kpi-card--red::before { background: #ef4444; }
.kpi-card--orange::before { background: #f59e0b; }
.kpi-card--yellow::before { background: #eab308; }
.kpi-card--cyan::before { background: #06b6d4; }
.kpi-card--gray::before { background: #6b7280; }
.kpi-card--gray .kpi-card-value { color: #9ca3af; }

.kpi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-card-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}
.kpi-card-icon--blue  { background: rgba(37,99,235,0.12); color: #3b82f6; box-shadow: 0 0 20px rgba(37,99,235,0.15); }
.kpi-card-icon--green { background: rgba(34,197,94,0.12);  color: #22c55e; box-shadow: 0 0 20px rgba(34,197,94,0.15); }
.kpi-card-icon--red   { background: rgba(239,68,68,0.12);  color: #ef4444; box-shadow: 0 0 20px rgba(239,68,68,0.15); }
.kpi-card-icon--yellow { background: rgba(234,179,8,0.12); color: #facc15; box-shadow: 0 0 20px rgba(234,179,8,0.15); }
.kpi-card-icon--teal  { background: rgba(6,182,212,0.12); color: #06d6a0; box-shadow: 0 0 20px rgba(6,182,212,0.15); }
.kpi-card-icon--gray  { background: rgba(107,114,128,0.15); color: #9ca3af; box-shadow: 0 0 20px rgba(107,114,128,0.15); }

.kpi-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.kpi-card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-card--green .kpi-card-value { color: #22c55e; }
.kpi-card--red .kpi-card-value { color: #ef4444; }
.kpi-card--orange .kpi-card-value { color: #f59e0b; }
.kpi-card--yellow .kpi-card-value { color: #eab308; }
.kpi-card--cyan .kpi-card-value { color: #06b6d4; }

.kpi-card-change {
    font-size: 0.75rem;
    color: #6b7280;
}

.kpi-card-change .up { color: #22c55e; }
.kpi-card-change .down { color: #ef4444; }

/* Mini sparkline area at card bottom */
.kpi-card-spark {
    height: 28px;
    margin-top: auto;
    padding-top: 8px;
    opacity: 0.5;
}
.kpi-card-spark svg {
    width: 100%;
    height: 100%;
}
.kpi-card:hover .kpi-card-spark {
    opacity: 0.8;
}

/* Auto-Healed KPI card accent */
.kpi-card--teal::before { background: #14b8a6; }
.kpi-card--teal .kpi-card-value { color: #14b8a6; }

/* ── KPI Value Flash Animation ──────────────────────────── */
.kpi-flash {
    animation: kpiFlash 0.7s ease;
}
@keyframes kpiFlash {
    0%   { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.6); transform: scale(1.08); }
    100% { text-shadow: none; transform: scale(1); }
}

/* ── Last Refresh Label ─────────────────────────────────── */
.last-refresh-label {
    font-size: 0.68rem;
    color: #6b7280;
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}

/* ── Alert Ticker Bar ───────────────────────────────────── */
.alert-ticker {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(239,68,68,0.12) 0%, rgba(234,179,8,0.08) 100%);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 16px;
    gap: 10px;
    overflow: hidden;
    min-height: 38px;
}
.alert-ticker-icon {
    font-size: 1rem;
    flex-shrink: 0;
    animation: tickerPulse 2s ease-in-out infinite;
}
@keyframes tickerPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
.alert-ticker-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
}
.alert-ticker-content {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #f87171;
    letter-spacing: 0.02em;
    animation: tickerScroll 25s linear infinite;
    white-space: nowrap;
}
@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.alert-ticker-dismiss {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.alert-ticker-dismiss:hover {
    color: #e5e7eb;
    background: rgba(255,255,255,0.08);
}

/* ── Operational Stats Bar ─────────────────────────────── */
.ops-stats-bar {
    display: flex;
    align-items: center;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 14px 24px;
    margin-bottom: 16px;
    gap: 0;
    overflow-x: auto;
}
.ops-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 0 16px;
}
.ops-stat:first-child { padding-left: 0; }
.ops-stat:last-child { padding-right: 0; }
.ops-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.ops-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ops-stat-icon svg {
    width: 18px;
    height: 18px;
}
.ops-stat-icon--blue  { background: rgba(37,99,235,0.12); color: #60a5fa; }
.ops-stat-icon--red   { background: rgba(239,68,68,0.12); color: #f87171; }
.ops-stat-icon--yellow { background: rgba(234,179,8,0.12); color: #facc15; }
.ops-stat-icon--teal  { background: rgba(20,184,166,0.12); color: #2dd4bf; }
.ops-stat-icon--green { background: rgba(34,197,94,0.12); color: #4ade80; }
.ops-stat-info {
    min-width: 0;
}
.ops-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #e6edf3;
    white-space: nowrap;
    line-height: 1.2;
}
.ops-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ops-stat-sub {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ── Self-Healing Activity Feed ─────────────────────────────────── */
.selfheal-feed-section {
    margin-bottom: 24px;
}

.selfheal-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.selfheal-feed-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}
.selfheal-feed-item:hover {
    background: rgba(255,255,255,0.03);
}
.selfheal-feed-item--new {
    animation: healFlash 1.2s ease-out;
}
@keyframes healFlash {
    0% { background: rgba(20,184,166,0.25); }
    100% { background: transparent; }
}

.selfheal-feed-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    padding-top: 2px;
}

.selfheal-feed-body {
    flex: 1;
    min-width: 0;
}

.selfheal-feed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.selfheal-feed-rule {
    font-weight: 600;
    font-size: 0.82rem;
    color: #e6edf3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selfheal-feed-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.heal-outcome--healed  { background: rgba(34,197,94,0.15); color: #22c55e; }
.heal-outcome--failed  { background: rgba(239,68,68,0.15); color: #ef4444; }
.heal-outcome--escalated { background: rgba(234,179,8,0.15); color: #eab308; }
.heal-outcome--dryrun  { background: rgba(99,102,241,0.15); color: #818cf8; }
.heal-outcome--progress { background: rgba(6,182,212,0.15); color: #06b6d4; }

.selfheal-feed-detail {
    font-size: 0.78rem;
    color: #8b949e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selfheal-feed-time {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
}

/* ── Infrastructure Health Timeline ─────────────────────────────── */
.ht-card {
    margin-bottom: 24px;
}
.ht-body {
    display: flex;
    gap: 20px;
}
.ht-grid-area {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}
.ht-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.ht-row--labels {
    margin-bottom: 0;
    margin-top: 2px;
}
.ht-row-label {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 64px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}
.ht-row-label svg {
    color: #6b7280;
    flex-shrink: 0;
}
.ht-row-cells {
    display: grid;
    grid-template-columns: repeat(48, 1fr);
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.ht-cell {
    aspect-ratio: 1;
    min-width: 6px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ht-cell:hover {
    transform: scale(1.5);
    z-index: 2;
}
.ht-cell--healthy {
    background: #22c55e;
    opacity: 0.7;
}
.ht-cell--healthy:hover {
    opacity: 1;
}
.ht-cell--warning {
    background: #eab308;
    opacity: 0.85;
}
.ht-cell--warning:hover {
    opacity: 1;
}
.ht-cell--critical {
    background: #ef4444;
    opacity: 0.9;
    box-shadow: 0 0 4px rgba(239,68,68,0.3);
}
.ht-cell--critical:hover {
    opacity: 1;
    box-shadow: 0 0 8px rgba(239,68,68,0.5);
}
.ht-cell--live {
    animation: htLivePulse 2s ease-in-out infinite;
}
@keyframes htLivePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}
.ht-time-labels {
    position: relative;
}
.ht-time-label {
    font-size: 0.6rem;
    color: #6b7280;
    white-space: nowrap;
}
.ht-time-label--now {
    color: #22c55e;
    font-weight: 600;
}
.ht-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 100px;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.ht-summary-item {
    text-align: center;
}
.ht-summary-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e5e7eb;
    font-variant-numeric: tabular-nums;
}
.ht-summary-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ht-legend {
    display: flex;
    gap: 16px;
    padding-top: 8px;
}
.ht-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #8b949e;
}
.ht-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.ht-legend-dot--healthy { background: #22c55e; }
.ht-legend-dot--warning { background: #eab308; }
.ht-legend-dot--critical { background: #ef4444; }

/* ── Two-Column Layout (Recent Incidents + Live Activity) ───────── */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* ── Live Activity Feed ─────────────────────────────────────────── */
.la-card {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    background: linear-gradient(180deg, #0f1b2b, #07111f);
}
.la-card .dash-card-header .dash-card-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
}
.la-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0 4px;
}

/* Item grid: time | marker | content | accent */
.la-item {
    display: grid;
    grid-template-columns: 54px 22px 1fr 3px;
    gap: 0 8px;
    position: relative;
    min-height: 76px;
    padding: 6px 0;
}

/* Time column */
.la-time {
    font-size: 0.66rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    padding-top: 3px;
    text-align: right;
}

/* Center marker column */
.la-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.la-marker-dot {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    background: var(--la-color);
    color: #07111f;
}
.la-marker-dot svg {
    width: 11px;
    height: 11px;
    stroke-width: 3;
}
.la-connector {
    flex: 1;
    width: 1px;
    background: #1e3a5f;
    margin-top: 4px;
}
.la-item:last-child .la-connector {
    display: none;
}

/* Content column */
.la-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding-top: 1px;
}
.la-content strong {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--la-color);
    line-height: 1.2;
}
.la-content span {
    font-size: 0.72rem;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.la-content small {
    font-size: 0.65rem;
    color: #64748b;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
}
.la-server-link {
    font-size: 0.65rem;
    color: #64748b;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    text-decoration: none;
    transition: color 0.15s;
}
.la-server-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Right accent bar — gradient fading to next event color */
.la-accent {
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--la-color), var(--la-next));
    opacity: 0.6;
}
.la-item:last-child .la-accent {
    background: var(--la-color);
    opacity: 0.3;
}

/* Type color overrides for marker glow */
.la-item--success .la-marker-dot { box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.la-item--info    .la-marker-dot { box-shadow: 0 0 8px rgba(59,130,246,0.5); }
.la-item--danger  .la-marker-dot { box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.la-item--warning .la-marker-dot { box-shadow: 0 0 8px rgba(245,158,11,0.5); }
.la-item--muted   .la-marker-dot { box-shadow: none; }

.la-footer {
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.04);
    text-align: center;
}

/* Dashboard Charts Row */
.dash-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* Dashboard Grid Layouts */
.dash-mid-grid,
.dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.dash-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.infra-card {
    overflow: hidden;
}
.infra-card .infra-table-wrap {
    overflow-x: auto;
    margin: 0 -20px -20px;
    padding: 0 20px 20px;
}

.dash-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.15s;
    overflow: hidden;
    min-width: 0;
}
.dash-card:hover {
    border-color: #374151;
}

/* ── Main Dashboard Grid: 4 cols, Live Activity spans 2 rows ──── */
.dash-main-grid {
    display: grid;
    grid-template-columns: 4fr 4fr 4fr 3fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "r1c1     r1c2     r1c3     live"
        "timeline timeline timeline live";
    gap: 16px;
    margin-bottom: 16px;
}
.dash-main-grid .la-card {
    max-height: none;
    display: flex;
    flex-direction: column;
}
.dash-main-grid .la-feed {
    flex: 1;
    overflow-y: auto;
    max-height: 460px;
}
.dash-main-grid .ht-card {
    margin-bottom: 0;
}

/* ── Bottom Dashboard Grid: 3 equal cols ──────────────────────── */
.dash-bottom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.dash-bottom-grid > .dash-card {
    min-width: 0;
    overflow: hidden;
}

/* Reusable donut + legend row layout */
.chart-donut-row {
    display: flex;
    align-items: center;
    gap: 20px;
}
.chart-donut-wrap {
    max-width: 120px;
    flex-shrink: 0;
}
.chart-donut-wrap--sm {
    max-width: 100px;
}

/* Chart health footer (green text under donut/legend) */
.chart-health-footer {
    font-size: 0.78rem;
    color: #22c55e;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-card-header .dash-card-title {
    margin-bottom: 0;
}

.dash-card-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(139,148,158,0.15);
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dash-card-badge--green {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
a.dash-card-badge--link {
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
a.dash-card-badge--link:hover {
    background: rgba(139,148,158,0.25);
    color: #c9d1d9;
}
/* Custom pill dropdown (see pill-select.js) — the OPEN list of a native <select> can't be
   rounded in any major browser, so small filter/picker selects get replaced with a button +
   this rounded overlay list instead. The original <select> stays in the DOM (hidden, not
   disabled) so all existing form/JS behavior keeps working unchanged. */
.pill-select-wrap {
    position: relative;
    display: inline-block;
}
.pill-select-native-hidden {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    pointer-events: none !important;
}
.pill-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pill-select-caret {
    font-size: 0.6rem;
    opacity: 0.7;
    transition: transform 0.15s ease;
}
.pill-select-btn.open .pill-select-caret {
    transform: rotate(180deg);
}
.pill-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 14px;
    padding: 6px;
    z-index: 1070;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}
.pill-select-menu.show {
    display: block;
}
.pill-select-option {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: #c9d1d9;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.pill-select-option:hover {
    background: #253347;
    color: #fff;
}
.pill-select-option.active {
    background: #3b82f6;
    color: #fff;
}

/* Custom autocomplete overlay for text inputs backed by a <datalist> (see pill-autocomplete.js)
   — the native datalist popup can't be styled at all in any browser, so it's replaced with this
   rounded, filter-as-you-type dropdown while the original <input> keeps working unchanged. */
.pill-ac-wrap {
    position: relative;
}
.pill-ac-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 14px;
    padding: 6px;
    z-index: 1070;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.pill-ac-dropdown.show {
    display: block;
}
.pill-ac-item {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #c9d1d9;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pill-ac-item:hover,
.pill-ac-item.active {
    background: #253347;
    color: #fff;
}
.pill-ac-item mark {
    background: transparent;
    color: #ffc107;
    font-weight: 600;
}

/* ── Modal polish ──────────────────────────────────────────────────────────
   Bootstrap's dark-theme modal/inputs are functional but flat — same neutral gray
   everywhere with no depth. This reuses the app's existing palette (card bg #111827,
   card border #1f2937, accent blue #2563eb) instead of introducing new colors, just
   applied with more intention: a slightly richer input surface, a soft blue focus glow,
   and quieter, tracked labels matching the .dash-card-title treatment used elsewhere. */
.modal-content {
    /* !important: several modals also carry Bootstrap's .bg-dark utility, which sets its own
       background-color as !important — this needs to win over that to apply consistently. */
    background-color: #10141f !important;
    border: 1px solid #1f2937;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-header,
.modal-footer {
    border-color: #1f2937;
}
.modal-title {
    font-weight: 700;
}

.modal-body .form-label,
.modal-body label.form-check-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #94a3b8;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea.form-control {
    background-color: #161b28;
    border: 1px solid #2a2f3f;
    color: #e5e7eb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus {
    background-color: #1a2033;
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
    color: #fff;
}
.modal-body .form-control::placeholder {
    color: #5b6478;
}
.modal-body .form-control:disabled,
.modal-body .form-select:disabled {
    background-color: #12151f;
    color: #5b6478;
}

.modal-body textarea.form-control {
    border-radius: 12px;
}

.modal-body .form-check-input {
    background-color: #161b28;
    border: 1px solid #2a2f3f;
}
.modal-body .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}
.modal-body .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}

.modal-body hr.border-secondary {
    border-color: #1f2937 !important;
    opacity: 1;
}

/* Quiet horizontal rhythm between field groups so a long modal (New Rule, Scheduled
   Action) doesn't read as one dense wall of inputs. */
.modal-body .row.g-3 {
    margin-bottom: 2px;
}

/* Pill-shaped dropdowns everywhere — Bootstrap's dark-mode .form-select already gets dark
   colors for free from data-bs-theme="dark" on <html>, it just keeps Bootstrap's default
   ~6px "rounded rectangle" corners. Rounding this up to a full pill makes every <select> in
   every modal across the app match the same style instead of just the dashboard's custom one. */
.form-select {
    border-radius: 999px;
}

.dash-card-select {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 24px 4px 14px;
    border-radius: 999px;
    background-color: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    outline: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 10px;
}
.dash-card-select:hover {
    background-color: #253347;
    border-color: #475569;
    color: #e2e8f0;
}
.dash-card-select:focus {
    background-color: #253347;
    border-color: #3b82f6;
    color: #e2e8f0;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.dash-card-select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 6px 10px;
}

.dash-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

/* System Status List */
.system-status-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.system-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.74rem;
}
.system-status-item:last-child { border-bottom: none; }
a.system-status-item--link {
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    padding: 6px 8px;
    margin: 0 -8px;
    transition: background-color 0.15s;
}
a.system-status-item--link:hover {
    background-color: rgba(255,255,255,0.04);
}
.system-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.system-status-dot--green { background: #22c55e; }
.system-status-dot--yellow { background: #eab308; }
.system-status-dot--red { background: #ef4444; }
.system-status-dot--blue { background: #2563eb; }
.system-status-label {
    flex: 1;
    color: #c9d1d9;
}
.system-status-value {
    font-weight: 600;
    font-size: 0.68rem;
}
.system-status-value--green { color: #22c55e; }
.system-status-value--yellow { color: #eab308; }
.system-status-value--red { color: #ef4444; }
.system-status-value--blue { color: #60a5fa; }

.chart-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.chart-canvas-wrap {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

/* Full-width chart mode (for trend chart etc.) */
.chart-container .chart-canvas-wrap:only-child {
    width: 100%;
    height: auto;
    aspect-ratio: 2.2 / 1;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #c9d1d9;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

a.chart-legend-item {
    text-decoration: none;
    color: inherit;
}

a.chart-legend-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Recent Incidents Card */
.recent-incidents-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

.recent-incident-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    gap: 8px;
    min-width: 0;
}

.recent-incident-item:last-child {
    border-bottom: none;
}
a.recent-incident-item--link {
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    padding: 8px 6px;
    margin: 0 -6px;
    transition: background-color 0.15s;
}
a.recent-incident-item--link:hover {
    background-color: rgba(255,255,255,0.04);
}

.recent-incident-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.recent-incident-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-incident-text {
    font-size: 0.78rem;
    color: #c9d1d9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 100%;
}

.severity-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.severity-badge--emergency { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.severity-badge--critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.severity-badge--high { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.severity-badge--warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.severity-badge--medium { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.severity-badge--low { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

.recent-incident-time {
    font-size: 0.72rem;
    color: #6b7280;
    white-space: nowrap;
    margin-left: 8px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2563eb;
    font-size: 0.82rem;
    text-decoration: none;
    margin-top: 8px;
}

.view-all-link:hover {
    color: #3b82f6;
}

/* Infrastructure Overview */
.infra-section {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.infra-section .dash-card-header {
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.infra-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.infra-select {
    background-color: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 999px;
    color: #c9d1d9;
    font-size: 0.8rem;
    padding: 6px 28px 6px 14px;
    outline: none;
    transition: border-color 0.2s;
}
.infra-select:focus {
    border-color: #3b82f6;
}

.infra-search {
    background-color: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.8rem;
    padding: 6px 10px 6px 30px;
    outline: none;
    width: 180px;
}

.infra-table-wrap {
    overflow-x: auto;
}

.infra-table {
    width: 100%;
    border-collapse: collapse;
}

.infra-table th {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 1px solid #1e2230;
    text-align: left;
    white-space: nowrap;
}

.infra-table td {
    padding: 14px 12px;
    font-size: 0.85rem;
    color: #c9d1d9;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.infra-table tr:last-child td {
    border-bottom: none;
}

.infra-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.025);
}

/* Row accent for critical/warning/offline rows */
.infra-row--critical td:first-child {
    border-left: 3px solid #ef4444;
}
.infra-row--warning td:first-child {
    border-left: 3px solid #eab308;
}
.infra-row--offline td:first-child {
    border-left: 3px solid #6b7280;
}

.infra-cell-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.infra-cell-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.infra-cell-client {
    font-weight: 600;
    color: #e6edf3;
}
.infra-cell-sep {
    color: #4b5563;
    margin: 0 2px;
}
.infra-cell-env {
    color: #8b949e;
}

.infra-stat {
    font-weight: 600;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.infra-stat--green { color: #22c55e; }
.infra-stat--red { color: #ef4444; }
.infra-stat--yellow { color: #eab308; }

.infra-incident-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.env-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.env-badge--prod { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.env-badge--stage { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.env-badge--dev { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.env-badge--internal { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.stat-green { color: #22c55e; }
.stat-red { color: #ef4444; }
.stat-yellow { color: #eab308; }
.stat-blue { color: #2563eb; }

.infra-row-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}
.infra-row-link:hover {
    color: #3b82f6;
}

/* Top Usage Bars */
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.usage-card {
    background-color: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
}

.usage-card .dash-card-header {
    margin-bottom: 14px;
}

.usage-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.usage-item:last-child {
    margin-bottom: 0;
}

.usage-item-name {
    font-size: 0.78rem;
    color: #c9d1d9;
    min-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usage-bar {
    flex: 1;
    height: 6px;
    background-color: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-bar-fill--blue { background: #2563eb; }
.usage-bar-fill--red { background: #ef4444; }
.usage-bar-fill--purple { background: #8b5cf6; }

.usage-item-value {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
a.usage-item--link {
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: background-color 0.15s;
}
a.usage-item--link:hover {
    background-color: rgba(255,255,255,0.04);
}

/* ── Fleet Health Heatmap ──────────────────────────────── */
.heatmap-section {
    margin-bottom: 24px;
}

.heatmap-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.heatmap-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #8b949e;
}

.heatmap-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.heatmap-legend-dot--healthy { background: #22c55e; }
.heatmap-legend-dot--warning { background: #eab308; }
.heatmap-legend-dot--critical { background: #ef4444; }
.heatmap-legend-dot--offline { background: #6b7280; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 5px;
    padding: 4px 0;
}

.heatmap-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    min-width: 0;
}

.heatmap-tile:hover {
    transform: scale(1.25);
    z-index: 2;
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
}

.heatmap-tile--incident {
    animation: heatmapPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 2px #ef4444;
}

.heatmap-tile--healthy { background: #22c55e; }
.heatmap-tile--warning { background: #eab308; }
.heatmap-tile--critical { background: #ef4444; }
.heatmap-tile--offline { background: #6b7280; }

@keyframes heatmapPulse {
    0%, 100% { box-shadow: 0 0 0 2px #ef4444; }
    50%      { box-shadow: 0 0 8px 3px rgba(239,68,68,0.5); }
}

.heatmap-tile-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 2px;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   EXISTING COMPONENT STYLES (preserved)
   ═══════════════════════════════════════════════════════ */

/* Server Cards */
.server-card {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-width: 2px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Server Link in Incidents */
.server-link:hover {
    text-decoration: underline !important;
    filter: brightness(1.2);
}

/* Status Dot */
.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.bg-danger {
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.6);
}

.status-dot.bg-warning {
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.status-dot.bg-success {
    box-shadow: 0 0 8px rgba(25, 135, 84, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Metric Box */
.metric-box {
    background-color: #1c2030;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

/* Cards */
.card {
    background-color: #151820;
    border-color: #1e2230;
    border-radius: 12px;
}

.card-header {
    background-color: #1a1f2e;
    border-bottom-color: #1e2230;
    font-weight: 600;
}

/* ── Server Card Grid (Redesigned) ────────────────────── */
.srv-section {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.srv-section .dash-card-header {
    margin-bottom: 14px;
}
.srv-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #e6edf3;
}
.srv-section-icon {
    color: #3b82f6;
    font-size: 0.7rem;
}
.srv-env-group {
    margin-bottom: 16px;
}
.srv-env-group:last-child { margin-bottom: 0; }
.srv-env-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.srv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 14px;
}

.srv-card {
    display: flex;
    flex-direction: column;
    background: #1a1f2e;
    border: 1px solid #262c3a;
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
}
.srv-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    border-color: #3b82f6;
    color: inherit;
}

/* Card Head */
.srv-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.srv-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e6edf3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}
.srv-card-badges {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* Compact Badges */
.srv-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.srv-badge--danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.srv-badge--warning { background: rgba(234,179,8,0.15); color: #eab308; }
.srv-badge--info { background: rgba(96,165,250,0.15); color: #60a5fa; }

/* Metric Rings Row */
.srv-card-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 14px;
}

/* Service Status Footer */
.srv-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 10px;
    margin-top: auto;
}
.srv-card-services {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.srv-svc-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.srv-svc-pill--ok { background: rgba(34,197,94,0.12); color: #22c55e; }
.srv-svc-pill--err { background: rgba(239,68,68,0.12); color: #ef4444; }
.srv-svc-pill--info { background: rgba(96,165,250,0.12); color: #60a5fa; }

.srv-card-timing {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.srv-card-timing small {
    font-size: 0.72rem;
    color: #6b7280;
}
.srv-timing--overdue {
    color: #eab308 !important;
}

/* Tables */
.table-dark {
    --bs-table-bg: #151820;
    --bs-table-striped-bg: #1a1f2e;
}

/* Timeline */
.timeline-container {
    border-left: 2px solid #2a2f3f;
    padding-left: 16px;
}

.timeline-item {
    padding: 6px 0;
    border-bottom: 1px solid #1e2230;
}

.timeline-item:last-child {
    border-bottom: none;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
}

.breadcrumb-item a {
    color: #2563eb;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f1117;
}

::-webkit-scrollbar-thumb {
    background: #2a2f3f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3f4f;
}

/* Filter Bar */
.filter-bar {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 12px 16px;
}

.filter-select {
    background-color: #1c2030;
    border-color: #2a2f3f;
    border-radius: 999px;
    color: #e0e0e0;
    min-width: 160px;
}

.filter-select:focus {
    background-color: #1c2030;
    border-color: #2563eb;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Client Sections (legacy - used by srv-section now) */
.client-section {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 16px;
}

.client-header {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 8px;
}

/* Incident Blinking Animations */
.incident-card-blink {
    animation: incident-border-blink 1.2s ease-in-out infinite;
}

@keyframes incident-border-blink {
    0%, 100% { border-color: #dc3545; box-shadow: 0 0 8px rgba(220, 53, 69, 0.4); }
    50% { border-color: #ff6b7a; box-shadow: 0 0 20px rgba(220, 53, 69, 0.8); }
}

.incident-badge-blink {
    animation: incident-badge-pulse 1s ease-in-out infinite;
}

@keyframes incident-badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Notification Bell */
.bell-ring {
    animation: bell-shake 0.5s ease-in-out;
}

@keyframes bell-shake {
    0% { transform: rotate(0); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-15deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
    100% { transform: rotate(0); }
}

.notification-dropdown {
    background-color: #151820;
    border: 1px solid #2a2f3f;
}

.notification-dropdown .dropdown-item {
    color: #e0e0e0;
    border-bottom: 1px solid #1e2230;
}

.notification-dropdown .dropdown-item:hover {
    background-color: #1c2030;
    color: #fff;
}

.notification-dropdown .dropdown-header {
    color: #adb5bd;
}

.nav-incident-badge {
    font-size: 0.65rem;
    vertical-align: top;
    margin-left: 2px;
}

.nav-incidents-alert {
    animation: nav-incident-pulse 1.5s ease-in-out infinite;
}

@keyframes nav-incident-pulse {
    0%, 100% { color: #dc3545; }
    50% { color: #ff8a9a; }
}

/* Incident Table */
.incident-table {
    border-collapse: collapse;
}

.incident-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    padding: 8px 12px;
    border-bottom: 1px solid #1e2230;
}

.incident-row {
    transition: background-color 0.15s;
}

.incident-row[onclick] {
    cursor: pointer;
}

.incident-row .btn,
.incident-row .dropdown {
    position: relative;
    z-index: 2;
}

.incident-row td {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #c9d1d9;
    border-bottom: 1px solid #1e2230;
    vertical-align: middle;
}

.incident-row:hover td {
    background-color: rgba(37, 99, 235, 0.04);
}

.incident-row-open {
}

.incident-row-ack {
}

.incident-row-resolved td {
    padding: 8px 12px;
    border-bottom: 1px solid #1e2230;
    font-size: 0.8rem;
}

.incident-detail-row td {
    background-color: transparent;
    padding: 0;
    border-bottom: 1px solid #1e2230;
}

.incident-detail-panel--open { border-left-color: var(--bs-danger, #dc3545); }
.incident-detail-panel--other { border-left-color: var(--bs-warning, #ffc107); }

.incident-severity-bar {
    width: 4px;
    height: 100%;
    min-height: 38px;
    border-radius: 2px;
}

.incident-note--acknowledge { border-left: 3px solid #ffc107; background-color: #2a2520; }
.incident-note--resolve { border-left: 3px solid #28a745; background-color: #1a2e1a; }
.incident-note--other { border-left: 3px solid #6c757d; background-color: #1e2230; }

/* Incident table pagination toolbar */
.incident-pagination-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #111827;
    border-top: 1px solid #1e2230;
    border-radius: 0 0 12px 12px;
    font-size: 0.8rem;
    color: #8b949e;
    gap: 12px;
    flex-wrap: wrap;
}

.incident-pagination-toolbar .pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.incident-pagination-toolbar .pagination-info select {
    background: #1a1f2e;
    border: 1px solid #2a2f3f;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.78rem;
    cursor: pointer;
}

.incident-pagination-toolbar .pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.incident-pagination-toolbar .pagination-nav button {
    background: #1a1f2e;
    border: 1px solid #2a2f3f;
    color: #c9d1d9;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}

.incident-pagination-toolbar .pagination-nav button:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.incident-pagination-toolbar .pagination-nav button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.incident-pagination-toolbar .pagination-nav button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* Highlight for deep-linked incident */
.incident-row-highlight {
    animation: row-highlight-flash 2s ease-out;
}

@keyframes row-highlight-flash {
    0% { background-color: rgba(37, 99, 235, 0.3); }
    100% { background-color: transparent; }
}

/* Summary stat cards */
.card.bg-dark {
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card.bg-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Filter pill tabs */
#incidentFilters .nav-link {
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    color: #adb5bd;
    background: transparent;
    border: 1px solid #2a2f3f;
}

#incidentFilters .nav-link.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

#incidentFilters .nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

/* Research Page */
.research-table thead th {
    border-bottom: 2px solid #2a2f3f;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b949e;
    padding: 0.6rem 0.75rem;
}

.research-table td {
    padding: 0.7rem 0.75rem;
}

.research-row-kept {
    border-left: 3px solid #198754;
}

.research-score {
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
}

.research-pulse {
    animation: research-glow 2s ease-in-out infinite;
}

@keyframes research-glow {
    0%, 100% { box-shadow: 0 0 4px rgba(25, 135, 84, 0.4); }
    50% { box-shadow: 0 0 12px rgba(25, 135, 84, 0.8); }
}

/* Server Detail - Process Bars */
.process-row {
    padding: 10px 12px;
    border-radius: 8px;
    background-color: #1a1f2e;
    transition: background-color 0.2s;
}

.process-row:hover {
    background-color: #222738;
}

.process-bar {
    height: 8px;
    background-color: #0f1117;
    border-radius: 4px;
}

.process-bar .progress-bar {
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Server Detail - Event Log */
.eventlog-msg {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 400px;
    word-break: break-word;
}

/* Server Detail - IIS Logs */
.iis-url {
    color: #2563eb;
    background-color: transparent;
    font-size: 0.85rem;
    word-break: break-all;
}

/* Collapsible Sections */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: #1a1f2e;
}

.collapse-chevron {
    font-size: 0.7rem;
    transition: transform 0.3s;
    color: #6c757d;
}

.collapsible-header[aria-expanded="true"] .collapse-chevron,
.collapsible-header:not(.collapsed) .collapse-chevron {
    transform: rotate(180deg);
}

/* Service toggle buttons */
.svc-toggle-btn, .svc-mandatory-btn {
    font-size: 0.7rem;
    padding: 2px 8px;
}

/* Error ignore button */
.error-ignore-btn {
    font-size: 0.75rem;
    padding: 2px 6px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.error-ignore-btn:hover {
    opacity: 1;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-pointer:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ═══════════════════════════════════════════════════════
   SERVERS LIST PAGE
   ═══════════════════════════════════════════════════════ */
.servers-filters {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

.servers-search-wrap {
    position: relative;
}

.servers-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

.servers-search-input {
    padding: 6px 10px 6px 32px;
    background-color: #1c2030;
    border: 1px solid #2a2f3f;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.8rem;
    outline: none;
    width: 180px;
}

.servers-search-input:focus {
    border-color: #2563eb;
}

.servers-table-wrap {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 12px;
    overflow: hidden;
}

.servers-table {
    width: 100%;
    border-collapse: collapse;
}

.servers-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    border-bottom: 1px solid #1e2230;
    text-align: left;
}

.servers-table td {
    padding: 14px;
    font-size: 0.84rem;
    color: #c9d1d9;
    border-bottom: 1px solid #1e2230;
    vertical-align: middle;
}

.servers-table-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.servers-table-row:hover td {
    background-color: rgba(37, 99, 235, 0.04);
}

.servers-table-row:last-child td {
    border-bottom: none;
}

.server-name-cell {
    display: flex;
    align-items: center;
}

.server-name-text {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 0.85rem;
}

.server-ip-text {
    font-size: 0.72rem;
    color: #6b7280;
}

.server-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.server-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.server-status--online { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.server-status--warning { color: #eab308; background: rgba(234, 179, 8, 0.1); }
.server-status--offline { color: #6b7280; background: rgba(107, 114, 128, 0.1); }
.server-status--critical { color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.server-status--maintenance { color: #6366f1; background: rgba(99, 102, 241, 0.1); }

.server-status-badge--sm {
    font-size: 0.68rem;
    padding: 2px 8px;
    gap: 4px;
}

.server-status-badge--sm .server-status-dot {
    width: 6px;
    height: 6px;
}

.metric-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-cell-value {
    font-size: 0.82rem;
    font-weight: 500;
    min-width: 32px;
}

.metric-cell-bar {
    width: 50px;
    height: 4px;
    background-color: #1c2030;
    border-radius: 2px;
    overflow: hidden;
}

.metric-cell-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.heartbeat-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
}

.heartbeat-badge--ok { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.heartbeat-badge--stale { color: #eab308; background: rgba(234, 179, 8, 0.1); }
.heartbeat-badge--offline { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.servers-table-footer {
    padding: 12px 14px;
    border-top: 1px solid #1e2230;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════
   SERVER DETAILS PAGE
   ═══════════════════════════════════════════════════════ */
.sd-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.sd-header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sd-status-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sd-status-pill--online { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.sd-status-pill--critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.sd-status-pill--warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.sd-status-pill--offline { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.sd-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.sd-meta-tag {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.12);
    color: #93c5fd;
}

.sd-meta-text {
    font-size: 0.78rem;
    color: #6b7280;
}

.sd-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* KPI Cards on Server Details */
.sd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.sd-kpi-card {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.sd-kpi-label {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.sd-kpi-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.sd-kpi-value.text-success { color: #22c55e !important; }
.sd-kpi-value.text-warning { color: #eab308 !important; }
.sd-kpi-value.text-danger { color: #ef4444 !important; }

.sd-kpi-spark {
    height: 24px;
    margin-top: 6px;
}

.sd-kpi-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
}

.sd-kpi-badge--running { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.sd-kpi-badge--stopped { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.sd-kpi-badge--na { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

/* Per-service / per-app-pool memory bar (Services & IIS tabs on ServerDetails) */
.sd-membar-track {
    position: relative;
    width: 60px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    flex-shrink: 0;
}
.sd-membar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}
.sd-membar--blue   { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.sd-membar--green  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.sd-membar--yellow { background: linear-gradient(90deg, #ca8a04, #facc15); }
.sd-membar--red    { background: linear-gradient(90deg, #dc2626, #f87171); }

.sd-resource-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
/* Inline heartbeat-interval editor (replaces the old floating popup) */
.sd-hbi-input {
    width: 48px;
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 999px;
    text-align: center;
    font-size: 0.78rem;
    padding: 1px 4px;
    outline: none;
}
.sd-hbi-input:focus {
    border-color: #3b82f6;
}
.sd-hbi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #475569;
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.68rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.12s ease;
}
.sd-hbi-btn:hover {
    background: #253347;
    color: #e2e8f0;
}
.sd-hbi-btn--save {
    border-color: #22c55e;
    color: #22c55e;
}
.sd-hbi-btn--save:hover {
    background: #22c55e;
    color: #0b0f19;
}
.sd-hbi-btn--cancel {
    border-color: #ef4444;
    color: #ef4444;
}
.sd-hbi-btn--cancel:hover {
    background: #ef4444;
    color: #0b0f19;
}

.sd-resource-label {
    width: 10px;
    flex-shrink: 0;
    color: #6b7280;
    font-weight: 700;
    font-size: 0.65rem;
}

/* Per-server threshold override cards (ServerDetails "Thresholds" tab) */
.sd-threshold-card {
    background: #11141c;
    border: 1px solid #1e2230;
    border-radius: 10px;
    padding: 16px;
    height: 100%;
}

.sd-threshold-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-bottom: 14px;
}

.sd-threshold-row {
    margin-bottom: 14px;
}

.sd-threshold-row:last-child {
    margin-bottom: 0;
}

.sd-threshold-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
}

.sd-threshold-disable {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #8b93a7;
    cursor: pointer;
    font-weight: 400;
}

.sd-threshold-disable input {
    cursor: pointer;
}

/* Server Detail Tabs */
.sd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #1e2230;
    margin-bottom: 24px;
    overflow-x: auto;
}

.sd-tab {
    padding: 10px 18px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.sd-tab:hover {
    color: #c9d1d9;
}

.sd-tab.active {
    color: #fff;
    border-bottom-color: #2563eb;
}

.sd-tab-panel {
    display: none;
}

.sd-tab-panel.active {
    display: block;
}

/* Overview 3-col grid */
.sd-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.sd-info-card {
    background-color: #151820;
    border: 1px solid #1e2230;
    border-radius: 10px;
    padding: 20px;
}

.sd-info-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

.sd-info-table {
    width: 100%;
}

.sd-info-table td {
    padding: 5px 0;
    font-size: 0.8rem;
    vertical-align: top;
}

.sd-info-table td:first-child {
    color: #6b7280;
    width: 120px;
}

.sd-info-table td:last-child {
    color: #c9d1d9;
}

/* ═══════════════════════════════════════════════════════
   SVG METRIC RINGS
   ═══════════════════════════════════════════════════════ */
.metric-ring-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.metric-ring {
    width: 48px;
    height: 48px;
}

.metric-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 3;
}

.metric-ring-fill {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dasharray 0.8s ease-out, stroke 0.3s;
}

.metric-ring-label {
    text-align: center;
    line-height: 1.1;
}

.metric-ring-label .fw-bold {
    font-size: 0.78rem;
}

.metric-ring-label small {
    font-size: 0.65rem;
    color: #6b7280;
    display: block;
}

/* ═══════════════════════════════════════════════════════
   UPTIME BADGE
   ═══════════════════════════════════════════════════════ */
.uptime-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    font-size: 0.82rem;
    color: #22c55e;
    font-weight: 600;
}

.uptime-ring {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.uptime-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 3;
}

.uptime-ring-fill {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dasharray 0.8s ease-out;
}

.uptime-label {
    font-size: 0.68rem;
    font-weight: 400;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════
   ENVIRONMENT ACCENT BORDERS
   ═══════════════════════════════════════════════════════ */
.env-accent--prod {
    border-left: 3px solid #ef4444 !important;
}
.env-accent--uat {
    border-left: 3px solid #f59e0b !important;
}
.env-accent--test {
    border-left: 3px solid #3b82f6 !important;
}
.env-accent--default {
    border-left: 3px solid #6b7280 !important;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .dash-charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    .dash-mid-grid,
    .dash-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .dash-mid-grid > :nth-child(3),
    .dash-grid-3 > :nth-child(3) {
        grid-column: 1 / -1;
    }
    .usage-grid {
        grid-template-columns: 1fr 1fr;
    }
    .usage-grid > :nth-child(3) {
        grid-column: 1 / -1;
    }
    .sd-overview-grid {
        grid-template-columns: 1fr 1fr;
    }
    .srv-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .dash-main-grid {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "r1c1     r1c2     live"
            "r1c3     r1c3     live"
            "timeline timeline timeline";
    }
    .dash-bottom-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .dash-charts-grid,
    .dash-mid-grid,
    .dash-grid-3,
    .usage-grid {
        grid-template-columns: 1fr;
    }
    .dash-two-col,
    .dash-grid-2 {
        grid-template-columns: 1fr;
    }
    .dash-mid-grid > :nth-child(3),
    .dash-grid-3 > :nth-child(3),
    .usage-grid > :nth-child(3) {
        grid-column: auto;
    }
    .dash-main-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "r1c1"
            "r1c2"
            "r1c3"
            "live"
            "timeline";
    }
    .dash-main-grid .la-feed {
        max-height: 300px;
    }
    .dash-bottom-grid {
        grid-template-columns: 1fr;
    }
    .ht-body {
        flex-direction: column;
    }
    .ht-summary {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.06);
        padding-left: 0;
        padding-top: 10px;
        justify-content: space-around;
    }
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .kpi-card-value {
        font-size: 1.8rem;
    }
    .sd-overview-grid {
        grid-template-columns: 1fr;
    }
    .sd-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .srv-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    .header-datetime {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        padding: 16px;
    }
    .top-header {
        padding: 12px 16px;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .kpi-card-value {
        font-size: 1.5rem;
    }
    .kpi-card-icon {
        width: 34px;
        height: 34px;
    }
    .kpi-card-icon svg {
        width: 18px;
        height: 18px;
    }
    .header-search {
        flex: 0 1 200px;
    }
    .header-user-info {
        display: none;
    }
    .sd-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .servers-table th:nth-child(6),
    .servers-table td:nth-child(6),
    .servers-table th:nth-child(7),
    .servers-table td:nth-child(7) {
        display: none;
    }
    /* Infra table: hide Healthy, Warning columns */
    .infra-table th:nth-child(4),
    .infra-table td:nth-child(4),
    .infra-table th:nth-child(5),
    .infra-table td:nth-child(5),
    .infra-table th:nth-child(6),
    .infra-table td:nth-child(6) {
        display: none;
    }
    .srv-grid {
        grid-template-columns: 1fr;
    }
    .heatmap-grid {
        grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
        gap: 3px;
    }
    .heatmap-tile-label {
        font-size: 0.45rem;
    }
    .heatmap-legend {
        gap: 8px;
    }
    .alert-ticker {
        padding: 6px 10px;
        gap: 6px;
    }
    .alert-ticker-content {
        font-size: 0.72rem;
    }
    .last-refresh-label {
        display: none;
    }
    .ops-stat-icon {
        width: 30px;
        height: 30px;
    }
    .ops-stat-icon svg {
        width: 15px;
        height: 15px;
    }
    .ops-stat-value {
        font-size: 0.88rem;
    }
    .srv-card-name {
        max-width: 55%;
        font-size: 0.85rem;
    }
    .recent-incident-text {
        max-width: 160px;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .heatmap-grid {
        grid-template-columns: repeat(auto-fill, minmax(26px, 1fr));
    }
    .kpi-card {
        padding: 14px 16px 10px;
    }
    .kpi-card-value {
        font-size: 1.8rem;
    }
    .page-header h1 {
        font-size: 1.2rem;
    }
    .page-header .page-subtitle {
        font-size: 0.75rem;
    }
    .main-content {
        padding: 12px;
    }
    .infra-section {
        padding: 14px;
    }
    .srv-section {
        padding: 14px;
    }
    .usage-card {
        padding: 14px;
    }
    .dash-card {
        padding: 14px;
    }
}

/* ── Scheduled Actions action buttons ── */
.sa-action-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.72rem;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.04);
    color: #c9d1d9;
    transition: all 0.15s;
    margin-left: 2px;
}
.sa-action-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.1); }
.sa-action-btn--run { color: #22c55e; border-color: rgba(34,197,94,0.3); }
.sa-action-btn--run:hover { background: rgba(34,197,94,0.15); color: #4ade80; }
.sa-action-btn--edit { color: #60a5fa; border-color: rgba(96,165,250,0.3); }
.sa-action-btn--edit:hover { background: rgba(96,165,250,0.15); color: #93c5fd; }
.sa-action-btn--clone { color: #a78bfa; border-color: rgba(167,139,250,0.3); }
.sa-action-btn--clone:hover { background: rgba(167,139,250,0.15); color: #c4b5fd; }
.sa-action-btn--toggle { color: #fbbf24; border-color: rgba(251,191,36,0.3); }
.sa-action-btn--toggle:hover { background: rgba(251,191,36,0.15); color: #fcd34d; }
.sa-action-btn--delete { color: #f87171; border-color: rgba(248,113,113,0.3); }
.sa-action-btn--delete:hover { background: rgba(248,113,113,0.15); color: #fca5a5; }
