/* PromPart AI Agents Dashboard */

:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-sidebar: #141620;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-icon { font-size: 28px; }
.logo-text { font-size: 14px; font-weight: 600; line-height: 1.3; }
.logo-text small { font-weight: 400; color: var(--text-muted); font-size: 11px; }

.agent-tabs {
    list-style: none;
    padding: 12px 0;
}

.agent-tabs li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.agent-tabs li a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.agent-tabs li.active a {
    color: var(--accent);
    background: rgba(59,130,246,0.1);
    border-right: 3px solid var(--accent);
}

.agent-icon { font-size: 20px; }

/* Content */
.content {
    margin-left: 220px;
    padding: 24px 32px;
    flex: 1;
    max-width: 1200px;
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.agent-header h1 { font-size: 24px; font-weight: 600; }

.agent-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--border);
    color: var(--text-muted);
}

.agent-status.active {
    background: rgba(34,197,94,0.15);
    color: var(--success);
}

/* Alerts */
.alerts-section { margin-bottom: 24px; }
.alerts-section h2 { font-size: 16px; margin-bottom: 12px; }

.alert {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
}

.alert-critical { border-left: 3px solid var(--danger); }
.alert-warning { border-left: 3px solid var(--warning); }
.alert-info { border-left: 3px solid var(--info); }

.alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.alert-header time { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.alert p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.alert-action { color: var(--accent) !important; margin-top: 6px; }

.btn-ack {
    margin-top: 8px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-ack:hover { border-color: var(--success); color: var(--success); }

/* Widgets Grid */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.2s;
}

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

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

.widget-header h3 { font-size: 14px; font-weight: 500; }
.widget-header time { font-size: 11px; color: var(--text-muted); }

.widget-body { min-height: 60px; }

/* KPI Card */
.kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

/* Tables */
.widget table, .agent-log table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.widget table td, .agent-log table td, .agent-log table th {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.agent-log table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
}

.widget table tr:last-child td { border-bottom: none; }

/* Mini alerts */
.mini-alerts { list-style: none; }
.mini-alerts li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

/* Widget footer */
.widget-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.widget-reason {
    font-size: 11px;
    color: var(--text-muted);
    cursor: help;
}

.no-data {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Agent log */
.agent-log { margin-top: 16px; }
.agent-log h2 { font-size: 16px; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar .logo-text, .sidebar .agent-name { display: none; }
    .content { margin-left: 60px; padding: 16px; }
    .widgets-grid { grid-template-columns: 1fr; }
}
