/* Admin Dashboard Styles */

.admin-layout {
    display: flex;
    height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-primary);
    overflow: hidden;
}

.admin-main-content {
    margin-left: 280px;
    flex: 1;
    padding: 1.5rem 2rem;
    width: calc(100% - 280px);
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--glass-surface);
    border-radius: var(--radius-lg);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), var(--glass-inner);
}

.admin-page-title {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.admin-page-subtitle {
    color: var(--text-secondary);
    font-weight: 400;
}

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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(74, 222, 128, 0.2);
    color: var(--text-primary);
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.status-badge-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

.status-badge--healthy {
    background: rgba(34, 197, 94, 0.22);
    color: #22c55e;
}

.admin-content-area {
    min-height: 400px;
}

.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--primary-color);
}

.admin-content-area {
    min-height: 400px;
}

.admin-placeholder {
    padding: 2rem;
    background: rgba(15, 23, 42, 0.65);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.35);
    min-height: 400px;
}

.metric-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.metric-card-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.metric-card-value {
    font-size: 1.8rem;
    margin: 0.2rem 0;
    color: var(--text-primary);
}

.metric-card-unit {
    font-size: 1rem;
    color: var(--text-secondary);
}

.metric-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.metric-card-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.metric-card-trend--positive {
    color: var(--success-color);
}

.metric-card-trend--negative {
    color: var(--error-color);
}

.metric-card-trend--neutral {
    color: var(--text-secondary);
}

.metric-card-trend-note {
    color: var(--text-secondary);
}

.cache-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cache-header-card {
    background: rgba(15, 23, 42, 0.65);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(18px);
}

.cache-header-loading {
    text-align: center;
    padding: 1rem;
    color: rgba(226, 232, 240, 0.7);
}

.cache-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    color: rgba(226, 232, 240, 0.8);
}

.cache-header-title {
    margin-bottom: 0.5rem;
    color: #f8fafc;
}

.cache-status-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.cache-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.cache-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.cache-status-indicator--connected {
    color: #4ade80;
}

.cache-status-indicator--disconnected {
    color: #f87171;
}

.cache-status-entry {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cache-header-actions {
    margin-left: auto;
}

.cache-refresh-btn {
    margin-right: 0;
}

.cache-metrics-title {
    margin-bottom: 0.5rem;
    color: rgba(226, 232, 240, 0.8);
}

.cache-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cache-metrics-placeholder,
.cache-empty-state {
    text-align: center;
    padding: 2rem;
    color: rgba(226, 232, 240, 0.7);
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
    grid-column: 1/-1;
}

.cache-card {
    background: rgba(15, 23, 42, 0.65);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.4);
}

.cache-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.cache-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #f8fafc;
}

.cache-card-title-icon {
    color: #a855f7;
}

.cache-hit-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cache-hit-pill--good {
    background: rgba(16, 185, 129, 0.2);
    color: #4ade80;
}

.cache-hit-pill--warn {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.cache-hit-pill--critical {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.cache-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.cache-card-stat {
    text-align: center;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.cache-card-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f8fafc;
}

.cache-card-stat-value--success {
    color: #4ade80;
}

.cache-card-stat-value--danger {
    color: #fb7185;
}

.cache-card-stat-value--primary {
    color: #93c5fd;
}

.cache-card-stat-value--warning {
    color: #fbbf24;
}

.cache-card-stat-label {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.7);
}

.alert-history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 0;
}

.admin-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 10000;
    animation: admin-toast-in 0.3s ease forwards;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.admin-toast.is-hiding {
    animation: admin-toast-out 0.3s ease forwards;
}

.admin-toast--success {
    background: #10b981;
}

.admin-toast--error {
    background: #ef4444;
}

.admin-toast--warning {
    background: #f59e0b;
}

.admin-toast--info {
    background: #3b82f6;
}

@keyframes admin-toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes admin-toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: rgba(8, 10, 18, 0.95);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-right: var(--glass-border);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(245, 247, 255, 0.7);
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    border-radius: 0 12px 12px 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(76, 101, 255, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
}

