:root {
  /* HelloNext brand */
  --hn-yellow: #f6c344;
  --hn-green: #5cc989;
  --hn-blue: #3f8ddd;
  --hn-pink: #e53274;

  /* Light — canvas ~8–10% preto (antes #cdcbcb ~20%, ficava pesado) */
  --pc-bg: #e8e7e7;
  --pc-surface: #ffffff;
  --pc-surface-raised: #ffffff;
  --pc-surface-inset: #f2f1f1;
  --pc-border: rgba(31, 34, 44, .12);
  --pc-border-strong: rgba(31, 34, 44, .2);
  --pc-accent: var(--hn-blue);
  --pc-accent-strong: #2f7bc9;
  --pc-accent-muted: rgba(63, 141, 221, .14);
  --pc-accent-text: #1f5f9e;
  --pc-text: #1f222c;
  --pc-text-muted: #5a6070;
  --pc-sidebar: #ffffff;
  --pc-sidebar-raised: #ffffff;
  --pc-sidebar-text: #1f222c;
  --pc-sidebar-text-muted: #5a6070;
  --pc-success-bg: rgba(92, 201, 137, .16);
  --pc-success-text: #1f7a4d;
  --pc-warning-bg: rgba(246, 195, 68, .2);
  --pc-warning-text: #9a6f00;
  --pc-info-bg: rgba(63, 141, 221, .14);
  --pc-info-text: #1f5f9e;
  --pc-danger-bg: rgba(229, 50, 116, .12);
  --pc-danger-text: #b01d57;
  --pc-shadow: 0 1px 2px rgba(31, 34, 44, .06), 0 8px 24px rgba(31, 34, 44, .08);
  --pc-shadow-lg: 0 24px 60px rgba(31, 34, 44, .16);

  font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  color: var(--pc-text);
  background: var(--pc-bg);
  color-scheme: light;
}

/* Evita anel de foco em títulos/layout (ex.: FocusOnNavigate antigo) */
h1:focus, h2:focus, h3:focus,
[tabindex="-1"]:focus {
  outline: none !important;
  box-shadow: none !important;
}

html.dark {
  --pc-bg: #1f222c;
  --pc-surface: #282d3d;
  --pc-surface-raised: #2e3448;
  --pc-surface-inset: #1f222c;
  --pc-border: rgba(255, 255, 255, .08);
  --pc-border-strong: rgba(255, 255, 255, .14);
  --pc-accent: var(--hn-blue);
  --pc-accent-strong: #5fa0e6;
  --pc-accent-muted: rgba(63, 141, 221, .2);
  --pc-accent-text: #3f8ddd;
  --pc-text: #f2f3f7;
  --pc-text-muted: #a7adbc;
  --pc-sidebar: #282d3d;
  --pc-sidebar-raised: #2e3448;
  --pc-sidebar-text: #f2f3f7;
  --pc-sidebar-text-muted: #a7adbc;
  --pc-success-bg: rgba(92, 201, 137, .16);
  --pc-success-text: #5cc989;
  --pc-warning-bg: rgba(246, 195, 68, .16);
  --pc-warning-text: #f6c344;
  --pc-info-bg: rgba(63, 141, 221, .16);
  --pc-info-text: #3f8ddd;
  --pc-danger-bg: rgba(229, 50, 116, .16);
  --pc-danger-text: #e53274;
  --pc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
  --pc-shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-width: 320px;
  background: var(--pc-bg);
  color: var(--pc-text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, p { margin-top: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--pc-accent-muted); }

/* shell */
.app-shell { display: flex; min-height: 100vh; background: var(--pc-bg); }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 20px 28px;
  background: var(--pc-surface);
  border-bottom: 1px solid var(--pc-border);
}
.page-header h1 { margin-bottom: 4px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; color: var(--pc-text); }
.page-header p { margin: 0; font-size: 13px; color: var(--pc-text-muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.page-content { flex: 1; padding: 22px 28px 40px; }

.brand { display: flex; align-items: center; gap: 11px; padding: 6px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--pc-accent);
  color: #1f222c;
  font-size: 15px;
  font-weight: 800;
}
.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}
.brand-logo--header {
  width: 118px;
  flex: 0 0 auto;
}
.brand-logo--hero {
  width: min(280px, 72vw);
  margin-bottom: 8px;
}
.brand--login {
  gap: 12px;
  justify-content: center;
}
.brand-logo--card {
  width: 160px;
}
.brand-logo-swap {
  display: grid;
  place-items: center;
}
.brand-logo-swap > img {
  grid-area: 1 / 1;
}
.brand-logo--light { display: none; }
html:not(.dark) .brand-logo--dark { display: none; }
html:not(.dark) .brand-logo--light { display: block; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 700; }
.brand small { margin-top: 1px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--pc-text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
}
.btn--tiny {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  gap: 6px;
}
.btn--primary { background: var(--pc-accent); color: #1f222c; }
.btn--primary:hover:not(:disabled) { background: var(--pc-accent-strong); }
.btn--secondary { background: var(--pc-surface); border-color: var(--pc-border-strong); color: var(--pc-text); }
.btn--board {
  min-height: 40px;
  padding: 0 16px;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  background: color-mix(in srgb, var(--hn-yellow) 22%, var(--pc-surface));
  border-color: color-mix(in srgb, var(--hn-yellow) 65%, var(--pc-border));
  color: var(--pc-text);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--hn-yellow) 25%, transparent);
}
.btn--board:hover:not(:disabled) {
  background: var(--hn-yellow);
  border-color: var(--hn-yellow);
  color: #1f222c;
}
.btn--board .btn__ico {
  width: 18px;
  height: 18px;
}
.btn--toggle {
  min-height: 38px;
  padding: 0 14px;
  gap: 8px;
  font-weight: 650;
  background: var(--pc-surface);
  border-color: var(--pc-border-strong);
  color: var(--pc-text-muted);
}
.btn--toggle:hover:not(:disabled) {
  color: var(--pc-text);
  border-color: color-mix(in srgb, var(--hn-blue) 45%, var(--pc-border));
}
.btn--toggle.is-on {
  background: color-mix(in srgb, var(--hn-blue) 22%, var(--pc-surface));
  border-color: color-mix(in srgb, var(--hn-blue) 70%, var(--pc-border));
  color: var(--pc-text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hn-blue) 35%, transparent);
}
.btn--toggle.is-on .btn__ico { color: var(--hn-blue); }
.btn--large { min-height: 44px; font-size: 14px; width: 100%; }
.btn--green { background: var(--hn-green); color: #1f222c; }
.btn--pink { background: var(--hn-pink); color: #fff; }
.btn--yellow { background: var(--hn-yellow); color: #1f222c; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--pc-text-muted);
  font-size: 16px;
}
.icon-btn:hover { background: var(--pc-surface-inset); color: var(--pc-text); }
.icon-btn .btn__ico { width: 16px; height: 16px; }

input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--pc-border-strong);
  border-radius: 9px;
  background: var(--pc-surface);
  color: var(--pc-text);
  outline: none;
}
input { height: 40px; }
input:focus { border-color: var(--pc-accent); box-shadow: 0 0 0 3px var(--pc-accent-muted); }

