/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #000000;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-hover: #141414;
    --bg-light: #f0f0f0;
    --bg-active: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #FF6600;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --border: #1f1f1f;
    --transition-fast: 150ms ease;
    --transition-medium: 250ms ease;
}
.text-primary {
  color: var(--text-primary);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-muted {
  color: var(--text-muted);
}
.text-accent {
  color: var(--accent);
}
.icon {
  color: var(--text-primary);
  width: 14px;
  height: 14px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card--compact {
    padding: 1vh 1vw !important;
    margin: 0 !important;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}
.card h3 {
    color: #2c3e50;
}
.card-item{
    display: flex;
    width: 200px;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: black;
    list-style: none;
    color: white;
    text-decoration: none;
}

.dashboard-grid-section{
    display: flex;
    flex-direction: column;
    gap: 2vw;
}

.card-item-container{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    flex-direction: column;
    gap: 2vw;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn-info {
    background-color: #9b59b6;
    color: white;
}

.btn-info:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}
.btn-disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Result Box */
.result-box {
    margin-top: 1rem;
    padding: 1.5rem;
    border-radius: 4px;
    background-color: #ecf0f1;
    border-left: 4px solid #95a5a6;
}

.result-box.success {
    background-color: #d5f4e6;
    border-left-color: #2ecc71;
}

.result-box.info {
    background-color: #dfe6e9;
    border-left-color: #3498db;
}

.result-box h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.result-box p {
    margin-bottom: 0.5rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    transition: width 0.5s ease;
}

/* Content */
.content {
    background: white;
    border-radius: 8px;
    padding: 1rem;
}

.content h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.content h2 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content li {
    margin-bottom: 0.5rem;
}

/* Code Block */
.code-block {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
}

/* Dashboard */
.dashboard-controls {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 1rem 0;
}

.stat-label {
    color: #95a5a6;
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}



/* NAVIGATION BAR */

.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    overflow: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    margin-left: 35px;
    text-decoration: none;
}
.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-right: 8px;
}
.logo p {
    font-size: 10px;
    margin: 2.4px;
    color: var(--text-muted);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Nav Sections */
.nav-section {
    margin-bottom: 8px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
    user-select: none;
}

.nav-section-header:hover {
    background: var(--bg-hover);
}

.nav-section-header.active {
    background: var(--bg-active);
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.nav-section-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-section-header:hover .nav-section-icon {
    opacity: 1;
}

.nav-section-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-medium);
}

.nav-section.expanded .nav-section-chevron {
    transform: rotate(90deg);
}

/* Nav Items */
.nav-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition-medium);
}

