/* ===================================================
   ITpiac - IT Beszerzési Érdektérkép
   Professional Dark Theme Stylesheet
   =================================================== */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0e0e24;
    --bg-card: #12122a;
    --bg-card-hover: #181840;
    --bg-input: #0f0f28;
    --bg-nav: #08081aee;
    --border-color: #1e1e4a;
    --border-hover: #2a2a6a;
    --text-primary: #e8e8f0;
    --text-secondary: #9090b0;
    --text-muted: #606080;
    --accent-blue: #3b82f6;
    --accent-blue-dim: #2563eb;
    --accent-green: #22c55e;
    --accent-green-dim: #16a34a;
    --accent-amber: #f59e0b;
    --accent-amber-dim: #d97706;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --glow-green: 0 0 20px rgba(34, 197, 94, 0.3);
    --glow-amber: 0 0 20px rgba(245, 158, 11, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.6);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --nav-height: 64px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #2a2a5a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a7a;
}

/* --- Selection --- */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* --- Navigation Bar --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: 1000;
    gap: 2rem;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.nav-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.15);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-actions {
    flex-shrink: 0;
}

.nav-search-mini {
    position: relative;
}

.nav-search-mini input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    width: 200px;
    outline: none;
    transition: all var(--transition);
}

.nav-search-mini input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    width: 280px;
}

.nav-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1001;
}

.nav-search-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.nav-search-dropdown a:last-child {
    border-bottom: none;
}

.nav-search-dropdown a:hover {
    background: rgba(59, 130, 246, 0.1);
}

.nav-search-dropdown .suggest-type {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* --- Main Content --- */
#app {
    padding-top: calc(var(--nav-height) + 1.5rem);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Pages --- */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

/* --- Stat Cards Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card.blue::before { background: var(--accent-blue); }
.stat-card.green::before { background: var(--accent-green); }
.stat-card.amber::before { background: var(--accent-amber); }
.stat-card.red::before { background: var(--accent-red); }
.stat-card.purple::before { background: var(--accent-purple); }
.stat-card.cyan::before { background: var(--accent-cyan); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-hover);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-value.blue { color: var(--accent-blue); }
.stat-value.green { color: var(--accent-green); }
.stat-value.amber { color: var(--accent-amber); }
.stat-value.red { color: var(--accent-red); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.cyan { color: var(--accent-cyan); }

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* --- Dashboard Layout --- */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 900px) {
    .dashboard-row,
    .profile-row {
        grid-template-columns: 1fr;
    }
}

/* --- Bar Chart (top orgs) --- */
.bar-chart-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.bar-chart-label {
    width: 200px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.bar-chart-label a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.bar-chart-label a:hover {
    color: var(--accent-blue);
}

.bar-chart-track {
    flex: 1;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    overflow: hidden;
    position: relative;
}

.bar-chart-fill {
    height: 100%;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    min-width: fit-content;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* --- Interest Group Circles --- */
.group-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.group-item:last-child {
    border-bottom: none;
}

.group-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.group-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Tables --- */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

tbody td {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

tbody td a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition);
}

tbody td a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.value-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--accent-green);
    white-space: nowrap;
}

.date-cell {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-accent {
    background: var(--accent-blue);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-blue-dim);
    box-shadow: var(--glow-blue);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-back {
    flex-shrink: 0;
}

/* --- Search --- */
.search-container {
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card-hover);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
}

.search-suggest .suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}

.search-suggest .suggest-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.search-suggest .suggest-item:last-child {
    border-bottom: none;
}

.search-suggest .suggest-name {
    font-size: 0.9rem;
}

.suggest-type {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.suggest-type.org { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.suggest-type.person { background: rgba(168,85,247,0.2); color: var(--accent-purple); }
.suggest-type.contract { background: rgba(34,197,94,0.2); color: var(--accent-green); }
.suggest-type.system { background: rgba(6,182,212,0.2); color: var(--accent-cyan); }
.suggest-type.framework { background: rgba(245,158,11,0.2); color: var(--accent-amber); }

/* --- Search Filters --- */
.search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* --- Search Results --- */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}

.result-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.result-card-title {
    font-size: 1rem;
    font-weight: 600;
}

.result-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-card-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-green);
    margin-top: 0.25rem;
}

/* --- Graph Container --- */
.graph-container {
    width: 100%;
    height: calc(100vh - var(--nav-height) - 140px);
    min-height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

/* --- Graph Controls --- */
.graph-controls {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.graph-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.graph-control-group > label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.layer-toggles {
    display: flex;
    gap: 0.75rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    accent-color: var(--accent-blue);
    width: 16px;
    height: 16px;
}

.control-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    width: 140px;
    outline: none;
    transition: all var(--transition);
}

.control-input:focus {
    border-color: var(--accent-blue);
}

/* --- Graph Legend --- */
.graph-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,255,255,0.2);
}

/* --- Timeline --- */
.timeline-container {
    width: 360px;
    position: relative;
}