.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--pc-text-muted); }
.banner {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.banner--error { background: var(--pc-danger-bg); color: var(--pc-danger-text); }
.banner--ok { background: var(--pc-success-bg); color: var(--pc-success-text); }

/* login HelloNext */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--pc-bg); }
.login-brand {
  position: relative;
  display: grid;
  place-items: center;
  padding: 60px;
  background: var(--pc-sidebar);
  color: var(--pc-sidebar-text);
  border-right: 1px solid var(--pc-border);
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -210px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: var(--pc-accent-muted);
}
.login-brand__content { position: relative; z-index: 1; max-width: 580px; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--pc-accent-text); font-weight: 700; }
.login-brand h1 { margin: 22px 0; font-size: clamp(34px, 4.4vw, 56px); font-weight: 700; line-height: 1.08; letter-spacing: -.03em; }
.login-brand p { max-width: 500px; line-height: 1.7; color: var(--pc-sidebar-text-muted); }
.login-panel { display: grid; place-items: center; padding: 40px; background: var(--pc-bg); }
.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  box-shadow: var(--pc-shadow);
}
.login-card h2 { margin-bottom: 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.login-card > p { margin: 0; font-size: 13px; color: var(--pc-text-muted); }
.login-help { text-align: center; font-size: 13px; color: var(--pc-text-muted); }
.login-help a { color: var(--pc-accent-text); font-weight: 600; }
.login-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 4px;
}
.login-lang {
  border: 1px solid var(--pc-border);
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.login-lang.on {
  border-color: var(--pc-accent);
  background: var(--pc-accent-muted);
  color: var(--pc-accent-text);
}

/* hub menu */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 860px;
}
.hub-card {
  display: grid;
  gap: 12px;
  padding: 24px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  box-shadow: var(--pc-shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.hub-card:hover { border-color: var(--pc-accent); transform: translateY(-2px); }
.hub-card__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 800;
  color: #1f222c;
}
.hub-card__mark--fin { background: var(--hn-green); }
.hub-card__mark--sd { background: var(--hn-pink); color: #fff; }
.hub-card__mark--admin { background: var(--hn-yellow); }
.hub-card h2 { margin: 0; font-size: 18px; }
.hub-card p { margin: 0; font-size: 13px; color: var(--pc-text-muted); }

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.users-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin-bottom: 22px;
  padding: 18px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
}
.users-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.users-form__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-row { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pc-text); }
.check input { width: auto; height: auto; }
.users-table-wrap {
  overflow: auto;
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: var(--pc-surface);
}
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--pc-border);
}
.users-table th { color: var(--pc-text-muted); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.users-table tr:last-child td { border-bottom: 0; }

/* User admin (master + SD) */
.ua { display: grid; gap: 16px; }
.ua-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.ua-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pc-accent-text);
}
.ua-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ua-sub { margin: 6px 0 0; font-size: 13px; color: var(--pc-text-muted); max-width: 520px; }
.ua-head__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ua-search {
  width: min(260px, 100%);
  height: 40px;
}
.ua-search--block { width: 100%; margin-bottom: 10px; }
.ua-layout { display: grid; gap: 16px; }
.ua-layout--split { grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: start; }
.ua-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ua-chip {
  border: 1px solid var(--pc-border);
  background: var(--pc-surface);
  color: var(--pc-text-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}
.ua-chip.on {
  background: var(--pc-accent-muted);
  border-color: var(--pc-accent);
  color: var(--pc-accent-text);
}
.ua-cards { display: grid; gap: 10px; }
.ua-user {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease;
}
.ua-user:hover, .ua-user--on { border-color: var(--pc-accent); }
.ua-user--inactive { opacity: .72; }
.ua-user__actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.ua-user__actions .ua-badge {
  flex-shrink: 0;
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}
.ua-active-btn {
  white-space: nowrap;
  font-weight: 700;
  border-radius: 8px;
  min-width: 5.75rem;
}
.ua-active-btn--on {
  background: color-mix(in srgb, var(--hn-green) 22%, var(--pc-surface));
  border-color: color-mix(in srgb, var(--hn-green) 65%, var(--pc-border));
  color: var(--pc-text);
}
.ua-active-btn--on:hover:not(:disabled) {
  background: var(--hn-green);
  border-color: var(--hn-green);
  color: #1f222c;
}
.ua-active-btn--off {
  background: color-mix(in srgb, var(--hn-pink) 14%, var(--pc-surface));
  border-color: color-mix(in srgb, var(--hn-pink) 45%, var(--pc-border));
  color: var(--pc-text);
}
.ua-active-btn--off:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hn-pink) 28%, var(--pc-surface));
  border-color: var(--hn-pink);
  color: var(--pc-text);
}
.ua-user__avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
  color: #1f222c;
}
.ua-user__row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ua-user__body p { margin: 2px 0 0; font-size: 13px; color: var(--pc-text-muted); }
.ua-user__meta { font-size: 12px !important; }
.ua-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.ua-empty { color: var(--pc-text-muted); font-size: 13px; padding: 20px; text-align: center; }
.ua-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 16px;
}
.ua-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ua-panel__head h3 { margin: 0; font-size: 16px; }
.ua-section-label {
  display: block;
  margin: 14px 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--pc-text-muted);
}
.ua-kinds {
  display: grid;
  gap: 6px;
}
.ua-kind {
  display: grid;
  grid-template-columns: 18px 12px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  opacity: .72;
  transition: opacity .15s ease, background .15s ease, border-color .15s ease;
}
.ua-kind:hover { opacity: .9; background: var(--pc-surface-inset); }
.ua-kind strong { display: block; font-size: 13px; }
.ua-kind small { display: block; margin-top: 2px; font-size: 11px; color: var(--pc-text-muted); }
.ua-kind.on {
  opacity: 1;
  border-color: var(--pc-accent);
  background: var(--pc-accent-muted);
}
.ua-kind__radio {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--pc-border);
  box-sizing: border-box;
  position: relative;
}
.ua-kind.on .ua-kind__radio {
  border-color: var(--pc-accent);
}
.ua-kind.on .ua-kind__radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--pc-accent);
}
.ua-kind__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 4px;
}
.ua-invite-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--pc-text-muted);
  line-height: 1.4;
}
.ua-fields { display: grid; gap: 12px; margin-top: 14px; }
.ua-active { margin-top: 4px; }
.ua-tenants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow: auto;
  padding: 2px;
}
.ua-tenant {
  border: 1px solid var(--pc-border);
  background: var(--pc-surface-inset);
  color: var(--pc-text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
}
.ua-tenant.on {
  border-color: var(--hn-blue);
  background: rgba(63,141,221,.18);
  color: var(--hn-blue);
}
.ua-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--pc-text-muted);
  line-height: 1.5;
}
.ua-panel__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--pc-border);
  position: sticky;
  bottom: -18px;
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: -18px;
  padding: 14px 18px 18px;
  background: var(--pc-surface);
  z-index: 1;
}

