/* ldap — ShipGlobal sign-in. Tokens: design-kb Palette 10 (Indigo + Cool Grey);
   spacing 4/8/12/16/24/32/48/64; type 12/14/16/18/20/24/30; one radius; 3 shadows. */
:root {
  --primary-900: #19216C; --primary-800: #2D3A8C; --primary-700: #35469C; --primary-600: #4055A8;
  --primary-500: #4C63B6; --primary-400: #647ACB; --primary-100: #BED0F7; --primary-50: #E0E8F9;
  --gray-900: #1F2933; --gray-800: #323F4B; --gray-700: #3E4C59; --gray-600: #52606D; --gray-500: #616E7C;
  --gray-400: #7B8794; --gray-300: #9AA5B1; --gray-200: #CBD2D9; --gray-100: #E4E7EB; --gray-50: #F5F7FA;
  --red-900: #610316; --red-800: #8A041A; --red-700: #AB091E; --red-600: #CF1124; --red-500: #E12D39; --red-100: #FFBDBD; --red-50: #FFE3E3;
  --yellow-900: #8D2B0B; --yellow-800: #B44D12; --yellow-500: #F0B429; --yellow-100: #FFF3C4; --yellow-50: #FFFBEA;
  --green-900: #014D40; --green-800: #0C6B58; --green-700: #147D64; --green-500: #27AB83; --green-100: #C6F7E2; --green-50: #EFFCF6;
  --info-900: #035388; --info-500: #2BB0ED; --info-50: #E3F8FF;
  --radius: 6px;
  --shadow-sm: 0 1px 3px hsla(210, 24%, 16%, .12), 0 1px 2px hsla(210, 24%, 16%, .08);
  --shadow-md: 0 4px 6px hsla(210, 24%, 16%, .08), 0 2px 4px hsla(210, 24%, 16%, .06);
  --shadow-lg: 0 15px 35px hsla(210, 24%, 16%, .12), 0 5px 15px hsla(210, 24%, 16%, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--gray-900); background: var(--gray-50); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-800); text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  font: 500 14px/1.25 var(--font); border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:focus-visible, .input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary-100); outline-offset: 0; }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-700); color: #fff; }