.nav-section.expanded .nav-items {
    max-height: 500px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px 9px 42px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 24px;
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.nav-item.active::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* Single Nav Items (no nesting) */
.nav-single {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

.nav-single:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-single:hover .nav-section-icon {
    opacity: 1;
}

.nav-single.active {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.nav-single.active .nav-section-icon {
    opacity: 1;
    color: var(--accent);
}

/* Workspace Nav Items */
.nav-workspace {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    user-select: none;
}

.nav-workspace:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-workspace-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform var(--transition-medium);
}

/* Cascading flyout submenus. Each workspace row lives in a .nav-flyout-root;
   hovering it opens the .nav-flyout panel to the right (positioned by
   nav_flyout.js). The panel is position:fixed so it escapes the sidebar's
   overflow:hidden; it stays a DOM child of its root so pointer enter/leave
   containment keeps it open while the mouse is inside. Nested
   .nav-flyout-root elements inside a panel cascade the same way. */
.nav-workspace.open {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-flyout {
    position: fixed;
    min-width: 200px;
    max-width: 300px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateX(4px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
    z-index: 90;
}

.nav-flyout.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Inside a flyout the items are menu entries: no accordion indent, no dot. */
.nav-flyout .nav-item {
    padding: 9px 10px;
}

.nav-flyout .nav-item::before {
    display: none;
}

/* Pin button on workspace rows: hidden until the row is hovered (or the
   workspace is pinned). Pinned workspaces are reordered to the top of their
   section by nav_pins.js, persisted in localStorage. */
.nav-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    margin-right: 2px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.nav-pin svg {
    width: 13px;
    height: 13px;
}

.nav-workspace:hover .nav-pin,
.nav-pin:focus-visible {
    opacity: 1;
}

.nav-pin:hover {
    color: var(--text-primary);
    background: var(--bg-active);
}

.nav-workspace.pinned .nav-pin {
    opacity: 1;
    color: var(--accent);
}

/* Non-interactive header showing the parent's full name; only rendered
   visible (.show-head) when the row label is actually truncated. */
.nav-flyout-head {
    display: none;
    padding: 8px 10px 9px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    cursor: default;
    word-break: break-word;
}

.nav-flyout.show-head .nav-flyout-head {
    display: block;
}

/* Long-label handling: labels truncate with an ellipsis instead of being
   clipped by the sidebar edge. nav_tooltip.js detects rows that actually
   overflow and shows the full name in a .nav-tip bubble on hover. */
.nav-single .icon,
.nav-item .icon,
.nav-workspace-header .icon {
    flex-shrink: 0;
}

.nav-workspace-header {
    flex: 1;
    min-width: 0;
}

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

.nav-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Full-name popup for truncated nav rows. position:fixed (placed by
   nav_tooltip.js) so it escapes the sidebar's overflow:hidden; pill style
   matches the .metric-info tooltip. */
.nav-tip {
    position: fixed;
    max-width: 320px;
    background: #18181B;
    color: #FAFAFA;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    padding: 7px 11px;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    z-index: 100;
    pointer-events: none;
    word-break: break-word;
}

.nav-tip.visible {
    opacity: 1;
    visibility: visible;
}

/* Section Labels */
.nav-label {
    padding: 20px 12px 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Badge */
.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border-radius: 10px;
}

.nav-badge.warning {
    background: #f59e0b;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-card:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #374151, #4b5563);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Sidebar toggle button */
.sidebar-toggle {
    position: fixed;
    top: 11px;
    left: 16px;
    z-index: 1001;
    color: white;
    background-color: #000000;
    border: none;
    padding: 5px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.sidebar-toggle:hover {
    background-color: #212121;
}

/* MAIN LAYOUT CARD */
.main-content-container {
    flex: 1;
    padding: 16px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Add a new class for the white card */
.main-card {
    background-color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex: 1;
    /* Makes the card fill available space */
}

/* Override main-card styling for resource status page */
.main-card:has(.resource-status-container) {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Dashboard uses a plain white canvas. */
.main-card:has(.dashboard-container) {
    background-color: #FFFFFF;
    box-shadow: none;
}

.main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Footer */
.footer {
    color: white;
    text-align: center;
    padding: 5px;
    margin-top: auto;
    font-size: 0.75rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0 !important;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar:not(.open) {
        transform: translateX(-100%);
    }
}


/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
}

.modal-close {
    border: none;
    background-color: white;
    border-radius: 2px;
    padding: 2px;
    cursor: pointer;
}

.modal-close:hover {
    background-color: var(--bg-light);
}

/* Language Options */
.language-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.language-option:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.language-option[data-active="true"] {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.flag-emoji {
    font-size: 1.5rem;
}

/* ========================================
   Resource Status Overview Page
   ======================================== */

.resource-status-container {
    padding: 2rem;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    background: #000000;
    min-height: 100vh;
}

.resource-status-header {
    margin-bottom: 2rem;
}

.resource-status-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.resource-status-subtitle {
    color: #a0a0a0;
    font-size: 1rem;
    margin: 0;
}

/* Status Summary Grid */
.status-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .status-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .status-summary-grid {
        grid-template-columns: 1fr;
    }
}

.status-card {
    background: linear-gradient(135deg, #0a0a0a 0%, #141414 100%);
    border: 1px solid #1f1f1f;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.status-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    border-color: currentColor;
}

.status-card:hover::before {
    opacity: 1;
}

.status-card:active {
    transform: translateY(-2px);
}

.status-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.status-card:hover .status-card-icon {
    transform: scale(1.1);
}

.status-card-icon .icon {
    width: 28px;
    height: 28px;
}

.status-card--total {
    color: #3b82f6;
}

.status-card--total .status-card-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-card--active {
    color: #10b981;
}

.status-card--active .status-card-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-card--warning {
    color: #FF6600;
}

.status-card--warning .status-card-icon {
    background: rgba(255, 102, 0, 0.15);
    color: #FF6600;
}

.status-card--deleted {
    color: #6b7280;
}

.status-card--deleted .status-card-icon {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.status-card-content {
    flex: 1;
}

.status-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.status-card-label {
    font-size: 0.875rem;
    color: #a0a0a0;
    font-weight: 500;
}

/* Alert Boxes */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.alert .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
}

.alert--warning {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
    color: #ffffff;
}

.alert--warning .icon {
    color: #FF6600;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #ffffff;
}

.alert p {
    margin: 0;
    font-size: 0.875rem;
    color: #a0a0a0;
}

/* Resource Sections */
.resource-section {
    margin-bottom: 3rem;
}

.resource-section-header {
    margin-bottom: 1.5rem;
}

.resource-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 1rem 0;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #0a0a0a;
    border-radius: 12px;
    border: 1px solid #1f1f1f;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #a0a0a0;
}

.filter-group label .icon {
    width: 16px;
    height: 16px;
}

.filter-select {
    padding: 0.5rem 0.75rem;
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:hover {
    border-color: #FF6600;
    background: #1a1a1a;
}

.filter-select:focus {
    outline: none;
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn--secondary {
    background: #141414;
    color: #ffffff;
    border: 1px solid #1f1f1f;
}

.btn--secondary:hover {
    background: #1a1a1a;
    border-color: #FF6600;
}

.btn--sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.btn .icon--sm {
    width: 14px;
    height: 14px;
}


.resource-section h2 .icon {
    width: 24px;
    height: 24px;
    color: #FF6600;
}

.icon--success {
    color: #10b981;
}

.icon--warning {
    color: #FF6600;
}

.icon--muted {
    color: #6b7280;
}

.resource-section--warning {
    padding: 1.5rem;
    background: rgba(255, 102, 0, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

.resource-section--muted {
    opacity: 0.8;
}

/* Resource Table */
.table-container {
    background: #0a0a0a;
    border-radius: 16px;
    border: 1px solid #1f1f1f;
    overflow-x: auto;
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    position: relative;
    scrollbar-width: auto;
    scrollbar-color: #FF6600 #141414;
}

/* Scrollbar styling for better visibility */
.table-container::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #141414;
    border-radius: 0 0 16px 16px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #FF6600;
    border-radius: 6px;
    border: 2px solid #141414;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #ff7a1a;
}

/* Scrollbar corner styling */
.table-container::-webkit-scrollbar-corner {
    background: #141414;
}

.resource-table {
    min-width: 100%;
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.resource-table thead {
    background: linear-gradient(135deg, #FF6600 0%, #cc5200 100%);
    border-bottom: none;
}

.resource-table th {
    padding: 0.5rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    user-select: none;
    white-space: nowrap;
}

.resource-table--sortable th[data-sort] {
    padding: 0;
}

.resource-table--sortable th[data-sort]:hover {
    background: rgba(255, 255, 255, 0.15);
}

.resource-table .sort-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1rem;
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.resource-table .sort-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.resource-table .sort-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.2);
}

.resource-table th .sort-icon {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.15s;
    color: rgba(255, 255, 255, 0.7);
}

.resource-table th[aria-sort="ascending"] .sort-icon,
.resource-table th[aria-sort="descending"] .sort-icon {
    color: #ffffff;
}

.resource-table tbody tr {
    border-bottom: 1px solid #1f1f1f;
    transition: all 0.2s;
    background: #0a0a0a;
}

.resource-table tbody tr:last-child {
    border-bottom: none;
}

.resource-table tbody tr:hover {
    background: linear-gradient(90deg, #141414 0%, #0a0a0a 100%);
    box-shadow: inset 4px 0 0 #FF6600;
}

.resource-table tbody tr.row--active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-left: 4px solid #10b981;
}

.resource-table tbody tr.row--active:hover {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.1) 100%);
    box-shadow: inset 4px 0 0 #10b981, 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.resource-table tbody tr.row--warning {
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.15) 0%, rgba(255, 102, 0, 0.05) 100%);
    border-left: 4px solid #FF6600;
}

.resource-table tbody tr.row--warning:hover {
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.25) 0%, rgba(255, 102, 0, 0.1) 100%);
    box-shadow: inset 4px 0 0 #FF6600, 0 0 0 1px rgba(255, 102, 0, 0.3);
}

.resource-table tbody tr.row--muted {
    opacity: 0.65;
    background: linear-gradient(90deg, #0f0f0f 0%, #0a0a0a 100%);
    border-left: 4px solid #6b7280;
}

.resource-table tbody tr.row--muted:hover {
    opacity: 0.85;
    box-shadow: inset 4px 0 0 #6b7280;
}

.resource-table td {
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
    color: #ffffff;
    vertical-align: middle;
    min-width: 120px;
    white-space: nowrap;
}

.resource-table .resource-id {
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.8125rem;
    background: linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    color: #FF6600;
    font-weight: 600;
    display: inline-block;
    border: 1px solid #2a2a2a;
}

.resource-table .resource-description {
    color: #a0a0a0;
    max-width: 400px;
    line-height: 1.6;
}

.resource-table .timestamp {
    font-size: 0.8125rem;
    color: #a0a0a0;
    cursor: help;
    border-bottom: 1px dotted #666666;
    transition: all 0.2s;
}

.resource-table .timestamp:hover {
    color: #ffffff;
    border-bottom-color: #a0a0a0;
    background: #141414;
    padding: 2px 4px;
    border-radius: 3px;
}

.resource-table .text-muted {
    color: #666666;
    font-style: italic;
    font-size: 0.8125rem;
}

/* Icon Sizes */
.icon--xs {
    width: 12px;
    height: 12px;
}

.icon--sm {
    width: 14px;
    height: 14px;
}

.icon--md {
    width: 18px;
    height: 18px;
}

.icon--large {
    width: 48px;
    height: 48px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.badge--primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

.badge--success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0.15) 100%);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.4);
}

.badge--warning {
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.25) 0%, rgba(255, 102, 0, 0.15) 100%);
    color: #ff7a1a;
    border-color: rgba(255, 102, 0, 0.4);
}

