/* ================================================
   Elite Dangerous Inspired Theme
   ================================================ */

:root {
    /* Core Elite colors */
    --ed-orange: #ff7100;
    --ed-orange-dim: #cc5a00;
    --ed-orange-glow: rgba(255, 113, 0, 0.4);
    --ed-blue: #0a9dff;
    --ed-blue-dim: #0077cc;
    --ed-blue-glow: rgba(10, 157, 255, 0.3);
    --ed-cyan: #00ffd5;
    --ed-red: #ff3333;
    --ed-green: #00ff66;
    --ed-yellow: #ffaa00;

    /* Backgrounds — warmer dark navy */
    --ed-bg-body: #0d1117;
    --ed-bg-body-grad: #141a22;
    --ed-bg-surface: #161b22;
    --ed-bg-elevated: #1c2129;
    --ed-bg-input: #222830;
    --ed-bg-hover: #282e38;
    --ed-bg-dark: #0d1117;
    --ed-bg-panel: rgba(22, 27, 34, 0.95);
    --ed-bg-panel-hover: rgba(28, 33, 41, 0.98);
    --ed-bg-header: rgba(255, 113, 0, 0.08);

    /* Borders — more visible */
    --ed-border-subtle: #2d333b;
    --ed-border: rgba(255, 113, 0, 0.25);
    --ed-border-bright: rgba(255, 113, 0, 0.5);
    --ed-border-blue: rgba(10, 157, 255, 0.3);
    --ed-border-strong: #444c56;

    /* Text — better hierarchy (WCAG AA compliant against ~#161b22) */
    --ed-text: #e6edf3;
    --ed-text-secondary: #b0b8c1;
    --ed-text-dim: #b0b8c1;
    --ed-text-muted: #95a0ab;
    --ed-text-faint: #95a0ab;
    --ed-text-orange: #ff9544;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Eurostile', 'Segoe UI', 'Arial', sans-serif;
    background: radial-gradient(ellipse at center, var(--ed-bg-body-grad) 0%, var(--ed-bg-body) 100%);
    background-attachment: fixed;
    color: var(--ed-text);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--ed-text);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1 {
    font-size: 1.5rem;
    color: var(--ed-orange);
    text-shadow: 0 0 20px var(--ed-orange-glow);
}

/* Links */
a, .btn-link {
    color: var(--ed-blue);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--ed-orange);
    text-shadow: 0 0 8px var(--ed-orange-glow);
}

/* ================================================
   Elite Panel System
   ================================================ */

.ed-panel {
    background: var(--ed-bg-panel);
    border: 1px solid var(--ed-border);
    position: relative;
    margin-bottom: 1rem;
}

/* Corner accents */
.ed-panel::before,
.ed-panel::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--ed-orange);
    border-style: solid;
    border-width: 0;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.ed-panel::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.ed-panel::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.ed-panel:hover::before,
.ed-panel:hover::after {
    opacity: 1;
}

/* Panel header */
.ed-panel-header {
    background: var(--ed-bg-header);
    border-bottom: 1px solid var(--ed-border);
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-orange);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ed-panel-body {
    padding: 1rem;
}

.ed-panel-body.no-padding {
    padding: 0;
}

/* ================================================
   Stats Display
   ================================================ */

.ed-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.ed-stat {
    background: linear-gradient(180deg, rgba(255, 113, 0, 0.05) 0%, transparent 100%);
    border: 1px solid var(--ed-border);
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.ed-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ed-orange), transparent);
    opacity: 0.5;
}

.ed-stat:hover {
    background: linear-gradient(180deg, rgba(255, 113, 0, 0.1) 0%, transparent 100%);
    border-color: var(--ed-border-bright);
}

.ed-stat-value {
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--ed-orange);
    line-height: 1;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 15px var(--ed-orange-glow);
}

.ed-stat-value.blue {
    color: var(--ed-blue);
    text-shadow: 0 0 15px var(--ed-blue-glow);
}

.ed-stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ed-text-dim);
}

/* ================================================
   Data Tables
   ================================================ */

.ed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ed-table thead {
    background: var(--ed-bg-header);
}

.ed-table th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-text-dim);
    border-bottom: 1px solid var(--ed-border);
}

.ed-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 113, 0, 0.1);
    transition: background 0.2s;
}

.ed-table tbody tr {
    cursor: pointer;
    transition: all 0.2s;
}

.ed-table tbody tr:hover {
    background: rgba(255, 113, 0, 0.08);
}

.ed-table tbody tr:hover td {
    color: var(--ed-text-orange);
}

.ed-table .text-end {
    text-align: right;
}