.btn-refresh,
.btn-logout {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-refresh {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(59, 130, 246, 0.35));
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.btn-refresh:hover {
    filter: brightness(1.1);
}

.btn-logout {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn-logout:hover {
    filter: brightness(1.1);
}

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

.dashboard-header {
    background: var(--glass-surface);
    padding: 24px;
    border-bottom: var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.header-left h2 {
    font-size: 28px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.health-issues li {
    color: #fca5a5;
    font-size: 13px;
    margin-bottom: 4px;
}

.health-details-section {
    margin-top: 12px;
    max-width: 500px;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(13, 15, 26, 0.7);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(18px);
}

/* Health Components Styling */
.health-components {
    margin-bottom: 16px;
}

.health-component {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.health-component-main {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.component-status {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.component-name {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
}

.component-message {
    color: var(--text-secondary);
    font-size: 13px;
    flex: 1;
}

.component-threshold {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 6px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-top: 2px;
    font-family: 'SFMono-Regular', Menlo, monospace;
    align-self: flex-start;
}

/* Thresholds Summary */
.thresholds-summary {
    margin-top: 16px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: var(--glass-border);
    border-radius: 10px;
}

.thresholds-summary h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.threshold-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 6px;
}

.threshold-item {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.last-update {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.health-status {
    display: flex;
    align-items: center;
}

.health-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.is-hidden {
    display: none;
}

.health-healthy {
    background-color: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.health-warning {
    background-color: rgba(251, 191, 36, 0.18);
    color: #fde68a;
}

.health-critical {
    background-color: rgba(248, 113, 113, 0.18);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.auto-refresh label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.auto-refresh input[type="checkbox"] {
    cursor: pointer;
}

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

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: rgba(15, 23, 42, 0.65);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 20px 35px rgba(2, 6, 23, 0.35);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-card:hover {
    box-shadow: 0 25px 45px rgba(2, 6, 23, 0.45);
    transform: translateY(-2px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-header h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-header i {
    font-size: 20px;
    color: var(--primary-color);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    background: rgba(15, 23, 42, 0.65);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 35px rgba(2, 6, 23, 0.35);
}

.chart-container h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #f8fafc;
}

.chart-container canvas {
    max-height: 300px;
    background: rgba(15, 23, 42, 0.35);
    border-radius: 12px;
    padding: 0.5rem;
}

/* Overview Charts */
.overview-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.overview-chart-card {
    background: rgba(15, 23, 42, 0.65);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.3);
}

.overview-chart-card canvas {
    max-height: 180px;
    width: 100%;
}

.overview-chart-title {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Alerting */
.alerting-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.alert-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.alert-stat-card {
    background: var(--glass-surface);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.alert-stat-card h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.alert-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.alert-stat-card--active .alert-stat-icon {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.alert-stat-card--warning .alert-stat-icon {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
}

.alert-stat-card--critical .alert-stat-icon {
    background: rgba(248, 113, 113, 0.25);
    color: #fecaca;
}

.alert-stat-card--total .alert-stat-icon {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}

.tabs-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

.threshold-panel,
.history-card,
.channel-card,
.channel-grid {
    background: var(--glass-surface);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
}

.threshold-panel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.threshold-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thresholds-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.threshold-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.threshold-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threshold-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.threshold-input {
    width: 100%;
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 12, 20, 0.85);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.threshold-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.threshold-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-card {
    overflow: hidden;
}

.history-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-secondary);
}

.history-table th,
.history-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.history-table th {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.channel-grid {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.channel-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.channel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.tab-content-loading,
.alert-stats-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--text-primary);
}

.btn-danger:hover {
    filter: brightness(1.1);
}

/* Cache Grid */
.cache-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.cache-item {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.cache-item h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cache-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.cache-stat:last-child {
    border-bottom: none;
}

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

.cache-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Queries Container */
.queries-container {
    display: grid;
    gap: 24px;
}

.queries-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stat-item {
    background: var(--glass-surface);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
    text-align: center;
}

.stat-item label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-item span {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.slow-queries-log {
    background: var(--glass-surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
}

.slow-queries-log h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.slow-queries-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--text-secondary);
}

.slow-queries-table thead {
    background-color: rgba(255, 255, 255, 0.04);
}

.slow-queries-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.slow-queries-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.slow-queries-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.index-recommendations {
    background: var(--glass-surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
    margin-top: 16px;
}

.index-recommendations h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.index-recommendations ul {
    list-style: none;
}

.index-recommendations li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.index-recommendations li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Scheduler Grid */
.scheduler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.scheduler-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.scheduler-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.scheduler-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Requests Table */
.requests-table-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.requests-table thead {
    background-color: var(--light-bg);
}

.requests-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.requests-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.requests-table tbody tr:hover {
    background-color: var(--light-bg);
}

/* Business Grid */
.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.business-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.business-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.business-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.business-card:nth-child(4) {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.business-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.business-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.business-card h3 {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.business-value {
    font-size: 32px;
    font-weight: 700;
}

/* Alerting System Styles */
.alert-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.alert-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.alert-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.alert-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.alert-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.alert-value.warning {
    color: var(--warning-color);
}

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

/* Alert Tabs */
.alert-tabs {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 24px;
}

.tab-content.active {
    display: block;
}

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

.tab-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tab-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tab-actions {
    display: flex;
    gap: 12px;
}

/* Thresholds Grid */
.thresholds-grid {
    display: grid;
    gap: 20px;
}

.threshold-item {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.threshold-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.threshold-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.threshold-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.threshold-input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.threshold-input-group input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.threshold-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.threshold-input-group input.warning {
    border-color: var(--warning-color);
}

.threshold-input-group input.critical {
    border-color: var(--danger-color);
}

/* Channels Grid */
.channels-grid {
    display: grid;
    gap: 20px;
}

.channel-item {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.channel-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.channel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Small Buttons */
.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-small.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-small.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-small.btn-secondary {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.btn-small.btn-secondary:hover {
    background: linear-gradient(135deg, #475569, #334155);
}

.btn-small.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-small.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.channel-config {
    display: grid;
    gap: 16px;
}

.channel-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.channel-input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.channel-input-group input,
.channel-input-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.channel-input-group input:focus,
.channel-input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.channel-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.channel-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.channel-toggle label {
    cursor: pointer;
    font-weight: 500;
}

/* Alert History */
.alert-history-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.alert-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.alert-history-table th {
    background: var(--light-bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.alert-history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.alert-history-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.alert-severity {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-severity.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.alert-severity.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

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

.alert-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.alert-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.alert-status.resolved {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* Test Alerts */
.test-alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.test-card {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 24px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease;
}

.test-card:hover {
    transform: translateY(-2px);
}

.test-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.test-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.btn-test {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-test:hover {
    background: #2563eb;
}

.btn-test:active {
    transform: scale(0.98);
}

/* Alert Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.healthy {
    background: var(--secondary-color);
}

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

.status-indicator.critical {
    background: var(--danger-color);
}

.status-indicator.down {
    background: var(--danger-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .admin-main-content {
        padding: 1rem 1.5rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .admin-main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
}

@media (max-width: 768px) {

    /* Mobile: Hide sidebar by default, show hamburger */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .sidebar--open {
        left: 0;
    }

    .sidebar-nav {
        flex-direction: column;
    }

    .nav-link {
        padding: 14px 20px;
        border-left: 3px solid transparent;
        border-bottom: none;
    }

    .nav-link.active {
        border-left-color: var(--primary-color);
        border-bottom: none;
    }

    .nav-link i {
        display: inline-block;
    }

    .sidebar-footer {
        flex-direction: column;
        padding: 16px;
        gap: 10px;
    }

    .btn-logout {
        width: 100%;
    }

    .admin-main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
        padding-top: 60px;
        /* Space for hamburger button */
    }

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

    .charts-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header,
    .admin-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 1rem;
    }

    .header-right,
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .overview-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Hamburger Toggle Button */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-toggle:hover {
    background: rgba(99, 102, 241, 0.3);
}

.sidebar-toggle--active {
    background: var(--primary-color);
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .sidebar-overlay {
        display: block;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}