.badge--muted {
    background: linear-gradient(135deg, rgba(160, 160, 160, 0.25) 0%, rgba(160, 160, 160, 0.15) 100%);
    color: #a0a0a0;
    border-color: rgba(160, 160, 160, 0.4);
}

.badge--info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.15) 100%);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

/* Badge icons should be clearly visible */
.badge .icon {
    color: inherit;
    opacity: 1;
}

/* Small tag badges for inline display */
.tag-badge-sm {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: #FF6600;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 3px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.resource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn--sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn--secondary:hover {
    background: #e5e7eb;
}

.btn .icon--sm {
    width: 14px;
    height: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #a0a0a0;
    background: #0a0a0a;
    border-radius: 12px;
    border: 1px solid #1f1f1f;
}

.empty-state .icon--large {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: #666666;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
    color: #a0a0a0;
}

/* ========================================
   Error Message Component
   ======================================== */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.error-box {
    text-align: center;
    max-width: 500px;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #fecaca;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.error-box .icon--error {
    width: 64px;
    height: 64px;
    color: #dc2626;
    margin: 0 auto 1.5rem;
}

.error-box h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1rem 0;
}

.error-box p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   Loading Indicator & Spinner
   ======================================== */

#loading-indicator {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.2s ease-in;
}

#loading-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon--spin {
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ============================================
   Dashboard Styles - Modern Design
   ============================================ */

