/* The company console, in the ERP's own look (Front/src/styles/theme.css, dark): the
   #0B0B0B page, #141414 surfaces, lime as the brand with ink on it, violet for people,
   Figtree, 20px cards and pill buttons, Iconly icons (icons.js) — Light at rest, Bold on
   the page you are on. Only this file styles the page: the content policy allows no
   inline style, so every variant is a class. */

@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/figtree-latin-ext.woff2') format('woff2');
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/figtree-latin.woff2') format('woff2');
  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;
}

:root {
  color-scheme: dark;
  --page: #0B0B0B; --surface: #141414; --card: #181818; --surface-2: #1A1A1A; --field: #1B1B1B;
  --hover: rgba(255, 255, 255, .06); --side-bg: #0B0B0B;
  --seg-on: #262626; --seg-shadow: none;
  --line: #232323; --line-strong: #303030; --side-line: #1E1E1E;
  --text: #FFFFFF; --text-2: #D4D4D4; --muted: #9B9B9B; --muted-2: #6E6E6E; --side-text: #B4B4B4;
  --violet: #5B53F2;
  /* The brand: lime with ink on it in the dark, as the ERP. */
  --brand: #D0F601; --brand-600: #BFE300; --on-brand: #141515;
  --nav-on-bg: #D0F601; --nav-on-text: #141515; --mark-bg: #D0F601; --mark-fg: #141515;
  --link: #D0F601; --focus: #D0F601; --btn-hover: #222222; --error-text: #F7C9C9;
  --scrim: rgba(0, 0, 0, .66); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  --login-card: rgba(20, 20, 20, .92); --glow-a: rgba(91, 83, 242, .28); --glow-b: rgba(208, 246, 1, .10);
  --kpi-blue: #B3A6FF; --kpi-teal: #4ADBC2; --kpi-amber: #F0BE62; --kpi-red: #F08A8A; --kpi-purple: #A995F5;
  --r-ctl: 14px; --r-inner: 10px; --r-card: 20px; --r-sheet: 24px; --r-pill: 999px;
  --font: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* The light theme, as the ERP's: white surfaces on #F5F5F7, violet buttons with white on
   them (lime does not read on white), and the current page as an ink pill with lime. */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #F5F5F7; --surface: #FFFFFF; --card: #FFFFFF; --surface-2: #FAFAFA; --field: #F3F3F3;
  --hover: #F1F1F3; --side-bg: #FFFFFF;
  --seg-on: #FFFFFF; --seg-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 0.8px rgba(0, 0, 0, .04);
  --line: #ECECEC; --line-strong: #D9D9D9; --side-line: #E4E4E4;
  --text: #141515; --text-2: #3A3A3A; --muted: #5E5E5E; --muted-2: #9A9A9A; --side-text: #5C5E64;
  --brand: #5B53F2; --brand-600: #4C44E0; --on-brand: #FFFFFF;
  --nav-on-bg: #141515; --nav-on-text: #D0F601; --mark-bg: #141515; --mark-fg: #D0F601;
  --link: #5B53F2; --focus: #5B53F2; --btn-hover: #F1F1F3; --error-text: #8E2B2B;
  --scrim: rgba(255, 255, 255, .74); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .14), 0 4px 14px rgba(0, 0, 0, .05);
  --login-card: rgba(255, 255, 255, .94); --glow-a: rgba(91, 83, 242, .14); --glow-b: rgba(208, 246, 1, .22);
  --kpi-blue: #5B53F2; --kpi-teal: #0E8A78; --kpi-amber: #8F6400; --kpi-red: #C24242; --kpi-purple: #7A4FE0;
}

* { box-sizing: border-box; }
/* `hidden` must win over the display a class gives (a field, the enrolment box, an error). */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
svg.i { display: block; flex: none; }

