/* Boecia Talent design system. Calm and simple: one honey accent, neutral greys,
   colour only for state, white cards, generous spacing. Light and dark. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/shared/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/shared/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f2f1ee;
  --hover: #f4f3f0;
  --border: #e8e6e1;
  --border-strong: #d6d3cc;
  --text: #1b1a17;
  --text-2: #57544d;
  --muted: #8a867c;
  --accent: #d99a1e;
  --accent-strong: #b87d0c;
  --accent-soft: #fbf1dc;
  --accent-text: #7a5208;
  --focus: #d99a1e;
  --blue: #2a78d6; --blue-soft: #e6effb; --blue-text: #1c5cab;
  --green: #1d8a4e; --green-soft: #e3f4ea; --green-text: #146b3b;
  --red: #c93c3c; --red-soft: #fbe7e7; --red-text: #a12c2c;
  --violet-soft: #eeeafc; --violet-text: #4a3aa7;
  --shadow-sm: 0 1px 2px rgba(20, 18, 12, .05);
  --shadow: 0 1px 2px rgba(20, 18, 12, .04), 0 4px 16px rgba(20, 18, 12, .06);
  --shadow-lg: 0 12px 40px rgba(20, 18, 12, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1a18;
    --surface-2: #22221f;
    --hover: #242421;
    --border: #2c2b27;
    --border-strong: #3a3934;
    --text: #f2f1ed;
    --text-2: #c6c3ba;
    --muted: #8f8b80;
    --accent: #e8ad3a;
    --accent-strong: #f0bd57;
    --accent-soft: #3a2f16;
    --accent-text: #f3cf85;
    --blue: #3987e5; --blue-soft: #16263b; --blue-text: #8fbdf2;
    --green: #2fae6a; --green-soft: #13291d; --green-text: #7fd6a4;
    --red: #e66767; --red-soft: #3a1b1b; --red-text: #f3a3a3;
    --violet-soft: #221d3b; --violet-text: #b3aaf2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font: 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1c1402; font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--red-text); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 44px; padding: 0 22px; font-size: 15px; }
.btn.icon { width: 34px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- forms ---------- */
label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 400;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
input[type=file] { font-size: 13px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--text); }
label.check input { margin-top: 2px; flex: none; }
.form { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.form-error { color: var(--red-text); background: var(--red-soft); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; }

/* ---------- surfaces ---------- */
.card, .panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 20px 22px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- badges (colour = state only) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.blue { background: var(--blue-soft); color: var(--blue-text); }
.badge.green { background: var(--green-soft); color: var(--green-text); }
.badge.red { background: var(--red-soft); color: var(--red-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet-text); }
.count-dot { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #1c1402; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover { background: var(--hover); }
.table .primary-cell { font-weight: 500; color: var(--text); }
.table .sub { color: var(--muted); font-size: 12.5px; }
.table td.check, .table th.check { width: 36px; padding-right: 0; }

/* ---------- empty / loading ---------- */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.loading { color: var(--muted); padding: 48px; text-align: center; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 100;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }

/* ---------- drawer & modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 14, 10, .32); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .15s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 50; background: var(--surface);
  box-shadow: none; transform: translateX(100%); transition: transform .2s ease-out, box-shadow .2s, visibility 0s linear .2s; display: flex; flex-direction: column;
  visibility: hidden;
}
.drawer.open { transform: none; box-shadow: var(--shadow-lg); visibility: visible; transition: transform .2s ease-out, box-shadow .2s, visibility 0s; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.drawer-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--border); }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); opacity: 0; pointer-events: none;
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow-y: auto; z-index: 60;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px 24px; transition: opacity .15s, transform .15s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal h2 { margin-bottom: 6px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- tabs / segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 9px 12px; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- misc ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.secret {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere;
}
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .panel { padding: 16px; }
}

/* ---------- utilities (no inline styles: the CSP blocks them) ---------- */
.full { grid-column: 1 / -1; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; } .mb-18 { margin-bottom: 18px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-between.top { align-items: flex-start; }
.push { margin-right: auto; }
.card-outline { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card-outline + .card-outline { margin-top: 10px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pad { padding: 12px; }

/* section label inside panels and drawers */
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.section-title:first-child { margin-top: 0; }

/* file inputs */
input[type="file"] { font: inherit; font-size: 13.5px; color: var(--text-2); padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; margin-right: 12px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