/* Dashboard owns the content surface: a plain white page so the hero, command
   bar, and cards sit on one continuous white background. */
.main-card:has(.dashboard-container) {
    background-color: #FFFFFF;
    padding: 0;
}

.dashboard-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Hero card sits at the top; the tagline + command bar sit just below it,
   and the usage metrics + workspace sections flow underneath. */
.command-bar-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3.25rem;
}

.command-bar-tagline {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    color: #52525B;
    letter-spacing: -0.01em;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Mid-rotation state: fade + lift out before the text is swapped in. */
.command-bar-tagline.is-swapping {
    opacity: 0;
    transform: translateY(-8px);
}

/* Dashboard Hero Section — light surface with a soft brand-orange wash so it
   sits gently on the white page rather than as a hard black block. */
.dashboard-hero {
    background: linear-gradient(135deg, #FFF7F0 0%, #FFFFFF 60%, #FFFBF7 100%);
    padding: 3.5rem 2rem;
    margin-bottom: 0;
    border-radius: 16px;
    border: 1px solid #F1E8DF;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(255, 102, 0, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 80% 60% at 80% 50%, rgba(255, 102, 0, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.dashboard-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #18181B;
    margin-bottom: 1rem;
    text-shadow: none;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    font-size: 1.25rem;
    color: #71717A;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Usage overview strip — proper KPI cards: value + period-over-period deviation
   + daily sparkline. Neutral per DESIGN.md; only the adoption card is orange. */
.dashboard-metrics-caption {
    font-size: 0.78rem;
    color: #A1A1AA;
    letter-spacing: -0.01em;
    margin-bottom: 0.6rem;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 1.75rem;
}

.metric-card {
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 14px;
    padding: 15px 18px 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.metric-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.metric-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #71717A;
}

/* Info "i" with a CSS hover tooltip explaining the KPI. */
.metric-info {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: #C4C4C8;
    cursor: help;
    position: relative;
}

.metric-info:hover { color: #71717A; }
.metric-info svg { display: block; }

.metric-info::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: #18181B;
    color: #FAFAFA;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0;
    padding: 9px 11px;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    z-index: 60;
    pointer-events: none;
}

.metric-info:hover::after { opacity: 1; visibility: visible; }

.metric-delta {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.metric-delta--up { color: #15803D; }
.metric-delta--down { color: #B91C1C; }
.metric-delta--flat { color: #A1A1AA; }

.metric-value {
    font-size: 27px;
    line-height: 1.05;
    font-weight: 600;
    color: #18181B;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.metric-spark-wrap {
    position: relative;
    margin: 1px 0 2px;
    line-height: 0;
}

.metric-spark {
    width: 100%;
    height: 30px;
    display: block;
    overflow: visible;
}

.metric-spark-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: #71717A;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: none;
    pointer-events: none;
}

.metric-card--accent .metric-spark-dot { background: #FF6600; }

.metric-spark-tip {
    position: absolute;
    display: none;
    pointer-events: none;
    background: #18181B;
    color: #FAFAFA;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.5; /* override the wrap's line-height:0 — that was squishing the text */
    letter-spacing: -0.01em;
    padding: 5px 9px;
    border-radius: 7px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    z-index: 40;
}

/* Blinking orange marker on the latest datapoint — the "live now" point. */
.metric-spark-now {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FF6600;
    transform: translate(-50%, -50%);
    display: none;
    pointer-events: none;
}

/* Two quick blinks — applied by the live script only when a card updates. */
@keyframes spark-now-blink {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.55); }
    50% { opacity: 0.2; box-shadow: 0 0 0 4px rgba(255, 102, 0, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
}

.metric-spark-now--blink { animation: spark-now-blink 0.45s ease-in-out 2; }

.metric-spark-line {
    fill: none;
    stroke: #C4C4C8;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.metric-spark-area {
    fill: rgba(113, 113, 122, 0.07);
    stroke: none;
}

.metric-sub {
    font-size: 0.76rem;
    color: #A1A1AA;
    letter-spacing: -0.01em;
}

.metric-card--accent {
    border-color: #FBDDC9;
    background: #FFFBF8;
}

.metric-card--accent .metric-value { color: #FF6600; }
.metric-card--accent .metric-spark-line { stroke: #FF8A33; }
.metric-card--accent .metric-spark-area { fill: rgba(255, 102, 0, 0.09); }

/* Live-update pulse: a brief ring when a card's value changes in real time. */
@keyframes metric-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
    25% { box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.13); }
    100% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
}

.metric-card--pulse { animation: metric-pulse 0.9s ease-out; }

/* Respect reduced-motion: keep the now-dot visible but stop it blinking/pulsing. */
@media (prefers-reduced-motion: reduce) {
    .metric-spark-now--blink { animation: none; }
    .metric-card--pulse { animation: none; }
}

/* Dashboard Command Bar.
   Light surface ("chat bar") sitting on the black dashboard canvas, full
   width to match the title hero above it. */
.command-bar {
    --cmdbar-surface: #FFFFFF;
    --cmdbar-surface-hover: #F4F4F5;
    --cmdbar-border: #E4E4E7;
    --cmdbar-text: #18181B;
    --cmdbar-text-muted: #A1A1AA;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.command-bar-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.command-bar-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--cmdbar-text-muted);
    pointer-events: none;
}

.command-bar-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--cmdbar-text);
    background: var(--cmdbar-surface);
    border: 1px solid var(--cmdbar-border);
    border-radius: 12px;
    outline: none;
    box-shadow: 0 2px 10px rgba(20, 15, 10, 0.05);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.command-bar-input::placeholder {
    color: var(--cmdbar-text-muted);
}

.command-bar-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

/* Sidebar search — a compact trigger (styled like a field) that opens the
   wide search dialog. The real input lives in the dialog, not here. */
.sidebar-search {
    padding: 12px 12px 0;
}

.sidebar-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-search-trigger:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.sidebar-search-trigger-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.sidebar-search-trigger-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-search-trigger-kbd {
    flex-shrink: 0;
    padding: 0.05rem 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 5px;
}

/* Search dialog — wide command palette opened from the sidebar trigger. Extends
   the base .modal (display:none until .is-open), but anchored near the top. */
.search-modal {
    align-items: flex-start;
    justify-content: center;
}

.search-modal.is-open {
    display: flex;
}

.search-modal-content {
    position: relative;
    z-index: 1001;
    width: 90%;
    max-width: 640px;
    margin-top: 12vh;
}

.command-bar--modal {
    width: 100%;
}

.command-bar--modal .command-bar-input {
    font-size: 1.05rem;
    padding: 1.1rem 1.1rem 1.1rem 3rem;
}

.command-bar--modal .command-bar-results {
    max-height: 60vh;
}

.command-bar-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 20;
    background: var(--cmdbar-surface);
    border: 1px solid var(--cmdbar-border);
    border-radius: 12px;
    padding: 0.35rem;
    box-shadow: 0 12px 40px rgba(20, 15, 10, 0.12);
    max-height: 360px;
    overflow-y: auto;
}

.command-bar-group-label {
    padding: 0.4rem 0.75rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cmdbar-text-muted);
}

.command-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--cmdbar-text);
}

.command-bar-row.active {
    background: var(--cmdbar-surface-hover);
}

.command-bar-row-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--cmdbar-text-muted);
}