@media (max-width: 720px) {
  .users-form__grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .ua-layout--split { grid-template-columns: 1fr; }
  .ua-panel { position: static; }
  .ua-user { grid-template-columns: 44px 1fr; }
  .ua-user__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.hub-card--selected { border-color: var(--pc-accent); outline: 2px solid var(--pc-accent-muted); }
.hub-card { cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%; }

/* Service Desk board */
.sd-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}
.sd-toolbar__filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sd-toolbar__filters select,
.sd-toolbar__filters input {
  width: auto;
  min-width: 160px;
  height: 38px;
}
.sd-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  height: 38px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--pc-border-strong);
  border-radius: 9px;
  background: var(--pc-surface);
}
.sd-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  height: 100%;
  min-width: 0;
  padding: 0;
  flex: 1;
}
.sd-search .btn__ico { color: var(--pc-text-muted); }
.sd-toolbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sd-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}
.sd-col {
  background: transparent;
  border: 0;
  border-radius: 0;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sd-col__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow);
}
.sd-col__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.sd-col__ico {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--pc-surface-inset);
}
.sd-col__ico svg {
  width: 15px;
  height: 15px;
  display: block;
}
.sd-col__count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
}
.sd-col--open .sd-col__head { box-shadow: inset 0 2px 0 var(--hn-blue), var(--pc-shadow); }
.sd-col--in_progress .sd-col__head { box-shadow: inset 0 2px 0 var(--hn-yellow), var(--pc-shadow); }
.sd-col--deadline_set .sd-col__head { box-shadow: inset 0 2px 0 var(--hn-pink), var(--pc-shadow); }
.sd-col--done .sd-col__head { box-shadow: inset 0 2px 0 var(--hn-green), var(--pc-shadow); }
.sd-col--open .sd-col__ico { color: var(--hn-blue); background: color-mix(in srgb, var(--hn-blue) 16%, var(--pc-surface)); }
.sd-col--in_progress .sd-col__ico { color: var(--hn-yellow); background: color-mix(in srgb, var(--hn-yellow) 16%, var(--pc-surface)); }
.sd-col--deadline_set .sd-col__ico { color: var(--hn-pink); background: color-mix(in srgb, var(--hn-pink) 16%, var(--pc-surface)); }
.sd-col--done .sd-col__ico { color: var(--hn-green); background: color-mix(in srgb, var(--hn-green) 16%, var(--pc-surface)); }
.sd-col__body {
  display: grid;
  gap: 12px;
  padding: 2px 2px 8px;
  align-content: start;
}
.sd-col__empty {
  margin: 4px 2px;
  font-size: 12px;
  color: var(--pc-text-muted);
  text-align: center;
  opacity: .8;
}

.sd-col__head-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}
.sd-col__link {
  font-size: 11px;
  font-weight: 600;
  color: var(--pc-accent-text);
  text-decoration: none;
  white-space: nowrap;
}
.sd-col__link:hover { text-decoration: underline; }

.sd-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--pc-shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.sd-card:hover {
  border-color: var(--pc-accent);
  transform: translateY(-2px);
  box-shadow: var(--pc-shadow-lg);
}
.sd-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 28px;
}
.sd-card__num {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pc-text-muted);
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--pc-surface-inset);
}
.sd-card__badges {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.sd-card__subject {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sd-card__facts {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--pc-border);
}
.sd-card__fact {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
  color: var(--pc-text-muted);
}
.sd-card__fact-ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
}
.sd-card__fact-ico svg {
  width: 12px;
  height: 12px;
  display: block;
}
.sd-card__fact-txt {
  font-size: 12px;
  line-height: 1.35;
  padding-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-card__fact--tenant .sd-card__fact-ico {
  color: var(--hn-blue);
  background: color-mix(in srgb, var(--hn-blue) 14%, var(--pc-surface));
}
.sd-card__fact--service .sd-card__fact-ico {
  color: var(--hn-yellow);
  background: color-mix(in srgb, var(--hn-yellow) 16%, var(--pc-surface));
}
.sd-card__fact--person .sd-card__fact-ico {
  color: var(--hn-green);
  background: color-mix(in srgb, var(--hn-green) 14%, var(--pc-surface));
}
.sd-card__fact--due .sd-card__fact-ico {
  color: var(--hn-pink);
  background: color-mix(in srgb, var(--hn-pink) 14%, var(--pc-surface));
}
.sd-card__fact--due .sd-card__fact-txt {
  font-weight: 700;
  color: var(--hn-pink);
}
.sd-card__fact--late .sd-card__fact-ico,
.sd-card__fact--late .sd-card__fact-txt {
  color: var(--pc-danger-text);
}
.sd-card__fact--late .sd-card__fact-ico {
  background: var(--pc-danger-bg);
}
.sd-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
  font-size: 11px;
  color: var(--pc-text-muted);
}
.sd-card__ago { flex: 0 0 auto; white-space: nowrap; }
.sd-card__assignee {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  background: var(--pc-accent-muted);
  color: var(--pc-accent-text);
  border: 1px solid color-mix(in srgb, var(--pc-accent) 35%, transparent);
}
.sd-card__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--pc-surface-raised, #1a1d27);
  color: var(--pc-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s ease;
  box-shadow: var(--pc-shadow-lg);
  z-index: 5;
}
.sd-card__assignee:hover .sd-card__tip,
.sd-card__assignee:focus-visible .sd-card__tip {
  opacity: 1;
  visibility: visible;
}
.sd-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.sd-modal__text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--pc-text-muted);
}
.sd-modal textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}
.sd-pendency {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.3;
}
.sd-pendency--requester {
  background: color-mix(in srgb, var(--hn-pink) 16%, var(--pc-surface));
  color: var(--hn-pink);
}
.sd-pendency--backend {
  background: color-mix(in srgb, var(--hn-blue) 18%, var(--pc-surface));
  color: var(--hn-blue);
}
.sd-pendency--resolved {
  background: color-mix(in srgb, var(--hn-green) 18%, var(--pc-surface));
  color: #2a7a4d;
}
html.dark .sd-pendency--resolved {
  color: var(--hn-green);
}
.sd-detail__hero .sd-pendency { margin-top: 10px; }
.sd-done-count {
  font-size: 12px;
  color: var(--pc-text-muted);
  align-self: center;
}
.sd-done-table-wrap {
  overflow: auto;
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: var(--pc-surface);
}
.sd-done-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sd-done-table th,
.sd-done-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--pc-border);
  white-space: nowrap;
}
.sd-done-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pc-text-muted);
  background: var(--pc-surface-inset);
}
.sd-done-table tbody tr {
  cursor: pointer;
}
.sd-done-table tbody tr:hover {
  background: color-mix(in srgb, var(--pc-accent) 8%, transparent);
}
.sd-done-table td:nth-child(2) {
  white-space: normal;
  max-width: 280px;
}
.sd-locked-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
  font-size: 13px;
}

.sd-prio {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
}
.sd-prio--critical { background: var(--pc-danger-bg); color: var(--pc-danger-text); }
.sd-prio--high { background: rgba(229, 50, 116, .12); color: var(--hn-pink); }
.sd-prio--medium { background: var(--pc-warning-bg); color: var(--pc-warning-text); }
.sd-prio--low { background: var(--pc-success-bg); color: var(--pc-success-text); }

