/* APIC admin - minimal CSS */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px; color: #1d2939; background: #f4f6fa; }

a { color: #2455d6; text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

button, input, select, textarea {
  font: inherit; color: inherit;
  border-radius: 6px; border: 1px solid #d0d5dd; padding: 7px 10px;
  background: #fff; outline: none;
}
button { background: #2455d6; color: #fff; border-color: #2455d6; cursor: pointer; padding: 7px 14px; }
button:hover { background: #1d46b5; }
button.ghost { background: #fff; color: #344054; }
button.ghost:hover { background: #f5f7fb; }
button.warn { background: #d92d20; border-color: #d92d20; }
button.warn:hover { background: #b42318; }
button.tiny { padding: 3px 8px; font-size: 12px; }

input, select, textarea { width: 100%; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
label { display: block; margin-bottom: 10px; color: #344054; }
label > input, label > select, label > textarea { margin-top: 4px; }
label.row { display: flex; align-items: center; gap: 8px; }
label.row > input[type=checkbox] { width: auto; }

/* sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 200px;
  background: #0e1726; color: #cdd5e0; padding: 16px 0;
  display: flex; flex-direction: column;
}
.sidebar .brand { padding: 0 20px 16px; font-size: 22px; font-weight: 700; color: #fff; }
.sidebar .brand small { display: block; font-size: 12px; font-weight: 400; color: #7d8b9c; }
.sidebar ul { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
.sidebar li a { display: block; padding: 9px 22px; color: #cdd5e0; border-left: 3px solid transparent; }
.sidebar li a:hover { background: #182338; text-decoration: none; }
.sidebar li a.active { background: #182338; border-color: #2dd4bf; color: #fff; }
.sidebar .who { border-top: 1px solid #1a2538; padding: 12px 20px; font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; }
.sidebar .who a { color: #7d8b9c; }

.content { margin-left: 200px; padding: 22px; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; }

.page { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #fff; border-radius: 10px; padding: 18px;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #344054; }

.grid { display: grid; gap: 12px; }
.grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) {
  .grid.grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 100%; height: auto; position: static; }
  .content { margin-left: 0; }
}

.kpi { font-size: 28px; font-weight: 700; color: #0e1726; }
.muted { color: #667085; }
.center { text-align: center; }
.small { font-size: 12px; }
.ok   { color: #027a48; }
.bad  { color: #b42318; }
.warn { color: #b54708; }
.hidden { display: none !important; }

.toolbar {
  background: #fff; padding: 12px; border-radius: 10px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.toolbar label { margin: 0; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,.05); }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
table.data th { background: #f8fafc; font-weight: 600; color: #475467; font-size: 12px; text-transform: uppercase; }
table.data tr:hover { background: #fafbfc; }
table.data td.ok, table.data td.bad { font-weight: 600; }
table.data td.ok { color: #027a48; }
table.data td.bad { color: #b42318; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  background: #eef2ff; color: #3538cd; }
.badge.lvl-info  { background: #eff8ff; color: #175cd3; }
.badge.lvl-warn  { background: #fff4e8; color: #b54708; }
.badge.lvl-alert { background: #fee4e2; color: #b42318; }

dialog { border: none; border-radius: 12px; padding: 0; box-shadow: 0 20px 50px rgba(16,24,40,.2);
  width: min(520px, 92vw); }
dialog::backdrop { background: rgba(16,24,40,.45); }
dialog form { padding: 20px; }
dialog h3 { margin: 0 0 14px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.row.split > label { flex: 1; }

.form-grid label { display: block; margin-bottom: 10px; }

form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
form.inline > * { flex: 1 1 auto; min-width: 140px; }
form.inline > button { flex: 0; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f3a8a, #0e1726); padding: 20px; }
.login-card { background: #fff; padding: 28px; border-radius: 12px; width: 360px;
  box-shadow: 0 20px 50px rgba(16,24,40,.3); }
.login-card .brand { font-size: 28px; font-weight: 800; margin-bottom: 6px; color: #0e1726; }
.login-card label { display: block; margin: 12px 0; }
.login-card button { width: 100%; margin-top: 8px; padding: 10px; }
.login-card .error { color: #b42318; min-height: 18px; margin: 8px 0 0; }

.toast { position: fixed; right: 20px; bottom: 20px; padding: 10px 16px; border-radius: 8px;
  color: #fff; font-size: 13px; z-index: 9999; box-shadow: 0 6px 14px rgba(16,24,40,.25); }
.toast.ok { background: #047857; }
.toast.error { background: #b42318; }