.ed-table .text-center {
    text-align: center;
}

/* Row highlight animation for new data */
.ed-table tbody tr.new-data {
    animation: row-highlight 2s ease-out;
}

@keyframes row-highlight {
    0% {
        background: rgba(255, 113, 0, 0.3);
        box-shadow: inset 0 0 20px var(--ed-orange-glow);
    }
    100% {
        background: transparent;
        box-shadow: none;
    }
}

/* ================================================
   State Badges
   ================================================ */

.ed-badge {
    display: inline-block;
    padding: 0.2em 0.5em;
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    background: transparent;
}

.ed-badge-stronghold {
    color: #9b59b6;
    border-color: rgba(155, 89, 182, 0.5);
}

.ed-badge-fortified {
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.5);
}

.ed-badge-exploited {
    color: #f07b05;
    border-color: rgba(240, 123, 5, 0.5);
}

.ed-badge-contested {
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.5);
}

.ed-badge-turmoil {
    color: var(--ed-yellow);
    border-color: rgba(255, 170, 0, 0.5);
}

.ed-badge-unoccupied {
    color: #a0a8b0;
    border-color: rgba(160, 168, 176, 0.5);
}

.ed-badge-unknown {
    color: var(--ed-text-dim);
    border-color: rgba(136, 136, 153, 0.5);
}

/* ================================================
   Live Status Indicator
   ================================================ */

.ed-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ed-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.ed-live-dot.connected {
    background: var(--ed-green);
    box-shadow: 0 0 6px var(--ed-green);
    animation: live-pulse 2s ease-in-out infinite;
}

.ed-live-dot.connecting {
    background: var(--ed-yellow);
    animation: live-blink 0.6s ease-in-out infinite;
}

.ed-live-dot.offline {
    background: var(--ed-text-dim);
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--ed-green); }
    50% { opacity: 0.7; box-shadow: 0 0 12px var(--ed-green); }
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.ed-live-text {
    color: var(--ed-text-dim);
}

.ed-live-text.connected {
    color: var(--ed-green);
}

/* ================================================
   Buttons
   ================================================ */

.ed-btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--ed-orange);
    background: transparent;
    color: var(--ed-orange);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ed-btn:hover {
    background: rgba(255, 113, 0, 0.15);
    box-shadow: 0 0 10px var(--ed-orange-glow);
    color: var(--ed-orange);
}

.ed-btn-blue {
    border-color: var(--ed-blue);
    color: var(--ed-blue);
}

.ed-btn-blue:hover {
    background: rgba(10, 157, 255, 0.15);
    box-shadow: 0 0 10px var(--ed-blue-glow);
    color: var(--ed-blue);
}

/* ================================================
   Alerts
   ================================================ */

.ed-alert {
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-left: 3px solid var(--ed-red);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.ed-alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
    border-left-color: var(--ed-yellow);
}

.ed-alert strong {
    color: var(--ed-red);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.ed-alert-warning strong {
    color: var(--ed-yellow);
}

/* ================================================
   Forms
   ================================================ */

.ed-input, .ed-select {
    background: var(--ed-bg-input);
    border: 1px solid var(--ed-border);
    color: var(--ed-text);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.ed-input:focus, .ed-select:focus {
    outline: none;
    border-color: var(--ed-orange);
    box-shadow: 0 0 10px var(--ed-orange-glow);
}

.ed-input::placeholder {
    color: var(--ed-text-dim);
}

.ed-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-text-dim);
    margin-bottom: 0.3rem;
}

/* ================================================
   Navigation
   ================================================ */

.ed-nav {
    background: var(--ed-bg-panel);
    border-right: 1px solid var(--ed-border);
}

.ed-nav-brand {
    padding: 1rem;
    border-bottom: 1px solid var(--ed-border);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

.ed-nav-brand .ed {
    color: var(--ed-orange);
    font-weight: 600;
    text-shadow: 0 0 10px var(--ed-orange-glow);
}

.ed-nav-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--ed-text-dim);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.ed-nav-item:hover {
    color: var(--ed-text);
    background: rgba(255, 113, 0, 0.05);
    border-left-color: var(--ed-orange);
}

.ed-nav-item.active {
    color: var(--ed-orange);
    background: rgba(255, 113, 0, 0.1);
    border-left-color: var(--ed-orange);
}

.ed-nav-icon {
    margin-right: 0.5rem;
    opacity: 0.7;
}

/* ================================================
   Layout Utilities
   ================================================ */

.ed-grid {
    display: grid;
    gap: 1rem;
}

.ed-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ed-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .ed-grid-2, .ed-grid-3 {
        grid-template-columns: 1fr;
    }
}