.sd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}
.sd-modal {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
}
.sd-modal h3 { margin: 0; font-size: 16px; }

.sd-wizard { display: grid; gap: 16px; }
.sd-stepper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pc-text-muted);
}
.sd-stepper span.on { color: var(--pc-accent-text); }
.sd-stepper--status span {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--pc-surface-inset);
}
.sd-stepper--status span.on { background: var(--pc-accent-muted); }
.sd-stepper--status span.current { outline: 1px solid var(--pc-accent); }

.sd-tree { display: grid; gap: 16px; max-width: 900px; }
.sd-tree__root {
  padding: 14px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  display: grid;
  gap: 10px;
}
.sd-tree__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sd-tree__leaves { display: grid; gap: 8px; }
.sd-leaf {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  background: var(--pc-surface-inset);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.sd-leaf small { color: var(--pc-text-muted); font-size: 11px; }
.sd-leaf--on { border-color: var(--pc-accent); background: var(--pc-accent-muted); }
.sd-leaf--static {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

/* Catalog tree (admin) */
.ctree-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
}
.ctree {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  padding: 12px 10px 16px;
  min-height: 240px;
}
.ctree__empty, .ctree__hint {
  margin: 8px 0 8px 34px;
  font-size: 12px;
  color: var(--pc-text-muted);
}
.ctree__block { display: grid; }
.ctree__children {
  display: grid;
  margin-left: 18px;
  border-left: 1px solid var(--pc-border);
  padding-left: 6px;
}
.ctree__row {
  display: grid;
  grid-template-columns: 18px 22px 18px 1fr auto;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 2px 4px;
  border-radius: 8px;
}
.ctree__row:hover { background: var(--pc-surface-inset); }
.ctree__row.on, .ctree__row--svc.on { background: var(--pc-accent-muted); }
.ctree__row--inactive { opacity: .62; }
.ctree__row--level2 .ctree__label small { opacity: .75; }
.ctree__row--dragging, .ctree__block--dragging { opacity: .55; }
.ctree__row--over, .ctree__block--over > .ctree__row--level,
.ctree__block--over > .ctree__row--level2 {
  outline: 1px dashed var(--pc-accent);
  background: var(--pc-accent-muted);
}
.ctree__grip {
  width: 18px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-text-muted);
  font-size: 11px;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
}
.ctree__grip--off { visibility: hidden; cursor: default; }
.ctree__grip:active { cursor: grabbing; }
.ctree__caret {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--pc-text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .15s ease;
  padding: 0;
}
.ctree__caret.open { transform: rotate(90deg); color: var(--pc-text); }
.ctree__caret--spacer { visibility: hidden; }
.ctree__ico {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--hn-blue);
  opacity: .85;
  display: inline-block;
}
.ctree__ico--leaf {
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--pc-surface), inset 0 0 0 5px var(--hn-blue);
  background: transparent;
  opacity: 1;
}
.ctree__label {
  border: 0;
  background: transparent;
  color: var(--pc-text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ctree__label small {
  color: var(--pc-text-muted);
  font-size: 11px;
}
.ctree__label.on { color: var(--pc-accent-text); }
.ctree__plus {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--pc-border);
  background: var(--pc-surface-inset);
  color: var(--pc-text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ctree__plus:hover {
  border-color: var(--pc-accent);
  color: var(--pc-accent-text);
  background: var(--pc-accent-muted);
}
.ctree__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 4px;
}
.ctree__actions .btn { white-space: nowrap; }
.ctree__del {
  background: color-mix(in srgb, var(--hn-pink) 12%, var(--pc-surface));
  border-color: color-mix(in srgb, var(--hn-pink) 40%, var(--pc-border));
  color: var(--pc-text);
  font-weight: 700;
}
.ctree__del:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hn-pink) 28%, var(--pc-surface));
  border-color: var(--hn-pink);
}
.ctree__del:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.ctree--pick {
  max-width: 720px;
}
.ctree--pick .ctree__row {
  grid-template-columns: 22px 18px 1fr;
}
.sd-attach-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.sd-attach-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pc-border);
  border-radius: 10px;
  background: var(--pc-surface-inset);
  font-size: 13px;
}
.sd-attach-list small { color: var(--pc-text-muted); margin-left: 6px; }
.sd-attach-kind {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pc-accent-text);
  margin-right: 8px;
}

.sd-compose {
  display: grid;
  grid-template-columns: minmax(280px, 480px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}
.sd-compose__form { max-width: none; }
.sd-compose__preview {
  position: sticky;
  top: 12px;
  min-height: 360px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow);
  overflow: hidden;
}
.sd-compose__preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pc-border);
  font-size: 13px;
}
.sd-compose__preview-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-compose__preview-head small { color: var(--pc-text-muted); flex: 0 0 auto; }
.sd-compose__preview-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background:
    linear-gradient(45deg, var(--pc-surface-inset) 25%, transparent 25%),
    linear-gradient(-45deg, var(--pc-surface-inset) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--pc-surface-inset) 75%),
    linear-gradient(-45deg, transparent 75%, var(--pc-surface-inset) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.sd-compose__preview-body img,
.sd-compose__preview-body video {
  max-width: 100%;
  max-height: min(68vh, 640px);
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--pc-shadow-lg);
  background: var(--pc-surface);
}
.sd-compose__preview-empty {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 28px;
  color: var(--pc-text-muted);
}
.sd-compose__preview-empty p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--pc-text);
}

.sd-attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.sd-attach-tile {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: var(--pc-surface-inset);
  overflow: visible;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.sd-attach-tile > img {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 13px 13px 0 0;
}
.sd-attach-tile__icon {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--pc-accent-text);
  background: var(--pc-surface);
  border-radius: 13px 13px 0 0;
}
.sd-attach-tile__icon--lg {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--pc-border);
  font-size: 16px;
}
.sd-attach-tile__name {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--pc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--pc-surface);
  border-radius: 0 0 13px 13px;
  border-top: 1px solid var(--pc-border);
}
.sd-attach-tile__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(31, 34, 44, .72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  z-index: 2;
}
.sd-attach-tile__remove:hover { background: var(--hn-pink); }
.sd-attach-tile:hover,
.sd-attach-tile.is-active {
  border-color: var(--pc-accent);
  box-shadow: 0 0 0 3px var(--pc-accent-muted);
}
.sd-attach-tile--add {
  position: relative;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  color: var(--pc-text-muted);
  overflow: hidden;
}
.sd-attach-tile--add .sd-attach-tile__name {
  width: 100%;
  text-align: center;
  background: transparent;
  border-top: 0;
  color: var(--pc-text-muted);
}
.sd-attach-tile--add:hover {
  color: var(--pc-accent-text);
  background: var(--pc-accent-muted);
}
.sd-attach-tile__plus {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  color: inherit;
}
.sd-attach-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.sd-attach-float {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 20;
  width: min(280px, 70vw);
  padding: 8px;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow-lg);
  pointer-events: none;
}
.sd-attach-float img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
}
@media (max-width: 900px) {
  .sd-compose { grid-template-columns: 1fr; }
  .sd-compose__preview { position: static; max-height: 420px; min-height: 280px; }
}
.sd-compose--detail {
  grid-template-columns: minmax(220px, 340px) minmax(240px, 1fr);
}
@media (max-width: 1100px) {
  .sd-compose--detail { grid-template-columns: 1fr; }
}
.ctree-panel {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  padding: 16px;
  position: sticky;
  top: 12px;
}
.ctree-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ctree-panel__head h3 { margin: 0; font-size: 15px; }
@media (max-width: 900px) {
  .ctree-layout { grid-template-columns: 1fr; }
  .ctree-panel { position: static; }
}

