/* Nexora Systems — shared design system (purple) */
:root {
  --brand-900: #2e1065; --brand-800: #3b0f86; --brand-700: #5b21b6; --brand-600: #6d28d9; --brand-500: #7c3aed;
  --brand-400: #a78bfa; --brand-100: #ede9fe; --brand-50: #f5f3ff;
  --bg: #f7f7fb; --surface: #ffffff; --surface-2: #f3f2f8; --line: #e6e4ef; --line-2: #d8d5e5;
  --text: #1c1830; --text-2: #4b4763; --muted: #807b97;
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --info: #5b21b6; --info-bg: #ede9fe;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 24, 48, .05), 0 4px 16px rgba(28, 24, 48, .06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; } h2 { font-size: 18px; font-weight: 650; } h3 { font-size: 15px; font-weight: 650; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow, .grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* logo mark */
.mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-800)); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.mark svg { width: 20px; height: 20px; }
.wordmark { font-weight: 700; letter-spacing: -.01em; }
.wordmark span { color: var(--brand-400); font-weight: 600; }

/* forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
label > input, label > select, label > textarea { margin-top: 5px; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
input[type=checkbox] { width: auto; accent-color: var(--brand-600); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 13px; }
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--brand-600); background: var(--brand-600); color: #fff; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover, button:hover { background: var(--brand-700); border-color: var(--brand-700); text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
.btn.ghost, button.ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover, button.ghost:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-50); }
.btn.danger, button.danger { background: var(--surface); color: var(--bad); border-color: #f1c4c4; }
.btn.danger:hover, button.danger:hover { background: var(--bad-bg); }
.btn.sm, button.sm { padding: 5px 10px; font-size: 12px; }
.btn svg, button svg { width: 16px; height: 16px; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
tbody tr:hover { background: #faf9fe; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
td .thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; }

/* toast + modal */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: var(--text); color: #fff; padding: 11px 16px;
  border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; max-width: min(420px, calc(100vw - 40px)); opacity: 0;
  transform: translateY(8px); transition: .2s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--bad); }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 14, 40, .45); display: grid; place-items: center; padding: 16px; }
.modal > .card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