.ed-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ed-col {
    flex: 1;
}

/* ================================================
   Scrollbars
   ================================================ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--ed-bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--ed-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ed-orange);
}

/* ================================================
   Loading
   ================================================ */

.ed-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.ed-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--ed-border);
    border-top-color: var(--ed-orange);
    border-radius: 50%;
    animation: ed-spin 1s linear infinite;
}

@keyframes ed-spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   Pagination
   ================================================ */

.ed-pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1rem;
}

.ed-page-btn {
    padding: 0.4rem 0.7rem;
    background: transparent;
    border: 1px solid var(--ed-border);
    color: var(--ed-text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ed-page-btn:hover:not(:disabled) {
    border-color: var(--ed-orange);
    color: var(--ed-orange);
}

.ed-page-btn.active {
    background: var(--ed-orange);
    border-color: var(--ed-orange);
    color: #000;
}

.ed-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ================================================
   Text Utilities
   ================================================ */

.text-orange { color: #f07b05 !important; }
.text-blue { color: var(--ed-blue) !important; }
.text-green { color: #00ff88 !important; }
.text-red { color: #ff4444 !important; }
.text-yellow { color: #ffcc00 !important; }
.text-info { color: #3498db !important; }
.text-dim { color: var(--ed-text-dim) !important; }
.text-muted { color: var(--ed-text-muted) !important; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: monospace; }

/* ================================================
   Scanline Effect (subtle)
   ================================================ */

.ed-scanlines::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ================================================
   Bootstrap Overrides
   ================================================ */

.btn-primary {
    background: var(--ed-orange);
    border-color: var(--ed-orange);
    color: #000;
}

.btn-primary:hover {
    background: var(--ed-orange-dim);
    border-color: var(--ed-orange-dim);
}

.btn-outline-primary {
    color: var(--ed-orange);
    border-color: var(--ed-orange);
    background: transparent;
}

.btn-outline-primary:hover {
    background: rgba(255, 113, 0, 0.15);
    border-color: var(--ed-orange);
    color: var(--ed-orange);
}

.btn-outline-danger {
    color: var(--ed-red);
    border-color: var(--ed-red);
}

.btn-sm {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card {
    background: var(--ed-bg-panel);
    border: 1px solid var(--ed-border);
    border-radius: 0;
}

.card-header {
    background: var(--ed-bg-header);
    border-bottom: 1px solid var(--ed-border);
    color: var(--ed-orange);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.6rem 1rem;
}

.table {
    color: var(--ed-text);
    margin-bottom: 0;
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 113, 0, 0.1);
}

.table thead th {
    background: var(--ed-bg-header);
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-text-dim);
    border-bottom: 1px solid var(--ed-border);
}

.table tbody tr {
    transition: background 0.2s;
}

.table-hover tbody tr:hover {
    background: rgba(255, 113, 0, 0.08) !important;
    color: var(--ed-text-orange);
}

.form-control, .form-select {
    background: var(--ed-bg-input);
    border: 1px solid var(--ed-border);
    color: var(--ed-text);
    border-radius: 0;
}

.form-control:focus, .form-select:focus {
    background: var(--ed-bg-hover);
    border-color: var(--ed-orange);
    box-shadow: 0 0 0 2px var(--ed-orange-glow);
    color: var(--ed-text);
}

.form-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-text-dim);
}

.alert {
    border-radius: 0;
    border-left-width: 3px;
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: rgba(255, 170, 0, 0.3);
    border-left-color: var(--ed-yellow);
    color: var(--ed-text);
}

/* Breadcrumb dark theme */
.breadcrumb {
    --bs-breadcrumb-divider-color: var(--ed-text-muted);
    --bs-breadcrumb-item-active-color: var(--ed-text-secondary);
}

.breadcrumb-item a {
    color: var(--ed-text-muted);
}

.breadcrumb-item a:hover {
    color: var(--ed-orange);
}

.badge {
    font-weight: 400;
    border-radius: 0;
}

/* State badges */
.badge-state {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-sm {
    font-size: 0.6rem;
    padding: 1px 4px;
}

.badge-stronghold {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
    border: 1px solid #9b59b6;
}

.badge-fortified {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid #3498db;
}

.badge-exploited {
    background: rgba(240, 123, 5, 0.2);
    color: #f07b05;
    border: 1px solid #f07b05;
}

.badge-contested {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.badge-turmoil {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.badge-unoccupied {
    background: rgba(160, 168, 176, 0.15);
    color: #a0a8b0;
    border: 1px solid #a0a8b0;
}

.badge-unknown {
    background: rgba(160, 168, 176, 0.15);
    color: #a0a8b0;
    border: 1px solid #a0a8b0;
}

/* Stat cards */
.stat-card {
    background: linear-gradient(180deg, rgba(255, 113, 0, 0.05) 0%, transparent 100%);
    border: 1px solid var(--ed-border);
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ed-orange), transparent);
    opacity: 0.5;
}

.stat-card:hover {
    background: linear-gradient(180deg, rgba(255, 113, 0, 0.1) 0%, transparent 100%);
    border-color: var(--ed-border-bright);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--ed-orange);
    line-height: 1;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 15px var(--ed-orange-glow);
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ed-text-dim);
}

/* Live status dot */
.live-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.75rem;
    vertical-align: middle;
    cursor: help;
}

.live-status-dot.live {
    background: var(--ed-green);
    box-shadow: 0 0 6px var(--ed-green);
    animation: live-pulse 2s ease-in-out infinite;
}

.live-status-dot.connecting {
    background: var(--ed-yellow);
    animation: live-blink 0.6s ease-in-out infinite;
}

.live-status-dot.offline {
    background: var(--ed-text-dim);
}

/* New data row animation */
.activity-new {
    animation: row-highlight 2s ease-out;
}

/* Content area */
.content {
    padding-top: 1rem;
}

/* Error boundary */
.blazor-error-boundary {
    background: var(--ed-red);
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--ed-green);
}

.invalid {
    outline: 1px solid var(--ed-red);
}

.validation-message {
    color: var(--ed-red);
    font-size: 0.8rem;
}

/* Cascade cards */
.cascade-card {
    background: var(--ed-bg-panel);
    border: 1px solid var(--ed-border);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.cascade-card:hover {
    border-color: var(--ed-border-bright);
}

.cascade-rank {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--ed-orange);
    min-width: 2.5rem;
    text-shadow: 0 0 10px var(--ed-orange-glow);
}

.dependent-count {
    font-size: 2rem;
    font-weight: 300;
    color: var(--ed-blue);
    text-shadow: 0 0 10px var(--ed-blue-glow);
}

/* Nav menu specifics */
.nav-badge {
    font-size: 0.6rem;
    padding: 0.15em 0.4em;
    margin-left: 0.5rem;
    background: var(--ed-red);
    color: white;
}

/* Vulnerable page specific */
.stat-card-red .stat-value {
    color: var(--ed-red);
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.4);
}