.command-bar-row-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-bar-row-label em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.command-bar-row-meta {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--cmdbar-text-muted);
}

.command-bar-row-hint {
    flex-shrink: 0;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    color: var(--cmdbar-text);
    background: var(--cmdbar-surface-hover);
    border: 1px solid var(--cmdbar-border);
    border-radius: 5px;
}

/* Keyboard hint footer at the bottom of the results dropdown. */
.command-bar-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.4rem 0.6rem 0.2rem;
    margin-top: 0.2rem;
    border-top: 1px solid var(--cmdbar-border);
    font-size: 0.7rem;
    color: var(--cmdbar-text-muted);
}

.command-bar-key {
    display: inline-block;
    min-width: 1.1rem;
    margin-right: 0.25rem;
    padding: 0.05rem 0.35rem;
    font-family: inherit;
    font-size: 0.68rem;
    line-height: 1.4;
    text-align: center;
    color: var(--cmdbar-text);
    background: var(--cmdbar-surface-hover);
    border: 1px solid var(--cmdbar-border);
    border-radius: 5px;
}

.command-bar-row-ask {
    border-bottom: 1px solid var(--cmdbar-border);
    margin-bottom: 0.25rem;
    padding-bottom: 0.7rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 0;
}

.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Workspace Section — flat grouping, no card chrome */
.workspace-section {
    background: none;
    padding: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.section-icon {
    width: 17px;
    height: 17px;
    color: #FF6600;
    stroke-width: 2.25;
}

.section-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #18181B;
    margin: 0;
    letter-spacing: -0.01em;
}

/* Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

/* Workspace Card (launcher) */
.workspace-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.workspace-card:hover {
    border-color: #DDD8D3;
    box-shadow: 0 6px 20px rgba(20, 15, 10, 0.06);
    transform: translateY(-1px);
}

.workspace-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.workspace-card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 9px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #F7F7F8;
    border: 1px solid #EEEEF0;
    color: #52525B;
    stroke-width: 2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Accent with intent: the card you're about to open gets the orange brand chip. */
.workspace-card:hover .workspace-card-icon {
    background: #FFF4EC;
    border-color: #FBDDC9;
    color: #FF6600;
}

.workspace-card-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #18181B;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-card-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #A1A1AA;
    stroke-width: 2;
    transition: color 0.15s ease, transform 0.15s ease;
}

.workspace-card:hover .workspace-card-arrow {
    color: #FF6600;
    transform: translate(2px, -2px);
}

/* Empty State (dashboard-scoped so other pages' .empty-state is untouched) */
.dashboard-container .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
}

.dashboard-container .empty-icon {
    width: 56px;
    height: 56px;
    color: #d1d5db;
    margin-bottom: 1rem;
    stroke-width: 1.5;
}

.dashboard-container .empty-state h3 {
    font-size: 1.15rem;
    color: #111827;
    margin-bottom: 0.4rem;
}