.sd-detail { display: grid; gap: 16px; }
.sd-detail__hero {
  padding: 20px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  display: grid;
  gap: 10px;
}
.sd-detail__hero h2 { margin: 0; font-size: 22px; }
.sd-detail__admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.sd-detail__confirm {
  font-size: 13px;
  color: var(--pc-danger-text);
}
.sd-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 16px;
  align-items: start;
}
.sd-detail__grid > .users-form,
.sd-detail__panel {
  max-width: none;
  width: 100%;
  margin-bottom: 0;
  min-width: 0;
}
.sd-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--pc-border);
  margin-bottom: 2px;
}
.sd-section-head__ico {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--hn-blue);
  background: color-mix(in srgb, var(--hn-blue) 16%, var(--pc-surface-inset));
}
.sd-section-head__ico--timeline {
  color: var(--hn-pink);
  background: color-mix(in srgb, var(--hn-pink) 16%, var(--pc-surface-inset));
}
.sd-section-head__ico svg {
  width: 20px;
  height: 20px;
  display: block;
}
.sd-section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sd-section-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--pc-text-muted);
}
.sd-detail__desc {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}
.sd-tl__original {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--pc-text-muted);
  white-space: pre-wrap;
  line-height: 1.4;
  opacity: 0.85;
}
.sd-tl__original em {
  font-style: normal;
  font-weight: 600;
  margin-right: 4px;
}
.sd-detail__meta {
  margin: 0;
  color: var(--pc-text-muted);
  font-size: 12px;
}
.sd-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--pc-border);
  align-items: stretch;
}
.sd-actions__block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--pc-border);
  background: var(--pc-surface-inset);
  min-width: 0;
}
.sd-actions__block--assign {
  border-color: color-mix(in srgb, var(--hn-blue) 28%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-blue) 8%, var(--pc-surface-inset));
}
.sd-actions__block--due {
  border-color: color-mix(in srgb, var(--hn-yellow) 32%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-yellow) 9%, var(--pc-surface-inset));
}
.sd-actions__block--status {
  border-color: color-mix(in srgb, var(--hn-green) 28%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-green) 8%, var(--pc-surface-inset));
}
.sd-actions__block--pendency {
  border-color: color-mix(in srgb, var(--hn-pink) 28%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-pink) 8%, var(--pc-surface-inset));
}
.sd-actions__head {
  display: grid;
  gap: 4px;
}
.sd-actions__eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pc-text-muted);
}
.sd-actions__head p {
  margin: 0;
  font-size: 12px;
  color: var(--pc-text-muted);
  line-height: 1.4;
}
.sd-actions__body {
  display: grid;
  gap: 12px;
  flex: 1;
  align-content: start;
}
.sd-actions__field {
  margin: 0;
  width: 100%;
  max-width: 100%;
}
.sd-actions__field input[type="datetime-local"],
.sd-actions__field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.sd-actions__block .btn {
  width: 100%;
  margin-top: auto;
}
.sd-actions__btns {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
@media (max-width: 980px) {
  .sd-actions {
    grid-template-columns: 1fr;
  }
}
.sd-attach__title {
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.sd-timeline { display: grid; gap: 0; padding: 8px 4px 8px 0; }
.sd-timeline__item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--pc-surface-inset);
  display: grid;
  gap: 4px;
}
.sd-timeline__item span { font-size: 11px; color: var(--pc-text-muted); }
.sd-timeline__item p { margin: 0; font-size: 13px; white-space: pre-wrap; }
.sd-timeline__item--internal { border-left: 3px solid var(--hn-yellow); }

.sd-timeline-panel { min-width: 0; }
.sd-tl {
  --tl-accent: var(--pc-text-muted);
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 0 0 18px;
  position: relative;
}
.sd-tl:last-child { padding-bottom: 6px; }
.sd-tl__rail {
  grid-row: 1 / span 2;
  position: relative;
  display: flex;
  justify-content: center;
}
.sd-tl__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -18px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tl-accent) 70%, transparent), color-mix(in srgb, var(--pc-border) 80%, transparent));
}
.sd-tl:last-child .sd-tl__rail::before { bottom: 12px; }
.sd-tl__dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--tl-accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--tl-accent) 22%, transparent),
    inset 0 1px 0 rgba(255,255,255,.35);
}
.sd-tl__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.sd-tl__meta strong { font-size: 13px; color: var(--pc-text); }
.sd-tl__meta time { color: var(--pc-text-muted); }
.sd-tl__meta em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--hn-yellow);
}
.sd-tl__delete {
  margin-left: auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pc-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.sd-tl__delete:hover:not(:disabled) {
  background: color-mix(in srgb, var(--hn-pink) 22%, transparent);
  color: var(--hn-pink);
}
.sd-tl__delete:disabled { opacity: .45; cursor: default; }
.sd-tl__bubble {
  grid-column: 2;
  position: relative;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tl-accent) 35%, var(--pc-border));
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 40%),
    color-mix(in srgb, var(--tl-accent) 14%, var(--pc-surface));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px rgba(0,0,0,.12);
}
.sd-tl__bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--tl-accent) 14%, var(--pc-surface));
  border-left: 1px solid color-mix(in srgb, var(--tl-accent) 35%, var(--pc-border));
  border-bottom: 1px solid color-mix(in srgb, var(--tl-accent) 35%, var(--pc-border));
}
.sd-tl__bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.sd-tl__media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sd-tl__media-item {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 84px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--pc-border);
  background: color-mix(in srgb, var(--pc-surface) 80%, transparent);
  color: var(--pc-text);
  font: inherit;
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}
.sd-tl__media-item img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}
.sd-tl__media-ico {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--tl-accent);
}
.sd-tl--system { --tl-accent: #8b93a7; }
.sd-tl--requester { --tl-accent: var(--hn-green); }
.sd-tl--agent { --tl-accent: var(--hn-blue); }
.sd-tl--admin { --tl-accent: var(--hn-pink); }
/* Nota interna: amarelo prevalece sobre a cor do autor */
.sd-tl--internal { --tl-accent: var(--hn-yellow); }
.sd-tl--internal .sd-tl__bubble {
  border-color: color-mix(in srgb, var(--hn-yellow) 70%, var(--pc-border));
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 42%),
    color-mix(in srgb, var(--hn-yellow) 28%, var(--pc-surface));
}
.sd-tl--internal .sd-tl__bubble::before {
  background: color-mix(in srgb, var(--hn-yellow) 28%, var(--pc-surface));
  border-left-color: color-mix(in srgb, var(--hn-yellow) 70%, var(--pc-border));
  border-bottom-color: color-mix(in srgb, var(--hn-yellow) 70%, var(--pc-border));
}
.sd-tl--internal .sd-tl__meta em {
  padding: 2px 7px;
  border-radius: 999px;
  color: #1f222c;
  background: var(--hn-yellow);
}

