html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.theme-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body {
    background-color: #f4f6f9;
}

.card {
    border-radius: 8px;
}

.navbar-brand span {
    line-height: 1.05;
}

.nav-link {
    font-size: 0.95rem;
}

.operations-nav {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 6px;
    display: inline-block;
}

.content-wrapper {
    min-height: calc(100vh - 140px); /* navbar + footer space */
}

footer {
    margin-bottom: 0 !important;
}

/* Improve card spacing */
.card {
    border-radius: 10px;
    transition: all 0.25s ease;
}

    .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

.recon-table {
    font-size: 0.8rem;
}

    .recon-table th,
    .recon-table td {
        padding: 0.25rem 0.4rem;
    }

.document-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
}

    .document-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }
/* ================================
   History Logs - Sortable Columns
================================ */

th.sortable {
    cursor: pointer;
    user-select: none;
}

    th.sortable:hover {
        background-color: #f2f2f2;
    }

.sort-indicator {
    font-size: 0.8em;
    color: #999;
    margin-left: 4px;
}

.recon-row-warning {
    background-color: rgba(255, 193, 7, 0.08);
}

.recon-row-fail {
    background-color: rgba(220, 53, 69, 0.10);
}

/* ================================
   Event Timeline styles
================================ */

.timeline-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
}

.timeline-time {
    width: 80px;
    font-family: monospace;
    color: #666;
}

.timeline-icon {
    width: 30px;
    text-align: center;
    display: inline-block;
}

.timeline-content {
    flex: 1;
}

.timeline-desc {
    font-size: 0.85em;
    color: #777;
}

.timeline-icon i {
    font-size: 1.1rem;
    width: 20px;
}

.timeline-toggle {
    transition: transform 0.2s ease;
}

    .timeline-toggle.collapsed {
        transform: rotate(-90deg);
    }

.timeline-minute {
    font-weight: 600;
    color: #666;
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.timeline-event {
    border-left: 4px solid transparent;
    padding-left: 8px;
    margin-bottom: 4px;
}

/* Alarm severity */
.severity-Alarm {
    border-left-color: #dc3545; /* bootstrap danger */
}

/* Warning / chatter */
.severity-Warning {
    border-left-color: #fd7e14;
}

/* Info / operator logs */
.severity-Info {
    border-left-color: #0d6efd;
}

/* Storm detection */
.severity-Storm {
    border-left-color: #6f42c1;
}

/* Older timeline events styles */
.older-burst-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.older-burst-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.older-burst-header {
    background: rgba(13, 110, 253, 0.04);
}

.older-burst-event {
    margin-bottom: 8px;
}

[data-bs-theme="dark"] .older-burst-card {
    border-color: rgba(255, 255, 255, 0.12);
}

[data-bs-theme="dark"] .older-burst-header {
    background: rgba(13, 110, 253, 0.10);
}

.older-burst-header .timeline-toggle {
    display: inline-block;
    transition: transform 0.2s ease;
}

.older-burst-header[aria-expanded="true"] .timeline-toggle {
    transform: rotate(90deg);
}

.older-burst-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .older-burst-meta .badge {
        font-weight: 500;
    }

[data-bs-theme="dark"] .older-burst-meta .text-bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #f8f9fa !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

.older-events-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.older-events-view {
    margin-top: 8px;
}

.older-filter-btn.active {
    pointer-events: none;
}

.active-alarms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.active-generator-card {
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 8px;
    background: var(--bs-body-bg);
}

.active-generator-header {
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.gen-name {
    margin-left: 6px;
    font-size: 1rem;
}

.active-generator-alarms {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
}

.alarm-badge {
    font-size: 0.85rem;
    display: block;
    margin-bottom: 6px;
}

.alarm-active-row {
    background-color: rgba(var(--bs-danger-rgb), 0.16);
    border-left: 4px solid rgba(var(--bs-danger-rgb), 0.55);
    font-weight: 600;
}

[data-bs-theme="dark"] .alarm-active-row {
    background-color: rgba(var(--bs-danger-rgb), 0.16);
}

.refresh-status {
    display: inline-block;
    width: 140px;
    text-align: right;
}

/* Dashboard event alart badge and legend */
.card-title .badge {
    font-size: 0.75rem;
}

.event-legend {
    font-size: 0.9rem;
    color: #666;
}

    .event-legend i {
        margin-right: 4px;
    }

/* Portal apert bar styles */
.portal-alert {
    width: 100%;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    max-height: 80px;
    transition: opacity 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
}

    .portal-alert.closing {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .portal-alert a {
        color: inherit;
        font-weight: 600;
        text-decoration: underline;
    }

    .portal-alert a:hover {
        opacity: 0.85;
    }

        .portal-alert a {
            color: inherit;
            font-weight: 600;
            text-decoration: underline;
        }

    .portal-alert a:hover {
        opacity: 0.85;
    }

.portal-alert-info {
    background: #0d6efd;
    color: white;
}

.portal-alert-warning {
    background: #ffc107;
    color: #222;
}

.portal-alert-critical {
    background: #dc3545;
    color: white;
}

.portal-alert-icon {
    font-size: 16px;
}

.portal-alert-countdown {
    display: inline-block;
    min-width: 18ch;
    text-align: left;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}