.btn-secondary { background: #fff; color: var(--gray-800); border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--gray-50); color: var(--gray-900); }
.btn-danger { background: var(--red-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: var(--red-700); color: #fff; }
.btn-link { background: none; border: 0; color: var(--primary-600); padding: 0; min-height: 0; font-weight: 500; }
.btn-link:hover { color: var(--primary-800); text-decoration: underline; }
.btn-link.danger { color: var(--red-700); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 4px 12px; }
.input, select, textarea { width: 100%; font: 400 16px/1.5 var(--font); color: var(--gray-900); background: #fff;
  border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 8px 12px; box-shadow: inset 0 1px 2px hsla(210, 24%, 16%, .06); }
textarea { font-family: var(--mono); font-size: 14px; min-height: 96px; }
.input::placeholder, textarea::placeholder { color: var(--gray-400); }
.input.otp { font: 600 24px/1.25 var(--mono); letter-spacing: .3em; text-align: center; }
label, .label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 4px; }
.hint { font-size: 14px; color: var(--gray-500); margin-top: 4px; }
.field { margin-bottom: 24px; }
.field-error { font-size: 14px; color: var(--red-700); margin-top: 4px; }
.has-error .input, .has-error textarea { border-color: var(--red-500); }
.radio-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; margin-bottom: 8px; cursor: pointer; }
.radio-row input { margin-top: 4px; }
.radio-row strong { display: block; font-size: 14px; font-weight: 600; }
.radio-row span { font-size: 14px; color: var(--gray-600); }

/* ---------- Alerts & chips ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); border-left: 4px solid; font-size: 14px; margin-bottom: 24px; }
.alert-error { background: var(--red-50); color: var(--red-900); border-color: var(--red-500); }
.alert-success { background: var(--green-50); color: var(--green-900); border-color: var(--green-500); }
.alert-warn { background: var(--yellow-50); color: var(--yellow-900); border-color: var(--yellow-500); }
.alert-info { background: var(--info-50); color: var(--info-900); border-color: var(--info-500); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 0 8px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip-green { background: var(--green-100); color: var(--green-900); }
.chip-red { background: var(--red-100); color: var(--red-900); }
.chip-yellow { background: var(--yellow-100); color: var(--yellow-900); }
.chip-gray { background: var(--gray-100); color: var(--gray-700); }
.chip-indigo { background: var(--primary-50); color: var(--primary-900); }
.chip.plain::before { display: none; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 64px 16px 32px; }
.brand { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; color: var(--gray-900); font-weight: 600; font-size: 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius); background: var(--primary-600); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand small { font-size: 14px; font-weight: 500; color: var(--gray-500); }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.auth-card { width: 100%; max-width: 400px; padding: 32px; }
.auth-card h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.auth-card .sub { color: var(--gray-600); font-size: 16px; margin-bottom: 32px; }
.auth-card .sub strong { color: var(--gray-900); font-weight: 600; }
.provider-list { display: grid; gap: 12px; }
.provider-list .btn { font-size: 16px; min-height: 48px; }
.provider-icon { width: 20px; height: 20px; flex: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--gray-400); font-size: 14px; margin: 24px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-100); }
.auth-foot { max-width: 400px; margin-top: 24px; text-align: center; font-size: 14px; color: var(--gray-500); }
.labs-note { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--gray-600); background: var(--yellow-50); border-radius: var(--radius); padding: 12px; margin-top: 24px; }
.labs-note .chip { flex: none; }
.state-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 24px; }
.state-icon svg { width: 24px; height: 24px; }
.state-icon.red { background: var(--red-50); color: var(--red-600); }
.state-icon.green { background: var(--green-50); color: var(--green-700); }
.state-icon.indigo { background: var(--primary-50); color: var(--primary-600); }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--gray-50); border-radius: var(--radius); margin-bottom: 24px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-100); color: var(--primary-900); display: grid; place-items: center; font-weight: 600; flex: none; object-fit: cover; }
.who .email { font-weight: 600; word-break: break-all; }
.who .meta { font-size: 14px; color: var(--gray-500); }
.stack > * + * { margin-top: 12px; }
.app-list { list-style: none; margin: 0 0 24px; padding: 0; }
.app-list li { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.app-list li span { color: var(--gray-500); }

/* ---------- Console ---------- */
.topbar { background: #fff; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 32px; min-height: 64px; }
.topbar .brand { margin: 0; font-size: 16px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a { padding: 8px 12px; border-radius: var(--radius); color: var(--gray-600); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--gray-900); background: var(--gray-50); text-decoration: none; }
.nav a.active { background: var(--primary-50); color: var(--primary-800); }
.me { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--gray-600); }
.me form { margin: 0; }
.main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.page-head p { color: var(--gray-600); font-size: 14px; margin-top: 4px; }
.crumb { font-size: 14px; color: var(--gray-500); margin-bottom: 8px; display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { padding: 16px 24px; }
.stat .num { font-size: 30px; font-weight: 600; line-height: 1.25; color: var(--gray-900); }
.stat .lbl { font-size: 14px; color: var(--gray-500); }
.panel { margin-bottom: 32px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; font-weight: 600; }
.panel-head p { font-size: 14px; color: var(--gray-500); }
.panel-body { padding: 24px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input { max-width: 320px; }
.toolbar select { width: auto; min-width: 160px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); padding: 12px 24px; background: var(--gray-50); white-space: nowrap; }
td { padding: 12px 24px; border-top: 1px solid var(--gray-100); vertical-align: top; }
tr.row-link:hover td { background: var(--gray-50); }
td .primary { font-weight: 500; color: var(--gray-900); }
td .secondary { color: var(--gray-500); font-size: 14px; }
td.num, th.num { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
.empty { padding: 48px 24px; text-align: center; color: var(--gray-500); }
.empty strong { display: block; color: var(--gray-800); font-size: 16px; margin-bottom: 4px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 12px 16px; font-size: 14px; margin: 0; }
.dl dt { color: var(--gray-500); }
.dl dd { margin: 0; color: var(--gray-900); word-break: break-word; }
.secret-box { display: flex; gap: 8px; align-items: center; background: var(--gray-900); color: var(--green-100); padding: 12px 16px; border-radius: var(--radius); font-family: var(--mono); font-size: 14px; word-break: break-all; margin-top: 12px; }
.uri-list { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 14px; }
.uri-list li { padding: 4px 0; word-break: break-all; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { max-width: 320px; }
.danger-zone { border-top: 1px solid var(--gray-100); padding-top: 24px; margin-top: 24px; }
.pager { display: flex; justify-content: space-between; padding: 16px 24px; border-top: 1px solid var(--gray-100); font-size: 14px; }
.muted { color: var(--gray-500); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
details summary { cursor: pointer; font-size: 14px; color: var(--gray-600); }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px; }
  .nav { order: 3; flex-basis: 100%; }
  .main { padding: 24px 16px 48px; }
  th, td { padding: 12px 16px; }
  .dl { grid-template-columns: 1fr; gap: 4px; }
  .dl dd { margin-bottom: 8px; }
}
@media (max-width: 480px) {
  .auth { padding-top: 32px; }
  .auth-card { padding: 24px; }
}
.panel-head .toolbar { margin: 0; }
.narrow { max-width: 640px; }