.stat-card-yellow .stat-value {
    color: var(--ed-yellow);
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.stat-card-green .stat-value {
    color: var(--ed-green);
    text-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
}

.table-header-red {
    background: rgba(255, 51, 51, 0.15) !important;
    border-bottom: 2px solid var(--ed-red) !important;
}

.table-header-yellow {
    background: rgba(255, 170, 0, 0.15) !important;
    border-bottom: 2px solid var(--ed-yellow) !important;
}

.alert-vulnerable {
    background: rgba(255, 51, 51, 0.1);
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-left: 3px solid var(--ed-red);
}

.alert-at-risk {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.3);
    border-left: 3px solid var(--ed-yellow);
}

/* Pulse animation for alerts */
.ed-pulse {
    animation: alert-pulse 2s ease-in-out infinite;
}

@keyframes alert-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ================================================
   Top Navigation Bar
   ================================================ */

.ed-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ed-topnav {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.98) 0%, rgba(13, 17, 23, 0.95) 100%);
    border-bottom: 1px solid var(--ed-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.ed-topnav-inner {
    display: flex;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 56px;
}

.ed-brand {
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--ed-text);
    text-decoration: none;
    margin-right: 2rem;
    transition: all 0.2s;
}

.ed-brand:hover {
    color: var(--ed-text);
    text-shadow: 0 0 15px var(--ed-orange-glow);
}

.ed-brand-ed {
    color: var(--ed-orange);
    font-weight: 600;
    text-shadow: 0 0 10px var(--ed-orange-glow);
}

.ed-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.ed-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ed-text-dim);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.ed-nav-link:hover {
    color: var(--ed-text);
    background: rgba(255, 113, 0, 0.08);
    border-color: rgba(255, 113, 0, 0.2);
}

.ed-nav-link.active {
    color: var(--ed-orange);
    background: rgba(255, 113, 0, 0.12);
    border-color: var(--ed-border);
}

.ed-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ed-orange);
    box-shadow: 0 0 8px var(--ed-orange-glow);
}

.ed-nav-link-alert {
    color: var(--ed-red);
}

