/* VC ONE IT Assistant — design tokens and shared components */
:root {
  --brand: #2447C6;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 9%, #ffffff);
  --brand-line: color-mix(in srgb, var(--brand) 28%, #ffffff);
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #0F1828;
  --ink-2: #3E4A60;
  --ink-3: #66728A;
  --line: #E2E6EE;
  --line-strong: #CDD3DF;
  --ok: #12754A; --ok-soft: #E6F4EC;
  --warn: #8A5300; --warn-soft: #FFF3DD;
  --danger: #B42318; --danger-soft: #FDEDEB; --danger-line: #F4C3BD;
  --info: #1F5FA8; --info-soft: #E8F0FA;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 24, 40, .06);
  --shadow: 0 1px 2px rgba(15, 24, 40, .05), 0 6px 20px rgba(15, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(15, 24, 40, .16);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: color-mix(in srgb, var(--brand) 22%, #111a2b);
    --brand-line: color-mix(in srgb, var(--brand) 45%, #111a2b);
    --bg: #0A111E; --surface: #111A2B; --surface-2: #162238;
    --ink: #E9EEF7; --ink-2: #B4BED1; --ink-3: #8592AA;
    --line: #233149; --line-strong: #31415E;
    --ok: #4CC38A; --ok-soft: #12301F; --warn: #F0B54D; --warn-soft: #33270F;
    --danger: #F2837A; --danger-soft: #3A1714; --danger-line: #6B2A24;
    --info: #79AEEA; --info-soft: #14263F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-soft: color-mix(in srgb, var(--brand) 22%, #111a2b);
  --brand-line: color-mix(in srgb, var(--brand) 45%, #111a2b);
  --bg: #0A111E; --surface: #111A2B; --surface-2: #162238;
  --ink: #E9EEF7; --ink-2: #B4BED1; --ink-3: #8592AA;
  --line: #233149; --line-strong: #31415E;
  --ok: #4CC38A; --ok-soft: #12301F; --warn: #F0B54D; --warn-soft: #33270F;
  --danger: #F2837A; --danger-soft: #3A1714; --danger-line: #6B2A24;
  --info: #79AEEA; --info-soft: #14263F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon-xs { width: 14px; height: 14px; }
.brand-mark { display: inline-flex; width: 32px; height: 32px; color: var(--brand); flex: none; }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }

.avatar-initials { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 700; letter-spacing: .02em; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 12px; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }

/* toggle */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 36px; height: 20px; border-radius: 20px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle input:checked + .track { background: var(--ok); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot-resolved { background: var(--ok); } .dot-escalated { background: var(--warn); } .dot-security { background: var(--danger); } .dot-active { background: var(--info); }

/* modal */
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal-wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 17, 30, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); position: sticky; bottom: 0; }

/* toast */
.toast-host { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
