/* ============================================
   Network Optimizer - Main Stylesheet
   Modern, dark-mode friendly design
   ============================================ */

/* CSS Variables for theming - Ozark Connect Brand Colors */
:root {
    /* Typography - Two font families only */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

    /* Brand Colors - Ozark Connect Blue + Orange */
    --primary-color: #0559C9;
    --primary-hover: #3385d6;
    --accent-color: #F97316;
    --accent-hover: #fb923c;

    /* Status Colors - refined for dark backgrounds */
    --success-color: #24bc70;
    --warning-color: #e79613;
    --danger-color: #ee6368;
    --info-color: #4797ff;

    /* Dark Mode Backgrounds - Ozark Connect blue-tinted */
    --bg-primary: #1a2029;
    --bg-secondary: #242c39;
    --bg-tertiary: #334155;
    --bg-card: #242c39;
    --bg-hover: #334155;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dark: #1F2937;

    /* Borders & Effects */
    --border-color: #334155;
    --border-radius: 4px;
    --border-radius-lg: 6px;
    --shadow: rgba(0, 0, 0, 0.4) 0px 4px 12px 0px, rgba(255, 255, 255, 0.03) 0px 0px 1px 0px;
    --shadow-lg: rgba(0, 0, 0, 0.5) 0px 8px 24px 0px, rgba(255, 255, 255, 0.03) 0px 0px 1px 0px;
    --focus-ring: 0 0 0 1px var(--primary-color);

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* Anchor Links - Ubiquiti Blue primary, Orange for hover emphasis */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited {
    color: inherit;
}

a:hover {
    color: var(--primary-hover);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    display: block;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.sidebar-header:hover {
    text-decoration: none;
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 0.75rem;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}

.app-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 11px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 2px solid transparent;
}

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

.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-icon-img {
    width: 2.5rem;
    height: 1.875rem;
    margin-right: 0.5rem;
    object-fit: contain;
    object-position: right;
    flex-shrink: 0;
}

.nav-text {
    font-weight: 500;
}

.nav-sub-item {
    padding-left: 1rem;
}

.nav-sub-icon {
    width: 2.5rem;
    margin-right: 0.5rem;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.nav-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.license-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-size: 0.875rem;
}

.license-icon {
    font-size: 1rem;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-indicators {
    display: flex;
    gap: 2rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-item.status-connected .status-icon {
    color: var(--success-color);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timestamp {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Page Content */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-icon {
    width: 32px;
    height: 32px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
}

.card-action {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Clickable card title links */
.card-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.card-title-link:hover {
    color: var(--primary-color);
}

.card-title-link:hover .card-title {
    color: var(--primary-color);
}

.card-body {
    padding: 16px;
}

/* Info section text (How it Works, etc.) */
.info-section {
    font-size: 0.8125rem;
    line-height: 1.6;
}

.info-section p,
.info-section ol,
.info-section ul,
.info-section li {
    font-size: 0.8125rem;
}

.info-section ol,
.info-section ul {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.info-section li {
    margin-bottom: 0.5rem;
}

.card-span-2 {
    grid-column: span 2;
}

/* Clickable card */
.clickable-card {
    cursor: pointer;
    transition: background 0.15s ease;
}

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

/* Speed Test Stats (Dashboard panel) */
.speed-test-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.speed-stat {
    text-align: center;
}

.speed-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.speed-stat-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.speed-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.speed-test-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

/* Speed Test List (Dashboard - multiple results) */
.speed-test-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.speed-test-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.speed-test-row:last-child {
    border-bottom: none;
}

.speed-test-row .speed-test-device {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 33%;
}

.speed-test-speeds {
    display: flex;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.speed-down {
    color: var(--speed-download-color);  /* blue - From Device */
}

.speed-up {
    color: var(--speed-upload-color);  /* green - To Device */
}

.speed-test-row .speed-test-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 88px;
}

.stat-card.stat-success {
    border-left: 2px solid var(--success-color);
}

.stat-card.stat-warning {
    border-left: 2px solid var(--warning-color);
}

.stat-card.stat-danger {
    border-left: 2px solid var(--danger-color);
}

/* Clickable stat cards */
a.stat-card-link,
a.stat-card-link:link,
a.stat-card-link:visited {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

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

a.stat-card-link:active {
    transform: translateY(0);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    font-size: 2.5rem;
    line-height: 1;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 3rem;
    height: 3rem;
}

.stat-icon-img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    opacity: 0.9;
    flex-shrink: 0;
}

.stat-icon-img.stat-icon-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.25rem;
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Main dashboard cards - fixed height to prevent flash during load */
.content-grid > .card:nth-child(-n+4) {
    min-height: 37vh;
}

/* Dashboard Grid */
.dashboard-grid {
    /* Dashboard specific styles */
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* Device Card */
.device-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 12px;
    border-left: 2px solid var(--border-color);
}

.device-card.device-online {
    border-left-color: var(--success-color);
}

.device-card.device-offline {
    border-left-color: var(--danger-color);
}

.device-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.device-icon {
    font-size: 1.5rem;
}

.device-info {
    flex: 1;
}

.device-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
}

.device-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.125rem;
}

.device-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

.device-card.device-offline .status-dot {
    background: var(--danger-color);
}

.device-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.device-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.detail-label {
    color: var(--text-secondary);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Security Score Gauge */
.security-score-gauge {
    text-align: center;
    padding: 1rem;
}

.gauge-container {
    max-width: 300px;
    margin: 0 auto 1rem;
}

.gauge-svg {
    width: 100%;
    height: auto;
}

.gauge-rating {
    margin-top: 1rem;
}

.rating-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 0.875rem;
}

.rating-badge.rating-excellent {
    background: var(--success-color);
    color: white;
}

.rating-badge.rating-good {
    background: var(--primary-color);
    color: white;
}

.rating-badge.rating-fair {
    background: var(--warning-color);
    color: white;
}

.rating-badge.rating-poor {
    background: var(--danger-color);
    color: white;
}

.rating-badge.rating-none {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.security-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 600;
    min-height: 1.25rem;
    display: inline-flex;
    align-items: center;
}

.summary-value.critical {
    color: var(--danger-color);
}

.summary-value.warning,
.summary-value.recommended {
    color: var(--warning-color);
}

/* SQM Status Panel */
.sqm-status-panel {
    /* Styles handled in component */
}

.sqm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.sqm-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.status-active {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.status-inactive {
    background: var(--text-muted);
}

.learning-badge {
    background: var(--info-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.metric-box {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
}

.metric-icon {
    font-size: 1.5rem;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-value .unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

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

.metric-baseline.latency-good {
    color: var(--success-color);
}

.metric-baseline.latency-fair {
    color: var(--warning-color);
}

.metric-baseline.latency-poor {
    color: var(--danger-color);
}

.learning-progress {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.sqm-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* Alerts List */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--border-color);
}

.alert-item.alert-critical {
    border-left-color: var(--danger-color);
}

.alert-item.alert-warning,
.alert-item.alert-recommended {
    border-left-color: var(--warning-color);
}

.alert-item.alert-info {
    border-left-color: var(--info-color);
}

.alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 0.125rem;
}

.alert-item.alert-critical .alert-icon {
    color: var(--danger-color);
}

.alert-item.alert-warning .alert-icon,
.alert-item.alert-recommended .alert-icon {
    color: var(--warning-color);
}

.alert-item.alert-info .alert-icon {
    color: var(--info-color);
}

.alert-content {
    flex: 1;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.alert-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

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

.alert-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
}

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

.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.no-alerts {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-alerts-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--success-color);
}

/* Agent Status Table */
.agent-status-table {
    /* Styles for table */
}

/* Table responsive wrapper - enables horizontal scroll on mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* Ensures table doesn't compress too much */
}

.data-table thead {
    background: var(--bg-primary);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.data-table tr:not(.history-details-row):hover {
    background: #2d3a4d;
}

.data-table code {
    background: var(--bg-primary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}

/* TC Monitor Configuration */
.section-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.wan-interfaces-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.wan-interfaces-section h4 {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.config-output {
    margin-top: 1.5rem;
}

.config-output h4 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.config-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 0.75rem;
}

.agent-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-icon {
    font-size: 1.25rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-active,
.status-badge.status-connected {
    background: rgba(36, 188, 112, 0.2);
    color: var(--success-color);
}

.status-badge.status-inactive,
.status-badge.status-disconnected {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.status-badge.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* Buttons - Three colors only: primary (blue), secondary (grey), danger (red) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    min-width: 6rem;
    padding: 0 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1;
    vertical-align: middle;
}

/* Ensure anchor buttons match button elements */
a.btn {
    line-height: 36px;
}

.btn-sm {
    height: 28px;
    padding: 0 12px;
    font-size: 0.8125rem;
}

a.btn-sm {
    line-height: 28px;
}

.btn-lg {
    height: 44px;
    padding: 0 24px;
    font-size: 0.9375rem;
    border-radius: var(--border-radius-lg);
}

a.btn-lg {
    line-height: 44px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary - Blue */
.btn-primary {
    background: var(--primary-color);
    color: white !important;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    color: white !important;
}

.btn-primary:visited {
    color: white !important;
}

/* Secondary - Grey (alias: btn-secondary, btn-ghost) */
.btn-secondary,
.btn-ghost {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
    background: #475569;
}

/* Danger - Red (for destructive actions) */
.btn-danger {
    background: var(--danger-color);
    color: white !important;
}

.btn-danger:hover:not(:disabled) {
    background: #dc5559;
    color: white !important;
}

.btn-danger:visited {
    color: white !important;
}

/* Legacy aliases - map to three main colors */
.btn-success,
.btn-accent,
.btn-gradient {
    background: var(--primary-color);
    color: white !important;
}

.btn-success:hover:not(:disabled),
.btn-accent:hover:not(:disabled),
.btn-gradient:hover:not(:disabled) {
    background: var(--primary-hover);
    color: white !important;
}

.btn-warning {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-warning:hover:not(:disabled) {
    background: var(--bg-hover);
}

/* Outline variant - primary only */
.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white !important;
}

/* Test button with progress indicator */
.test-button {
    position: relative;
    overflow: hidden;
    min-width: 7.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.test-button .test-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
}

.test-button .test-progress .progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    transition: width 0.25s ease-out;
}

.test-button .test-phase {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.btn-sm.test-button {
    min-width: 6.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Action button spacing in tables */
td .btn + .btn {
    margin-left: 0.5rem;
}

/* Data Management Section */
.data-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.action-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.action-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.action-item:first-child {
    padding-top: 0;
}

.action-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.action-item p {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.action-item.danger-zone h4 {
    color: var(--danger-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 89, 201, 0.2);
}

select.form-control {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    appearance: none;
    -webkit-appearance: none;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 1rem;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

/* Alerts/Messages */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    font-size: 0.875rem;
}

.alert-success {
    background: rgba(36, 188, 112, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Alert with progress bar */
.alert-progress {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.alert-progress .alert-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(5, 89, 201, 0.4) 0%, rgba(5, 89, 201, 0.25) 100%);
    transition: width 0.25s ease-out;
    border-right: 2px solid rgba(5, 89, 201, 0.6);
}

.alert-progress .alert-progress-text {
    position: relative;
    z-index: 1;
}

/* Alert as clickable link */
.alert-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.alert-link:hover {
    background: rgba(36, 188, 112, 0.25);
    transform: translateY(-1px);
}

.alert-link:active {
    transform: translateY(0);
}

.alert-link-hint {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pdf {
    background: var(--danger-color);
    color: white;
}

.badge-markdown {
    background: var(--info-color);
    color: white;
}

.badge-html {
    background: var(--warning-color);
    color: white;
}

.badge-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--accent-color);
}

.tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab.tab-muted {
    color: var(--text-muted);
}

.tab.tab-muted.active {
    color: var(--text-secondary);
    border-bottom-color: var(--text-secondary);
}

/* Issue Styling */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.issue-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--border-color);
}

.issue-item.issue-critical {
    border-left-color: var(--danger-color);
}

.issue-item.issue-warning,
.issue-item.issue-recommended {
    border-left-color: var(--warning-color);
}

.issue-item.issue-info {
    border-left-color: var(--info-color);
}

.issue-icon {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 0.125rem;
    width: 24px;
    min-height: 24px;
}

.issue-item.issue-critical .issue-icon {
    color: var(--danger-color);
}

.issue-item.issue-warning .issue-icon,
.issue-item.issue-recommended .issue-icon {
    color: var(--warning-color);
}

.issue-item.issue-info .issue-icon {
    color: var(--info-color);
    padding-top: 0.25rem;
}

.issue-body {
    flex: 1;
    min-width: 0;
}

.issue-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.issue-severity {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.issue-critical .issue-severity {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.issue-warning .issue-severity,
.issue-recommended .issue-severity {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.issue-info .issue-severity {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info-color);
}

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

.issue-action {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.7;
}

.issue-action:hover {
    opacity: 1;
}

.issue-settings-icon {
    width: 20px;
    height: 20px;
    margin-left: 0.5rem;
    background: transparent;
    text-decoration: none;
}

.issue-settings-icon svg {
    width: 14px;
    height: 14px;
}

.issue-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.issue-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.issue-recommendation {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.issue-recommendation strong {
    color: var(--text-primary);
}

.no-issues {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.issue-item.issue-dismissed {
    opacity: 0.6;
    border-left-color: var(--text-muted);
}

.issue-item.issue-dismissed .issue-icon {
    color: var(--text-muted);
}

/* Collapsible Issue Type Groups */
.issue-type-group {
    margin-bottom: 0.5rem;
}

.issue-type-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.15s ease;
    font-weight: 500;
    color: var(--text-primary);
    border-left: 4px solid var(--border-color);
}

.issue-type-header:hover {
    background: var(--bg-hover);
}

.issue-type-header.expanded {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.issue-type-group .expand-wrapper .expand-content {
    border-left: 4px solid var(--border-color);
}

.issue-type-group .expand-wrapper.expanded .expand-content {
    background: var(--bg-primary);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.issue-type-group.issue-critical .expand-wrapper .expand-content {
    border-left-color: var(--danger-color);
}

.issue-type-group.issue-recommended .expand-wrapper .expand-content {
    border-left-color: var(--warning-color);
}

.issue-type-group.issue-info .expand-wrapper .expand-content {
    border-left-color: var(--info-color);
}

/* Issue type group severity colors - uses same classes as issue-item */
.issue-type-group.issue-critical .issue-type-header {
    border-left-color: var(--danger-color);
}

.issue-type-group.issue-recommended .issue-type-header {
    border-left-color: var(--warning-color);
}

.issue-type-group.issue-info .issue-type-header {
    border-left-color: var(--info-color);
}

.issue-type-icon {
    display: flex;
    align-items: flex-start;
    padding-top: 0.125rem;
    width: 24px;
    min-height: 24px;
    flex-shrink: 0;
}

.issue-type-icon svg {
    width: 24px;
    height: 24px;
}

.issue-type-group.issue-critical .issue-type-icon {
    color: var(--danger-color);
}

.issue-type-group.issue-recommended .issue-type-icon {
    color: var(--warning-color);
}

.issue-type-group.issue-info .issue-type-icon {
    color: var(--info-color);
    padding-top: 0.25rem;
}

.issue-type-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.issue-type-body .issue-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.issue-type-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 2rem;
    flex-shrink: 0;
    margin-left: auto;
}

.issue-type-name {
    font-weight: 500;
    flex: 1;
}

.issue-type-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-right: 0.5rem;
}

.issue-type-description {
    padding: 0.75rem 1rem 0.5rem 3.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.issue-type-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem 3.5rem;
}

.issue-type-item .issue-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    font-size: 0.875rem;
    margin: 0;
}

.issue-type-item .issue-context .context-item {
    display: inline-flex;
    gap: 0.25rem;
}

.issue-type-item .issue-context .context-item strong {
    color: var(--text-muted);
}

.issue-type-item .issue-action {
    margin-left: auto;
    background: var(--bg-secondary);
}

.issue-type-item .issue-item-description {
    flex: 1;
    color: var(--text-secondary);
}

.issue-type-recommendation {
    padding: 0.75rem 1rem 1.25rem 3.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Footer */
.app-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Hamburger Menu Button - hidden on desktop */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Sidebar Overlay - hidden on desktop */
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    /* Show hamburger button on mobile */
    .hamburger-btn {
        display: block;
    }

    /* Off-canvas sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.visible {
        display: block;
    }

    /* Main content takes full width */
    .main-content {
        width: 100%;
    }

    /* Top bar adjustments */
    .top-bar {
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .status-indicators {
        display: none;
    }

    .header-actions {
        flex: 1;
        justify-content: flex-end;
    }

    .timestamp {
        font-size: 0.75rem;
    }

    /* Content adjustments */
    .stats-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .content-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .device-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .page-content {
        padding: 1rem;
    }

    .content {
        padding: 0;
    }

    /* Card adjustments for mobile */
    .card {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Filter tabs mobile - wrap below title, compact sizing */
    .filter-tabs {
        width: 100%;
        gap: 0.25rem;
        justify-content: flex-start;
    }

    .filter-tabs .tab {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Footer adjustments */
    .app-footer {
        padding: 0.75rem;
        font-size: 0.7rem;
    }

    /* Alert items - icon inline with title on mobile */
    .alert-item {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 0.5rem;
        row-gap: 0.25rem;
    }

    .alert-icon {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        padding-top: 0.15rem;
    }

    .alert-content {
        display: contents;
    }

    .alert-header {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
        align-items: center;
    }

    .alert-title {
        font-size: 0.9rem;
    }

    .alert-time {
        font-size: 0.7rem;
        margin-left: auto;
    }

    .alert-message {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .alert-source {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .alert-actions {
        grid-column: 1 / -1;
        grid-row: 4;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    /* Issue items - icon inline with title on mobile */
    .issue-item {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 0.5rem;
        row-gap: 0.25rem;
    }

    .issue-icon {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        padding-top: 0.1rem;
    }

    .issue-body {
        display: contents;
    }

    .issue-header {
        grid-column: 1 / -1;
        grid-row: 1;
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .issue-severity {
        font-size: 0.6rem;
    }

    .issue-category {
        font-size: 0.65rem;
    }

    .issue-title {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.9rem;
        margin-top: 0.125rem;
    }

    .issue-description {
        grid-column: 1 / -1;
        grid-row: 3;
        font-size: 0.8rem;
    }

    .issue-context {
        grid-column: 1 / -1;
        grid-row: 4;
    }

    .issue-recommendation {
        grid-column: 1 / -1;
        grid-row: 5;
        font-size: 0.8rem;
    }

    .issue-action {
        margin-left: auto;
    }

    /* Collapsible group header - match single item layout */
    .issue-type-header {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 0.5rem;
        row-gap: 0.25rem;
        position: relative;
        padding-right: 2rem;
    }

    .issue-type-icon {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        padding-top: 0.1rem;
    }

    .issue-type-body {
        display: contents;
    }

    .issue-type-body .issue-header {
        grid-column: 1 / -1;
        grid-row: 1;
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .issue-type-body .issue-title {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.9rem;
        margin-top: 0.125rem;
    }

    .issue-type-chevron {
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Expanded items - full width context */
    .issue-type-description {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .issue-type-items-list {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .issue-type-recommendation {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .issue-type-item .issue-context {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .issue-type-item .issue-context .context-item {
        width: 100%;
    }

    .issue-type-item .issue-action {
        margin-top: 0.5rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.d-flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Connection Banner */
.connection-banner {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.banner-icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.banner-text strong {
    font-size: 1rem;
    color: white;
}

.banner-text span {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

.connection-banner .btn-secondary {
    background: white;
    color: var(--warning-color) !important;
    border: none;
}

.connection-banner .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Loading State */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
    min-height: 150px;
}

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

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state .empty-icon-img {
    margin-bottom: 0;
}

.empty-state .empty-icon-img img {
    width: 100px;
    height: 100px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

/* Status indicators for disconnected state */
.status-disconnected {
    color: var(--text-muted);
}

.status-disconnected .status-icon {
    color: var(--text-muted);
}

/* SQM unavailable state */
.sqm-unavailable {
    padding: 1rem;
    text-align: center;
}

.sqm-unavailable .status-message {
    color: var(--text-secondary);
    margin: 1rem 0;
    font-size: 0.8125rem;
}

/* SQM not deployed state */
.sqm-not-deployed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.not-deployed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.not-deployed-icon {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

.not-deployed-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.not-deployed-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.not-deployed-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.status-not-configured {
    color: var(--text-muted);
}

.status-unavailable {
    color: var(--warning-color);
}

/* TC Interfaces Grid */
.tc-interfaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.tc-interface-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.tc-interface-card.inactive {
    opacity: 0.6;
}

.interface-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.interface-name {
    font-weight: 600;
    color: var(--text-primary);
}

.interface-status {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.interface-status.status-active {
    background: rgba(36, 188, 112, 0.2);
    color: var(--success-color);
}

.interface-status.status-not_found {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.interface-rate {
    margin: 0.75rem 0;
}

.interface-rate .rate-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-color);
}

.interface-rate .rate-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.interface-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.rate-raw {
    color: var(--text-secondary);
}

.tc-timestamp {
    color: var(--text-muted);
}

/* Spinner small */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.status-offline {
    color: var(--danger-color);
}

/* Accent Highlight Box (Ozark Connect style) */
.highlight-box {
    background: rgba(249, 115, 22, 0.1);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 1rem 0;
}

.highlight-box p {
    color: var(--accent-color);
    font-weight: 500;
    margin: 0;
}

/* Accent Links */
.link-accent {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-accent:hover {
    color: var(--accent-hover);
}

/* Primary Links (for light elements on dark bg) */
.link-primary {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-primary:hover {
    color: var(--accent-color);
}

/* Accent Text */
.text-accent {
    color: var(--accent-color);
}

.text-primary-brand {
    color: var(--primary-color);
}

/* Stat Value Accent (for prominent numbers) */
.stat-value-accent {
    color: var(--accent-color);
}

/* Audit Issue Context Styles */
.issue-context {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.issue-context .context-item {
    display: inline-flex;
    gap: 0.25rem;
}

.issue-context .context-item strong {
    color: var(--text-muted);
}

/* ============================================
   Ozark Connect Gradient & Accent Styles
   ============================================ */

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0466e0 100%);
}

.bg-gradient-hero {
    background: linear-gradient(135deg, rgba(5, 89, 201, 0.1) 0%, transparent 100%);
}

/* Info Box (Blue - Ozark Connect style) */
.info-box {
    background: rgba(5, 89, 201, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 1rem 0;
}

.info-box p {
    color: var(--text-primary);
    margin: 0;
}

.info-box strong {
    color: var(--primary-color);
}

/* Callout Box (Orange highlight - Ozark Connect style) */
.callout-box {
    background: rgba(249, 115, 22, 0.08);
    border-left: 4px solid var(--accent-color);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 1rem 0;
}

.callout-box p {
    color: var(--text-primary);
    margin: 0;
}

.callout-box strong {
    color: var(--accent-color);
}

/* Feature Badge (Ozark Connect style) */
.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.feature-badge .badge-icon {
    color: var(--primary-color);
}

/* Card with gradient header */
.card-gradient-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0466e0 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-gradient-header h3 {
    color: white;
    margin: 0;
}

/* ============================================
   Speed Test Results Component
   ============================================ */

/* Color variables for speed test */
:root {
    --speed-upload-color: var(--success-color);    /* green - To Device */
    --speed-download-color: var(--primary-hover);  /* blue - From Device */
}

.speed-results {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.speed-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    min-width: 180px;
}

.speed-result.upload {
    border-left: 4px solid var(--speed-upload-color);
}

.speed-result.upload .speed-icon {
    color: var(--speed-upload-color);
}

.speed-result.download {
    border-left: 4px solid var(--speed-download-color);
}

.speed-result.download .speed-icon {
    color: var(--speed-download-color);
}

.speed-icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.speed-details,
.speed-info {
    display: flex;
    flex-direction: column;
}

.speed-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.speed-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 0.8;
}

.speed-unit {
    font-size: 0.875rem;
    font-weight: normal;
    color: var(--text-secondary);
    vertical-align: baseline;
}

.speed-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.retransmits-info {
    text-align: center;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.test-timestamp {
    text-align: center;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.test-details {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Path Analysis - Redesigned */
.path-analysis {
    margin-top: 1.25rem;
    padding: 1rem 1rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.history-details .path-analysis {
    padding-bottom: 0.25rem;
}

.path-analysis .path-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.path-analysis .path-max-speed {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 6px;
    min-width: 80px;
}

.path-analysis .path-max-speed .speed-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.path-analysis .path-max-speed .speed-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0;
}

.path-analysis .efficiency-grades {
    display: flex;
    gap: 0.5rem;
}

.path-analysis .grade-badge {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: help;
}

.grade-excellent { background: rgba(36, 188, 112, 0.2); color: var(--success-color); }
.grade-good { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.grade-fair { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.grade-poor { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.grade-critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Path Visualization */
.path-analysis .path-visualization {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 6px;
    row-gap: 0.75rem;
}

.path-analysis .path-hop {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.path-analysis .path-hop .hop-icon {
    font-size: 0.9rem;
}

.path-analysis .path-hop .hop-name {
    color: var(--text-primary);
    font-weight: 500;
}

.path-analysis .path-hop.bottleneck {
    border: 1px solid var(--warning-color);
}

.path-analysis .path-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.2rem;
    margin-top: 1rem;
    gap: 0.1rem;
}

.path-analysis .path-connector .connector-line {
    width: 154%;
    height: 2px;
    background: #3b82f6;
    position: relative;
}

.path-analysis .path-connector .connector-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    border: 4px solid transparent;
    border-left-color: #3b82f6;
}

.path-analysis .path-connector .connector-speed {
    font-size: 0.6rem;
    color: #93c5fd;
    white-space: nowrap;
}

.path-analysis .path-connector.bottleneck .connector-line {
    background: var(--warning-color);
}

.path-analysis .path-connector.bottleneck .connector-line::after {
    border-left-color: var(--warning-color);
}

.path-analysis .path-connector.bottleneck .connector-speed {
    color: var(--warning-color);
    font-weight: 500;
}

/* Wireless link indicator - shows wifi icon above the connector line */
.path-analysis .path-connector.wireless {
    position: relative;
}

.path-analysis .path-connector .wireless-icon {
    position: absolute;
    top: -0.9rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}

/* Wi-Fi tooltip styling */
.wifi-tooltip-header {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #f1f5f9;
}

.wifi-tooltip-row {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.wifi-tooltip-signal {
    color: #60a5fa;
}

.wifi-tooltip-speed {
    color: #4ade80;
    font-weight: 500;
}

.wifi-tooltip-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 0.4rem 0;
}

.wifi-tooltip-link {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wifi-tooltip-link-signal {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.3rem;
    padding-left: 0.25rem;
}

.wifi-tooltip-link-speed {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.15rem;
    padding-left: 0.25rem;
}

.wifi-speed-rx {
    color: var(--speed-download-color);
}

.wifi-speed-tx {
    color: var(--speed-upload-color);
}

.wifi-band-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.wifi-band-badge.wifi-band-ng {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.wifi-band-badge.wifi-band-na {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.wifi-band-badge.wifi-band-6e {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

/* Warnings and badges */
.path-analysis .bottleneck-warning {
    padding: 0.5rem 0.75rem;
    background: rgba(234, 179, 8, 0.1);
    border-left: 3px solid var(--warning-color);
    border-radius: 0 4px 4px 0;
    font-size: 0.8rem;
    color: var(--warning-color);
    margin-bottom: 0.5rem;
}

.path-analysis .routing-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #93c5fd;
    margin-bottom: 0.5rem;
}

.path-analysis .path-error {
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

/* Notes section */
.path-analysis .path-notes {
    border-top: 1px solid var(--border-color);
}

.path-analysis .note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.path-analysis .note.recommendation {
    color: #93c5fd;
}

.test-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius);
    color: var(--danger-color);
    font-size: 0.9rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* History Table Expandable Rows */
.history-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.history-row-clickable:hover {
    background: #2d3a4d;
}

.history-row-expanded {
    background: #2d3a4d;
}

.history-details-row {
    background: #2d3a4d;
}

.expand-chevron {
    width: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.history-details-row {
    background: var(--bg-tertiary);
}

.history-details-row td {
    padding: 0 !important;
}

.history-details-row .expand-wrapper.expanded {
    border-top: 1px solid var(--border-color);
}

.history-details {
    padding: 1rem 1.5rem 1.5rem;
}

/* ============================================
   Pagination Component
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   Result Summary (compact link to full result)
   ============================================ */

/* Expandable result box - unified container for summary + details */
.result-box {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    margin: 1rem 0 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.result-box:hover {
    background: var(--bg-hover);
}

.result-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.result-box-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.result-box-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease-out;
}

.result-box.expanded .result-box-details {
    grid-template-rows: 1fr;
}

.result-box-details-inner {
    overflow: hidden;
    padding: 0 1rem;
}

.result-box.expanded .result-box-details-inner {
    padding: 0 1rem 1rem;
}

/* Legacy result-summary for any remaining uses */
.result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s ease;
    margin: 1rem 0 0;
}

.result-summary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.result-speeds {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-weight: 600;
}

.result-speed {
    font-size: 1.25rem;
}

.result-unit {
    font-size: 0.875rem;
    font-weight: normal;
    color: var(--text-secondary);
}

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

.result-summary {
    cursor: pointer;
}

.result-expand-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

/* Expandable details animation wrapper */
.expand-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.25s ease-out;
}

.expand-wrapper.expanded {
    grid-template-rows: 1fr;
}

.expand-wrapper > .expand-content {
    overflow: hidden;
}

.result-expanded-details {
    padding: 1rem 0;
}

/* Form section header */
.form-section-header h5 {
    color: var(--text-primary);
}

.form-section-header .form-help {
    color: var(--text-muted);
}

.form-section-header a {
    color: var(--primary-color);
}

/* ============================================
   Blazor Reconnection Dialog (Dark Theme)
   ============================================ */
.components-reconnect-dialog {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius) !important;
    padding: 2rem !important;
    box-shadow: var(--shadow-lg) !important;
}

.components-reconnect-dialog p {
    color: var(--text-primary) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.components-reconnect-dialog button {
    background: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--border-radius) !important;
    padding: 0.625rem 1.25rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.components-reconnect-dialog button:hover {
    background: var(--primary-hover) !important;
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--danger-color) !important;
    color: white !important;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: none;
}

#blazor-error-ui * {
    color: white !important;
}

#blazor-error-ui.show {
    display: block;
}

/* ============================================
   Audit Page Styles
   ============================================ */

/* Audit Controls Layout */
.audit-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    padding-top: 1rem;
}

.audit-controls .btn {
    margin-right: 0.5rem;
}

/* Audit Options (Checkboxes) */
.audit-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.audit-options .checkbox-label {
    gap: 0.625rem;
}

/* Audit Results Summary */
.results-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3rem;
    place-content: center;
}

.summary-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.score-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 4px solid var(--border-color);
}

.score-circle.score-excellent {
    border-color: var(--success-color);
    background: rgba(36, 188, 112, 0.1);
}

.score-circle.score-good {
    border-color: var(--primary-color);
    background: rgba(5, 89, 201, 0.1);
}

.score-circle.score-fair {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.score-circle.score-poor {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-max {
    font-size: 1rem;
    color: var(--text-muted);
    margin-left: 0.125rem;
}

.score-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.score-excellent .score-label,
.summary-score:has(.score-excellent) .score-label {
    color: var(--success-color);
}

.score-good .score-label,
.summary-score:has(.score-good) .score-label {
    color: var(--primary-color);
}

.score-fair .score-label,
.summary-score:has(.score-fair) .score-label {
    color: var(--warning-color);
}

.score-poor .score-label,
.summary-score:has(.score-poor) .score-label {
    color: var(--danger-color);
}

/* Issue Counts */
.issue-counts {
    display: flex;
    gap: 2rem;
}

.issue-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    min-width: 80px;
}

.issue-count .count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.issue-count .label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.issue-count.critical .count {
    color: var(--danger-color);
}

.issue-count.warning .count,
.issue-count.recommended .count {
    color: var(--warning-color);
}

.issue-count.info .count {
    color: var(--text-secondary);
}

/* Audit Timestamp */
.audit-timestamp {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Audit Detail Sections
   ============================================ */

/* Switch section */
.switch-section {
    margin-bottom: 2rem;
}

.switch-section:last-child {
    margin-bottom: 0;
}

.switch-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.switch-model {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.switch-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

/* AP section */
.ap-section {
    margin-bottom: 1.5rem;
}

.ap-section:last-child {
    margin-bottom: 0;
}

.ap-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.client-count {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Port table - fixed column widths */
.port-table {
    table-layout: fixed;
}

.port-table th,
.port-table td {
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Switch port table columns: Port, Name, Link, PoE, Port Sec, Forward, Native VLAN, Status */
.port-table th:nth-child(1),
.port-table td:nth-child(1) { width: 5%; }   /* Port */
.port-table th:nth-child(2),
.port-table td:nth-child(2) { width: 18%; }  /* Name */
.port-table th:nth-child(3),
.port-table td:nth-child(3) { width: 8%; }   /* Link */
.port-table th:nth-child(4),
.port-table td:nth-child(4) { width: 6%; }   /* PoE */
.port-table th:nth-child(5),
.port-table td:nth-child(5) { width: 9%; }   /* Port Sec */
.port-table th:nth-child(6),
.port-table td:nth-child(6) { width: 10%; }  /* Forward */
.port-table th:nth-child(7),
.port-table td:nth-child(7) { width: 28%; }  /* Native VLAN */
.port-table th:nth-child(8),
.port-table td:nth-child(8) { width: 16%; }  /* Status */

/* Wireless client table - fixed column widths */
.wireless-client-table {
    table-layout: fixed;
}

.wireless-client-table th,
.wireless-client-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Wireless client columns: Client, Type, Network, Status */
.wireless-client-table th:nth-child(1),
.wireless-client-table td:nth-child(1) { width: 35%; }  /* Client */
.wireless-client-table th:nth-child(2),
.wireless-client-table td:nth-child(2) { width: 20%; }  /* Type */
.wireless-client-table th:nth-child(3),
.wireless-client-table td:nth-child(3) { width: 25%; }  /* Network */
.wireless-client-table th:nth-child(4),
.wireless-client-table td:nth-child(4) { width: 20%; }  /* Status */

/* Offline client table - fixed column widths */
.offline-client-table {
    table-layout: fixed;
}

.offline-client-table th,
.offline-client-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Offline client columns: Client, Type, Network, Last Seen, Status */
.offline-client-table th:nth-child(1),
.offline-client-table td:nth-child(1) { width: 30%; }  /* Client */
.offline-client-table th:nth-child(2),
.offline-client-table td:nth-child(2) { width: 18%; }  /* Type */
.offline-client-table th:nth-child(3),
.offline-client-table td:nth-child(3) { width: 22%; }  /* Network */
.offline-client-table th:nth-child(4),
.offline-client-table td:nth-child(4) { width: 13%; }  /* Last Seen */
.offline-client-table th:nth-child(5),
.offline-client-table td:nth-child(5) { width: 17%; }  /* Status */

/* Status classes */
.status-success {
    color: var(--success-color);
    font-weight: 500;
}

.status-warning {
    color: var(--warning-color);
    font-weight: 500;
}

.status-danger {
    color: var(--danger-color);
    font-weight: 500;
}

.status-neutral {
    color: var(--text-muted);
    font-weight: 500;
}

.row-warning {
    background-color: rgba(231, 150, 19, 0.1);
}

.row-warning td {
    border-color: rgba(231, 150, 19, 0.2);
}

.row-critical {
    background-color: rgba(218, 68, 68, 0.1);
}

.row-critical td {
    border-color: rgba(218, 68, 68, 0.2);
}

/* Hardening list */
.hardening-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hardening-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.hardening-list li:last-child {
    border-bottom: none;
}

.hardening-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* DNS Security summary */
.dns-summary {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.dns-protected {
    background-color: rgba(36, 188, 112, 0.1);
    border: 1px solid rgba(36, 188, 112, 0.3);
    color: var(--success-color);
}

.dns-partial {
    background-color: rgba(231, 150, 19, 0.1);
    border: 1px solid rgba(231, 150, 19, 0.3);
    color: var(--warning-color);
}

/* ============================================
   Tooltip Icon Component (using Tippy.js)
   Interactive popovers with link support
   ============================================ */
.tooltip-wrapper {
    display: inline-flex;
    align-items: center;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.tooltip-icon:hover {
    color: var(--text-primary);
    background: var(--primary-color);
}

/* Smaller tooltip icon for table cells and inline use */
.tooltip-icon-sm {
    width: 14px;
    height: 14px;
    font-size: 10px;
    margin-left: 3px;
}

/* Hidden content element (Tippy reads innerHTML from this) */
.tooltip-content {
    display: none;
}

/* Tippy.js custom theme to match app styling */
.tippy-box[data-theme~='custom'] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
}

.tippy-box[data-theme~='custom'] .tippy-content {
    padding: 10px 14px;
}

.tippy-box[data-theme~='custom'] .tippy-arrow {
    color: var(--border-color);
}

/* Links inside Tippy tooltips */
.tippy-box[data-theme~='custom'] a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tippy-box[data-theme~='custom'] a:hover {
    color: var(--accent-color);
}

.tippy-box[data-theme~='custom'] strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   Login Page Styles
   ============================================ */

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1117 50%, var(--bg-secondary) 100%);
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 140px;
    height: auto;
    margin-bottom: 0.75rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

.login-card .form-group {
    margin-bottom: 1.5rem;
}

.login-card .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-card .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.login-card .form-control::placeholder {
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer .text-muted {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Logout Button in Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--bg-hover);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.logout-btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Device Icons
   ============================================ */

/* Device icon image */
.device-icon {
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Size variants */
.device-icon-sm {
    width: 16px;
    height: 16px;
}

.device-icon-md {
    width: 28px;
    height: 28px;
}

.device-icon-lg {
    width: 34px;
    height: 34px;
}

.device-icon-xl {
    width: 48px;
    height: 48px;
}

/* Fallback emoji display */
.device-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.device-icon-fallback.device-icon-sm {
    font-size: 14px;
}

.device-icon-fallback.device-icon-md {
    font-size: 18px;
}

.device-icon-fallback.device-icon-lg {
    font-size: 24px;
}

.device-icon-fallback.device-icon-xl {
    font-size: 36px;
}

/* Device icon with name wrapper */
.device-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Table icon cell */
.icon-cell {
    width: 32px;
    padding-right: 0 !important;
    text-align: center;
}

.icon-cell .device-icon {
    display: block;
    margin: 0 auto;
    margin-right: -0.5rem;
}

/* ============================================
   MOBILE OVERRIDES (must come after base styles)
   ============================================ */
@media (max-width: 768px) {
    /* Issue counts - reduce gap and padding on mobile */
    .issue-counts {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .issue-count {
        padding: 1rem 1rem;
        min-width: 70px;
    }

    /* Audit timestamp - hide label, reduce font size */
    .audit-timestamp {
        font-size: 0.75rem;
    }

    .audit-timestamp .timestamp-label {
        display: none;
    }
}

/* ============================================
   SETUP GUIDE - Collapsible help sections
   ============================================ */

.setup-guide {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.setup-guide summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setup-guide summary::-webkit-details-marker {
    display: none;
}

.setup-guide summary::before {
    content: "▶";
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.setup-guide[open] summary::before {
    transform: rotate(90deg);
}

.setup-guide summary:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
}

.setup-guide:not([open]) summary:hover {
    border-radius: 8px;
}

.setup-guide-content {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.setup-guide-content h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    font-size: 0.95rem;
}

.setup-guide-content h4:first-child {
    margin-top: 0;
}

.setup-guide-content p {
    margin: 0.5rem 0;
}

.setup-guide-content ol,
.setup-guide-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.setup-guide-content li {
    margin: 0.35rem 0;
}

.setup-guide-content ul ul {
    margin-top: 0.25rem;
}

.setup-guide-content code {
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Audit page table minimum widths for mobile */
@media (max-width: 768px) {
    .port-table {
        min-width: 800px;
    }

    .wireless-client-table,
    .offline-client-table {
        min-width: 700px;
    }
}
