/* public/app/styles.css
   Layers on top of /console/styles.css, which owns the brand tokens. Only what
   the workspace adds lives here, so a brand change stays a one-file edit. */



.view form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.view form:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.view form:first-child > .subhead:first-child { margin-top: 0; }

/* activity timeline */

.timeline { margin: 16px 0 0; padding: 0; list-style: none; }

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.timeline-item:last-child { border-bottom: 0; }
body.app-ui [data-view="activity"] .timeline { max-height: none; overflow: visible; }
.timeline-item .badge { flex-shrink: 0; margin-top: 2px; }

/* ------------------------------------------------------- account profile

   THE PROFILE LAYOUT IS NOT HERE ANY MORE. .profile-grid, .profile-avatar,
   .avatar-side and the .kv corrections all live in public/console/styles.css,
   which both clients load, because the superadmin's own profile page needed the
   identical treatment and a second copy is how the two drifted apart the first
   time. Only the note below is workspace-only, because only this panel has one. */

#me-note { margin: 18px 0 0; }

/* The identifier list under the profile grid. Plain .kv, so it is NOT reached
   by the .profile-grid > .kv rules and arrives with the stock 120px column and
   a value column that takes the rest of the panel: a twelve-digit number in a
   1070px input reads as a broken layout rather than a field.

   132px matches the label column of the grid above so the two lists share a
   left edge, and the value column is capped at the width of the longest thing
   that goes in it, the PF number. */
#account-view .profile-section .kv {
  margin: 16px 0 0;
  grid-template-columns: 132px minmax(0, 420px);
  align-items: baseline;
}

/* Below this the label column plus a usable input no longer fit side by side,
   so the pairs stack. Matches what .kv does elsewhere on a narrow screen. */
@media (max-width: 620px) {
  /* The 132px label column never collapsed, so it was WIDER than the 126px value
     column at 375 and "qa_admin@qa.local" broke mid-token. The rule below this
     one already did exactly this collapse, but only for #account-view, so the
     console Profile and the tenant admin card kept the two-column grid. */
  .profile-grid > .kv { grid-template-columns: 1fr; }
  .profile-grid > .kv dt { margin-top: 10px; }
  #account-view .profile-section .kv { grid-template-columns: 1fr; }
  #account-view .profile-section .kv dt { margin-top: 10px; }
}

/* ---------------------------------------------------------- documents

   Four fixed cards. auto-fit rather than a fixed column count, so the grid is
   4 across on a desktop, 2 on a tablet and 1 on a phone without a breakpoint
   for each. minmax's floor is the narrowest a card can be before the status
   pill and the title collide. */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  /* One step inside the panel's own radius. Nested corners that match the
     parent read as a mistake; the inner radius is the outer minus the padding. */
  border-radius: calc(var(--radius) - 4px);
  background: var(--surface);
}

.doc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doc-card-head h4 { margin: 0; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }

/* An approved card is a statement rather than a control surface, so it loses
   the hover affordance the others keep. */
.doc-card.locked { background: rgba(47, 111, 79, 0.04); border-color: rgba(47, 111, 79, 0.22); }

/* aspect-ratio rather than a height: the box is the same size before the image
   arrives as after, so a slow load does not shove the page down. */
.doc-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb:hover { border-color: var(--gold-deep); transform: translateY(-1px); }
.doc-thumb:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.doc-thumb.empty {
  display: grid;
  place-items: center;
  cursor: default;
  border-style: dashed;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* The reason is the whole point of a rejection, so it is type the eye lands on
   rather than another muted line. Gold, which already means "needs attention"
   on the badge beside it. */
.doc-reason {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--gold-deep) 45%, transparent);
  background: rgba(233, 201, 119, 0.14);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: light-dark(#6f5716, var(--gold));
}

.doc-card-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.doc-card .muted.small { margin: auto 0 0; }

/* The viewer. The image is whatever the employee photographed, so the stage
   caps it rather than trusting it to be a sensible shape. */
.doc-stage {
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.doc-stage img { max-width: 100%; max-height: 62vh; width: auto; height: auto; border-radius: 6px; }

/* A detail nobody has filled in yet. Inline in the same row as the value it
   will become, so the list does not reflow when it is saved. */
.fill-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fill-row input { flex: 1 1 180px; min-width: 0; margin: 0; }

/* Download sits left, the decisions sit right, so a reviewer cannot hit
   Approve while reaching for Download. */
.modal-actions-group { display: inline-flex; gap: 8px; margin-left: auto; }

/* A link styled as a button, the outline twin of .file-btn in the console
   sheet. An <a download> rather than a <button>, because the browser owns the
   save: the session cookie rides along, the filename comes off the response,
   and no script has to hold two megabytes of somebody Aadhaar card in memory.
   button.secondary cannot be reused here, it is scoped to the element. */
.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.link-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--text-on-ink); }
.link-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

/* A country code beside its number. The SAME 0.6fr to 1.4fr ratio and the same
   10px gap as .grid-4 uses for the client contact rows, so the code field is
   the same proportion of its row wherever a phone number is typed in this
   product. Do not pick new numbers here; change .grid-4 and this together. */
.phone-pair {
  display: grid;
  grid-template-columns: 0.6fr 1.4fr;
  gap: 10px;
  align-items: end;
}
.phone-pair input { margin: 0; }

/* The pair inside a fill-once row has to share the row with a Save button, so
   it takes the space the inputs would have had rather than adding a third
   column. The 0.6 / 1.4 ratio is unchanged. */
.fill-row .phone-pair { flex: 1 1 220px; display: grid; margin-bottom: 0; }

/* The inferred-country-code note. Sits under its pair, inside the same grid
   cell, so it pushes nothing sideways and wraps with the field it explains. */
.phone-hint { margin: 6px 0 0; }
.phone-pair:not(.fill-row .phone-pair) { margin-bottom: 18px; }
.phone-pair:not(.fill-row .phone-pair) + .phone-hint { margin: -12px 0 18px; }