.timeline-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    transition: box-shadow var(--transition);
}

.timeline-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.7);
}

.timeline-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.timeline-date-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-top: 0.3rem;
    font-family: var(--font-mono);
}

.timeline-histogram {
    width: 100%;
    height: 40px;
    margin-bottom: 0.3rem;
}

.timeline-histogram rect {
    fill: rgba(59, 130, 246, 0.3);
    transition: fill var(--transition);
}

.timeline-histogram rect.active {
    fill: var(--accent-blue);
}

/* --- System Timeline (vertical) --- */
.system-timeline {
    position: relative;
    padding-left: 2rem;
}

.system-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-entry {
    position: relative;
    padding: 1rem 0 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.timeline-entry:last-child {
    border-bottom: none;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -1.55rem;
    top: 1.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
    border: 2px solid var(--bg-card);
}

.timeline-entry-date {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.timeline-entry-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0.2rem 0;
}

.timeline-entry-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.timeline-entry-title a:hover {
    color: var(--accent-blue);
}

.timeline-entry-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-entry-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-green);
    font-size: 0.85rem;
}

/* --- Progress Bar (Framework Utilization) --- */
.progress-container {
    margin: 1rem 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.progress-label span:first-child {
    color: var(--text-secondary);
}

.progress-label span:last-child {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-green);
}

.progress-bar {
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
    position: relative;
}

.progress-fill::after {
    content: attr(data-pct);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

/* --- Admin --- */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-grid > .card:first-child {
    grid-column: 1 / -1;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-log {
    max-height: 300px;
    overflow-y: auto;
}

.admin-log-entry {
    padding: 0.4rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

.admin-log-entry:last-child {
    border-bottom: none;
}

.admin-log-time {
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* --- Pipeline Progress --- */
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pipeline-step {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
}
.pipeline-step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.pipeline-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.pipeline-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.pipeline-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}
.pipeline-bar-track {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.pipeline-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.pipeline-done .pipeline-icon {
    background: var(--accent-green);
    color: #fff;
}
.pipeline-done .pipeline-title {
    color: var(--accent-green);
}
.pipeline-done .pipeline-bar-fill {
    background: var(--accent-green);
}
.pipeline-active .pipeline-icon {
    background: var(--accent-blue);
    color: #fff;
    animation: pulse-icon 1.5s ease infinite;
}
.pipeline-active .pipeline-title {
    color: var(--accent-blue);
}
.pipeline-active .pipeline-bar-fill {
    background: var(--accent-blue);
}
@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.pipeline-pending .pipeline-icon {
    background: var(--text-muted);
    color: var(--bg-card);
}
.pipeline-pending .pipeline-title {
    color: var(--text-muted);
}
.pipeline-pending .pipeline-bar-fill {
    background: var(--text-muted);
}

/* --- Admin Form --- */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.admin-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.admin-form .form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.admin-form .control-input {
    width: 100%;
    box-sizing: border-box;
}
.admin-form .form-row {
    display: flex;
    gap: 1rem;
}
.admin-form .form-row .form-group {
    flex: 1;
}
.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm, 6px);
}

/* Scheduler table */
#scheduler-status table {
    width: 100%;
}
#scheduler-status td, #scheduler-status th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
#scheduler-status th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* --- Systems Grid --- */
.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.system-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}

.system-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}

.system-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.system-card-category {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.system-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.system-card-maintainer {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* --- Detail fields --- */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.detail-value a {
    color: var(--accent-blue);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

.detail-value.mono {
    font-family: var(--font-mono);
}

.detail-value.large {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-green);
}

/* --- Person & Org tags --- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
}

.tag:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.tag.green {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--accent-green);
}

.tag.amber {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-amber);
}

.tag.purple {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

/* --- Toast Notifications --- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.2rem;
    font-size: 0.85rem;
    box-shadow: var(--shadow-card-hover);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
    max-width: 380px;
}

.toast.success {
    border-left: 3px solid var(--accent-green);
}

.toast.error {
    border-left: 3px solid var(--accent-red);
}

.toast.info {
    border-left: 3px solid var(--accent-blue);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(10px); }
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Hidden utility --- */
.hidden {
    display: none !important;
}

/* --- Participant value bar (framework page) --- */
.participant-bar-track {
    width: 100%;
    height: 18px;
    background: var(--bg-secondary);
    border-radius: 9px;
    overflow: hidden;
}

.participant-bar-fill {
    height: 100%;
    border-radius: 9px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.6s ease;
}

/* --- Highlighter for current maintainer --- */
.highlight-current {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.highlight-current .highlight-badge {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 1rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #navbar {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .nav-links {
        gap: 0.1rem;
    }

    .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .nav-link .nav-icon {
        display: none;
    }

    .nav-actions {
        display: none;
    }

    #app {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .search-results {
        grid-template-columns: 1fr;
    }

    .graph-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .timeline-container {
        width: 100%;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}