/* ---- sign-in -------------------------------------------------------------------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(640px 420px at 12% 8%, var(--glow-a), transparent 62%),
    radial-gradient(560px 380px at 88% 92%, var(--glow-b), transparent 62%),
    var(--page);
}
.login-card {
  width: 100%; max-width: 420px; display: grid; gap: 16px;
  background: var(--login-card); border: 0.8px solid var(--line);
  border-radius: 28px; padding: 36px 32px 32px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand { padding: 0; margin-bottom: 8px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .btn { width: 100%; height: 50px; font-size: 15px; margin-top: 6px; }
.enroll { background: var(--field); border: 0.8px solid var(--line-strong); border-radius: var(--r-ctl); padding: 14px; display: grid; gap: 8px; }
.enroll .mono { word-break: break-all; color: var(--text); font-size: 14px; }

/* ---- the brand mark ------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; flex: none; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--mark-bg); color: var(--mark-fg);
}
.brand-text { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.theme-toggle { width: 36px; height: 36px; }
.theme-toggle.corner { position: fixed; top: 18px; right: 18px; }
.brand-text b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text span { font-size: 12px; color: var(--muted); }

/* ---- fields and buttons --------------------------------------------------------- */
label.field { display: grid; gap: 7px; }
label.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  background: var(--field); border: 0.8px solid var(--line-strong); border-radius: var(--r-ctl);
  padding: 0 14px; height: 46px; min-width: 0; width: 100%; color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type="checkbox"] { width: 20px; height: 20px; padding: 0; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); }