.dashboard-container .empty-state p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.dashboard-container .empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #FF6600;
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dashboard-container .empty-state .btn-primary:hover {
    background: #e65c00;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 24px 20px;
    }

    .dashboard-title {
        font-size: 1.3rem;
    }

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

@media (max-width: 480px) {
    .dashboard-container {
        padding: 20px 16px;
    }

    .dashboard-title {
        font-size: 1.2rem;
    }
}

/* ===================================================================
   Health dashboard (per-workspace uptime / latency / error rate)
   Follows DESIGN.md: hairline cards, status as dots (never pill-floods),
   orange accent reserved for the one active state, Geist + Geist Mono.
   =================================================================== */
.health-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 8px 0 40px;
}
.health-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
}
.health-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #FF6600;
    margin-bottom: 4px;
}
.health-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #18181B;
    margin: 0;
}
.health-head-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.health-window {
    font-size: 12.5px;
    color: #9A9AA2;
    font-variant-numeric: tabular-nums;
}
.health-grafana-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: #52525B;
    text-decoration: none;
    padding: 6px 11px;
    border: 1px solid #E4E4E7;
    border-radius: 9px;
    transition: background .15s, border-color .15s;
}
.health-grafana-link:hover {
    background: #F7F7F8;
    border-color: #DDD8D3;
}
.health-grafana-icon {
    width: 14px;
    height: 14px;
}

