/*
 * admin-tables.css
 *
 * Extracted inline <style> blocks and style="" attributes from the admin
 * pages (logs, analytics, migrations) so templates carry no inline CSS.
 * Grouped by originating page, followed by shared layout utilities.
 */

/* ============================================================
   Log Viewer (admin/logs.html)
   ============================================================ */
.log-viewer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 12px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    overflow: hidden;
}
.log-viewer-header {
    background: #252526;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.log-viewer-body {
    height: 500px;
    overflow-y: auto;
    padding: 0;
}
.log-viewer-body.live-mode {
    background: #0d1117;
}
.log-entry {
    padding: 0.25rem 1rem;
    border-bottom: 1px solid #2d2d2d;
    display: flex;
    gap: 1rem;
    white-space: nowrap;
}
.log-entry:hover {
    background: #2a2d2e;
}
.log-timestamp {
    color: #6a9955;
    flex-shrink: 0;
    width: 180px;
}
.log-level {
    flex-shrink: 0;
    width: 60px;
    font-weight: 600;
}
.log-level.DEBUG { color: #569cd6; }
.log-level.INFO { color: #4ec9b0; }
.log-level.WARN { color: #dcdcaa; }
.log-level.ERROR { color: #f14c4c; }
.log-level.TRACE { color: #9cdcfe; }
.log-thread {
    color: #808080;
    flex-shrink: 0;
    width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-logger {
    color: #ce9178;
    flex-shrink: 0;
    width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.log-message {
    color: #d4d4d4;
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}
.log-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.log-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.log-filters select,
.log-filters input {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}
.log-stats {
    color: #808080;
    font-size: 0.75rem;
}
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4ec9b0;
}
.live-indicator .dot {
    width: 8px;
    height: 8px;
    background: #4ec9b0;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.log-file-card {
    cursor: pointer;
    transition: all 0.2s;
}
.log-file-card:hover {
    border-color: var(--bs-primary);
}
.log-file-card.active {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
}
.log-viewer .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #808080;
    padding: 2rem;
}
.log-viewer .empty-state svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}
/* Log filter controls (was inline style="width: 200px;") */
.log-search-input { width: 200px; }

/* ============================================================
   Analytics (admin/analytics.html)
   Lightweight, dependency-free visuals (no charting library / CSP-safe).
   ============================================================ */
.an-kpi { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.an-kpi-label { color: var(--bf-gray-600, #6c757d); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.an-spark { width: 100%; height: 64px; display: block; }
.an-spark path { fill: none; stroke: #0d6efd; stroke-width: 2; }
.an-spark .an-spark-area { fill: rgba(13,110,253,.10); stroke: none; }
.an-bar-track { background: var(--bf-gray-100, #f1f3f5); border-radius: 4px; height: 10px; overflow: hidden; }
.an-bar-fill { background: #0d6efd; height: 100%; }
.an-empty { color: var(--bf-gray-600, #6c757d); }
.an-mono { font-variant-numeric: tabular-nums; }
/* Contributors "Share" column (was inline style="min-width:160px") */
.col-minw-160 { min-width: 160px; }

/* ============================================================
   Migrations (admin/migrations.html)
   ============================================================ */
.sql-viewer {
    max-height: 65vh;
    overflow: auto;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color);
    background: #fafafa;
}
.sql-viewer pre {
    margin: 0;
    padding: 0;
    background: transparent;
}
.sql-viewer code {
    display: block;
    padding: 1rem 1.25rem 1rem 0;
    font-size: 13px;
    line-height: 1.55;
    background: transparent;
    color: #24292e;
    white-space: pre;
    font-family: var(--bs-font-monospace);
}
.sql-viewer .sql-lines {
    display: flex;
    align-items: stretch;
}
.sql-viewer .sql-gutter {
    user-select: none;
    text-align: right;
    padding: 1rem .75rem;
    color: #adb5bd;
    background: #f1f3f5;
    border-right: 1px solid var(--bs-border-color);
    font-family: var(--bs-font-monospace);
    font-size: 13px;
    line-height: 1.55;
    min-width: 3.25rem;
}
.sql-viewer .sql-gutter span { display: block; }
.stat-card-label { color: var(--bs-secondary-color); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card-value { font-size: 1.85rem; font-weight: 600; line-height: 1.1; }
.search-input { position: relative; }
.search-input i { position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); }
.search-input input { padding-left: 2.25rem; }
.cursor-pointer { cursor: pointer; }

/* ============================================================
   Shared table column-width utilities
   (replace legacy inline th style="width: ...px")
   ============================================================ */
.col-w-90 { width: 90px; }
.col-w-110 { width: 110px; }
.col-w-130 { width: 130px; }
.col-w-140 { width: 140px; }
.col-w-170 { width: 170px; }
.col-w-280 { width: 280px; }

/* Preserve wrapping in preformatted error output (was style="white-space: pre-wrap;") */
.pre-wrap { white-space: pre-wrap; }