textarea { min-height: 96px; padding: 12px 14px; height: auto; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--r-pill);
  border: 0.8px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-danger { color: var(--kpi-red); border-color: color-mix(in srgb, var(--kpi-red) 35%, transparent); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--kpi-red) 8%, transparent); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.icon-btn {
  width: 38px; height: 38px; flex: none; padding: 0; border-radius: var(--r-pill);
  display: grid; place-items: center; cursor: pointer;
  border: 0.8px solid var(--line-strong); background: transparent; color: var(--text-2);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.error { color: var(--error-text); background: color-mix(in srgb, var(--kpi-red) 12%, transparent);
  border: 0.8px solid color-mix(in srgb, var(--kpi-red) 30%, transparent);
  border-radius: var(--r-ctl); padding: 10px 14px; margin: 0; }
.ok { color: var(--kpi-teal); background: color-mix(in srgb, var(--kpi-teal) 10%, transparent); border-radius: var(--r-ctl); padding: 10px 14px; margin: 0; }

/* ---- the shell ------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  background: var(--side-bg); border-right: 0.8px solid var(--side-line);
  padding: 22px 14px 16px; display: grid; grid-template-rows: auto 1fr auto; gap: 8px;
}
.nav { display: grid; gap: 6px; align-content: start; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px;
  border-radius: var(--r-ctl); color: var(--side-text); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--nav-on-bg); color: var(--nav-on-text); font-weight: 600; }
.who {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 0.8px solid var(--line); border-radius: 18px; padding: 10px;
}
.who-meta { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.who-meta b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-meta span { font-size: 12px; color: var(--muted); }
.who .icon-btn { width: 34px; height: 34px; }

.avatar {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-pill);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: .02em;
  background: var(--violet); color: #fff;
}

.main { padding: 30px 34px 40px; display: grid; gap: 26px; align-content: start; min-width: 0;
  grid-template-columns: minmax(0, 1fr); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- surfaces ------------------------------------------------------------------- */
.card { background: var(--surface); border: 0.8px solid var(--line); border-radius: var(--r-card); padding: 22px; min-width: 0; }
.card.flush { padding: 4px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

/* The figures: one panel, a label over its number, hairlines between — no icon rings.
   Each figure draws its right and bottom rule; the panel's own edge hides the ones that
   fall on its outside. */
.figures {
  display: grid;
  background: var(--surface); border: 0.8px solid var(--line); border-radius: var(--r-card); overflow: hidden;
}
.figure {
  padding: 20px 22px 22px; min-width: 0;
  border-right: 0.8px solid var(--line); border-bottom: 0.8px solid var(--line);
  margin: 0 -0.8px -0.8px 0;
}
.figure .k { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.figure .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 10px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Columns that divide the figures into full rows, so no row ends in empty cells. */
.figures.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.figures.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  .figures.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .figures.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A section: its heading, what sits beside it, then its content. */
.block { display: grid; gap: 14px; min-width: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.block-head h2 { margin: 0; }
/* A switch: one tray, the chosen option raised out of it, each option with its count. */
.seg { justify-self: start; display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px;
  background: var(--field); border: 0.8px solid var(--line); }
.seg button {
  height: 32px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text-2); font-weight: 500; font-size: 13.5px;
}
.seg button:hover { color: var(--text); }
.seg button .n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: var(--seg-shadow); }
.seg button.on .n { color: var(--text-2); }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form .wide { grid-column: 1 / -1; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px 22px; }
.fact .label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.fact .val { font-weight: 500; overflow-wrap: anywhere; }

/* ---- tables --------------------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; scrollbar-width: none; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 14px 16px; white-space: nowrap; }
td { padding: 15px 16px; border-top: 0.8px solid var(--line); vertical-align: middle; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 22px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 22px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.who-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-cell .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
.who-cell b { display: block; font-weight: 600; }
.av-0 { background: #5B53F2; } .av-1 { background: #0E8A78; } .av-2 { background: #B7791F; }
.av-3 { background: #C24242; } .av-4 { background: #7A4FE0; } .av-5 { background: #2563EB; }

/* ---- chips ---------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  font-size: 12px; font-weight: 600; border-radius: 6px; white-space: nowrap;
  color: var(--tone, var(--muted)); background: color-mix(in srgb, var(--tone, var(--muted)) 13%, transparent);
}
.chip.active { --tone: var(--kpi-teal); }
.chip.read_only { --tone: var(--kpi-amber); }
.chip.suspended, .chip.bad { --tone: var(--kpi-red); }
.chip.provisioning { --tone: var(--kpi-blue); }
.chip.archived { --tone: var(--muted); }

/* ---- dialog --------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; z-index: 20; }
.dialog {
  background: var(--card); border: 0.8px solid var(--line-strong); border-radius: var(--r-sheet);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 580px; max-height: 90vh; overflow: auto;
  padding: 26px; display: grid; gap: 18px;
}
.dialog h2 { font-size: 20px; margin: 0; }
.dialog .foot { display: flex; justify-content: flex-end; gap: 10px; }
.secret-once { background: color-mix(in srgb, var(--kpi-amber) 10%, transparent); color: var(--kpi-amber);
  border: 0.8px solid color-mix(in srgb, var(--kpi-amber) 30%, transparent);
  border-radius: var(--r-ctl); padding: 14px; display: grid; gap: 8px; }
.secret-once .mono { color: var(--text); word-break: break-all; }

/* ---- empty and loading ---------------------------------------------------------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 30px 16px; color: var(--muted); text-align: center; }
.empty .ic { display: grid; place-items: center; color: var(--muted-2); }
.loading { color: var(--muted); padding: 8px 2px; }

/* ---- a phone -------------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 0.8px solid var(--side-line);
    grid-template-rows: auto; padding: 14px 12px; gap: 12px; }
  .brand { padding: 0 4px; }
  .nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; scrollbar-width: none; }
  .nav a { height: 40px; }
  .main { padding: 20px 16px 32px; }
  .figures.cols-6, .figures.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure { padding: 16px; }
  .figure .v { font-size: 21px; }
  h1 { font-size: 22px; }
}

/* spacing helpers (the content policy allows no inline styles) */
.stack { display: grid; gap: 22px; }
.mb8 { margin-bottom: 8px; } .ml8 { margin-left: 8px; } .mt4 { margin-top: 4px; }
.mt12 { margin-top: 12px; } .mt18 { margin-top: 18px; } .m0 { margin: 0; }
.m-x0 { margin-left: 0; margin-right: 0; margin-bottom: 0; }