.ed-nav-link-alert:hover {
    color: var(--ed-red);
    background: rgba(255, 51, 51, 0.1);
    border-color: rgba(255, 51, 51, 0.3);
}

.ed-nav-link-alert.active {
    color: var(--ed-red);
    background: rgba(255, 51, 51, 0.15);
    border-color: rgba(255, 51, 51, 0.4);
}

.ed-nav-link-alert.active::after {
    background: var(--ed-red);
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.ed-nav-badge {
    font-size: 0.6rem;
    padding: 0.15em 0.4em;
    background: var(--ed-red);
    color: white;
    border-radius: 2px;
    font-weight: 500;
    min-width: 1.2em;
    text-align: center;
}

.ed-nav-search {
    margin-left: auto;
}

.ed-nav-search .ed-nav-link {
    border: 1px solid var(--ed-border);
    background: var(--ed-bg-surface);
}

.ed-nav-search .ed-nav-link:hover {
    border-color: var(--ed-blue);
    color: var(--ed-blue);
    background: rgba(10, 157, 255, 0.1);
}

/* Main Content Area */
.ed-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ed-content {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .ed-topnav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .ed-brand {
        margin-right: auto;
    }

    .ed-nav-links {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .ed-nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }

    .ed-nav-search {
        order: 2;
        margin-left: 0;
    }

    .ed-content {
        padding: 1rem;
    }
}

/* Remove old sidebar styles */
.page, .sidebar, .top-row, .nav-scrollable {
    all: unset;
}

.navbar-toggler {
    display: none;
}

/* ================================================
   Shared: Loading / Empty / Error States
   ================================================ */

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ed-bg-surface);
    border: 1px solid var(--ed-border-subtle);
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    color: var(--ed-text-muted);
    gap: 8px;
}

.empty-state h4 {
    color: var(--ed-text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--ed-text-muted);
    margin: 0;
}

.empty-state small {
    color: var(--ed-text-muted);
    font-size: 0.8rem;
}

.error-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--ed-bg-surface);
    border: 1px solid var(--ed-border-subtle);
    border-radius: 8px;
}

.error-state h4 {
    color: var(--ed-text-secondary);
    margin-bottom: 8px;
}

.error-state p {
    color: var(--ed-text-muted);
    margin-bottom: 16px;
}

.btn-retry {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #f07b05;
    color: #f07b05;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-retry:hover {
    background: rgba(240, 123, 5, 0.1);
}

.btn-back {
    display: inline-block;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #f07b05;
    color: #f07b05;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-back:hover {
    background: rgba(240, 123, 5, 0.1);
}

/* ================================================
   Shared: Filter Panel
   ================================================ */

.filter-panel {
    background: linear-gradient(135deg, var(--ed-bg-surface) 0%, var(--ed-bg-elevated) 100%);
    border: 1px solid var(--ed-border-subtle);
    border-radius: 8px;
    padding: 16px;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ed-text-muted);
    font-weight: 600;
}

.filter-select {
    background: var(--ed-bg-input);
    border: 1px solid var(--ed-border-strong);
    color: var(--ed-text);
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 3px;
    min-width: 140px;
}

.filter-select:focus {
    background: var(--ed-bg-input);
    border-color: #f07b05;
    box-shadow: none;
    color: #fff;
}

/* ================================================
   Shared: Stats Row + Stat Card
   ================================================ */

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, var(--ed-bg-surface) 0%, var(--ed-bg-elevated) 100%);
    border: 1px solid var(--ed-border-subtle);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #f07b05;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--ed-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.stat-card .stat-sublabel {
    font-size: 0.7rem;
    color: var(--ed-text-muted);
    margin-top: 4px;
}

/* ================================================
   Shared: Panel
   ================================================ */

.panel {
    background: var(--ed-bg-surface);
    border: 1px solid var(--ed-border-subtle);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--ed-bg-elevated);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ed-text-secondary);
    border-bottom: 1px solid var(--ed-border-subtle);
}

.panel-body {
    padding: 16px;
    flex: 1;
    min-height: 0;
}

.panel-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(240, 123, 5, 0.15);
    border-radius: 3px;
    color: #f07b05;
    text-transform: none;
}

.panel-compact {
    margin-bottom: 12px;
}

/* ================================================
   Shared: Results Header
   ================================================ */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: var(--ed-text-secondary);
    font-size: 0.85rem;
}

.results-count strong {
    color: #f07b05;
}

/* ================================================
   Shared: Page Header
   ================================================ */

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: var(--ed-text);
}

.page-subtitle {
    color: var(--ed-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* ================================================
   Shared: Small Utilities
   ================================================ */

.clickable-row {
    cursor: pointer;
}