/* Time-range toggle (tabs) */
.health-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #F4F4F5;
    border: 1px solid #ECECEE;
    border-radius: 9px;
    padding: 2px;
}
.health-tab {
    font-size: 12.5px;
    font-weight: 500;
    color: #71717A;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 7px;
    font-variant-numeric: tabular-nums;
    transition: background .15s, color .15s;
}
.health-tab:hover {
    color: #18181B;
}
.health-tab--active {
    background: #FFFFFF;
    color: #18181B;
    box-shadow: 0 1px 2px rgba(20, 15, 10, 0.06);
}

/* Header stat strip */
.health-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.health-stat {
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 14px;
    padding: 16px 18px;
}
.health-stat-label {
    font-size: 12px;
    color: #71717A;
    margin-bottom: 8px;
}
.health-stat-value {
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #18181B;
    font-variant-numeric: tabular-nums;
}

/* Workspace table */
.health-table-wrap {
    background: #FFFFFF;
    border: 1px solid #ECECEE;
    border-radius: 14px;
    overflow: hidden;
}
.health-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.health-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9A9AA2;
    background: #FCFCFD;
    padding: 11px 16px;
    border-bottom: 1px solid #F0F0F1;
    white-space: nowrap;
}
.health-table th.health-th-num,
.health-table td.health-td-num {
    text-align: right;
}

/* Hover hints on the column headers. Reuses the dashboard's dark-pill tooltip
   style; positioned BELOW the header (the table card clips overflow, so a
   tooltip above would be cut off) and anchored to whichever side keeps a wide
   tooltip inside the card. */
.health-table th[data-tip] {
    position: relative;
    cursor: help;
}
.health-table th[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 210px;
    background: #18181B;
    color: #FAFAFA;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
    white-space: normal; /* the header row is nowrap; let the tooltip wrap */
    padding: 9px 11px;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    z-index: 60;
    pointer-events: none;
}
/* Right-aligned (numeric / trend) headers sit near the card's right edge, so
   anchor their tooltip to the right so it extends inward, not off-card. */
.health-table th.health-th-num[data-tip]::after,
.health-table th.health-th-spark[data-tip]::after {
    left: auto;
    right: 0;
}
.health-table th[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
}
.health-table th.health-th-spark { width: 120px; }
.health-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #F4F4F5;
    color: #52525B;
    vertical-align: middle;
}
.health-table tbody tr:last-child td { border-bottom: none; }
.health-table tbody tr:hover td { background: #FCFAF9; }
.health-mono {
    font-family: "Geist Mono", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

.health-td-ws { white-space: nowrap; }
.health-ws-name {
    display: block;
    font-weight: 600;
    color: #18181B;
}
.health-ws-id {
    display: block;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 11.5px;
    color: #A1A1AA;
    margin-top: 1px;
}
.health-ws-socket {
    display: block;
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size: 10.5px;
    color: #B4B4BC;
    margin-top: 2px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status as an 8px dot + label (never a colored pill) */
.health-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.health-dot--up { background: #16A34A; }
.health-dot--degraded { background: #F59E0B; }
.health-dot--down { background: #EF4444; }
.health-dot--idle {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px #D4D4D8;
}
.health-status-label {
    font-size: 13px;
    color: #3F3F46;
}
.health-source {
    font-size: 10.5px;
    color: #A1A1AA;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 2px;
}

/* Inline latency/throughput sparkline */
.health-spark {
    width: 100px;
    height: 26px;
    display: block;
}
.health-spark-line {
    fill: none;
    stroke: #18181B;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}
.health-spark-area {
    fill: rgba(24, 24, 27, 0.06);
    stroke: none;
}

/* Empty / scaffold state */
.health-empty {
    text-align: center;
    padding: 64px 24px;
    color: #71717A;
}
.health-empty-icon {
    width: 40px;
    height: 40px;
    color: #C4C4CC;
    margin-bottom: 12px;
}
.health-empty h3 {
    font-size: 15px;
    font-weight: 600;
    color: #18181B;
    margin: 0 0 6px;
}
.health-empty p {
    font-size: 13.5px;
    margin: 0;
}

@media (max-width: 720px) {
    .health-stats { grid-template-columns: repeat(2, 1fr); }
    .health-th-spark, .health-td-spark { display: none; }
}