.sd-tl-composer { display: grid; gap: 10px; margin-top: 14px; }
.sd-tl-composer__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sd-internal-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sd-internal-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 8px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--hn-yellow) 35%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-yellow) 8%, var(--pc-surface));
  color: var(--pc-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.sd-internal-toggle:hover {
  border-color: color-mix(in srgb, var(--hn-yellow) 55%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-yellow) 14%, var(--pc-surface));
}
.sd-internal-toggle.is-on {
  border-color: color-mix(in srgb, var(--hn-yellow) 75%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-yellow) 26%, var(--pc-surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hn-yellow) 35%, transparent);
}
.sd-internal-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sd-internal-toggle__box {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid color-mix(in srgb, var(--hn-yellow) 55%, var(--pc-border));
  background: var(--pc-surface);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease;
}
.sd-internal-toggle__box::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
}
.sd-internal-toggle.is-on .sd-internal-toggle__box {
  background: var(--hn-yellow);
  border-color: var(--hn-yellow);
}
.sd-internal-toggle.is-on .sd-internal-toggle__box::after {
  border-left-color: #1f222c;
  border-bottom-color: #1f222c;
}
.sd-internal-toggle__label { line-height: 1.2; }
.sd-help {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--hn-yellow) 45%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-yellow) 18%, var(--pc-surface));
  color: #1f222c;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.sd-help::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: min(260px, 70vw);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--pc-border);
  background: var(--pc-surface);
  color: var(--pc-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: var(--pc-shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
  z-index: 20;
}
.sd-help::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--pc-border);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 21;
}
.sd-help:hover::after,
.sd-help:hover::before,
.sd-help:focus-visible::after,
.sd-help:focus-visible::before {
  opacity: 1;
  visibility: visible;
}
.sd-help:hover::after,
.sd-help:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}
.sd-attach-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}
.sd-attach-grid--compact .sd-attach-tile { border-radius: 12px; }

.sd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 16, .72);
  backdrop-filter: blur(10px);
}
.sd-lightbox__panel {
  width: min(960px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--pc-border);
  background: color-mix(in srgb, var(--pc-surface) 88%, transparent);
  box-shadow: var(--pc-shadow-lg);
  overflow: hidden;
}
.sd-lightbox__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--pc-border);
}
.sd-lightbox__head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sd-lightbox__actions { display: flex; gap: 8px; align-items: center; }
.sd-lightbox__body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  min-height: 280px;
}
.sd-lightbox__body img,
.sd-lightbox__body video {
  max-width: 100%;
  max-height: min(72vh, 720px);
  border-radius: 12px;
}
.sd-lightbox__body iframe {
  width: min(100%, 880px);
  height: min(70vh, 700px);
  border: 0;
  border-radius: 12px;
  background: #111;
}
.sd-lightbox__doc {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  color: var(--pc-text-muted);
}
.sd-lightbox__doc p { margin: 0; color: var(--pc-text); font-weight: 700; }

textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--pc-border-strong);
  border-radius: 9px;
  background: var(--pc-surface);
  color: var(--pc-text);
  resize: vertical;
  outline: none;
}
textarea:focus { border-color: var(--pc-accent); box-shadow: 0 0 0 3px var(--pc-accent-muted); }

.swatch-row { display: flex; gap: 8px; margin-top: 28px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--pc-border); }
.swatch--y { background: var(--hn-yellow); }
.swatch--g { background: var(--hn-green); }
.swatch--b { background: var(--hn-blue); }
.swatch--p { background: var(--hn-pink); }

@media (max-width: 1100px) {
  .sd-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-detail__grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { min-height: 220px; padding: 32px; }
  .hub-grid { grid-template-columns: 1fr; }
  .page-header, .page-content { padding-left: 18px; padding-right: 18px; }
  .sd-board { grid-template-columns: 1fr; }
}


/* Notifications + Apple-style floating cards (right, under bell) */
.notif-wrap { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--hn-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}

.notif-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: transparent;
  cursor: default;
}

.apple-notifs,
.apple-toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  left: auto;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(400px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: none;
  /* keep a little inset so cards don't touch the viewport edge */
  padding: 4px 8px 12px 4px;
  box-sizing: border-box;
}
.apple-notifs { pointer-events: auto; }
.apple-notifs__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 2px;
  color: var(--pc-text);
}
.apple-notifs__bar strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.apple-notifs__clear {
  border: 0;
  background: transparent;
  color: var(--hn-blue);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 6px;
}
.apple-notifs__clear:hover { text-decoration: underline; }

