/* Realtime AI Support - admin panel */
:root {
    --nav-bg: #0f172a; --nav-text: #cbd5e1; --blue: #2563eb; --blue-dark: #1d4ed8; --blue-soft: #eff6ff;
    --bg: #f3f4f6; --card: #fff; --line: #e5e7eb; --text: #111827; --muted: #6b7280;
    --green: #16a34a; --amber: #b45309; --red: #dc2626;
    --font: "Segoe UI", system-ui, -apple-system, "Noto Sans", "Nirmala UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.5; }
a { color: var(--blue-dark); }
.icon { flex: none; vertical-align: middle; }

.admin { display: flex; min-height: 100vh; }
.nav { width: 248px; flex: none; background: var(--nav-bg); color: var(--nav-text); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav-logo { background: #fff; border-radius: 8px; padding: 4px 6px; }
.nav-logo img { display: block; width: 100%; height: auto; }   /* logo kept at its own proportions */
.nav-title { color: #fff; font-weight: 600; margin: 14px 6px 10px; font-size: 15px; }
.nav-user { margin: -4px 6px 12px; color: #94a3b8; }
.nav-user .small { margin-top: 4px; font-size: 12px; line-height: 1.35; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin: 12px 10px 4px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; font-weight: normal !important; }
.check-card:hover { border-color: #bfdbfe; background: #f8fbff; }
.check-card input { margin-top: 3px; }
.role-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.role-pick label { flex: 1; min-width: 220px; }
.video-thumb { position: relative; display: inline-block; }
.nav nav, .nav-bottom { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--nav-text);
    text-decoration: none; font-size: 14px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: #1e293b; color: #fff; }
.nav .badge { margin-left: auto; background: #f59e0b; color: #111; border-radius: 999px; font-size: 11.5px; padding: 0 7px; font-weight: 600; }
.nav-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid #273449; }
.logout-form { margin: 0; }

.content { flex: 1; min-width: 0; padding: 20px 26px 40px; }
.content-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.content-head h1 { margin: 0; font-size: 21px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.alert.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.warn .n { color: var(--amber); }
.stat.good .n { color: var(--green); }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { background: #f8fafc; font-weight: 600; color: #374151; white-space: nowrap; }
table.grid tr:hover td { background: #fafcff; }
.table-scroll { overflow-x: auto; }

.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #f1f5f9; color: #334155; white-space: nowrap; }
.tag.blue { background: var(--blue-soft); color: var(--blue-dark); }
.tag.green { background: #ecfdf5; color: var(--green); }
.tag.amber { background: #fffbeb; color: var(--amber); }
.tag.red { background: #fef2f2; color: var(--red); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; font-size: 13.5px; font-family: inherit; }
.btn:hover { border-color: #cbd5e1; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters a.pill { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); font-size: 13px; }
.filters a.pill.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field select, .field textarea, .filters input, .filters select {
    width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff;
}
.filters input, .filters select { width: auto; }
.field textarea { min-height: 90px; resize: vertical; }
.field textarea.big { min-height: 260px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field-validation-error, .validation-summary-errors { color: var(--red); font-size: 12.5px; }
.validation-summary-errors ul { margin: 0 0 10px; padding-left: 18px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: normal !important; }

.preview { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 12px 14px; background: #fcfcfd; min-height: 120px; }
.preview table { border-collapse: collapse; width: 100%; font-size: 13px; }
.preview th, .preview td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.preview p { margin: 0 0 8px; }
.thumb { max-width: 260px; height: auto; border: 1px solid var(--line); border-radius: 6px; display: block; margin: 6px 0; }

.question-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.question-box .q { font-size: 16px; font-weight: 600; margin: 2px 0 6px; white-space: pre-wrap; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.sugg { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.sugg:last-child { border-bottom: 0; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 22px; }
.login-card .logo { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto 18px; }
.login-card h1 { font-size: 18px; margin: 0 0 16px; }
.login-card .field { margin-bottom: 12px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; }

@media (max-width: 900px) {
    .nav { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
    .nav.open { transform: none; }
    .nav-toggle { display: inline-flex; }
    .content { padding: 16px; }
    .form-grid, .two-col { grid-template-columns: 1fr; }
}
