/* AI-платформа конференции — веб-интерфейс управления. Минимальный чистый стиль. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; font-size: 14px; color: #1f2937; background: #f3f4f6; line-height: 1.5; }

a { color: #2563eb; text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: 0; padding: 8px 14px; border-radius: 6px; background: #2563eb; color: #fff; font-weight: 500; }
button:hover { background: #1d4ed8; }
button.secondary { background: #e5e7eb; color: #1f2937; } button.secondary:hover { background: #d1d5db; }
button.danger { background: #dc2626; } button.danger:hover { background: #b91c1c; }
button.small { padding: 4px 10px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input, select, textarea { border: 1px solid #d1d5db; padding: 8px 12px; border-radius: 6px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: transparent; }
label { display: block; font-weight: 500; margin-bottom: 4px; color: #374151; font-size: 13px; }

/* ========== LAYOUT ========== */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #111827; color: #e5e7eb; padding: 20px 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sidebar nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sidebar h1 { padding: 0 20px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #374151; margin-bottom: 14px; }
.sidebar nav a { display: block; padding: 8px 20px; color: #d1d5db; font-size: 13px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: #1f2937; color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #1f2937; color: #fff; border-left-color: #3b82f6; }
.sidebar-group { padding: 14px 20px 4px; font-size: 10px; font-weight: 600; color: #6b7280; letter-spacing: 1.2px; text-transform: uppercase; }
.sidebar-group:first-of-type { padding-top: 6px; }
.agent-status { float: right; font-size: 9px; padding: 2px 6px; border-radius: 10px; background: #374151; color: #9ca3af; margin-top: 2px; }
.agent-status.active { background: #065f46; color: #d1fae5; }
.agent-status.frozen { background: #78350f; color: #fed7aa; }
.agent-status.not-built { background: #374151; color: #6b7280; }
.sidebar-footer { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid #374151; font-size: 12px; color: #9ca3af; margin-top: auto; }
.sidebar-footer a { color: #9ca3af; }

.main { padding: 24px 32px; overflow-x: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; }
.page-header .subtitle { color: #6b7280; font-size: 13px; margin-top: 2px; }

/* ========== CARDS ========== */
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin-bottom: 16px; }
.card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.metric .label { color: #6b7280; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.metric .value { font-size: 28px; font-weight: 600; margin-top: 6px; color: #111827; }
.metric .sub { color: #6b7280; font-size: 12px; margin-top: 4px; }

/* ========== TABLES ========== */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
th { background: #f9fafb; font-weight: 600; color: #4b5563; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfc; }

/* ========== BADGES ========== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 500; text-transform: uppercase; }
.badge.success { background: #d1fae5; color: #065f46; }
.badge.error, .badge.failed { background: #fee2e2; color: #991b1b; }
.badge.running { background: #dbeafe; color: #1e40af; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.cancelled { background: #e5e7eb; color: #374151; }

/* ========== LOGIN ========== */
.login-wrap { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: #fff; padding: 32px; border-radius: 12px; width: 360px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .subtitle { color: #6b7280; margin-bottom: 24px; font-size: 13px; }
.login-card label { margin-top: 12px; }
.login-card button { width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }
.login-error { background: #fee2e2; color: #991b1b; padding: 10px; border-radius: 6px; margin-top: 12px; font-size: 13px; }

/* ========== MODAL ========== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: grid; place-items: center; z-index: 100; }
.modal { background: #fff; border-radius: 8px; padding: 24px; width: 480px; max-width: 90vw; max-height: 85vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 17px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ========== UTILS ========== */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #e5e7eb; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { text-align: center; padding: 40px; color: #6b7280; }
.empty { text-align: center; padding: 40px; color: #9ca3af; font-size: 13px; }
.error-msg { background: #fee2e2; color: #991b1b; padding: 12px; border-radius: 6px; margin: 16px 0; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.muted { color: #6b7280; }
.small { font-size: 12px; }
pre { background: #f3f4f6; padding: 12px; border-radius: 6px; font-size: 12px; overflow-x: auto; font-family: "SF Mono", Menlo, monospace; }
.filters { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 140px; }

.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 12px 16px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.2); font-size: 13px; max-width: 360px; }
.toast.error { background: #dc2626; }
.toast.success { background: #059669; }