.apple-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, #fff 14%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, #2c2c2e 82%, transparent);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  color: #f5f5f7;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  animation: apple-toast-in .35s ease;
}
.apple-toast--empty {
  cursor: default;
  opacity: .88;
  grid-template-columns: 1fr;
}
html:not(.dark) .apple-toast {
  background: color-mix(in srgb, #f2f2f7 88%, transparent);
  color: #1d1d1f;
  border-color: color-mix(in srgb, #000 8%, transparent);
  box-shadow: none;
}
.apple-toast__ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: #1f222c;
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
}
.apple-toast__ico svg { width: 22px; height: 22px; display: block; }
.apple-toast__ico--chat {
  background: linear-gradient(145deg, #f6c344, #5cc989);
  color: #1f222c;
}
.apple-toast__ico--ticket {
  background: color-mix(in srgb, var(--hn-blue) 28%, #1f222c);
  color: #3f8ddd;
}
html:not(.dark) .apple-toast__ico--ticket {
  background: color-mix(in srgb, #3f8ddd 18%, #fff);
  color: #2b6cb8;
}
.apple-toast__ico img { width: 28px; height: auto; display: block; }
.apple-toast__content { min-width: 0; display: grid; gap: 2px; }
.apple-toast__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.apple-toast__row strong { font-size: 14px; font-weight: 700; }
.apple-toast__row time { font-size: 11px; opacity: .55; flex: 0 0 auto; }
.apple-toast__body {
  font-size: 13px;
  line-height: 1.35;
  opacity: .92;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.apple-toast--panel {
  cursor: default;
}
.apple-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.apple-toast__btn {
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  background: color-mix(in srgb, #fff 10%, transparent);
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.2;
}
.apple-toast__btn:hover { background: color-mix(in srgb, #fff 18%, transparent); }
.apple-toast__btn:disabled { opacity: .45; cursor: not-allowed; }
.apple-toast__btn--primary {
  border-color: color-mix(in srgb, var(--hn-blue) 55%, transparent);
  background: color-mix(in srgb, var(--hn-blue) 28%, transparent);
  color: #fff;
}
.apple-toast__btn--primary:hover { background: color-mix(in srgb, var(--hn-blue) 42%, transparent); }
html:not(.dark) .apple-toast__btn {
  border-color: color-mix(in srgb, #000 12%, transparent);
  background: color-mix(in srgb, #000 4%, transparent);
}
html:not(.dark) .apple-toast__btn--primary {
  background: color-mix(in srgb, var(--hn-blue) 18%, #fff);
  color: #0b4a8a;
  border-color: color-mix(in srgb, var(--hn-blue) 35%, transparent);
}
@keyframes apple-toast-in {
  from { opacity: 0; transform: translateX(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.sd-settings {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: none;
  margin-bottom: 8px;
}
.sd-settings__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}
.sd-settings__panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  box-shadow: var(--pc-shadow);
  min-width: 0;
}
.sd-settings__tz { max-width: 320px; margin: 0; }
.sd-settings__toggle { margin-top: 2px; }
.sd-settings__url {
  margin: 0;
  word-break: break-all;
}
.sd-settings__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sd-settings__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 2px 0;
}

.sd-hours-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.sd-hours-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  background: var(--pc-surface-inset);
}
.sd-hours-row.is-on {
  border-color: color-mix(in srgb, var(--hn-blue) 35%, var(--pc-border));
  background: color-mix(in srgb, var(--hn-blue) 8%, var(--pc-surface));
}
.sd-hours-row .check {
  font-weight: 650;
  min-width: 0;
}
.sd-hours-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.sd-hours-times input[type="time"] {
  width: 100%;
  min-width: 0;
}
.sd-hours-sep { font-size: 12px; color: var(--pc-text-muted); text-align: center; }
.sd-hours-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--pc-surface-inset);
  color: var(--pc-text-muted);
  margin-left: auto;
}
.sd-hours-pill.on { background: var(--pc-success-bg); color: var(--pc-success-text); }

.sd-wa-help {
  margin: 4px 0 0;
  border: 1px solid var(--pc-border);
  border-radius: 12px;
  background: var(--pc-surface-inset);
  padding: 10px 14px;
}
.sd-wa-help summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.sd-wa-help p {
  margin: 10px 0 8px;
  font-size: 12px;
  color: var(--pc-text-muted);
}
.sd-wa-help__json {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  font-size: 11px;
  line-height: 1.45;
  overflow: auto;
  max-height: 220px;
  white-space: pre;
  color: var(--pc-text);
}

@media (max-width: 1100px) {
  .sd-settings__layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sd-hours-grid { grid-template-columns: 1fr; }
  .sd-settings__fields { grid-template-columns: 1fr; }
}

/* SD Dashboards */
.sd-dash__meta { margin: 0 0 14px; font-size: 12px; color: var(--pc-text-muted); }
.sd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sd-kpi {
  padding: 14px 16px;
  border: 1px solid var(--pc-border);
  border-radius: 14px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow);
}
.sd-kpi > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--pc-text-muted);
}
.sd-kpi > strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.sd-kpi > small { display: block; margin-top: 4px; font-size: 11px; color: var(--pc-text-muted); }
.sd-kpi--accent { border-color: color-mix(in srgb, var(--hn-blue) 45%, var(--pc-border)); }
.sd-kpi--accent > strong { color: var(--hn-blue); }
.sd-kpi--success > strong { color: var(--hn-green); }
.sd-kpi--danger > strong { color: var(--hn-pink); }
.sd-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sd-dash-panel {
  padding: 16px;
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow);
}
.sd-dash-panel--wide { grid-column: 1 / -1; }
.sd-funnel { display: grid; gap: 12px; margin-top: 8px; }
.sd-funnel__head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.sd-funnel__track {
  height: 10px;
  border-radius: 999px;
  background: var(--pc-surface-inset);
  overflow: hidden;
}
.sd-funnel__bar { display: block; height: 100%; border-radius: 999px; background: var(--hn-blue); min-width: 0; }
.sd-funnel__bar--open { background: var(--hn-blue); }
.sd-funnel__bar--in_progress { background: var(--hn-yellow); }
.sd-funnel__bar--deadline_set { background: var(--hn-pink); }
.sd-funnel__bar--done { background: var(--hn-green); }
.sd-donut { display: grid; gap: 18px; place-items: center; margin-top: 8px; }
.sd-donut__ring {
  width: 168px; height: 168px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.sd-donut__hole {
  width: 108px; height: 108px;
  border-radius: 50%;
  background: var(--pc-surface);
  display: grid; place-items: center;
  text-align: center;
}
.sd-donut__hole strong { font-size: 24px; }
.sd-donut__hole small { font-size: 10px; color: var(--pc-text-muted); }
.sd-donut__legend {
  list-style: none; margin: 0; padding: 0;
  width: 100%;
  display: grid; gap: 8px;
}
.sd-donut__legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.sd-donut__dot { width: 10px; height: 10px; border-radius: 50%; }
.sd-donut__dot--low { background: #5cc989; }
.sd-donut__dot--medium { background: #f6c344; }
.sd-donut__dot--high { background: #e53274; }
.sd-tl-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  gap: 4px;
  align-items: end;
  min-height: 160px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.sd-tl-chart__col { display: grid; gap: 6px; justify-items: center; }
.sd-tl-chart__bars {
  height: 140px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}
.sd-tl-chart__created, .sd-tl-chart__closed {
  width: 6px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}
.sd-tl-chart__created { background: var(--hn-blue); }
.sd-tl-chart__closed { background: var(--hn-green); }
.sd-tl-chart__col small { font-size: 9px; color: var(--pc-text-muted); writing-mode: horizontal-tb; }
.sd-tl-chart__legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-size: 12px; color: var(--pc-text-muted);
}
.sd-tl-chart__legend .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
}
.sd-tl-chart__legend .dot.created { background: var(--hn-blue); }
.sd-tl-chart__legend .dot.closed { background: var(--hn-green); }
.sd-rank { display: grid; gap: 12px; margin-top: 8px; }
.sd-rank__head {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; margin-bottom: 5px;
}
.sd-rank__head > span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.sd-rank__track {
  height: 8px; border-radius: 999px;
  background: var(--pc-surface-inset); overflow: hidden;
}
.sd-rank__track > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--hn-blue), var(--hn-green));
}
.sd-rank__row > small { font-size: 11px; color: var(--pc-text-muted); }
.sd-row--late td:first-child strong { color: var(--hn-pink); }
@media (max-width: 1100px) {
  .sd-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-dash-grid { grid-template-columns: 1fr; }
  .sd-dash-panel--wide { grid-column: auto; }
}

/* —— SD Chat —— */
.chat-page { display: grid; gap: 12px; }
.chat-page__bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.chat-page__title {
  margin: 0; font-size: 20px; font-weight: 800; flex: 1;
}
.chat-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  min-height: min(72vh, 720px);
  border: 1px solid var(--pc-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--pc-surface);
}
.chat-list {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--pc-border);
  background: color-mix(in srgb, var(--pc-surface) 92%, var(--pc-bg));
  min-height: 0;
}
.chat-list__search { padding: 10px; border-bottom: 1px solid var(--pc-border); }
.chat-list__search input {
  width: 100%; min-height: 36px; border-radius: 10px;
  border: 1px solid var(--pc-border); background: var(--pc-surface);
  color: var(--pc-text); padding: 0 12px;
}
.chat-list__empty {
  padding: 24px 16px; color: var(--pc-text-muted); font-size: 13px; margin: 0;
}
.chat-list__item {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px;
  align-items: center; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; border-bottom: 1px solid var(--pc-border);
  background: transparent; color: inherit; cursor: pointer;
}
.chat-list__item:hover, .chat-list__item.on {
  background: var(--pc-accent-muted);
}
.chat-list__avatar {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--hn-blue) 28%, var(--pc-surface));
  color: var(--hn-blue); font-size: 12px; font-weight: 800;
}
.chat-list__meta { min-width: 0; display: grid; gap: 2px; }
.chat-list__row {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
}
.chat-list__row small { color: var(--pc-text-muted); font-size: 11px; }
.chat-list__preview {
  font-size: 12px; color: var(--pc-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-list__badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--hn-pink); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center;
}
.chat-thread { display: grid; grid-template-rows: auto 1fr auto auto; min-height: 0; }
.chat-thread__empty {
  display: grid; place-content: center; gap: 8px; text-align: center;
  color: var(--pc-text-muted); padding: 40px 24px;
}
.chat-thread__hint { font-size: 13px; max-width: 360px; margin: 0 auto; }
.chat-thread__head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--pc-border);
}
.chat-thread__head small { display: block; color: var(--pc-text-muted); font-size: 12px; }
.chat-thread__msgs {
  overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: color-mix(in srgb, var(--pc-bg) 55%, var(--pc-surface));
}
.chat-bubble {
  max-width: min(78%, 520px); padding: 10px 12px; border-radius: 14px;
  display: grid; gap: 6px;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: color-mix(in srgb, var(--hn-yellow) 28%, var(--pc-surface));
  border: 1px solid color-mix(in srgb, var(--hn-yellow) 45%, var(--pc-border));
  border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-bottom-left-radius: 4px;
}
.chat-bubble__name { font-size: 11px; font-weight: 700; color: var(--hn-blue); }
.chat-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.chat-bubble__original {
  margin: 0; font-size: 11px; color: var(--pc-text-muted);
  white-space: pre-wrap; word-break: break-word; opacity: 0.85;
}
.chat-bubble time { font-size: 10px; color: var(--pc-text-muted); justify-self: end; }
.chat-bubble:has(.chat-media) { max-width: min(92%, 360px); }
.chat-media { display: grid; gap: 8px; }
.chat-media__item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.chat-media__item img,
.chat-media__item video {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}
.chat-media__pdf {
  width: 100%;
  height: 200px;
  border: 0;
  border-radius: 12px;
  pointer-events: none;
  background: #111;
}
.chat-media__ph {
  min-height: 140px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--pc-surface-inset);
  border: 1px solid var(--pc-border);
  font-size: 12px;
  text-align: center;
  word-break: break-word;
}
.chat-media__ico { font-size: 13px; font-weight: 800; letter-spacing: .04em; color: var(--hn-blue); }
.chat-media__name {
  font-size: 11px;
  opacity: .8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-bubble__atts { display: grid; gap: 6px; }
.chat-att {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--pc-border); border-radius: 10px;
  background: var(--pc-surface-inset); padding: 6px 8px;
  color: inherit; cursor: pointer; text-align: left;
}
.chat-att__name {
  font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px;
}
.chat-pending {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px;
  border-top: 1px solid var(--pc-border);
}
.chat-pending__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px; font-size: 12px;
  background: var(--pc-accent-muted); border: 1px solid var(--pc-border);
}
.chat-pending__chip img {
  width: 22px; height: 22px; object-fit: cover; border-radius: 6px;
}
.chat-pending__chip button {
  border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px;
}
.sd-lightbox--over {
  z-index: 1400;
  padding: 12px;
}
.sd-lightbox--over .sd-lightbox__panel {
  width: min(1200px, 96vw);
  max-height: 94vh;
  height: min(94vh, 960px);
}
.sd-lightbox--over .sd-lightbox__body img,
.sd-lightbox--over .sd-lightbox__body video {
  max-height: min(82vh, 860px);
}
.sd-lightbox--over .sd-lightbox__body iframe {
  width: 100%;
  height: min(82vh, 860px);
}
.chat-composer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px; border-top: 1px solid var(--pc-border);
}
.chat-composer__input {
  min-height: 40px; border-radius: 12px; border: 1px solid var(--pc-border);
  background: var(--pc-surface-inset); color: var(--pc-text); padding: 0 12px;
}
.chat-composer__attach {
  position: relative; overflow: hidden; cursor: pointer; min-width: 36px;
}
.chat-composer__attach input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.chat-picker { max-width: 420px; width: min(92vw, 420px); }
.chat-picker__search {
  width: 100%; min-height: 38px; margin: 8px 0 12px; border-radius: 10px;
  border: 1px solid var(--pc-border); background: var(--pc-surface-inset);
  color: var(--pc-text); padding: 0 12px;
}
.chat-picker__list {
  max-height: 360px; overflow: auto; display: grid; gap: 4px; margin-bottom: 12px;
}
.chat-picker__row {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  width: 100%; text-align: left; padding: 8px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer;
}
.chat-picker__row:hover { background: var(--pc-accent-muted); border-color: var(--pc-border); }
.chat-picker__row small { display: block; color: var(--pc-text-muted); font-size: 12px; }
@media (max-width: 860px) {
  .chat-shell { grid-template-columns: 1fr; min-height: 70vh; }
  .chat-list { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--pc-border); }
}