:root {
  color: var(--text);
  --ink: light-dark(#120502, #f3ede6);
  --ink-soft: light-dark(#302721, #e6ddd3);
  --accent: #e9c977;
  --accent-ink: light-dark(#7E6318, #e9c977);
  --accent-deep: color-mix(in srgb, #e9c977 85%, #120502);
  --accent-soft: light-dark(color-mix(in srgb, #e9c977 22%, #ffffff), rgba(233, 201, 119, 0.14));
  --on-accent: #120502;
  --gold: var(--accent);
  --gold-deep: var(--accent-deep);
  --on-gold: var(--on-accent);
  --gold-on-ink: light-dark(#e9c977, #7E6318);
  --paper: light-dark(#F9F5F3, #120502);
  --surface: light-dark(#ffffff, #1c0f0b);
  --surface-2: light-dark(#F9F5F3, #2a1912);
  --text: light-dark(#120502, #f3ede6);
  --text-on-ink: light-dark(#ffffff, #120502);
  --muted: light-dark(#766559, #b3a99f);
  --muted-on-ink: light-dark(#B29E90, #5c544e);
  --border: light-dark(#EEE5DF, rgba(243, 237, 230, 0.1));
  --border-on-ink: light-dark(rgba(255, 255, 255, 0.14), rgba(18, 5, 2, 0.14));
  --tint: light-dark(#120502, #f3ede6);
  --danger: light-dark(#C81912, #F27A6E);
  --ok: light-dark(#059669, #34d399);
  --info: light-dark(#5C3315, #D9A86C);
  --warn: light-dark(#b45309, #fbbf24);
  --hero: #120502;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 5, 2, 0.04), 0 10px 28px rgba(18, 5, 2, 0.08);
}

body.app-ui { background: var(--paper); }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.rail {
  --rail-ink: #F3EDE6;
  --rail-muted: #B29E90;
  flex: 0 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 0 16px;
  background: var(--hero);
  border-right: 1px solid light-dark(transparent, var(--border));
  overflow-y: auto;
  scrollbar-width: none;
}

.rail-brand { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; flex-shrink: 0; }
.rail-brand > span:not(.initials) { display: none; }
.rail-brand .initials { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: 0.8125rem; }
.rail-brand .org-logo { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; background: #ffffff; }

.rail-nav, .rail-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-foot { margin-top: auto; padding-top: 12px; }

body.app-ui .rail-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 60px;
  min-height: 56px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--rail-muted);
  font-size: 0.65625rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  transform: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
body.app-ui .rail-item:hover { background: color-mix(in srgb, var(--rail-ink) 7%, transparent); color: var(--rail-ink); }
body.app-ui .rail-item:is(.active, [aria-pressed="true"]) { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
body.app-ui .rail-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail-item .nav-icon { width: 20px; height: 20px; }
.rail-dot { position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--hero); }
.rail-dot[hidden] { display: none; }

.nav-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 12px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 0 10px 14px; }
.nav-panel-title { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; }
.nav-panel-blurb { margin: 4px 0 0; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }

.sidenav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item > span:not(.nav-count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-icon { width: 17px; height: 17px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.active .nav-icon { color: currentColor; }
.nav-item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
body.app-ui button.nav-item { border: 0; background: transparent; box-shadow: none; color: var(--ink-soft); font: inherit; font-size: 0.875rem; font-weight: 500; letter-spacing: 0; text-align: left; text-transform: none; transform: none; cursor: pointer; }
body.app-ui button.nav-item:hover { background: var(--surface-2); color: var(--text); }
body.app-ui button.nav-item.active, body.app-ui button.nav-item.active:hover { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.nav-count { flex: none; margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.6875rem; font-weight: 700; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; }
.nav-count[hidden] { display: none; }
.nav-item.active .nav-count { background: var(--surface); }

.nav-sep { flex-shrink: 0; height: 1px; margin: 12px 10px; background: var(--border); }
.nav-mini { margin: 0; padding: 0 10px 6px; font-size: 0.71875rem; font-weight: 600; color: var(--muted); }
.nav-empty { margin: 0; padding: 4px 10px; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); }

.nav-saved-row { position: relative; display: flex; align-items: center; }
.nav-saved-row:is(:hover, :focus-within) .nav-item { padding-right: 38px; }
body.app-ui button.nav-unsave {
  position: absolute;
  right: 4px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  opacity: 0;
  transform: none;
  cursor: pointer;
}
.nav-saved-row:is(:hover, :focus-within) .nav-unsave { opacity: 1; }
body.app-ui button.nav-unsave:hover { background: var(--surface-2); color: var(--danger); }
body.app-ui button.nav-unsave:focus-visible { opacity: 1; outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.nav-unsave svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: none) { .nav-unsave { opacity: 1; } .nav-saved-row .nav-item { padding-right: 38px; } }

body.app-ui button.nav-save-view {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: none;
  transform: none;
  cursor: pointer;
}
body.app-ui button.nav-save-view:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.nav-save-view .nav-icon { width: 16px; height: 16px; }

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-main { min-width: 0; display: flex; flex-direction: column; }

body.app-ui .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 32px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

body.app-ui .topbar h1 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle, .nav-close {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

.nav-toggle:hover, .nav-close:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

.nav-toggle svg, .nav-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(18, 5, 2, 0.5); }

body.nav-locked { overflow: hidden; }

body.app-ui .wrap { padding: 24px 32px 72px; }

@media (max-width: 1023px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: 100%;
    height: 100dvh;
    border-right: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform 0.22s ease; }
  .rail { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); padding-left: env(safe-area-inset-left); flex-basis: calc(72px + env(safe-area-inset-left)); }
  .nav-panel { padding-top: max(14px, env(safe-area-inset-top)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .nav-toggle, .nav-close { display: grid; }
  .nav-item, body.app-ui button.nav-save-view { min-height: 48px; font-size: 0.9375rem; }
  body.app-ui button.nav-unsave { width: 44px; height: 44px; right: 2px; }
  .nav-saved-row .nav-item, .nav-saved-row:is(:hover, :focus-within) .nav-item { padding-right: 52px; }
  body.app-ui .topbar {
    padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  }
  body.app-ui .wrap { padding: 16px 16px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar.open { transition: none; }
}

@media (max-height: 500px) {
  .rail { gap: 2px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .rail-brand, .rail-brand .initials, .rail-brand .org-logo { width: 36px; height: 36px; }
  .rail-brand { margin-bottom: 6px; }
  .rail-foot { padding-top: 4px; }
  body.app-ui .rail-item { min-height: 44px; width: 48px; padding: 0; gap: 0; }
  .rail-item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-panel { padding-top: max(10px, env(safe-area-inset-top)); }
  .nav-panel-head { padding-bottom: 8px; }
}

body.app-ui button {
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: capitalize;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

body.app-ui button.inline { font-size: 0.8125rem; border-radius: var(--field-radius); }
body.app-ui button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

body.app-ui :is(button.primary, button[type="submit"]:not(.secondary), #doc-view-approve, #crop-save, #in-download) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(18, 5, 2, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.app-ui :is(button.primary, button[type="submit"]:not(.secondary), #doc-view-approve, #crop-save, #in-download):hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--on-accent);
  transform: translateY(-1px);
}

body.app-ui button.secondary { color: var(--text); }
body.app-ui button.secondary:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--text); }
body.app-ui button.secondary.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
body.app-ui button.secondary.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

@media (pointer: coarse) {
  body.app-ui button.inline { min-height: 44px; }
}

body.app-ui .panel {
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(18, 5, 2, 0.03);
}

body.app-ui .panel-head h2 { font-size: 1.25rem; }

body.app-ui .panel tbody tr { transition: background 0.12s ease; }
body.app-ui .panel tbody tr:hover { background: var(--surface-2); }

body.app-ui .badge { border-radius: 999px; font-weight: 600; white-space: nowrap; }
body.app-ui .badge.ok { background: light-dark(#ecfdf5, rgba(52, 211, 153, 0.14)); border-color: transparent; color: var(--ok); }
body.app-ui .badge.warn { background: light-dark(#fffbeb, rgba(251, 191, 36, 0.14)); border-color: transparent; color: var(--warn); }
body.app-ui .badge.info { background: light-dark(#F7F2EE, rgba(217, 168, 108, 0.14)); border-color: transparent; color: var(--info); }

:is(.badge, .rec-tile, #lead-modal).stage-new { --stage: #866E5D; }
:is(.badge, .rec-tile, #lead-modal).stage-contacted { --stage: #5C3315; }
:is(.badge, .rec-tile, #lead-modal).stage-needs_chasing { --stage: #d97706; }
:is(.badge, .rec-tile, #lead-modal).stage-qualified { --stage: #7E6318; }
:is(.badge, .rec-tile, #lead-modal).stage-proposal { --stage: #B07A3A; }
:is(.badge, .rec-tile, #lead-modal).stage-converted { --stage: #059669; }
:is(.badge, .rec-tile, #lead-modal).stage-rejected { --stage: #C81912; }
.badge.stage-notif-announcements { --stage: #B07A3A; }
.badge.stage-notif-attendance { --stage: #9C7A3C; }
.badge.stage-notif-leave { --stage: #d97706; }
.badge.stage-notif-documents { --stage: #7E6318; }
.badge.stage-notif-helpdesk { --stage: #5C3315; }
.badge.stage-notif-incidents { --stage: #C81912; }
.badge.stage-notif-lifecycle { --stage: #A0522D; }
.badge.stage-notif-other { --stage: #866E5D; }

body.app-ui .badge[class*="stage-"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--stage, var(--muted)) 14%, transparent);
  color: light-dark(color-mix(in srgb, var(--stage, var(--muted)) 82%, #120502), color-mix(in srgb, var(--stage, var(--muted)) 55%, #fff));
}

body.app-ui .chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-ink);
}

.initials {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: light-dark(hsl(var(--hue) 62% 34%), hsl(var(--hue) 85% 82%));
  background: light-dark(hsl(var(--hue) 90% 94%), hsl(var(--hue) 45% 30% / 0.55));
}

.home { display: flex; flex-direction: column; gap: 20px; }

.home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.home-head h2 { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); letter-spacing: -0.03em; }
.home-date { margin: 0 0 4px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
}

.kpi {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "value value" "sub sub";
  align-content: start;
  gap: 12px 12px;
  min-height: 150px;
  padding: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -64px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: hsl(var(--k) 85% 60% / 0.1);
  pointer-events: none;
}

.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: hsl(var(--k) 70% 55% / 0.45); }
.kpi:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.kpi-violet { --k: 18; }
.kpi-amber { --k: 38; }
.kpi-rose { --k: 8; }
.kpi-teal { --k: 48; }

.kpi-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: hsl(var(--k) 85% 60% / 0.15);
  color: light-dark(hsl(var(--k) 70% 40%), hsl(var(--k) 85% 72%));
}

.kpi-svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-label { grid-area: label; align-self: center; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

.kpi { container-type: inline-size; }

.kpi-value {
  grid-area: value;
  font-size: clamp(0.875rem, 10.5cqi, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kpi-sub { grid-area: sub; font-size: 0.8125rem; color: var(--muted); }

.kpi.is-loading {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: kpi-shimmer 1.2s linear infinite;
}

.kpi.is-loading::after { display: none; }

@keyframes kpi-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .kpi.is-loading { animation: none; }
  .kpi:hover, body.app-ui :is(button.primary, button[type="submit"]:not(.secondary), #doc-view-approve, #crop-save, #in-download):hover { transform: none; }
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-wide { grid-column: 1 / -1; }

body.app-ui .home-card { padding: 20px 22px; }
.myday-card { display: flex; flex-direction: column; gap: 10px; }
.myday-card .card-head { margin-bottom: 2px; }
.myday-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.myday-card .home-row-main > * { white-space: normal; }
.myday-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-head h3 { margin: 0; font-size: 1rem; letter-spacing: -0.01em; }

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}

.card-link:hover { text-decoration: underline; }

.stage-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.stage-bar {
  display: grid;
  grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
  font-size: 0.8125rem;
}

.stage-name { color: var(--muted); font-weight: 600; }
.stage-track { height: 10px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.stage-fill { display: block; height: 100%; border-radius: inherit; background: var(--stage, var(--accent)); }
.stage-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.stage-bar.stage-new { --stage: #B29E90; }
.stage-bar.stage-contacted { --stage: #8A5A2B; }
.stage-bar.stage-needsChasing { --stage: #f59e0b; }
.stage-bar.stage-qualified { --stage: #B8963F; }
.stage-bar.stage-proposal { --stage: #6B3A26; }
.stage-bar.stage-converted { --stage: #10b981; }
.stage-bar.stage-rejected { --stage: #DC4B3E; }

.home-list { margin: 0; padding: 0; list-style: none; }

.home-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.home-row:last-child { border-bottom: 0; }
.home-row-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.home-row-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-row .badge { flex-shrink: 0; }

.dot { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.dot-invoice { background: #DC4B3E; }
.dot-lead { background: #B8963F; }
.dot-account { background: #2A1912; }
.dot-project { background: #8A5A2B; }
.dot-deal { background: #f59e0b; }

.home-empty { padding: 18px 0; }
.home-empty p { margin: 0; }
.home-empty.is-error strong { color: var(--danger); }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}

[data-view="organization"] form { margin-top: 0; padding-top: 0; border-top: 0; }

@media (max-width: 1280px) {
  body.app-ui .table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
  body.app-ui .panel .table-scroll table { display: table; min-width: 960px; }
  body.app-ui .panel table thead { display: table-header-group; }
  body.app-ui .panel table tbody { display: table-row-group; }
  body.app-ui .panel table tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; }
  body.app-ui .panel table td {
    display: table-cell;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow-wrap: normal;
  }
  body.app-ui .panel table td::before { content: none; }
  body.app-ui .panel table td.num { display: table-cell; }
  body.app-ui .panel table td.row-actions {
    display: table-cell;
    margin: 0;
    padding-top: 14px;
    border-top: 0;
    text-align: right;
    white-space: nowrap;
  }
  body.app-ui .panel table td.row-actions:empty { display: table-cell; }
  body.app-ui .panel table td.row-actions > * { margin: 0 0 0 6px; }
  body.app-ui .panel table td[colspan] { white-space: normal; }
  body.app-ui .panel table :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
  }
  body.app-ui .panel table td[colspan]:first-child { position: static; box-shadow: none; }
}

.crumb { display: none; margin: 0; font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.crumb strong { color: var(--text); font-weight: 700; }
.crumb-sep { margin: 0 8px; opacity: 0.6; }

@media (min-width: 1024px) {
  .crumb { display: block; }
  body.app-ui .topbar h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.sidenav .nav-item {
  text-transform: none;
  letter-spacing: 0;
  justify-content: flex-start;
  border: 0;
  box-shadow: none;
}

.sidenav .nav-item.active, .sidenav .nav-item.active:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: none;
}

body.app-ui button.row-more {
  display: inline-grid;
  place-items: center;
  width: 34px;
  padding: 0;
  vertical-align: middle;
}

.row-more svg { width: 18px; height: 18px; fill: currentColor; }

@media (pointer: coarse) {
  body.app-ui button.row-more { width: 44px; }
}

.row-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 140px;
  width: max-content;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow), 0 2px 6px rgba(18, 5, 2, 0.08);
  color: var(--text);
}

body.app-ui .row-menu-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

body.app-ui .row-menu-item:hover { background: var(--surface-2); color: var(--text); transform: none; }
body.app-ui .row-menu-item.danger { color: var(--danger); }
body.app-ui .row-menu-item.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

@media (pointer: coarse) {
  body.app-ui .row-menu-item { min-height: 44px; }
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-mono-variable.woff2") format("woff2");
}

body.app-ui,
body.app-ui :is(button, input, select, textarea, dialog) {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01", "cv11";
}

:is(h1, h2, h3, h4) { color: var(--ink); }
body.app-ui :is(h1, h2, h3, h4) { font-family: "Geist", ui-sans-serif, system-ui, sans-serif; letter-spacing: -0.025em; }
body.app-ui :is(code, kbd, pre, .mono, .code) { font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
body.app-ui :is(td, .kpi-value, .stage-n) { font-variant-numeric: tabular-nums; }

@media (max-width: 1280px) {
  body.app-ui .table-scroll {
    background:
      linear-gradient(to left, var(--surface) 40%, transparent) right center / 56px 100% no-repeat local,
      linear-gradient(to left, color-mix(in srgb, var(--tint) 16%, transparent), transparent) right center / 18px 100% no-repeat scroll;
  }
}

@media (max-width: 767px) {
  body.app-ui .panel table :is(th, td):first-child:not(.num) {
    min-width: 136px;
    max-width: 168px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 640px) {
  .kpi-grid { gap: 10px; }
  .kpi {
    min-height: 0;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "icon label value" "icon sub value";
    align-items: center;
    gap: 2px 12px;
    padding: 14px 16px;
  }
  .kpi::after { display: none; }
  .kpi-value { font-size: 1.25rem; text-align: right; overflow-wrap: normal; white-space: nowrap; }
  .kpi-label { align-self: end; color: var(--text); }
  .kpi-sub { align-self: start; font-size: 0.75rem; }
  .kpi.is-loading { min-height: 68px; }
  .home-head .head-actions { width: 100%; }
  .home-head .head-actions button { flex: 1; }
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

body.app-ui :is(button, .row-menu-item) > :is(svg, span) { pointer-events: none; }

body.app-ui button.has-icon { display: inline-flex; align-items: center; gap: 6px; }

body.app-ui button.has-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--btn-icon) center / contain no-repeat;
  mask: var(--btn-icon) center / contain no-repeat;
}

.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.ui-card-interactive { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.ui-card-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.view[data-layout]:not([hidden]) { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head-text { min-width: 0; max-width: 72ch; }

.page-eyebrow {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

body.app-ui .page-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.03em; }
body.app-ui .page-head .page-desc { margin: 6px 0 0; }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.app-ui .page-actions button.page-more { display: inline-flex; align-items: center; gap: 6px; }

.subtabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.subtab {
  flex-shrink: 0;
  margin-bottom: -1px;
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.subtab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; border-radius: 6px; }
body.app-ui .panel-title .count-chip { min-width: 0; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.date-head.date-year-row { margin-bottom: 0; }
.date-nav[data-year-step="1"]::before { transform: scaleX(-1); }
.date-head .date-titles { display: flex; flex: 1; justify-content: center; gap: 2px; min-width: 0; }
.date-head .date-titles .date-title { flex: 0 1 auto; padding-inline: 10px; }
.date-head .date-title[data-jump]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }
.date-head .date-title[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
.form-section { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
* + .form-section { margin-top: 12px; }
.form-section > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; cursor: pointer; list-style: none; border-radius: 12px; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary:hover { background: var(--surface-2); }
.form-section > summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.form-section > summary::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.18s ease; }
.form-section[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.form-section[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.form-section-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.form-section-note { margin-left: auto; font-size: 0.75rem; color: var(--muted); }
.form-section-title:last-child { margin-right: auto; }
.form-section-body { padding: 16px 16px 0; }
.form-section { interpolate-size: allow-keywords; }
.form-section::details-content { block-size: 0; overflow: clip; transition: block-size 0.26s cubic-bezier(0.16, 1, 0.3, 1), content-visibility 0.26s allow-discrete; }
.form-section[open]::details-content { block-size: auto; }
#account-view .profile-collapse { margin-top: 16px; padding: 0; border: 1px solid var(--border); }
#account-view .profile-collapse .form-section-body { padding: 16px; }
#account-view .profile-collapse .form-section-body > :first-child { margin-top: 0; }
#account-view #me-edit { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .form-section > summary::after { transition: none; } .form-section::details-content { transition: none; } }
.char-count { display: block; margin: 2px 0 0; text-align: right; font-size: 0.6875rem; line-height: 14px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; }
.char-count.is-tucked { margin: -16px 0 2px; }
.char-count.is-full { color: var(--danger); }
.char-count:empty { display: none; }
.panel > .kpi-grid { margin-bottom: 20px; }
.panel > .subtabs { margin: 4px 0 16px; }
@media (min-width: 1024px) { body[data-page="app"] nav.subtabs { display: none; } }
.ts-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.ts-desc { min-width: 220px; white-space: normal !important; }
body.app-ui .reveal button.secondary { background: transparent; border-color: var(--border-on-ink); color: var(--gold-on-ink); }
body.app-ui .reveal button.secondary:hover { background: color-mix(in srgb, var(--gold-on-ink) 14%, transparent); border-color: var(--gold-on-ink); color: var(--gold-on-ink); }
:is(input, textarea):read-only + .char-count { display: none; }
body.app-ui .char-count + p.muted.small, body.app-ui dialog .grid-2 > div > .char-count + p.muted.small { margin-top: 2px; }
.subtab .tab-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.6875rem; }
.subtab .tab-count:empty { display: none; }
.col-org .org-id { display: block; width: fit-content; margin-top: 4px; font-size: 0.75rem; }
.panel.kpi-strip { padding: 0; border: 0; background: none; box-shadow: none; }
.tenant-head { margin-bottom: 0; }
.admin-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 16px; align-items: end; margin-top: 16px; }
.admin-row label { margin-top: 0; }
.admin-row input { margin-bottom: 0; }
body.app-ui :is(.head-actions, .page-tools) input[type="search"] { width: 100%; height: var(--field-h-sm); min-height: var(--field-h-sm); margin: 0; padding-right: 44px; }
body.app-ui :is(.head-actions, .page-tools) .search-field { width: 220px; }
.search-field { position: relative; display: inline-flex; align-items: center; }
body.app-ui .search-field > button.search-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 28px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
body.app-ui .search-field > button.search-btn:hover { background: var(--surface-2); color: var(--text); }
body.app-ui .search-field > button.search-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 0; }
body.app-ui dialog .grid-2 > div > p.muted.small { margin: -10px 0 18px; }
body.app-ui .page-toolbar > .page-tools:only-child { flex: 0 1 66.667%; margin-left: auto; }
body.app-ui td button.icon-action { height: auto; min-height: 0; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; }
body.app-ui td button.icon-action:hover { background: color-mix(in srgb, var(--tint) 6%, transparent); color: var(--text); }
body.app-ui input[type="search"]::-webkit-search-cancel-button { appearance: none; }
@media (max-width: 767px) {
  body.app-ui .page-toolbar > .page-tools:only-child { flex-basis: 100%; }
}
body.app-ui .page-toolbar > .page-tools:only-child .search-field { width: 100%; }
@media (pointer: coarse) {
  body.app-ui :is(.head-actions, .page-tools) input[type="search"] { height: var(--field-h); min-height: var(--field-h); }
  body.app-ui .search-field > button.search-btn { width: 40px; height: 40px; }
}
body.app-ui .panel > h2 { font-size: 1.25rem; }
body.app-ui:not([data-page="app"]) dialog > form > .modal-head { position: sticky; top: -28px; z-index: 2; margin: -28px -28px 16px; padding: 28px 28px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
body.app-ui:not([data-page="app"]) dialog > form > .modal-actions { position: sticky; bottom: -28px; z-index: 2; margin: 24px -28px -28px; padding: 16px 28px 28px; background: var(--surface); border-top: 1px solid var(--border); }
.person-head { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.person-head .avatar, .person-head .avatar-img { width: 56px; height: 56px; flex-shrink: 0; }
.person-id { display: grid; gap: 2px; flex: 1; min-width: 0; }
.person-id strong { font-size: 1rem; }
.person-id .muted { overflow-wrap: anywhere; }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0 0; }
.fact-grid > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.fact-grid dt { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.fact-grid dd { margin: 4px 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
@media (max-width: 1023px) {
  .topbar .topbar-meta { display: none; }
}
@media (max-width: 767px) {
  .person-head { flex-wrap: wrap; }
  .person-head > button { width: 100%; }
  .admin-row { grid-template-columns: 1fr; }
  body.app-ui :is(.head-actions, .page-tools) .search-field { width: 100%; }
}
.kpi[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.subtab.active .tab-count { background: var(--accent-soft); color: var(--accent-ink); }

.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.page-filters { display: flex; flex: 1 1 320px; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.page-filters .chips { margin: 0; }
.page-filters .chip-clear { margin-left: 0; }
.page-clear { display: flex; flex: 1 0 100%; justify-content: flex-end; }
.page-clear:not(:has(> :not([hidden]))) { display: none; }
body.app-ui .page-clear > .chip-clear { margin: 0; }
@container page (min-width: 940px) {
  body.app-ui .page-toolbar:has(> .page-clear > :not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; gap: 8px 20px; }
  body.app-ui .page-toolbar:has(> .page-clear > :not([hidden])) > .page-filters { grid-column: 1; grid-row: 1 / span 2; }
  body.app-ui .page-toolbar:has(> .page-clear > :not([hidden])) > .page-tools { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  body.app-ui .page-toolbar:has(> .page-clear > :not([hidden])) > .page-clear { grid-column: 2; grid-row: 2; }
}
body.app-ui [data-layout="page"] { container: page / inline-size; }
.route-filters { display: contents; }

.page-tools { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; font-size: 0.875rem; }
body.app-ui .page-tools .pager { margin: 0; padding: 0; border: 0; gap: 16px; }
.page-tools .count-chip { margin: 0; }
.month-nav { display: flex; align-items: center; gap: 8px; }

body.app-ui .page-card { padding: 24px 28px; }
body.app-ui .page-card > :first-child { margin-top: 0; }

@media (max-width: 640px) {
  body.app-ui .page-card { padding: 16px; }
  .page-tools { width: 100%; }
  .page-actions { width: 100%; }
  .page-actions > button:last-child { flex: 1; justify-content: center; }
}

body.app-ui a.record-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

body.app-ui a.record-link:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
body.app-ui a.record-link:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }

.detail-link { margin: 10px 0 0; }
.detail-link a.record-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); text-decoration: none; font-size: 0.8125rem; font-weight: 600; }
.detail-link a.record-link:hover { text-decoration: underline; }

body.app-ui .chip.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-ink);
  text-decoration: none;
}

body.app-ui .chip.chip-filter:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink); }
body.app-ui .chip.chip-filter:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

body.app-ui .row-menu-item { gap: 10px; align-items: center; text-decoration: none; }
body.app-ui a.row-menu-item:hover { background: var(--surface-2); }
.row-menu-item .ui-icon { color: var(--muted); }
.row-menu-item.danger .ui-icon { color: inherit; }
.row-menu-count { margin-left: auto; padding-left: 16px; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.row-menu-count:empty { display: none; }

body.app-ui .panel tbody tr.is-inactive td:not(.row-actions) { color: var(--muted); }
body.app-ui .badge.danger { background: light-dark(#FDF0EF, rgba(242, 122, 110, 0.14)); border-color: transparent; color: var(--danger); }
.att-who :is(select, .select-trigger) { min-width: 180px; }
.illustration { display: block; width: 160px; height: 120px; margin: 0 auto 12px; }
.illustration .ill-card { fill: var(--surface); stroke: color-mix(in srgb, var(--accent) 28%, var(--border)); stroke-width: 1.5; }
.illustration .ill-soft { fill: var(--accent-soft); }
.illustration .ill-accent { fill: var(--accent); }
.illustration .ill-warm { fill: #f59e0b; }
.illustration .ill-shadow { fill: color-mix(in srgb, var(--tint) 8%, transparent); }
.illustration .ill-line { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.illustration .ill-line-accent { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.illustration .ill-line-light { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.empty-state { box-sizing: border-box; width: 100%; padding: 28px 16px 32px; text-align: center; }
li:has(> .empty-state) { display: block; flex: 1 1 100%; }
.empty-state p { margin: 0 0 4px; }
.empty-state .empty-title { font-size: 0.9375rem; }
.empty-state .empty-cta { margin-top: 14px; }
.empty-state.is-compact { padding: 16px 8px; }
.empty-state.is-compact .illustration { width: 96px; height: 72px; margin-bottom: 8px; }
.empty-state.is-error .empty-title { color: var(--danger); }
body.app-ui .panel tbody tr.empty-row:hover,
body.app-ui .panel tbody tr.skeleton-row:hover { background: none; }
.empty-item { list-style: none; }

.skeleton-row td { padding: 18px 12px; }
.skeleton-bar {
  position: relative;
  display: block;
  height: 14px;
  margin: 14px 0 22px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.skeleton-bar:last-child { margin-bottom: 4px; }
.skeleton-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.3s ease-in-out infinite;
}
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

body .toasts {
  top: auto;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  left: auto;
  transform: none;
  align-items: flex-end;
  width: min(380px, calc(100vw - 40px));
}
body .toast {
  position: relative;
  width: 100%;
  overflow: hidden;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px 16px 16px;
  border-left: 0;
  border-radius: 12px;
  animation: none;
}
.toast-icon { display: inline-grid; place-items: center; flex-shrink: 0; color: var(--accent-ink); }
.toast.ok .toast-icon { color: var(--ok); }
.toast.error .toast-icon { color: var(--danger); }
.toast-text { flex: 1; min-width: 0; }
.toast-action { margin-left: auto; }
.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left;
}

body.app-ui dialog {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.16s ease-in, transform 0.16s ease-in, overlay 0.16s allow-discrete, display 0.16s allow-discrete;
}
body.app-ui dialog[open] {
  opacity: 1;
  transform: none;
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
body.app-ui dialog::backdrop {
  opacity: 0;
  transition: opacity 0.16s ease-in, overlay 0.16s allow-discrete, display 0.16s allow-discrete;
}
body.app-ui dialog[open]::backdrop { opacity: 1; transition-duration: 0.22s; }
@starting-style {
  body.app-ui dialog[open] { opacity: 0; transform: scale(0.98); }
  body.app-ui dialog[open]::backdrop { opacity: 0; }
}

.confetti { position: fixed; left: 50%; top: 38%; width: 0; height: 0; z-index: 90; pointer-events: none; }
.confetti-piece { position: absolute; left: -4px; top: -6px; width: 8px; height: 12px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton-bar::after { animation: none; }
  .toast-progress { display: none; }
  body.app-ui dialog,
  body.app-ui dialog[open],
  body.app-ui dialog::backdrop { transition: none; }
}

body.app-ui button.inline:has(> .ui-icon),
body.app-ui .link-btn:has(> .ui-icon) { display: inline-flex; align-items: center; gap: 6px; }

.home-art { width: 128px; height: 96px; margin: 0; flex-shrink: 0; }
.home-head { justify-content: flex-start; }
.home-head .head-actions { margin-left: auto; }
.stage-fill { width: 100%; border-radius: 0; transform-origin: left center; }
.kpi.ui-card { border-radius: 16px; }

body.app-ui button:active:not(:disabled) { transform: scale(0.98); }
body.app-ui .row-menu-item:active { transform: none; }

@media (max-width: 640px) {
  .home-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.app-ui button:active:not(:disabled),
  .ui-card-interactive:hover { transform: none; }
  .ui-card-interactive, .subtab, a.record-link,
  body.app-ui .panel tbody tr { transition: none; }
}

@media (min-width: 1024px) {
  body.app-ui .panel .table-scroll table { width: 100%; min-width: 0; }
  body.app-ui .panel table :is(th, td) { white-space: normal; }
  body.app-ui .panel table :is(th, td):first-child:not(.num) { min-width: 0; position: static; box-shadow: none; }
  body.app-ui .panel table td.row-actions { width: 1%; white-space: nowrap; }
  body.app-ui .panel table td :is(.badge, .pill, time) { white-space: nowrap; }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  body.app-ui .panel table :is(th, td) { padding-inline: 8px; }
  body.app-ui .row-preview > span { display: none; }
  body.app-ui button.row-preview { width: 34px; padding: 0; display: inline-grid; place-items: center; }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  body.app-ui [data-view="invoices"] .panel table td:first-child .badge { white-space: normal; text-align: center; line-height: 1.25; }
}

body.app-ui .panel table td code { white-space: nowrap; }
body.app-ui:not([data-page="app"]) .panel table :is(th, td) { white-space: nowrap; }

@media (min-width: 1024px) and (max-width: 1365px) {
  body.app-ui [data-view="invoices"] .panel table :is(th, td) { padding-inline: 6px; }
}

body.app-ui :is(.file-btn, .link-btn) {
  display: inline-flex;
  align-items: center;
  min-height: var(--field-h-sm);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--field-radius);
  background: transparent;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: capitalize;
}
body.app-ui :is(.file-btn, .link-btn):hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--text); }
body.app-ui #c-phone-add { margin-bottom: 24px; }

@media (min-width: 1024px) {
  body.app-ui .pager { flex-direction: row; align-items: center; }
}
body.app-ui .page-card .table-scroll:has(+ .pager) tbody tr:last-child td { border-bottom: 0; }
body.app-ui .page-card .pager:has(> .pager-status[data-empty="true"]) { display: none; }

@media (min-width: 1024px) {
  .page-filters { flex: 1 1 0; min-width: 240px; }
  .page-tools { flex-wrap: nowrap; margin-left: auto; }
  .page-tools > * { flex-shrink: 0; }
  body.app-ui .page-tools .pager { flex-wrap: nowrap; }
  body.app-ui .page-tools .pager :is(select, .select-trigger) { padding-right: 28px; background-position: right 10px center; }
}

body.app-ui th[data-sort] { padding: 0 12px 10px; }
body.app-ui .th-sort {
  display: inline-flex;
  width: auto;
  min-height: 0;
  padding: 0;
  border-radius: 4px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
body.app-ui .th-sort:hover { background: transparent; color: var(--text); }

body.app-ui .cal-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid var(--dot, var(--border));
  background: color-mix(in srgb, var(--dot, transparent) 35%, transparent);
}
body.app-ui .cal-legend .s-present { --dot: light-dark(#2f6f4f, #4ade80); }
body.app-ui .cal-legend .s-wfh { --dot: light-dark(#5C3315, #D9A86C); }
body.app-ui .cal-legend .s-od { --dot: light-dark(#A0522D, #E3A27A); }
body.app-ui .cal-legend .s-leave { --dot: light-dark(#b8912a, #e9c977); }
body.app-ui .cal-legend .s-absent { --dot: light-dark(#b3261e, #f87171); }
body.app-ui .cal-legend .s-half-day { --dot: light-dark(#2f6f4f, #4ade80); border-style: dashed; background: transparent; }
body.app-ui .cal-legend .s-holiday { --dot: light-dark(#866E5D, #a8a29e); }
body.app-ui .cal-legend .s-nonworking { --dot: light-dark(#DCD2CC, #57534e); background: transparent; }
body.app-ui .cal-cell.is-nonworking :is(.cal-num, .cal-status) { opacity: 1; }
body.app-ui .cal-cell.is-nonworking .cal-status { color: var(--muted); }

body.app-ui ::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); opacity: 1; }
body.app-ui .not-set { font-style: italic; }

@media (min-width: 1024px) {
  body.app-ui #account-view .profile-grid { flex-direction: column; align-items: stretch; gap: 24px; }
  body.app-ui #account-view .profile-grid > .kv { flex: none; width: 100%; }
  body.app-ui #account-view .kv { column-gap: 32px; }
  body.app-ui #account-view .kv dd { min-width: 0; overflow-wrap: break-word; }
  body.app-ui #account-view .fill-row { flex-wrap: nowrap; }
  body.app-ui #account-view .fill-row > button { flex-shrink: 0; }
}

@media (min-width: 1024px) {
  body.app-ui .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.app-ui .doc-thumb { max-height: 200px; }
}
@media (min-width: 1600px) {
  body.app-ui .doc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

body.app-ui .view :is(select, .select-trigger) { background-color: var(--surface); }
body.app-ui .view :is(input, select, textarea):has(+ p.muted.small),
body.app-ui .view .select-trigger:has(+ .select-panel + p.muted.small) { margin-bottom: 6px; }
body.app-ui .view :is(input, select, textarea, .select-panel) + p.muted.small { margin-top: 0; margin-bottom: 18px; }

:root {
  --field-h: 44px;
  --field-h-sm: 36px;
  --field-radius: 10px;
  --field-pad-x: 14px;
  --field-font: 0.875rem;
  --field-border: color-mix(in srgb, var(--tint) 14%, transparent);
  --field-border-hover: color-mix(in srgb, var(--tint) 26%, transparent);
  --field-ring: color-mix(in srgb, var(--accent) 24%, transparent);
  --ta-short: 72px;
  --ta-medium: 120px;
  --ta-large: 208px;
}

body.app-ui :is(input:is([type="text"], [type="email"], [type="password"], [type="tel"], [type="date"], [type="time"], [type="number"], [type="search"], [type="url"]), select, .select-trigger, textarea) {
  box-sizing: border-box;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  background-color: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--field-font);
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body.app-ui :is(input:is([type="text"], [type="email"], [type="password"], [type="tel"], [type="date"], [type="time"], [type="number"], [type="search"], [type="url"]), select, .select-trigger) {
  height: var(--field-h);
  min-height: var(--field-h);
  padding-block: 0;
  line-height: 1.25;
}

body.app-ui input:is([type="text"], [type="email"], [type="password"], [type="tel"], [type="date"], [type="time"], [type="number"], [type="search"], [type="url"]) {
  padding-inline: var(--field-pad-x);
}

body.app-ui :is(select, .select-trigger) {
  padding-inline: var(--field-pad-x) 40px;
  background-position: right 14px center;
}

body.app-ui textarea {
  min-height: var(--ta-medium);
  padding: 12px var(--field-pad-x);
  line-height: 1.5;
  resize: vertical;
}

body.app-ui textarea.ta-short { min-height: var(--ta-short); }
body.app-ui textarea.ta-medium { min-height: var(--ta-medium); }
body.app-ui textarea.ta-large { min-height: var(--ta-large); }

body.app-ui :is(input, select, .select-trigger, textarea):not([type="checkbox"], [type="radio"], [type="file"]):hover:not(:disabled, :focus) {
  border-color: var(--field-border-hover);
}

body.app-ui :is(input, select, .select-trigger, textarea):not([type="checkbox"], [type="radio"], [type="file"]):focus-visible {
  outline: none;
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--field-ring);
  background-color: var(--surface);
}

body.app-ui :is(input, select, .select-trigger, textarea):disabled { opacity: 0.55; cursor: not-allowed; }

body.app-ui :is(.pager, .page-tools) :is(select, .select-trigger),
body.app-ui :is(select, .select-trigger).compact {
  width: auto;
  height: var(--field-h-sm);
  min-height: var(--field-h-sm);
  margin-bottom: 0;
  padding-inline: 12px 32px;
  border-radius: var(--field-radius);
  background-position: right 12px center;
  font-size: 0.8125rem;
  font-weight: 500;
}

body.app-ui button:not(.panel-tab, .nav-item, .rail-item, .nav-unsave, .nav-save-view, .see-more, .signout-desktop, .time-cell, .notif-cta, .notif-retry, .cal-cell, .th-sort, .theme-switch, .chip, .row-menu-item, .popover-item, .icon-btn, .nav-toggle, .nav-close, .row-more, .usermenu-item, .tpl-tab, .select-trigger, .date-nav, .date-title, .date-day, .date-month, .date-action) {
  height: var(--field-h);
  min-height: var(--field-h);
  padding-block: 0;
  padding-inline: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--field-radius);
}

body.app-ui button.inline:not(.row-more) {
  height: var(--field-h-sm);
  min-height: var(--field-h-sm);
  padding-inline: 14px;
  font-size: 0.8125rem;
}

body.app-ui button.row-more,
body.app-ui button.row-preview {
  width: var(--field-h-sm);
  height: var(--field-h-sm);
  min-height: var(--field-h-sm);
  padding: 0;
}

body.app-ui .chip { min-height: var(--field-h-sm); }

body.app-ui button.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--field-h-sm);
  height: var(--field-h-sm);
  min-height: var(--field-h-sm);
  padding: 0;
  border-radius: var(--field-radius);
  font-size: 1.125rem;
  line-height: 1;
}

body.app-ui button.icon-btn:hover { background: var(--surface-2); color: var(--text); }

@media (pointer: coarse) {
  body.app-ui button.inline:not(.row-more),
  body.app-ui :is(button.row-more, button.row-preview, button.icon-btn),
  body.app-ui .chip,
  body.app-ui :is(.pager, .page-tools) :is(select, .select-trigger) { height: 44px; min-height: 44px; }
  body.app-ui :is(button.row-more, button.row-preview, button.icon-btn) { width: 44px; }
  body.app-ui :is(.card-link, label.check) { min-height: 44px; }
}

body.app-ui .chip { font-size: 0.8125rem; border-radius: var(--field-radius); }

body.app-ui button.has-icon[aria-expanded="true"]::before { display: none; }

body.app-ui button.select-trigger {
  width: 100%;
  margin-bottom: 18px;
  justify-content: flex-start;
  gap: 8px;
  padding-block: 0;
  background-repeat: no-repeat;
  background-size: 12px 8px;
}

body.app-ui :is(.pager, .page-tools, .head-actions, .att-who, .toolbar) button.select-trigger { width: auto; margin-bottom: 0; }
body.app-ui .field-row > button.select-trigger { margin-bottom: 0; }
body.app-ui .field-row > button:not(.select-trigger) { align-self: stretch; height: auto; }

body.app-ui .select-panel {
  border-color: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow), 0 2px 6px rgba(18, 5, 2, 0.08);
}

body.app-ui .select-option.is-active { background: var(--surface-2); }
body.app-ui .select-option[aria-selected="true"] { color: var(--accent-ink); background: var(--accent-soft); }
body.app-ui .select-panel:popover-open { animation: select-panel-in 0.14s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes select-panel-in { from { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  body.app-ui .select-panel:popover-open { animation: none; }
}

body.app-ui button.select-trigger,
body.app-ui button.select-trigger:is(:hover, :focus-visible) { background-image: none; }
body.app-ui :is(.pager, .page-tools) button.select-trigger { padding-right: 32px; }
body.app-ui :is(.pager, .page-tools) button.select-trigger::after { right: 12px; }

body.app-ui input:is([type="checkbox"], [type="radio"], [type="range"]) { color: var(--text); }
body.app-ui input[type="checkbox"]:checked::before { background: var(--accent); border-color: var(--accent); }
body.app-ui input[type="checkbox"]::after { border-color: var(--on-accent); }
body.app-ui input[type="radio"]:checked::before { border-color: var(--accent); }
body.app-ui input[type="radio"]::after { background: var(--accent); }
body.app-ui input:is([type="checkbox"], [type="radio"]):focus-visible::before { box-shadow: 0 0 0 3px var(--field-ring); }
body.app-ui input[type="range"]::-webkit-slider-thumb { background: var(--accent); }
body.app-ui input[type="range"]::-moz-range-thumb { background: var(--accent); }

body.app-ui .date-panel { border-radius: 12px; box-shadow: var(--shadow), 0 2px 6px rgba(18, 5, 2, 0.08); }
body.app-ui .date-panel button:hover:not(:disabled, [aria-disabled="true"]) { background: var(--surface-2); }
body.app-ui .date-panel button:focus-visible { outline-color: var(--accent-ink); }
body.app-ui .date-panel .date-day.is-today { color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
body.app-ui .date-panel :is(.date-day[aria-selected="true"], .date-month.is-selected),
body.app-ui .date-panel :is(.date-day[aria-selected="true"], .date-month.is-selected):hover { background: var(--accent); color: var(--on-accent); }
body.app-ui .date-panel .date-action { color: var(--accent-ink); }
body.app-ui button.select-trigger:is(.date-trigger, .time-trigger)[aria-expanded="true"]::after { background: var(--accent); }

body.app-ui .tooltip { border-radius: 8px; }
body.app-ui :is(input, select, textarea, .select-trigger)[aria-invalid="true"]:not([type="checkbox"], [type="radio"]) { border-color: var(--danger); }
body.app-ui :is(input, select, textarea, .select-trigger)[aria-invalid="true"]:not([type="checkbox"], [type="radio"]):focus-visible {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}
body.app-ui #ask-dialog button.danger[type="submit"],
body.app-ui #ask-dialog button.danger[type="submit"]:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--danger) 30%, transparent);
  color: light-dark(#ffffff, #120502);
}
body.app-ui #ask-dialog button.danger[type="submit"]:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 86%, var(--tint)); }
body.app-ui #ask-dialog button.danger[type="submit"]:focus-visible { outline-color: var(--danger); }

.badge.has-icon { display: inline-flex; align-items: center; gap: 4px; }
.badge .pill-icon { width: 12px; height: 12px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chips-gap { width: 1px; align-self: stretch; margin: 2px 4px; background: var(--border); }

.hd-confidential {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 4%, transparent);
  font-size: 0.8125rem;
  color: var(--muted);
}
.hd-confidential.is-chosen { color: var(--text); background: color-mix(in srgb, var(--danger) 9%, transparent); }

.inc-meta { margin-bottom: 14px; }
.inc-follow-row { margin: 4px 0 16px; }
.inc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px 20px; margin: 0 0 18px; }
.inc-facts > div:first-child { grid-column: 1 / -1; }
.inc-facts dt { margin: 0 0 2px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.inc-facts dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.inc-triage { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin-bottom: 14px; }
.inc-moves { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.inc-actions-wrap { margin-bottom: 18px; }
.inc-actions { display: grid; gap: 8px; margin-bottom: 12px; }
.inc-action { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.inc-action-text { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.inc-action-buttons { display: flex; gap: 8px; }
.inc-action-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.inc-tile.is-overdue { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
@media (max-width: 760px) { .inc-action-form { grid-template-columns: minmax(0, 1fr); } }

dialog.wide.hd-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.hd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 16px; }
.hd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hd-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hd-status { display: inline-flex; align-items: center; gap: 8px; }
.hd-status label { margin: 0; white-space: nowrap; }
.hd-status .select-trigger { min-width: 160px; }
.hd-thread { display: flex; flex-direction: column; gap: 10px; max-height: min(46dvh, 420px); overflow-y: auto; margin-bottom: 16px; padding-right: 4px; }
.hd-subject { margin: 0 0 2px; }
.hd-entry { max-width: 88%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.hd-entry.is-other { align-self: flex-start; background: color-mix(in srgb, var(--tint) 3%, transparent); }
.hd-entry.is-own { align-self: flex-end; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hd-entry.is-internal { border-style: dashed; background: rgba(233, 201, 119, 0.12); }
.hd-entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 0.8125rem; }
.hd-entry-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.875rem; }
#hd-reply-form .check { margin: 8px 0 4px; }

dialog.wide.pub-dialog {
  display: none;
  width: min(1040px, calc(100vw - 32px));
  height: min(940px, calc(100dvh - 32px));
  max-height: none;
}
dialog.wide.pub-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 16px; }
.pub-dialog .modal-head { align-items: flex-start; }
.pub-dialog .modal-head h2 { margin: 0; }
.pub-dialog .modal-head p.muted { margin: 4px 0 0; }
.pub-dialog .modal-actions { flex-wrap: wrap; margin-top: 0; }
.pub-dialog .modal-actions button { white-space: nowrap; }
.pub-frame-wrap { min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #ffffff; }
.pub-frame-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

tr.is-unread td:first-child strong { color: var(--accent-ink); }

body.app-ui :is(.view, .page-card) > form:not([hidden]):has(~ :not([hidden])) { margin-bottom: 28px; }

.ann-cards { display: flex; flex-wrap: wrap; gap: 16px; }
body.app-ui .ann-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; flex: 1 1 340px; min-width: min(100%, 340px);
  padding: 20px 22px 20px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(18, 5, 2, 0.05), 0 4px 14px rgba(18, 5, 2, 0.05); overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
body.app-ui .ann-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: color-mix(in srgb, var(--ink) 16%, transparent); }
body.app-ui .ann-card.is-pinned {
  flex-basis: 100%; border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 65%);
}
body.app-ui .ann-card.is-pinned::before { background: var(--accent); }
@media (hover: hover) {
  body.app-ui .ann-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
}
.ann-card-top { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.ann-card-titles { min-width: 0; flex: 1; }
.ann-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.ann-card.is-pinned .ann-icon { background: var(--accent); color: var(--on-accent); }
.ann-icon-svg, .ann-meta-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ann-icon-svg { width: 20px; height: 20px; }
body.app-ui .ann-card h3 { margin: 0; font-size: 1.0625rem; line-height: 1.35; overflow-wrap: anywhere; }
.ann-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--muted); font-size: 0.8125rem; }
.ann-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.ann-meta-icon { flex: none; width: 14px; height: 14px; }
.ann-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ink-soft); }
.ann-foot { display: flex; align-items: center; gap: 6px; margin: auto 0 0; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 0.8125rem; }
body.app-ui .ann-card[data-ann-open] { cursor: pointer; }
body.app-ui .ann-card[data-ann-open]:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
body.app-ui button.ann-open { padding: 0 !important; min-height: 0 !important; height: auto !important; border: 0 !important; background: none !important; box-shadow: none !important; color: var(--text) !important; text-align: left; text-transform: none !important; cursor: pointer; }
body.app-ui button.ann-open:hover strong { text-decoration: underline; text-underline-offset: 3px; }
dialog.ann-view { width: min(640px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
dialog.ann-view[open] { display: flex; flex-direction: column; max-height: min(86dvh, 760px); }
#ann-view-content { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.ann-view-close { position: absolute; top: 14px; right: 14px; z-index: 1; }
.ann-view-hero { display: flex; align-items: flex-start; gap: 16px; padding: 28px 64px 22px 28px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--surface-2), var(--surface) 70%); }
.ann-view-hero.is-pinned { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.ann-view-hero .ann-icon { width: 48px; height: 48px; border-radius: 14px; }
.ann-view-hero.is-pinned .ann-icon { background: var(--accent); color: var(--on-accent); }
.ann-view-heading { min-width: 0; }
.ann-view-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.ann-view-pills { display: inline-flex; gap: 6px; letter-spacing: 0; text-transform: none; }
.ann-view-title { margin: 0; font-size: 1.375rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; }
.ann-view-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; padding: 16px 28px; border-bottom: 1px dashed var(--border); }
.ann-view-facts div { display: grid; gap: 2px; }
.ann-view-facts dt { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.ann-view-facts dd { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.ann-view-body { padding: 20px 28px 8px; font-size: 0.9375rem; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
dialog.ann-view .modal-actions { flex: none; margin: 0; padding: 14px 28px 20px; }
@media (max-width: 480px) {
  .ann-view-hero { padding: 22px 56px 18px 18px; gap: 12px; }
  .ann-view-hero .ann-icon { width: 40px; height: 40px; }
  .ann-view-title { font-size: 1.1875rem; }
  .ann-view-facts, .ann-view-body, dialog.ann-view .modal-actions { padding-inline: 18px; }
}
@media (max-width: 480px) {
  body.app-ui .ann-card { padding: 16px 16px 16px 20px; }
  .ann-icon { width: 36px; height: 36px; border-radius: 10px; }
}
.ann-snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 52ch; white-space: normal; }
body.app-ui label.check.ann-pin { margin-top: 8px; }

.emp-emergency { margin: 4px 0 16px; }
#emergency-form > button[type="submit"] { margin-top: 16px; }

.tpl-publish { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; }
.tpl-publish.is-issue .select-trigger { min-width: 220px; }
.tpl-recipient { display: inline-flex; align-items: center; }

@media (pointer: coarse) {
  body.app-ui :is(.tpl-publish, .hd-status) .select-trigger { height: 44px; min-height: 44px; }
}
.tpl-recipient[hidden] { display: none; }
.tpl-actions { flex-wrap: wrap; align-items: center; justify-content: flex-end; }

@media (max-width: 1280px) {
  body.app-ui :is([data-view="helpdesk"], [data-view="announcements"], [data-view="policies"], [data-view="letters"], [data-view="published"]) .panel table :is(th, td):first-child:not([colspan]) {
    width: 1%;
    min-width: 150px;
    white-space: normal;
  }
}

@media (max-width: 640px), (max-height: 600px) {
  .hd-thread { max-height: none; overflow: visible; padding-right: 0; }
}

@media (max-height: 500px) {
  dialog.wide.pub-dialog { height: calc(100dvh - 12px); padding: 12px 16px; }
  dialog.wide.pub-dialog[open] { gap: 8px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .pub-dialog .modal-head { grid-column: 1; }
  .pub-dialog .modal-actions { grid-column: 2; grid-row: 1; align-self: center; flex-wrap: nowrap; }
  .pub-dialog .pub-frame-wrap { grid-column: 1 / -1; }
  .pub-dialog .modal-head h2 { font-size: 1.0625rem; }
}

@media (max-width: 640px) {
  .hd-entry { max-width: 100%; }
  .hd-bar { align-items: flex-start; }
  .tpl-publish { width: 100%; margin-right: 0; }
  .tpl-publish.is-issue .select-trigger { min-width: 0; flex: 1; }
}

body.app-ui button.row-more { justify-content: center; align-items: center; }
body.app-ui .row-menu-item > .ui-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
body.app-ui .row-menu-item.danger > .ui-icon { color: currentColor; }
.logo-field { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.logo-preview { display: grid; place-items: center; flex-shrink: 0; width: 72px; height: 72px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-body { display: grid; gap: 6px; min-width: 0; }
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-bell { position: relative; display: inline-flex; }
.notif-trigger { position: relative; display: grid; place-items: center; width: 40px; height: 40px; min-height: 0 !important; padding: 0 !important; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.notif-trigger:hover { background: var(--surface-2); color: var(--text); }
.notif-trigger, .notif-trigger:hover { text-decoration: none; }
.notif-trigger:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: var(--text-on-ink); font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center; }
.notif-badge[hidden] { display: none; }
body.app-ui button.panel-tab { text-transform: capitalize; }
body.app-ui :is(button.select-trigger, button.cal-cell, .date-panel button) { text-transform: none; }

.console-org { display: flex; flex-direction: column; gap: 2px; }
.console-org .panel-tab .tab-count { margin-left: auto; }
.console-org-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 4px 0 4px; padding: 4px 8px; font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.console-org-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-mark { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 0.625rem; overflow: hidden; }
.org-mark.has-logo { background: #ffffff; border: 1px solid var(--border); }
.org-mark img { width: 100%; height: 100%; object-fit: contain; }
.console-org #panel-tabs .nav-item { padding-left: 10px; }
.org-id-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 0.75rem; white-space: nowrap; }
.org-id-label { color: var(--muted); }
.org-id-chip code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
body.app-ui button.org-id-copy { display: inline-grid; place-items: center; width: 26px; height: 26px; min-height: 0 !important; padding: 0 !important; border: 0; border-radius: 999px; background: transparent; color: var(--muted); box-shadow: none; cursor: pointer; }
body.app-ui button.org-id-copy:hover { background: var(--surface-2); color: var(--text); transform: none; }
body.app-ui button.org-id-copy:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.org-id-copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:where(body.app-ui) :where(#home-greeting, #myday-greeting, .badge, .chip, .tab-count, .notif-title, .notif-head strong, .popover-panel :is(h2, h3, h4), dialog :is(h1, h2, h3), .ui-card :is(h2, h3, h4), .panel :is(h2, h3, h4), .card-head h3, .ann-card h3, .form-section-title, .kpi-label, .detail-title, .empty-title) { text-transform: capitalize; }



.notif-page { margin-top: 12px; container-type: inline-size; }
.notif-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.notif-summary { margin: 0; font-size: 0.875rem; color: var(--muted); }
.notif-actions { display: flex; align-items: center; gap: 8px; }
.notif-filter-btn { gap: 8px; }
.notif-filter-icon, .notif-chip-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notif-filter-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.6875rem; font-weight: 700; line-height: 20px; text-align: center; }
.notif-filter-count.is-active { background: var(--accent); color: var(--on-accent); }
.popover-panel.notif-filter-panel { inset: auto; margin: 0; width: min(320px, calc(100vw - 16px)); padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.notif-filter-panel .select-trigger { width: 100%; margin-bottom: 14px; }
.notif-filter-panel .notif-filter-label { display: block; }
.notif-filter-label { margin: 0 0 8px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.notif-filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.notif-chip { display: inline-flex; align-items: center; gap: 6px; }
.notif-chip-count:not(:empty) { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #ffffff; font-size: 0.6875rem; line-height: 18px; text-align: center; }
.notif-filter-actions { display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--border); }
.notif-feed { display: flex; flex-direction: column; gap: 12px; }
.notif-day { display: flex; align-items: center; gap: 14px; margin: 14px 0 2px; color: var(--muted); font-size: 0.8125rem; }
.notif-day::before, .notif-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.notif-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; column-gap: 18px; padding: 16px 20px 16px 36px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); box-shadow: 0 1px 2px rgba(18, 5, 2, 0.05), 0 4px 14px rgba(18, 5, 2, 0.05); transition: box-shadow 0.18s ease, border-color 0.18s ease; }
.notif-card:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.notif-card.is-unread { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.notif-card.is-unread::before { content: ""; position: absolute; left: 15px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 999px; background: var(--accent-ink); animation: notif-dot-pulse 0.9s ease-out infinite; }
.notif-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 3px rgba(18, 5, 2, 0.08); }
.notif-card[data-category] .notif-card-icon { color: var(--cat, var(--muted)); }
.notif-card[data-category="announcements"] { --cat: #B07A3A; }
.notif-card[data-category="attendance"] { --cat: #9C7A3C; }
.notif-card[data-category="leave"] { --cat: #d97706; }
.notif-card[data-category="documents"] { --cat: #7E6318; }
.notif-card[data-category="helpdesk"] { --cat: light-dark(#5C3315, #D9A86C); }
.notif-card[data-category="incidents"] { --cat: var(--danger); }
.notif-card[data-category="lifecycle"] { --cat: #A0522D; }
.notif-icon-svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-card-main { min-width: 0; display: grid; gap: 4px; }
.notif-kind { display: flex; }
.notif-kind .badge { font-size: 0.6875rem; }
.notif-title { margin: 0; font-size: 0.9375rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.notif-body { margin: 0; font-size: 0.8125rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }
body.app-ui button.notif-cta { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px; border: 0; background: none; box-shadow: none; color: var(--accent-ink); font-size: 0.9375rem; font-weight: 700; white-space: nowrap; cursor: pointer; transform: none; }
body.app-ui button.notif-cta:hover { background: none; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; }
body.app-ui button.notif-cta:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
.notif-cta-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease; }
.notif-cta:hover .notif-cta-arrow { transform: translateX(3px); }
.notif-empty { margin: 0; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 0.875rem; border: 1px dashed var(--border); border-radius: var(--radius); }
body.app-ui button.notif-retry { min-height: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent-ink); font-weight: 600; text-decoration: underline; cursor: pointer; }
.notif-foot { display: flex; justify-content: center; margin-top: 18px; }
.notif-foot .notif-end { flex: 1; margin: 0; }
.notif-more { min-width: 160px; }
.notif-card:not(.is-unread) { background: var(--surface-2); border-color: var(--border); box-shadow: none; }
.notif-card:not(.is-unread):hover { box-shadow: none; border-color: color-mix(in srgb, var(--tint) 18%, var(--border)); }
.notif-card:not(.is-unread) .notif-card-icon { color: var(--muted); background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: none; }
.notif-card:not(.is-unread) .notif-kind .badge { opacity: 0.6; }
.notif-card:not(.is-unread) .notif-title { font-weight: 500; color: var(--ink-soft); }
.notif-card:not(.is-unread) .notif-body { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.notif-card.is-unread { box-shadow: 0 2px 4px rgba(18, 5, 2, 0.06), 0 8px 22px rgba(18, 5, 2, 0.08); }
.notif-card.is-unread:hover { box-shadow: var(--shadow); }
.notif-card.is-unread .notif-title { font-weight: 700; }
@container (min-width: 760px) {
  body.app-ui button.notif-cta { min-width: 200px; justify-content: flex-end; }
  .notif-time { min-width: 150px; text-align: right; }
}
@container (max-width: 759px) {
  .notif-card { grid-template-columns: auto minmax(0, 1fr); row-gap: 10px; column-gap: 14px; padding: 14px 16px 14px 32px; }
  .notif-card.is-unread::before { left: 13px; top: 35px; margin-top: -3px; }
  .notif-card-icon { width: 42px; height: 42px; align-self: start; }
  .notif-icon-svg { width: 20px; height: 20px; }
  .notif-time { grid-column: 2; }
  body.app-ui button.notif-cta { grid-column: 2; justify-self: start; min-height: 44px; padding: 0; }
}

.signout-desktop { display: none; }
@media (min-width: 1024px) {
  body.app-ui button.signout-desktop { display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; color: var(--danger); cursor: pointer; transition: color 0.15s ease, background-color 0.15s ease; }
  body.app-ui button.signout-desktop .usermenu-icon { width: 26px; height: 26px; }
  body.app-ui button.signout-desktop:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
  body.app-ui button.signout-desktop:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
  body.app-ui #signout { display: none; }
}

.notif-gone { display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 200px; font-size: 0.8125rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.notif-gone::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--muted); opacity: 0.6; }
.notif-gone-note, .notif-info { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 0.8125rem; color: var(--muted); }
.notif-gone-note { color: var(--danger); }
.notif-info-icon { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.app-ui button.notif-cta.notif-cta-quiet { min-width: 0; min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.8125rem; font-weight: 600; color: var(--text); }
body.app-ui button.notif-cta.notif-cta-quiet:hover { text-decoration: none; background: var(--surface-2); }
@media (max-width: 640px) { .notif-gone { grid-column: 2; justify-content: flex-start; min-width: 0; } }

.notif-card.is-unread::after { content: ""; position: absolute; left: 15px; top: 50%; width: 6px; height: 6px; margin-top: -3px; box-sizing: border-box; border: 1px solid var(--accent-ink); border-radius: 999px; opacity: 0; pointer-events: none; animation: notif-dot-ping 0.9s ease-out infinite; }
@keyframes notif-dot-pulse {
  0%, 65%, 100% { transform: scale(1); }
  25%, 40% { transform: scale(1.66); }
}
@keyframes notif-dot-ping {
  0%, 40% { transform: scale(1); opacity: 0; }
  55% { opacity: 0.5; }
  85%, 100% { transform: scale(3.9); opacity: 0; }
}
@media (max-width: 640px) {
  .notif-card.is-unread::after { left: 13px; top: 35px; }
}
@media (prefers-reduced-motion: reduce) {
  .notif-card.is-unread::before, .notif-card.is-unread::after { animation: none; }
  .notif-card.is-unread::after { opacity: 0; }
}

.time-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.time-col { min-width: 0; }
.time-col-label { margin: 0 0 6px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; color: var(--muted); }
.time-col-list { display: flex; flex-direction: column; gap: 2px; max-height: 216px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 10px; }
body.app-ui button.time-cell { flex: none; display: grid; place-items: center; width: 100%; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text); font-size: 0.875rem; font-variant-numeric: tabular-nums; cursor: pointer; transform: none; }
body.app-ui button.time-cell:hover { background: var(--surface-2); color: var(--text); }
body.app-ui button.time-cell.is-selected { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
body.app-ui button.time-cell:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.time-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
@media (pointer: coarse) {
  body.app-ui button.time-cell { min-height: 44px; }
}

dialog.form-modal { width: min(720px, calc(100vw - 24px)); }
dialog.form-modal > form { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }

.cal-cell.is-leave-awaiting { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0 6px, var(--surface) 6px 12px); border-style: dashed; border-color: var(--accent-deep); }

.lv-why { display: block; margin-top: 4px; max-width: 32ch; white-space: normal; overflow-wrap: anywhere; }

.see-more-row { list-style: none; display: flex; justify-content: center; padding-top: 10px; }
body.app-ui button.see-more { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); box-shadow: none; color: var(--accent-ink); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s ease; }
body.app-ui button.see-more:hover { background: var(--surface-2); color: var(--accent-ink); }
body.app-ui button.see-more:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

.live-clock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.live-clock-time { font-variant-numeric: tabular-nums; }
body.app-ui .badge.live-clock-zone { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); font-weight: 700; text-transform: none; }
body.app-ui .crumb strong { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid light-dark(transparent, rgba(243, 237, 230, 0.22)); background: #120502; color: #ffffff; font-weight: 700; }

body.app-ui::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 1px; background: color-mix(in srgb, var(--tint) 20%, transparent); z-index: 60; pointer-events: none; }

@media (min-width: 641px) {
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
}
@media (min-width: 641px) and (max-width: 1279px) {
  .kpi { padding: 16px; gap: 10px; min-height: 136px; }
  .kpi-label { line-height: 1.25; }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .sidebar { width: min(360px, 85vw); border-right: 1px solid var(--border); box-shadow: var(--shadow); }
}

:where(body.app-ui) :where(button, a.button, .file-btn):not(.cal-cell, .ann-open, .notif-card, .select-option) { white-space: nowrap; }
body.app-ui .modal-actions, body.app-ui .head-actions, body.app-ui .row-actions, body.app-ui .form-actions { flex-wrap: wrap; }

body.app-ui #att-form .modal-actions:has(> :is(#att-approve, #att-reject, #att-reopen):not([hidden])) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.app-ui #att-form .modal-actions:has(> :is(#att-approve, #att-reject, #att-reopen):not([hidden])) > button { width: 100%; margin: 0; justify-content: center; }
body.app-ui #att-form .modal-actions > #att-reject { order: 1; }
body.app-ui #att-form .modal-actions > #att-approve { order: 2; }
body.app-ui #att-form .modal-actions > #att-reopen { order: 2; grid-column: 1 / -1; }
body.app-ui #att-form .modal-actions > #att-cancel { order: 3; }
body.app-ui #att-form .modal-actions > #att-submit { order: 4; }
body.app-ui #att-form .modal-actions > #att-approved-note { order: 5; grid-column: 1 / -1; margin: 0; }

.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.rec-grid > :is(.empty-state, .table-empty) { grid-column: 1 / -1; }
.rec-grid { perspective: 1200px; }
.rec-tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 18px 18px 14px; border: 1px solid light-dark(rgba(18, 5, 2, 0.08), rgba(245, 245, 244, 0.1)); border-radius: 16px; background: linear-gradient(180deg, light-dark(#ffffff, #241510) 0%, light-dark(#fbfaf9, #1b0f0b) 100%); box-shadow: inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.06)), 0 1px 1px light-dark(rgba(18, 5, 2, 0.04), rgba(18, 5, 2, 0.3)), 0 2px 4px light-dark(rgba(18, 5, 2, 0.04), rgba(18, 5, 2, 0.3)), 0 6px 12px light-dark(rgba(18, 5, 2, 0.05), rgba(18, 5, 2, 0.35)), 0 14px 28px -6px light-dark(rgba(18, 5, 2, 0.08), rgba(18, 5, 2, 0.45)); transform-origin: 50% 100%; transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease; will-change: transform; }
.rec-tile:is(:hover, :focus-within) { border-color: light-dark(rgba(18, 5, 2, 0.14), rgba(245, 245, 244, 0.18)); transform: translateY(-6px) rotateX(2deg); box-shadow: inset 0 1px 0 light-dark(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.08)), 0 2px 4px light-dark(rgba(18, 5, 2, 0.04), rgba(18, 5, 2, 0.35)), 0 8px 16px light-dark(rgba(18, 5, 2, 0.06), rgba(18, 5, 2, 0.4)), 0 24px 40px -8px light-dark(rgba(18, 5, 2, 0.16), rgba(18, 5, 2, 0.6)), 0 40px 64px -24px light-dark(rgba(126, 99, 24, 0.22), rgba(18, 5, 2, 0.55)); }
@media (prefers-reduced-motion: reduce) {
  .rec-tile { transition: box-shadow 150ms ease, border-color 150ms ease; }
  .rec-tile:is(:hover, :focus-within) { transform: none; }
}
.rec-tile.is-late { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.rec-tile.is-closed { background: linear-gradient(180deg, light-dark(#faf9f8, #1f120e) 0%, light-dark(#f4f2f0, #180d0a) 100%); }
.rec-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rec-tile-value { font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-tile-name { min-width: 0; }
.rec-tile-title { margin: 0 0 2px; font-size: 1rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-tile-name p { margin: 0; overflow-wrap: anywhere; }
.rec-tile-contact { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--tint) 3%, transparent); box-shadow: inset 0 1px 2px light-dark(rgba(18, 5, 2, 0.05), rgba(18, 5, 2, 0.35)); }
.rec-tile-contact.is-empty { min-height: 56px; }
.rec-tile-initials { flex-shrink: 0; width: 36px; height: 36px; font-size: 0.8125rem; }
.rec-tile-person { display: grid; min-width: 0; }
.rec-tile-person strong { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-tile-person .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-tile-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.rec-tile-meta dt { margin: 0 0 2px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rec-tile-meta dd { margin: 0; font-size: 0.875rem; }
.rec-tile-meta .is-overdue { color: var(--danger); font-weight: 600; }
body.app-ui .rec-tile-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
body.app-ui .rec-tile-foot > .rec-tile-view { flex: 1 1 auto; }
.rec-tile[class*="stage-"], .rec-tile[class*="stage-"]:is(:hover, :focus-within) { border-color: color-mix(in srgb, var(--stage) 40%, var(--border)); }
body.app-ui #lead-modal[class*="stage-"] { border-color: color-mix(in srgb, var(--stage) 40%, var(--border)); }
:is(.rec-tile, #detail-modal).tone-ok { --stage: var(--ok); }
:is(.rec-tile, #detail-modal).tone-off { --stage: color-mix(in srgb, var(--tint) 45%, transparent); }
.rec-tile[class*="tone-"], .rec-tile[class*="tone-"]:is(:hover, :focus-within) { border-color: color-mix(in srgb, var(--stage) 40%, var(--border)); }
body.app-ui #detail-modal[class*="tone-"] { border-color: color-mix(in srgb, var(--stage) 40%, var(--border)); }
#detail-modal .info-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
:is(.badge, .rec-tile).stage-deal-discovery { --stage: #866E5D; }
:is(.badge, .rec-tile).stage-deal-qualified { --stage: #7E6318; }
:is(.badge, .rec-tile).stage-deal-proposal { --stage: #B07A3A; }
:is(.badge, .rec-tile).stage-deal-negotiation { --stage: #d97706; }
:is(.badge, .rec-tile).stage-deal-won { --stage: #059669; }
:is(.badge, .rec-tile).stage-deal-lost { --stage: #C81912; }
.deal-odds { display: grid; gap: 6px; }
.deal-odds-head { display: flex; justify-content: space-between; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.deal-odds-head strong { font-size: 0.875rem; letter-spacing: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.deal-odds-track { height: 8px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--tint) 7%, transparent); }
.deal-odds-fill { display: block; height: 100%; border-radius: inherit; background: var(--stage, var(--accent)); }
:is(.badge).stage-act-ok { --stage: #059669; }
:is(.badge).stage-act-info { --stage: #5C3315; }
:is(.badge).stage-act-warn { --stage: #d97706; }
:is(.badge).stage-act-danger { --stage: #C81912; }
:is(.badge).stage-act-violet { --stage: #7E6318; }
:is(.badge).stage-act-neutral { --stage: #866E5D; }
.act-feed { position: relative; margin: 8px 0 0; padding: 0; list-style: none; }
.act-day { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.act-day:first-child { margin-top: 4px; }
.act-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.act-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 0 0 18px; }
.act-item::before { content: ""; position: absolute; left: 19.5px; top: 44px; bottom: 4px; width: 1px; background: var(--border); }
.act-item:has(+ .act-day)::before, .act-item:last-child::before { display: none; }
.act-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--act) 13%, transparent); color: var(--act); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--act) 22%, transparent); }
.act-glyph { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act-body { min-width: 0; padding: 12px 16px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px light-dark(rgba(18, 5, 2, 0.04), rgba(18, 5, 2, 0.3)); transition: box-shadow 150ms ease, border-color 150ms ease; }
.act-item:hover .act-body { border-color: color-mix(in srgb, var(--act) 35%, var(--border)); box-shadow: 0 6px 18px -8px light-dark(rgba(18, 5, 2, 0.16), rgba(18, 5, 2, 0.6)); }
.act-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.act-target { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; font-weight: 600; color: var(--act); text-decoration: none; }
a.act-target:hover { text-decoration: underline; }
.act-target.is-gone { color: var(--muted); font-weight: 500; text-decoration: line-through; }
.act-time { margin-left: auto; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-title { margin: 8px 0 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.act-details { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 0.8125rem; color: var(--muted); }
.act-details li { overflow-wrap: anywhere; }
.act-by { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 0.75rem; color: var(--muted); }
.act-avatar { width: 22px; height: 22px; border-radius: 7px; font-size: 0.625rem; }
@media (max-width: 640px) {
  .act-item { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .act-icon { width: 32px; height: 32px; border-radius: 10px; }
  .act-glyph { width: 16px; height: 16px; }
  .act-item::before { left: 15.5px; top: 36px; }
  .act-time { margin-left: 0; width: 100%; }
}
body.app-ui a.record-link.act-target { color: var(--act); text-decoration-color: color-mix(in srgb, var(--act) 40%, transparent); }
:is(.badge, .rec-tile).stage-tkt-open { --stage: #5C3315; }
:is(.badge, .rec-tile).stage-tkt-in_progress { --stage: #d97706; }
:is(.badge, .rec-tile).stage-tkt-resolved { --stage: #059669; }
:is(.badge, .rec-tile).stage-tkt-closed { --stage: #866E5D; }
.badge.stage-tkt-p-low { --stage: #866E5D; }
.badge.stage-tkt-p-normal { --stage: #5C3315; }
.badge.stage-tkt-p-high { --stage: #d97706; }
.badge.stage-tkt-p-urgent { --stage: #C81912; }
.tkt-number { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); font-variant-numeric: tabular-nums; }
.tkt-lock { width: 16px; height: 16px; margin-right: 2px; vertical-align: -2px; fill: none; stroke: #C81912; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tkt-preview { margin: 6px 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tkt-preview.is-hidden { font-style: italic; }
.tkt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tkt-priority { display: inline-flex; align-items: center; gap: 6px; }
.tkt-pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #C81912; }
.tkt-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #C81912; animation: tkt-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes tkt-ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
.rec-tile.tkt.is-urgent { box-shadow: 0 0 0 1px color-mix(in srgb, #C81912 30%, transparent), 0 10px 28px -12px color-mix(in srgb, #C81912 45%, transparent); }
@media (prefers-reduced-motion: reduce) { .tkt-pulse::after { animation: none; } }
.chip .chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; background: color-mix(in srgb, var(--tint) 8%, transparent); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-count { background: var(--accent-ink); color: #fff; }
body.app-ui .page-filters button.select-trigger.chip-select { width: auto; min-width: 150px; height: 36px; min-height: 36px; margin: 0; border-radius: 999px; padding-inline: 14px 34px; font-size: 0.8125rem; font-weight: 600; }
body.app-ui .page-filters button.select-trigger.chip-select.is-set { background-color: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); }
.profile-hero { position: relative; overflow: hidden; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 1px 2px light-dark(rgba(18, 5, 2, 0.04), rgba(18, 5, 2, 0.3)), 0 12px 32px -18px light-dark(rgba(18, 5, 2, 0.25), rgba(18, 5, 2, 0.7)); }
.profile-cover { height: 112px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 55%, transparent) 0%, transparent 55%), radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, #7E6318 30%, transparent) 0%, transparent 60%), linear-gradient(135deg, #120502 0%, #3a2414 100%); }
.profile-hero-main { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 340px); gap: 18px 24px; align-items: start; padding: 0 24px 22px; }
.profile-avatar-wrap { position: relative; margin-top: -56px; }
.avatar.avatar-xl { display: block; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; border: 4px solid var(--surface); box-shadow: 0 8px 24px -10px rgba(18, 5, 2, 0.45); background: var(--surface); }
.avatar.avatar-xl .avatar-img { width: 100%; height: 100%; object-fit: cover; transition: transform 200ms ease; }
.profile-avatar-wrap:hover .avatar-img { transform: scale(1.05); }
.avatar-cam { position: absolute; right: 2px; bottom: 6px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #120502; border: 3px solid var(--surface); cursor: pointer; box-shadow: 0 4px 10px -4px rgba(18, 5, 2, 0.5); transition: transform 150ms ease; }
.avatar-cam:hover { transform: scale(1.08); }
.avatar-cam svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.profile-id { min-width: 0; padding-top: 14px; }
.profile-name { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.profile-sub { margin: 4px 0 0; font-size: 0.9375rem; color: var(--muted); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
body.app-ui .profile-tag { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--tint) 3%, transparent); font: inherit; font-size: 0.8125rem; font-weight: 500; color: var(--text); white-space: nowrap; }
body.app-ui .profile-tag.is-role { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); font-weight: 600; }
body.app-ui button.profile-tag.is-copy { cursor: pointer; }
body.app-ui button.profile-tag.is-copy:hover { border-color: var(--accent); }
.profile-tag-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.profile-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.profile-meter { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.meter-ring { position: relative; flex-shrink: 0; width: 72px; height: 72px; }
.meter-ring svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.meter-track { fill: none; stroke: color-mix(in srgb, var(--tint) 10%, transparent); stroke-width: 7; }
.meter-fill { fill: none; stroke: var(--accent-ink); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 213.63; stroke-dashoffset: 213.63; transition: stroke-dashoffset 700ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.meter-ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; font-variant-numeric: tabular-nums; }
.meter-text { min-width: 0; }
.meter-title { margin: 2px 0 8px; font-size: 0.875rem; font-weight: 700; }
.meter-steps { display: flex; flex-wrap: wrap; gap: 6px; }
body.app-ui button.meter-step { display: inline-flex; align-items: center; gap: 4px; height: 28px; min-height: 0; padding: 0 10px; border: 1px dashed color-mix(in srgb, var(--accent-ink) 50%, transparent); border-radius: 999px; background: var(--surface); color: var(--accent-ink); font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
body.app-ui button.meter-step:hover { background: var(--accent-soft); transform: translateY(-1px); }
.meter-step-icon { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.meter-done { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--ok); font-weight: 600; }
.profile-cards { margin-bottom: 12px; }
.profile-cards .kv-row:has(> dd[hidden]) { display: none; }
.profile-cards .kv-row dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
body.app-ui button.copy-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; min-height: 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
body.app-ui button.copy-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.copy-btn-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1100px) {
  .profile-hero-main { grid-template-columns: auto minmax(0, 1fr); }
  .profile-meter { grid-column: 1 / -1; margin-top: 0; }
}
@media (max-width: 640px) {
  .profile-cover { height: 88px; }
  .profile-hero-main { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 0 16px 18px; }
  .profile-avatar-wrap { margin-top: -52px; }
  .profile-id { padding-top: 0; }
  .profile-tags, .profile-hero-actions { justify-content: center; }
  .profile-meter { text-align: left; width: 100%; box-sizing: border-box; }
}
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }
body.app-ui .profile-tag.is-copy, body.app-ui .copy-btn { text-transform: none; }
@media (min-width: 900px) {
  .info-cards.profile-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .profile-cards > .info-card:first-child { grid-row: span 2; }
}
body.app-ui button.profile-tag { min-height: 0; height: 30px; }