/* —— SD Chat floating widget —— */
.chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #1f222c;
  background: linear-gradient(145deg, #f6c344, #5cc989);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32); }
.chat-fab.is-open { background: linear-gradient(145deg, #3f8ddd, #5cc989); }
.chat-fab__ico { width: 26px; height: 26px; }
.chat-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e53274;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--pc-bg, #1f222c);
}
.chat-float {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 1201;
  width: min(400px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--pc-border);
  background: var(--pc-surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.chat-float__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pc-border);
  background: color-mix(in srgb, var(--pc-surface) 88%, var(--pc-bg));
  flex-shrink: 0;
}
.chat-float__bar strong { flex: 1; font-size: 15px; }
.chat-float__bar-actions { display: flex; align-items: center; gap: 6px; }
.chat-float__peer { flex: 1; min-width: 0; }
.chat-float__peer strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-float__peer small { display: block; color: var(--pc-text-muted); font-size: 11px; }
.chat-float__scroll {
  overflow: auto;
  min-height: 0;
  flex: 1;
}
.chat-float__msgs {
  min-height: 0;
  flex: 1;
}
.chat-float__err {
  padding: 8px 12px;
  font-size: 12px;
  color: #e53274;
  background: color-mix(in srgb, #e53274 12%, var(--pc-surface));
  border-bottom: 1px solid var(--pc-border);
  flex-shrink: 0;
}
.chat-float .chat-list__search { flex-shrink: 0; }
.chat-float .chat-pending,
.chat-float .chat-composer { flex-shrink: 0; }
.chat-float-picker-scrim { z-index: 1300; }
@media (max-width: 480px) {
  .chat-fab { right: 14px; bottom: 14px; }
  .chat-float {
    right: 8px;
    left: 8px;
    bottom: 78px;
    width: auto;
    height: min(70vh, calc(100vh - 100px));
  }
}
