:root {
  --bg: #f4f1ee;
  --panel: #ffffff;
  --ink: #16120f;
  --ink-soft: #2c241e;
  --muted: #6b5f55;
  --line: #e4d8ce;
  --accent: #d35400;
  --accent-hover: #b84700;
  --accent-soft: #ffe8d6;
  --accent-wash: #fff4eb;
  --accent-grad: linear-gradient(135deg, #ffbb4e 0%, #f38d30 48%, #cc5323 100%);
  --warn: #a85a08;
  --warn-soft: #fff6e8;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #157a3c;
  --ok-soft: #ecfdf3;
  --shadow: 0 1px 2px rgba(22, 18, 15, 0.04), 0 12px 28px rgba(22, 18, 15, 0.06);
  --shadow-soft: 0 8px 20px rgba(22, 18, 15, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --ease: 160ms ease;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 8% -8%, rgba(243, 141, 48, 0.16) 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(204, 83, 35, 0.10) 0%, transparent 50%),
    linear-gradient(180deg, #faf7f4 0%, var(--bg) 40%, #efe8e1 100%);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— App frame + left sidebar —— */
.app-frame {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: stretch;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px 16px;
  color: #f3efe9;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(243, 141, 48, 0.28) 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(204, 83, 35, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #1a1a1a 0%, #0b0b0b 55%, #080808 100%);
  border-right: 1px solid #1f1f1f;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.22);
  transition: width var(--ease), flex-basis var(--ease), padding var(--ease);
  overflow: hidden;
}
html.nav-collapsed .sidebar {
  flex-basis: var(--sidebar-w-collapsed);
  width: var(--sidebar-w-collapsed);
  padding-left: 10px;
  padding-right: 10px;
}
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 6px;
}
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.sidebar-brand:hover { text-decoration: none; color: inherit; }
.sidebar-brand-text {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #f5f1eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 0 0 2px #1a1a1a, 0 0 0 3px rgba(243, 141, 48, 0.65);
}
.sidebar-toggle,
.sidebar-open {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background: #141414;
  color: #d8d0c8;
  cursor: pointer;
  padding: 0;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}
.sidebar-toggle:hover,
.sidebar-open:hover {
  background: rgba(243, 141, 48, 0.16);
  border-color: #f38d30;
  color: #ffbb4e;
}
.sidebar-toggle svg,
.sidebar-open svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--ease);
}
html.nav-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: #b7b0a9;
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(243, 141, 48, 0.18);
  color: #ffbb4e;
}
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-dropdown {
  position: relative;
}
.sidebar-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.sidebar-dropdown > summary::-webkit-details-marker {
  display: none;
}
.sidebar-group-toggle {
  width: 100%;
}
.sidebar-caret {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #8a827a;
  transition: transform var(--ease), color var(--ease);
}
.sidebar-caret svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-dropdown[open] > .sidebar-group-toggle .sidebar-caret {
  transform: rotate(180deg);
  color: #ffbb4e;
}
.sidebar-group-toggle.is-open-parent,
.sidebar-dropdown[open] > .sidebar-group-toggle {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-group-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px;
}
.sidebar-group-collapsed-link {
  display: none !important;
}
.sidebar-sublink {
  min-height: 36px;
  margin-left: 18px;
  padding-left: 10px;
  font-size: 0.86rem;
  color: #9a9087;
  position: relative;
}
.sidebar-sublink::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: #3a3530;
}
.sidebar-sublink .sidebar-ico {
  width: 18px;
  height: 18px;
}
.sidebar-sublink .sidebar-ico svg {
  width: 16px;
  height: 16px;
}
.sidebar-group.is-active-group .sidebar-sublink:not(.active) {
  color: #b7b0a9;
}
html.nav-collapsed .sidebar-label,
html.nav-collapsed .sidebar-caret {
  display: none;
}
html.nav-collapsed .sidebar-dropdown > .sidebar-group-toggle,
html.nav-collapsed .sidebar-dropdown > .sidebar-group-menu {
  display: none !important;
}
html.nav-collapsed .sidebar-dropdown > .sidebar-group-collapsed-link {
  display: flex !important;
}
html.nav-collapsed .sidebar-sublink {
  margin-left: 0;
  padding-left: 0;
}
html.nav-collapsed .sidebar-sublink::before {
  display: none;
}
.sidebar-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.sidebar-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.nav-collapsed .sidebar-brand-text,
html.nav-collapsed .sidebar-label,
html.nav-collapsed .sidebar-section-label,
html.nav-collapsed .sidebar-account-meta {
  display: none;
}
html.nav-collapsed .sidebar-link {
  justify-content: center;
  padding: 0;
  width: 44px;
  margin: 0 auto;
}
html.nav-collapsed .sidebar-brand {
  justify-content: center;
}
html.nav-collapsed .sidebar-head {
  flex-direction: column;
  gap: 10px;
}
html.nav-collapsed .sidebar-toggle {
  width: 44px;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}
.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a736c;
  padding: 4px 12px 8px;
}
.sidebar-account {
  position: relative;
}
.sidebar-account > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease);
}
.sidebar-account > summary::-webkit-details-marker { display: none; }
.sidebar-account > summary:hover,
.sidebar-account.is-active > summary,
.sidebar-account[open] > summary {
  background: rgba(243, 141, 48, 0.14);
  border-color: rgba(243, 141, 48, 0.45);
}
.sidebar-account-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.sidebar-account-meta strong {
  font-size: 0.88rem;
  color: #f5f1eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account-email {
  color: #9a9087;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.nav-collapsed .sidebar-account > summary {
  justify-content: center;
  padding: 8px;
}
.sidebar-account-menu {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 6px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
html.nav-collapsed .sidebar-account-menu {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 0;
  min-width: 210px;
  z-index: 70;
}
.sidebar-account-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: #e8e2db;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
.sidebar-account-menu a:hover,
.sidebar-account-menu a.active {
  background: rgba(243, 141, 48, 0.16);
  color: #ffbb4e;
}
.sidebar-account-menu a.nav-profile-out {
  color: #9a9087;
  margin-top: 2px;
  border-top: 1px solid #2a2a2a;
  border-radius: 0 0 9px 9px;
}
.sidebar-backdrop {
  display: none;
}
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-mobile-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #f5f1eb;
  background:
    linear-gradient(90deg, #1a1a1a 0%, #0b0b0b 100%);
  border-bottom: 1px solid #1f1f1f;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-mobile-bar .mobile-brand .sidebar-brand-text {
  display: inline;
  color: #f5f1eb;
}
.app-mobile-bar .sidebar-open {
  border-color: #2a2a2a;
  background: #141414;
  color: #d8d0c8;
}
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  width: 100%;
}
/* Full-width project boards */
body.is-project-board .shell,
body.is-project-board .shell.shell-board,
.shell:has(.trello-board-canvas),
.shell:has(.trello-board-shell) {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 14px 20px !important;
  box-sizing: border-box;
}
body.is-project-board .section-tabs,
.shell:has(.trello-board-canvas) .section-tabs {
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    width: min(280px, 86vw);
    flex-basis: auto;
    box-shadow: var(--shadow);
    transition: transform 200ms ease;
  }
  html.nav-collapsed .sidebar {
    width: min(280px, 86vw);
    padding-left: 12px;
    padding-right: 12px;
  }
  html.nav-collapsed .sidebar-brand-text,
  html.nav-collapsed .sidebar-label,
  html.nav-collapsed .sidebar-section-label,
  html.nav-collapsed .sidebar-account-meta {
    display: initial;
  }
  html.nav-collapsed .sidebar-account-meta {
    display: grid;
  }
  html.nav-collapsed .sidebar-link {
    justify-content: flex-start;
    padding: 0 12px;
    width: auto;
    margin: 0;
  }
  html.nav-collapsed .sidebar-head {
    flex-direction: row;
  }
  html.nav-collapsed .sidebar-toggle svg {
    transform: none;
  }
  html.nav-mobile-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(22, 18, 15, 0.42);
  }
  .sidebar-backdrop[hidden] {
    display: none !important;
  }
  .app-mobile-bar {
    display: flex;
  }
  html.nav-collapsed .sidebar-account-menu {
    position: static;
    left: auto;
    min-width: 0;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand:hover { text-decoration: none; color: inherit; }
.brand-logo {
  height: 44px;
  width: auto;
  max-width: min(280px, 55vw);
  display: block;
  object-fit: contain;
  object-position: left center;
  border-radius: 10px;
}
.brand-text {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #f5f1eb;
  line-height: 1.1;
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(243, 141, 48, 0.2);
  color: #ffbb4e;
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  flex: 0 0 auto;
}
.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  border: 1px solid var(--line);
}
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-photo-upload {
  display: grid;
  gap: 4px;
  min-width: 200px;
}
.profile-photo-upload .req {
  color: var(--danger);
  font-style: normal;
  font-weight: 700;
  font-size: 0.78rem;
}
.profile-photo-preview.is-required {
  outline: 2px dashed color-mix(in srgb, var(--danger) 55%, transparent);
  outline-offset: 2px;
}
.profile-gate-banner {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: linear-gradient(180deg, #fff7f5 0%, #fff 100%);
  margin-bottom: 12px;
}
.profile-gate-banner h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--danger);
}
.profile-gate-banner p {
  margin: 0;
  color: var(--ink-soft);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 20px;
  margin-bottom: 18px;
}
.panel h1 {
  font-family: var(--display);
  margin: 0 0 6px;
  letter-spacing: -0.03em;
  font-size: 1.7rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.15;
}
.panel h2 {
  font-family: var(--display);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  font-size: 1.28rem;
  font-weight: 650;
  color: var(--ink-soft);
  line-height: 1.2;
}
.muted { color: var(--muted); }
.toolbar {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  margin-bottom: 14px; flex-wrap: wrap;
}
.toolbar .muted { max-width: 62ch; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.stat {
  background: linear-gradient(180deg, #fff 0%, var(--accent-wash) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.stat .stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.stat .stat-link:hover {
  text-decoration: none;
}
.stat .stat-link:hover .l {
  color: var(--accent);
}
.stat .n {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat .l { color: var(--muted); font-size: 0.86rem; margin-top: 4px; font-weight: 600; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid label.span-2 {
  grid-column: 1 / -1;
}
.form-grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 720px) {
  .form-grid,
  .form-grid.three { grid-template-columns: 1fr; }
}
.stack { display: grid; gap: 12px; }
.stack.compact { gap: 10px; }
.inline-suffix {
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-suffix input { flex: 1; min-width: 0; }
.inline-suffix .suffix {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
}
.form-section-title {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.05rem;
  margin: 10px 0 4px;
  letter-spacing: -0.02em;
  color: var(--ink-soft);
}
label { display: grid; gap: 6px; font-weight: 650; font-size: 0.88rem; color: var(--ink-soft); }
input, select, textarea {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  color: var(--ink);
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #f0b48a;
  box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.14);
}
textarea { min-height: 80px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-sm); padding: 10px 16px;
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent-grad); color: #fff; text-decoration: none;
  transition: filter var(--ease), transform var(--ease), box-shadow var(--ease);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset;
}
.btn.secondary {
  background: #efe7df;
  color: var(--ink);
  box-shadow: none;
}
.btn.small { padding: 7px 11px; font-size: 0.84rem; }
.pw-reveal {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  background: #f3eee7;
  border-radius: 4px;
  word-break: break-all;
}
.btn:hover { filter: brightness(0.96); text-decoration: none; }
.btn.secondary:hover { background: #e5dbd0; filter: none; }
.btn:active { transform: translateY(1px); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* CRM (Sales → CRM) */
.crm-panel .toolbar { margin-bottom: 14px; }
.crm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.crm-stat {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.crm-stat:hover {
  border-color: #d0d5dd;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}
.crm-stat.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.crm-stat-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.crm-stat strong {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.crm-stat em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}
.crm-stat.is-paid strong { color: #216e4e; }
.crm-stat.is-trial strong { color: #974f0c; }
.crm-stat.is-paused strong { color: #ae2a19; }
.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafb;
}
.crm-toolbar-field {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.crm-toolbar-field select {
  min-width: 140px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 8px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.crm-toolbar-search {
  flex: 1 1 220px;
  margin: 0;
  min-width: 180px;
}
.crm-toolbar-search input[type="search"] {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: #fff;
  font: inherit;
}
.crm-form {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.crm-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.crm-form-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.crm-empty {
  text-align: center;
  padding: 40px 16px;
  border: 1px dashed #d0d5dd;
  border-radius: 14px;
  background: #fbfcfd;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.crm-empty strong { font-size: 1rem; }
.crm-table-wrap { margin-top: 4px; }
.crm-table td:first-child {
  white-space: normal;
  min-width: 200px;
}
.crm-account {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.crm-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #eef2f6;
  color: #344054;
  font-size: 0.78rem;
  font-weight: 800;
}
.crm-account-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.crm-account-meta strong {
  font-size: 0.9rem;
  color: var(--ink);
}
.crm-sub {
  font-size: 0.76rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-client-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}
.crm-client-link:hover { text-decoration: underline; }
.crm-platform {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 0.75rem;
  font-weight: 700;
}
.crm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}
.crm-badge-paid { background: #e7f8ef; color: #216e4e; }
.crm-badge-trial { background: #fff7e6; color: #974f0c; }
.crm-badge-paused { background: #ffecec; color: #ae2a19; }
.crm-badge-deleted { background: #f2f4f7; color: #667085; }
.crm-badge-default { background: #eef2f6; color: #344054; }
.crm-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.crm-col-actions { width: 1%; white-space: nowrap; }
.crm-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.crm-row-actions form { margin: 0; }
.crm-del-btn { color: #b42318 !important; }
@media (max-width: 820px) {
  .crm-table th:nth-child(2),
  .crm-table td:nth-child(2),
  .crm-table th:nth-child(6),
  .crm-table td:nth-child(6) {
    display: none;
  }
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--muted); font-weight: 700; font-size: 0.86rem;
  text-decoration: none;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.chip.active {
  background: var(--accent-soft); border-color: #f0b48a; color: var(--accent);
}
.chip:hover { text-decoration: none; color: var(--ink); border-color: #b7c7d4; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td {
  text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.data-table th {
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 750;
  background: #f3e8de;
  border-bottom: 1px solid #e0d0c2;
}
.data-table thead th:first-child { border-radius: 10px 0 0 0; }
.data-table thead th:last-child { border-radius: 0 10px 0 0; }
.data-table tbody tr:hover td { background: rgba(255, 244, 235, 0.55); }
.cell-sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.row-actions {
  white-space: nowrap;
}
.row-actions .btn { margin: 0 2px 2px 0; }

/* Clients list: truncate long usernames/names + pin actions on the right */
.clients-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.clients-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
}
.clients-table th:nth-child(1),
.clients-table td:nth-child(1) { width: 36px; }
.clients-table th:nth-child(2),
.clients-table td:nth-child(2) { width: 18%; }
.clients-table th:nth-child(3),
.clients-table td:nth-child(3) { width: 10%; }
.clients-table th:nth-child(4),
.clients-table td:nth-child(4) { width: 12%; }
.clients-table th:nth-child(5),
.clients-table td:nth-child(5) { width: 7%; }
.clients-table th:nth-child(6),
.clients-table td:nth-child(6) { width: 9%; }
.clients-table th:nth-child(7),
.clients-table td:nth-child(7) { width: 11%; }
.clients-table th:nth-child(8),
.clients-table td:nth-child(8) { width: 8%; }
.clients-table th:nth-child(9),
.clients-table td:nth-child(9) { width: 11%; }
.clients-table th:nth-child(10),
.clients-table td:nth-child(10) { width: 48px; }
.clients-table .col-check {
  width: 36px;
  min-width: 36px;
  text-align: center;
  vertical-align: middle;
  padding-left: 8px;
  padding-right: 4px;
}
.clients-table .col-check input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #f0b48a;
  border-radius: 14px;
  background: var(--accent-soft);
}
.bulk-bar[hidden] { display: none !important; }
.bulk-bar-left,
.bulk-bar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.bulk-source-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
  font-size: 0.86rem;
}
.bulk-source-label select {
  width: auto;
  min-width: 200px;
  padding: 7px 10px;
}
.clients-table .cell-username,
.clients-table .cell-name {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clients-table .cell-username strong {
  font-weight: 700;
}
.clients-table .client-link {
  color: inherit;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clients-table .client-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.clients-table .muted-link {
  color: var(--muted);
}
.clients-table .cell-name {
  color: var(--muted);
}
.clients-table .cell-source {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clients-table .sticky-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
  vertical-align: middle;
  padding: 10px 6px;
  overflow: visible;
  border-left: 1px solid var(--line);
  box-shadow: none;
}
.clients-table thead .sticky-actions,
.clients-table thead .th-actions {
  background: #f3e8de;
  z-index: 3;
  border-left: 1px solid #e0d0c2;
  border-radius: 0 10px 0 0;
  box-shadow: none;
}
.clients-table tbody tr:hover .sticky-actions {
  background: #fff7f1;
}
.clients-table tbody .sticky-actions {
  box-shadow: -8px 0 12px -10px rgba(18, 32, 42, 0.16);
}
.clients-table .action-menu-trigger {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  max-width: 100%;
}
.th-sort:hover {
  color: var(--accent);
  text-decoration: none;
}
.th-sort.is-active {
  color: var(--accent);
}
.sort-ctrl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 0.7;
  flex: 0 0 auto;
}
.sort-up,
.sort-down {
  font-size: 0.62rem;
  color: #b7a89a;
  font-weight: 800;
}
.th-sort:hover .sort-up,
.th-sort:hover .sort-down {
  color: #d9a078;
}
.sort-up.is-on,
.sort-down.is-on {
  color: var(--accent);
}
.clients-table th {
  overflow: visible;
}
.clients-table th .th-sort {
  overflow: visible;
}
.sort-hint {
  gap: 8px;
}
.sort-hint .chip {
  font-size: 0.82rem;
}

.action-menu {
  position: relative;
  display: inline-flex;
  justify-content: center;
}
.action-menu-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.action-menu-trigger:hover,
.action-menu:hover .action-menu-trigger,
.action-menu:focus-within .action-menu-trigger {
  background: var(--accent-soft);
  border-color: #f0b48a;
  color: var(--accent);
}
.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 148px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 30;
  text-align: left;
}
.action-menu:hover .action-menu-panel,
.action-menu:focus-within .action-menu-panel,
.action-menu.is-open .action-menu-panel {
  display: grid;
  gap: 2px;
}
.action-menu-panel a,
.action-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}
.action-menu-panel a:hover,
.action-menu-panel button:hover {
  background: var(--accent-wash);
  color: var(--accent);
  text-decoration: none;
}
.action-menu-panel .action-menu-danger {
  color: var(--danger);
}
.action-menu-panel .action-menu-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.action-menu-panel form { margin: 0; }

.quick-edit-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow);
  background: #fff;
  color: var(--ink);
}
.quick-edit-dialog::backdrop {
  background: rgba(18, 32, 42, 0.35);
}
.quick-edit-dialog form {
  padding: 18px 18px 16px;
}
.quick-edit-dialog h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 650;
}
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 8px;
  background: #e8eef3; font-size: 0.76rem; font-weight: 750;
  letter-spacing: 0.01em;
}

.list { display: grid; gap: 8px; }
.list-row {
  display: grid; gap: 2px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  color: inherit; text-decoration: none; background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.list-row:hover { border-color: #9fc9c3; text-decoration: none; box-shadow: var(--shadow-soft); }
.list-row span { color: var(--muted); font-size: 0.86rem; }
.list-row.static:hover { border-color: var(--line); box-shadow: none; }

.empty { color: var(--muted); padding: 14px 0; }
.flash {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 650;
  border: 1px solid transparent;
}
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(243, 141, 48, 0.22), transparent 55%),
    radial-gradient(700px 380px at 90% 100%, rgba(204, 83, 35, 0.14), transparent 50%),
    #0b0b0b;
}
.login-card {
  width: min(420px, 100%);
  padding: 28px !important;
}
.login-card h1 { font-size: 1.85rem; }
.login-brand {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.login-brand img {
  width: min(280px, 100%);
  height: auto;
  display: block;
  border-radius: 12px;
}

.year-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 750;
}
.chip em {
  font-style: normal;
  padding: 0 6px;
  border-radius: 8px;
  background: #e8eef3;
  color: var(--ink);
  font-size: 0.78rem;
}
.chip.active em {
  background: #fff;
  color: var(--accent);
}
.muted.tiny { font-size: 0.82rem; }
.team-stats .team-stat {
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease;
}
.team-stats .team-stat:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.data-table.dense th,
.data-table.dense td {
  padding: 8px 10px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.data-table.dense td:nth-child(4),
.data-table.dense td:nth-child(9),
.data-table.dense td:nth-child(11),
.full-sales td:nth-child(11) {
  white-space: normal;
  min-width: 120px;
}
.table-wrap.full {
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.full-sales {
  min-width: 1100px;
}
.sheet-sales {
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}
.sheet-sales th,
.sheet-sales td {
  vertical-align: top;
  border-right: 1px solid var(--line);
}
.sheet-sales th.person-col {
  min-width: 160px;
  text-align: left;
  background: #f3f8f8;
}
.sheet-sales .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  border-right: 2px solid var(--line);
}
.sheet-sales thead .sticky-col,
.sheet-sales tfoot .sticky-col {
  background: #f8fbfb;
  z-index: 2;
}
.sheet-sales td.sheet-cell {
  white-space: normal;
  min-width: 150px;
  max-width: 220px;
}
.sheet-sales td.has-orders {
  background: #f7fcfb;
}
.sheet-orders {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet-order {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  line-height: 1.25;
  padding: 2px 0;
}
.sheet-order:hover {
  color: var(--accent);
  text-decoration: none;
}
.sheet-user {
  font-weight: 650;
  font-size: 0.84rem;
}
.sheet-amt {
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.sheet-coupon {
  color: #0a7a5a;
  font-size: 0.72rem;
  font-weight: 700;
}
.sheet-tip {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sheet-cell-total {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  font-weight: 650;
}
.cell-sub {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
}
.data-table tfoot td {
  background: #f8fbfb;
  font-weight: 600;
  border-bottom: 0;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.box-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfb);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-height: 120px;
}
.box-top { display: flex; justify-content: space-between; gap: 8px; }
.box-line { font-size: 0.95rem; }
.box-meta { color: var(--muted); font-size: 0.86rem; margin-top: auto; }
.box-actions { display: flex; gap: 8px; }

@media (max-width: 720px) {
  .shell { padding: 16px; }
  .data-table:not(.full-sales):not(.dense) th:nth-child(n+5),
  .data-table:not(.full-sales):not(.dense) td:nth-child(n+5) { display: none; }
  .data-table:not(.full-sales):not(.dense) th:last-child,
  .data-table:not(.full-sales):not(.dense) td:last-child { display: table-cell; }
}


/* Hosting renewals UI */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 750;
  background: #eef2f6;
  color: var(--ink);
}
.badge.due { background: var(--warn-soft); color: var(--warn); }
.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.task { background: var(--accent-soft); color: var(--accent); }

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  font-weight: 650;
}
.flash.error { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
.flash.success { background: var(--ok-soft); border-color: #bbf7d0; color: var(--ok); }
.flash.info { background: #eff6ff; border-color: #bfdbfe; }

/* Toast save / status notices (replaces full-width flash banners in app) */
.toast-host {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  animation: toast-in 0.22s ease;
}
.toast-success { background: #0f766e; }
.toast-error { background: #b42318; }
.toast-info { background: #1e3a5f; }
.toast-msg { flex: 1 1 auto; min-width: 0; }
.toast-dismiss {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}
.toast-dismiss:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.toast.is-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
body.theme-crm .toast-host { top: 64px; }

form.stack {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: none;
}
form.stack.compact {
  gap: 10px;
  margin-top: 12px;
}
form.stack.compact label {
  color: var(--ink);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.tab span { margin-right: 2px; }
.tab em {
  font-style: normal;
  min-width: 22px;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8eef3;
  color: var(--ink);
  font-size: 0.8rem;
}
.tab:hover {
  text-decoration: none;
  color: var(--ink);
  border-color: #b7c7d4;
}
.tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.tab.active em {
  background: #fff;
  color: var(--accent);
}
.renew-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8f3;
}
.followup-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.followup-message {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: #faf7f4;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.month-box {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbfb);
  color: inherit;
  text-decoration: none;
  min-height: 96px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.month-box:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #b7c7d4;
  box-shadow: 0 8px 18px rgba(21, 32, 43, 0.06);
}
.month-box.is-current {
  border-color: #99d5cf;
}
.month-box.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.18);
}
.month-box.is-empty .month-count {
  color: #9aa8b5;
}
.month-name {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.month-count {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 650;
  line-height: 1.1;
}
.month-sub {
  color: var(--muted);
  font-size: 0.8rem;
}
@media (max-width: 900px) {
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-height: 92px;
}
.metric-card.metric-warn {
  grid-column: span 1;
}
.metric-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}
.metric-hint {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  cursor: help;
}
.metric-value {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.02em;
}
.filter-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.filter-pill em {
  font-style: normal;
  min-width: 1.4em;
  text-align: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8eef3;
  font-size: 0.78rem;
}
.filter-pill:hover {
  text-decoration: none;
  border-color: #b7c7d4;
}
.filter-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.filter-pill.active em {
  background: #fff;
  color: var(--accent);
}
.month-split {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}
.dot-ok::before,
.dot-bad::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-ok { color: var(--ok); }
.dot-ok::before { background: var(--ok); }
.dot-bad { color: var(--danger); }
.dot-bad::before { background: var(--danger); }
.month-grid-mgmt {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
@media (max-width: 1000px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-grid-mgmt { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .month-grid-mgmt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.package-card {
  position: relative;
  cursor: pointer;
  margin: 0;
}
.package-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.package-card-body {
  display: grid;
  gap: 4px;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.package-card-body strong {
  font-size: 0.98rem;
}
.package-card-body span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}
.package-card-body em {
  margin-top: auto;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}
.package-card input:checked + .package-card-body {
  border-color: var(--accent);
}

.box-sub {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}
.copy-block {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.copy-block .copy-text {
  width: 100%;
  min-height: 88px;
  font-size: 0.86rem;
  line-height: 1.4;
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}
.decline-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.decline-block > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
}
.decline-block[open] > summary {
  color: var(--danger);
  margin-bottom: 8px;
}
.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
}
.check-row input {
  width: auto;
  margin-top: 3px;
}
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  margin: 4px 0 8px;
}
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
}
.search-bar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
}
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 4px;
  background: #eef3f5;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
}
.section-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}
.section-tabs a:hover {
  color: var(--ink);
  background: var(--accent-wash);
  text-decoration: none;
}
.section-tabs a.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(21, 32, 43, 0.08);
}
.row-cancelled td {
  opacity: 0.72;
}
.row-cancelled .badge,
.badge-cancelled {
  background: #fee2e2;
  color: var(--danger);
}
.row-pipeline td {
  background: rgba(245, 158, 11, 0.04);
}
.badge-pipeline {
  background: #fff7ed;
  color: #c2410c;
}
.badge-completed {
  background: #ecfdf5;
  color: #047857;
}
.sale-amount-cancelled {
  text-decoration: line-through;
  opacity: 0.75;
}
.sale-amount-pipeline {
  font-style: italic;
}

.domain-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.domain-stats-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.domain-stats-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  .domain-stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .domain-stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .domain-stats,
  .domain-stats-5,
  .domain-stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.domain-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.domain-stat strong {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.domain-stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.domain-stat.is-free { border-color: #bbf7d0; background: #f0fdf4; }
.domain-stat.is-used { border-color: #a5f3fc; background: #ecfeff; }
.domain-stat.is-missing { border-color: #fecaca; background: #fef2f2; }
.domain-stat.is-linked { border-color: #c4b5fd; background: #f5f3ff; }
.domain-stat.is-unlinked { border-color: #fde68a; background: #fffbeb; }
.domain-table .domain-link { font-weight: 700; color: var(--accent, #9a3412); text-decoration: none; }
.domain-table .domain-link:hover { text-decoration: underline; }
.domain-table .is-free-row td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.domain-table .is-used-row td:first-child { box-shadow: inset 3px 0 0 #0891b2; }
.domain-table .is-missing-row { opacity: 0.75; }
.domain-table .is-cancelled-row { opacity: 0.72; }
.domain-edit-row td {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.domain-edit-form { max-width: 920px; }
.inline-form { display: inline; }

/* Registrar / billing domain tables */
.panel-flush { padding-top: 8px; }
.provider-domains-table,
.provider-plans-table {
  table-layout: fixed;
  width: 100%;
}
.provider-domains-table th,
.provider-domains-table td,
.provider-plans-table th,
.provider-plans-table td {
  padding: 8px 10px;
  vertical-align: middle;
}
.provider-domains-table th:nth-child(1),
.provider-domains-table td:nth-child(1) { width: 26%; }
.provider-domains-table th:nth-child(2),
.provider-domains-table td:nth-child(2) { width: 28%; }
.provider-domains-table th:nth-child(3),
.provider-domains-table td:nth-child(3) { width: 12%; }
.provider-domains-table th:nth-child(4),
.provider-domains-table td:nth-child(4) { width: 12%; }
.provider-domains-table th:nth-child(5),
.provider-domains-table td:nth-child(5) { width: 10%; }
.provider-domains-table th:nth-child(6),
.provider-domains-table td:nth-child(6) { width: 12%; }
.provider-plans-table th:nth-child(1),
.provider-plans-table td:nth-child(1) { width: 26%; }
.provider-plans-table th:nth-child(2),
.provider-plans-table td:nth-child(2) { width: 14%; }
.provider-plans-table th:nth-child(3),
.provider-plans-table td:nth-child(3),
.provider-plans-table th:nth-child(4),
.provider-plans-table td:nth-child(4) { width: 10%; }
.provider-plans-table th:nth-child(5),
.provider-plans-table td:nth-child(5),
.provider-plans-table th:nth-child(6),
.provider-plans-table td:nth-child(6),
.provider-plans-table th:nth-child(7),
.provider-plans-table td:nth-child(7) { width: 10%; }
.provider-plans-table th:nth-child(8),
.provider-plans-table td:nth-child(8) { width: 10%; }
.domain-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.domain-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #78716c;
  background: #f5f5f4;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  padding: 1px 7px;
}
.domain-client-link {
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
}
.domain-client-link:hover { color: var(--accent, #9a3412); text-decoration: underline; }
.domain-link-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.domain-link-form select {
  max-width: 180px;
  min-width: 120px;
  font-size: 0.82rem;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
@media (max-width: 900px) {
  .provider-domains-table th:nth-child(4),
  .provider-domains-table td:nth-child(4),
  .provider-domains-table th:nth-child(5),
  .provider-domains-table td:nth-child(5),
  .provider-plans-table th:nth-child(4),
  .provider-plans-table td:nth-child(4),
  .provider-plans-table th:nth-child(6),
  .provider-plans-table td:nth-child(6) {
    display: none;
  }
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.pkg-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pkg-type-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eef3;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}
.danger-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* Sales: Existing / New client modes */
.client-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eef3f5;
  border-radius: 12px;
  margin: 0 0 12px;
}
.client-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}
.client-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.client-mode-option:has(input:checked) {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(21, 32, 43, 0.08);
}
.client-mode-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-wash);
}
.client-mode-panel[hidden] {
  display: none !important;
}
.client-source-hint {
  margin: 0;
}

/* Project board */
.kanban {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
/* SEO person board: ~2 columns wide so cards stay readable */
.kanban.kanban-people {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow-x: visible;
  gap: 16px;
}
.kanban-people .kanban-col {
  min-height: 280px;
}
.kanban-people .kanban-card {
  padding: 14px 16px;
  gap: 8px;
}
.kanban-people .kanban-card-title {
  font-size: 1.05rem;
  word-break: break-word;
}
.kanban-people .kanban-move select {
  font-size: 0.9rem;
  padding: 6px 8px;
}
@media (max-width: 720px) {
  .kanban.kanban-people {
    grid-template-columns: 1fr;
  }
}
.kanban-col {
  background: var(--panel-soft, #f7f5f2);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
}
.kanban-col-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.kanban-card-title {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.kanban-card-title:hover { color: var(--accent); }
.kanban-card-meta,
.kanban-card-assignee {
  font-size: 0.82rem;
  color: var(--muted);
}
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kanban-move select {
  width: 100%;
  font-size: 0.8rem;
  margin-top: 2px;
}
.kanban-add {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.kanban-add:hover {
  background: rgba(0,0,0,0.04);
  color: var(--ink, #1a1a1a);
}
.quick-add-order-wrap {
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #fff 0%, #f8fafc 100%);
}
.quick-add-order-board {
  margin-top: 12px;
}
.quick-add-order .form-grid label.span-2 {
  grid-column: 1 / -1;
}
@media (max-width: 720px) {
  .quick-add-order .form-grid label.span-2 {
    grid-column: auto;
  }
}
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.boards-dnd-hint {
  margin: 4px 0 0;
}
.boards-dnd-hint-ico {
  display: inline-block;
  letter-spacing: -1px;
  font-weight: 700;
  color: var(--ink);
}
.board-tile-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}
.board-tile-wrap.is-dragging {
  opacity: 0.55;
}
.board-tile-wrap.is-drag-over .board-tile {
  outline: 2px dashed var(--accent, #c45c26);
  outline-offset: 2px;
}
.board-drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  color: var(--muted);
  cursor: grab;
  font-size: 0.85rem;
  line-height: 1;
  letter-spacing: -2px;
}
.board-drag-handle:active { cursor: grabbing; }
.board-drag-handle:hover { color: var(--ink); background: #fff; }
.board-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 120px;
  padding: 16px 40px 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #fff 0%, var(--accent-wash, #fff7ed) 100%);
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.board-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.board-tile-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
}
.board-tile-desc {
  color: var(--muted);
  font-size: 0.88rem;
  flex: 1;
}
.board-tile-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.board-tile-new {
  background: #fff;
  border-style: dashed;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding-right: 18px;
  min-height: 120px;
}

/* Passwords / Login & Password — clean table, no cards */
.passwords-page.ws-page {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 18px 20px 22px;
}
.pw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
}
.pw-toolbar input[type="search"] {
  flex: 1 1 240px;
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 12px;
  font: inherit;
}
.pw-form {
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid #eef1f4;
}
.pw-form-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #111827;
}
.pw-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.pw-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}
.pw-form-grid input {
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  color: #111827;
  font-weight: 500;
}
.pw-span-2 { grid-column: 1 / -1; }
.pw-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}
.pw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.pw-table th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.pw-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #111827;
}
.pw-table tr:last-child td { border-bottom: 0; }
.pw-table tr.is-revealed td {
  background: #f8fafc;
}
.pw-secret-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.pw-reveal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 4px;
}
.pw-decrypt-error {
  color: #b42318;
  font-size: 12px;
  line-height: 1.35;
  max-width: 220px;
}
.pw-url-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-url-cell a {
  color: #1e3a5f;
  text-decoration: none;
}
.pw-url-cell a:hover { text-decoration: underline; }
.pw-actions-cell {
  white-space: nowrap;
}
.pw-actions-cell form {
  display: inline;
  margin: 0;
}
.pw-link {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 10px 0 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1e3a5f;
  cursor: pointer;
  text-decoration: none;
}
.pw-link:hover { text-decoration: underline; }
.pw-danger { color: #b42318 !important; }
@media (max-width: 800px) {
  .pw-form-grid { grid-template-columns: 1fr; }
  .pw-span-2 { grid-column: auto; }
}

/* Profile polish */
.profile-page .profile-photo-row {
  margin-bottom: 4px;
}
.profile-panels {
  display: grid;
  gap: 16px;
}
.board-member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.board-member-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.board-member-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.avatar-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent, #f38d30);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-chip.tiny {
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
}
.kanban-card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.trello-board-shell {
  margin-bottom: 10px;
  position: relative;
  z-index: 5;
}
.trello-board-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #0b0b0b;
  color: #f5f1eb;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 50;
  overflow: visible;
}
.trello-board-bar-left,
.trello-board-bar-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.trello-board-bar-left {
  flex: 1 1 auto;
  min-width: 0;
}
.trello-board-bar-right {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 2;
}
.trello-board-search {
  position: relative;
  display: block;
  width: 200px;
  max-width: 220px;
  margin: 0;
  min-width: 160px;
  align-self: center;
  z-index: 1;
}
.trello-board-search-field {
  position: relative;
  display: block;
}
.trello-board-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: #6b6560;
  font-size: 0.95rem;
  pointer-events: none;
  line-height: 1;
  width: 1em;
  text-align: center;
}
.trello-board-search input[type="search"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 34px 8px 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e8e6e3;
  color: #16120f;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  height: 36px;
  box-shadow: none;
}
.trello-board-search input[type="search"]::placeholder {
  color: #7a726b;
  font-weight: 600;
}
.trello-board-search input[type="search"]:focus {
  outline: none;
  border-color: #f38d30;
  box-shadow: 0 0 0 2px rgba(243, 141, 48, 0.35);
  background: #fff;
}
.trello-board-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  color: #5c554e;
  font-size: 1.1rem;
  line-height: 1;
  background: rgba(0, 0, 0, 0.08);
  font-family: inherit;
}
.trello-board-search-clear[hidden] {
  display: none !important;
}
.trello-board-search-clear:hover {
  color: #16120f;
  background: rgba(0, 0, 0, 0.14);
}
.trello-board-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(340px, 50vh);
  overflow: auto;
  background: #fff;
  border: 1px solid #ddd6cf;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(22, 18, 15, 0.16);
  padding: 6px;
  z-index: 80;
}
.trello-board-search-results[hidden] {
  display: none !important;
}
.trello-board-search-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.trello-board-search-item:hover,
.trello-board-search-item.is-active {
  background: #f4f1ec;
}
.trello-board-search-item-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #16120f;
}
.trello-board-search-item-meta {
  font-size: 0.78rem;
  color: #7a726b;
}
.trello-board-search-empty {
  padding: 12px 10px;
  color: #7a726b;
  font-size: 0.86rem;
}
.trello-bar-btn {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .trello-board-bar {
    flex-wrap: wrap;
  }
  .trello-board-bar-left,
  .trello-board-bar-right {
    width: 100%;
    flex-wrap: wrap;
  }
  .trello-board-bar-right {
    margin-left: 0;
  }
  .trello-board-search {
    width: 100%;
    max-width: none;
    min-width: 0;
    order: -1;
    flex: 1 1 100%;
  }
}
.trello-back {
  color: #b7b0a9;
  text-decoration: none;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}
.trello-back:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,0.08); }
.trello-board-rename {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  margin: 0;
  max-width: min(320px, 42vw);
}
.trello-board-name-input,
.trello-board-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 650;
  color: #fff;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 8px;
  width: 100%;
  min-width: 80px;
  line-height: 1.2;
  box-shadow: none;
}
.trello-board-name-input:hover {
  background: rgba(255, 255, 255, 0.08);
}
.trello-board-name-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(243, 141, 48, 0.7);
  box-shadow: 0 0 0 2px rgba(243, 141, 48, 0.25);
}
.trello-member-stack {
  display: flex;
  align-items: center;
}
.trello-member-stack .avatar-chip {
  margin-left: -6px;
  border: 2px solid #0b0b0b;
}
.trello-member-stack .avatar-chip:first-child { margin-left: 0; }
.trello-share-dropdown {
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
}
.trello-share-dropdown[open] {
  z-index: 70;
}
.trello-share-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.trello-share-dropdown > summary::-webkit-details-marker {
  display: none;
}
.trello-share-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 8px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
}
.trello-share-trigger:hover,
.trello-share-dropdown[open] > .trello-share-trigger {
  background: rgba(255, 255, 255, 0.2);
}
.trello-share-avatars {
  display: inline-flex;
  align-items: center;
}
.trello-share-avatars .avatar-chip {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
  border-color: #0b0b0b;
}
.trello-share-label {
  letter-spacing: 0.01em;
}
.trello-share-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(380px, 92vw);
  max-height: min(70vh, 560px);
  overflow: auto;
  background: #fff;
  color: #172b4d;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18), 0 0 1px rgba(9, 30, 66, 0.3);
  z-index: 80;
}
.trello-share-panel-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #ebecf0;
}
.trello-share-panel-head strong {
  display: block;
  font-size: 0.95rem;
  color: #172b4d;
}
.trello-share-panel-head .muted {
  margin: 4px 0 0;
}
.trello-share-section {
  padding: 12px 16px;
  border-bottom: 1px solid #ebecf0;
}
.trello-share-section:last-child {
  border-bottom: 0;
}
.trello-share-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #44546f;
  margin-bottom: 8px;
}
.trello-share-search-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #44546f;
  margin-bottom: 6px;
}
.trello-share-search {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 2px solid #091e4224;
  border-radius: 8px;
  font: inherit;
  margin-bottom: 8px;
}
.trello-share-search:focus {
  outline: none;
  border-color: #0c66e4;
}
.trello-share-people {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 200px;
  overflow: auto;
}
.trello-share-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border-radius: 8px;
}
.trello-share-person:hover {
  background: #091e420a;
}
.trello-share-person-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.trello-share-person-meta strong {
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trello-share-add-form {
  margin: 0;
}
.trello-share-add-btn,
.trello-share-remove-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
}
.trello-share-empty,
.trello-share-hint {
  margin: 6px 0 0;
}
.trello-share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.trello-share-link-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 2px solid #091e4224;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  color: #44546f;
  background: #f7f8f9;
}
.trello-share-copied {
  margin: 8px 0 0;
  color: #216e4e;
  font-weight: 650;
}
/* legacy members dropdown aliases (keep harmless) */
.trello-members-dropdown {
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
}
.trello-members-dropdown[open] {
  z-index: 70;
}
.trello-members-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.trello-members-dropdown > summary::-webkit-details-marker {
  display: none;
}
.trello-members-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 10px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
}
.trello-members-trigger:hover,
.trello-members-dropdown[open] > .trello-members-trigger {
  background: rgba(255, 255, 255, 0.2);
}
.trello-members-ico {
  display: none;
}
.trello-members-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.trello-members-caret {
  opacity: 0.8;
  font-size: 0.7rem;
}
.trello-members-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(280px, 86vw);
  background: #fff;
  color: #172b4d;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18), 0 0 1px rgba(9, 30, 66, 0.3);
  z-index: 80;
  overflow: hidden;
}
.trello-members-panel-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid #ebecf0;
}
.trello-members-panel-head strong {
  font-size: 0.88rem;
  color: #44546f;
}
.trello-members-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow: auto;
}
.trello-members-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
}
.trello-members-item .avatar-chip {
  grid-row: 1 / span 2;
}
.trello-members-name {
  font-weight: 650;
  font-size: 0.9rem;
  color: #172b4d;
}
.trello-members-item .muted {
  grid-column: 2;
}
.trello-members-empty {
  margin: 10px 14px;
}
.trello-members-panel-foot {
  border-top: 1px solid #ebecf0;
  padding: 8px;
}
.trello-members-panel-foot a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 0.88rem;
  color: #0c66e4;
  text-decoration: none;
}
.trello-members-panel-foot a:hover {
  background: #091e420f;
  text-decoration: none;
}
.trello-board-menu { position: relative; z-index: 3; }
.trello-board-menu[open] { z-index: 70; }
.trello-board-menu > summary {
  list-style: none;
  cursor: pointer;
}
.trello-board-menu > summary::-webkit-details-marker { display: none; }
.trello-board-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 80;
  display: grid;
}
.trello-board-menu-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
}
.trello-board-menu-panel a:hover {
  background: var(--accent-wash);
  color: var(--accent);
  text-decoration: none;
}
.trello-inline-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.trello-board-canvas {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 16px;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  isolation: isolate;
}
body.is-project-board .trello-board-canvas,
.shell:has(.trello-board-canvas) .trello-board-canvas {
  min-height: calc(100vh - 200px);
}
.trello-lists {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 420px;
  width: max-content;
  max-width: none;
  position: relative;
  z-index: 1;
}
.trello-list {
  width: 272px;
  flex: 0 0 272px;
  flex-shrink: 0;
  background: #e9ebef;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  position: relative;
  z-index: 1;
  transform: translateZ(0);
}
.trello-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 10px 8px;
  position: relative;
}
.trello-list-head .trello-list-count {
  margin-left: auto;
}
.trello-list-menu {
  position: relative;
  flex: 0 0 auto;
}
.trello-list-menu > summary {
  list-style: none;
}
.trello-list-menu > summary::-webkit-details-marker {
  display: none;
}
.trello-list-menu-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #44546f;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
}
.trello-list-menu-btn:hover,
.trello-list-menu[open] > .trello-list-menu-btn {
  background: rgba(255, 255, 255, 0.85);
  color: #172b4d;
}
.trello-list-menu[open] {
  z-index: 45;
}
.trello-list-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 304px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18), 0 0 1px rgba(9, 30, 66, 0.3);
  z-index: 50;
  padding: 0 0 8px;
  overflow: visible;
}
.trello-list-menu-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid #ebecf0;
  margin-bottom: 6px;
  position: relative;
}
.trello-list-menu-head strong {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #44546f;
  grid-column: 1 / -1;
  pointer-events: none;
}
.trello-list-menu-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #44546f;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.trello-list-menu-close:hover {
  background: #091e420f;
}
.trello-list-menu-item {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #172b4d;
  cursor: pointer;
  text-decoration: none;
}
.trello-list-menu-item:hover {
  background: #091e420f;
}
.trello-list-menu-item.is-danger {
  color: #ae2a19;
}
.trello-list-menu-item.is-danger:hover {
  background: #fef2f1;
}
.trello-list-menu-item.is-sub {
  list-style: none;
}
.trello-list-menu-item.is-sub::-webkit-details-marker {
  display: none;
}
.trello-list-menu-form {
  margin: 0;
}
.trello-list-menu-sep {
  height: 1px;
  background: #ebecf0;
  margin: 8px 0;
}
.trello-list-menu-sub {
  margin: 0;
}
.trello-list-menu-subpanel {
  padding: 0 0 4px;
}
.trello-list-menu-hint {
  margin: 4px 20px 8px;
}
.trello-list-move-board-form {
  padding: 4px 8px 8px;
}
.trello-list-move-board-label {
  display: grid;
  gap: 6px;
  margin: 4px 8px 8px;
  font-size: 0.78rem;
  font-weight: 650;
  color: #44546f;
}
.trello-list-move-board-label select {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: #172b4d;
}
.trello-list-menu-item.is-primary {
  background: #0c66e4;
  color: #fff;
  font-weight: 650;
  text-align: center;
  margin-top: 2px;
}
.trello-list-menu-item.is-primary:hover {
  background: #0055cc;
  color: #fff;
}
.trello-list-drag-handle {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b778c;
  cursor: grab;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: -2px;
  padding: 0;
}
.trello-list-drag-handle:hover {
  color: #172b4d;
  background: rgba(255,255,255,0.7);
}
.trello-list-drag-handle:active {
  cursor: grabbing;
}
.trello-list.is-list-dragging {
  opacity: 0.55;
}
.trello-list.is-list-drag-over {
  outline: 2px dashed #0c66e4;
  outline-offset: 2px;
}
.trello-list-head strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #172b4d;
  letter-spacing: -0.01em;
}
.trello-list-rename {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.trello-list-name-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: #172b4d;
  padding: 2px 6px;
  border-radius: 6px;
  margin: 0;
  letter-spacing: -0.01em;
}
.trello-list-name-input:hover {
  background: rgba(255,255,255,0.55);
  border-color: rgba(9,30,66,0.08);
}
.trello-list-name-input:focus {
  outline: none;
  background: #fff;
  border-color: #0c66e4;
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.18);
}
.trello-list-head em {
  font-style: normal;
  color: #6b778c;
  font-weight: 650;
  font-size: 0.8rem;
}
.trello-list-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 24px;
  padding: 0 2px 6px;
  isolation: isolate;
}
.trello-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 10px 8px;
  box-shadow: 0 1px 1px rgba(9, 30, 66, 0.13);
  display: grid;
  gap: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 0;
  isolation: isolate;
  contain: layout style;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.trello-card:hover {
  border-color: rgba(9, 30, 66, 0.08);
  box-shadow: 0 1px 1px rgba(9, 30, 66, 0.16), 0 0 0 1px rgba(9, 30, 66, 0.04);
}
.trello-card.has-cover {
  padding-top: 0;
}
.trello-card-cover {
  display: block;
  width: calc(100% + 24px);
  margin: 0 -12px 6px;
  height: 132px;
  max-height: 132px;
  background: #ebecf0;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
  position: relative;
  z-index: 0;
}
.trello-card-cover img {
  width: 100%;
  height: 132px;
  max-height: 132px;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #fff;
  pointer-events: none;
}
.trello-card:active { cursor: grabbing; }
.trello-card.is-dragging {
  opacity: 0.45;
  transform: rotate(2deg);
}
.trello-card.is-saving { opacity: 0.7; }
.trello-list.is-drag-over {
  background: #dfe3e9;
  outline: 2px dashed rgba(0, 82, 204, 0.35);
}
.trello-list-cards {
  min-height: 48px;
}
.trello-card-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.trello-card-top .trello-card-title { flex: 1; }
.trello-card-menu {
  position: relative;
  flex: 0 0 auto;
}
.trello-card-menu > summary {
  list-style: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #6b778c;
  font-weight: 800;
  line-height: 1;
}
.trello-card-menu > summary::-webkit-details-marker { display: none; }
.trello-card-menu > summary:hover {
  background: rgba(9, 30, 66, 0.08);
  color: var(--ink);
}
.trello-card-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: 260px;
  max-width: min(260px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18), 0 0 1px rgba(9, 30, 66, 0.2);
  padding: 10px;
  z-index: 80;
  display: grid;
  gap: 10px;
}
.trello-card-menu[open] {
  z-index: 90;
}
.trello-card:has(.trello-card-menu[open]) {
  overflow: visible;
  z-index: 60;
  contain: none;
  isolation: auto;
}
.trello-list:has(.trello-card-menu[open]) {
  z-index: 50;
  overflow: visible;
}
.trello-list-cards:has(.trello-card-menu[open]) {
  overflow: visible;
}
.trello-card-menu-panel.is-fixed {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 4000;
}
.trello-card-menu-panel label {
  display: grid;
  gap: 4px;
}
.trello-card-menu-panel select {
  width: 100%;
  font: inherit;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.trello-move-card {
  display: grid;
  gap: 8px;
}
.first-draft-move {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: grid;
  gap: 8px;
}
.trello-move-heading {
  margin: 0;
  font-weight: 700;
  color: #172b4d;
}
.trello-move-lists-label {
  margin: 2px 0 0;
}
.trello-move-lists {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}
.trello-move-list-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: #f4f5f7;
  color: #172b4d;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}
.trello-move-list-btn:hover {
  background: #e9ebef;
}
.trello-move-list-btn.is-current {
  background: linear-gradient(90deg, rgba(240, 80, 0, 0.12), rgba(30, 58, 95, 0.08));
  box-shadow: inset 3px 0 0 #f05000;
}
.trello-card.is-overdue { box-shadow: inset 3px 0 0 #b42318; }
.trello-card.is-due-today { box-shadow: inset 3px 0 0 #a85a08; }
.trello-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 2px;
}
.trello-card-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 8px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--label-color, #dfe1e6);
  color: #172b4d;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trello-card-title {
  font-family: var(--font);
  font-weight: 650;
  font-size: 0.92rem;
  color: #172b4d;
  text-decoration: none;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.trello-card-title:hover { color: #172b4d; }
.trello-card-meta {
  font-size: 0.78rem;
  color: #6b778c;
  line-height: 1.3;
}
.trello-card-progress {
  height: 4px;
  border-radius: 999px;
  background: #ebecf0;
  overflow: hidden;
  margin: 2px 0 0;
}
.trello-card-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  min-width: 0;
}
.trello-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.trello-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f1f2f4;
  color: #44546f;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
}
.trello-card-badge.is-icon {
  background: transparent;
  color: #6b778c;
  padding: 0 2px;
  font-size: 0.78rem;
}
.trello-card-badge.is-warn,
.trello-card-badge.due-overdue,
.trello-card-badge.delivery-late,
.trello-card-badge.delivery-delivered-late {
  background: #ffecec;
  color: #ae2a19;
}
.trello-card-badge.due-today,
.trello-card-badge.delivery-today {
  background: #fff7e6;
  color: #974f0c;
}
.trello-card-badge.delivery-ontrack,
.trello-card-badge.delivery-delivered-ontime,
.trello-card-badge.delivery-delivered-early {
  background: #e7f8ef;
  color: #216e4e;
}
.trello-card-badges .avatar-chip.tiny {
  margin-left: auto;
}
.card-modal-progress {
  margin: 4px 0 0;
  height: 8px;
}
.progress-badge {
  background: #eef3f5;
  color: #334;
  font-variant-numeric: tabular-nums;
}
.delivery-badge.delivery-ontrack {
  background: #e8f5ee;
  color: #1b6b3a;
}
.delivery-badge.delivery-today {
  background: #fff3df;
  color: #8a5a00;
}
.delivery-badge.delivery-late,
.delivery-badge.delivery-delivered-late {
  background: #fde8e6;
  color: #9b1c1c;
}
.delivery-badge.delivery-delivered-ontime {
  background: #e7f2fb;
  color: #1a5f8a;
}
.delivery-badge.delivery-delivered-early {
  background: #e7f8ef;
  color: #216e4e;
}
.card-delivery-section {
  margin-top: 12px;
}
.card-delivery-plan {
  display: grid;
  gap: 8px;
}
.card-delivery-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.card-delivery-dates label {
  display: grid;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}
.card-delivery-dates input[type="date"] {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
}
.card-delivery-delay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--danger-soft, #fef3f2);
  border: 1px solid color-mix(in srgb, var(--danger, #b42318) 18%, transparent);
}
.card-delivery-delay[hidden] {
  display: none !important;
}
.card-delivery-delay label {
  display: grid;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}
.card-delivery-delay select,
.card-delivery-delay input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
}
.card-delivery-delay > p {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .card-delivery-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .card-delivery-dates {
    grid-template-columns: 1fr;
  }
  .card-delivery-delay {
    grid-template-columns: 1fr;
  }
}
.card-delivery-milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.card-delivery-plan label.card-delivery-check,
.card-delivery-milestones label.card-delivery-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  width: auto !important;
  max-width: none;
  grid-template-columns: none !important;
}
.card-delivery-plan label.card-delivery-check > input[type="checkbox"],
.card-delivery-milestones label.card-delivery-check > input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 15px;
  height: 15px;
  margin: 0 !important;
  padding: 0;
  flex: 0 0 15px;
  align-self: center;
  position: static;
  float: none;
}
.card-delivery-plan label.card-delivery-check > span,
.card-delivery-milestones label.card-delivery-check > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  white-space: nowrap;
  margin: 0;
}
.card-delivery-plan label.card-delivery-check:has(input:checked),
.card-delivery-milestones label.card-delivery-check:has(input:checked) {
  border-color: var(--accent);
  background: #fff7f0;
}
.card-delivery-check em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 550;
}
.card-delivery-planned {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.card-delivery-planned input {
  width: 52px;
  padding: 5px 6px;
  margin: 0;
}
.card-revision-start-form {
  margin: 0 0 10px;
}
.card-delivery-progress-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfcfc;
}
.card-delivery-progress-box .card-modal-progress {
  margin: 0 0 6px;
}
.card-delivery-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.card-delivery-summary {
  margin: 0;
}
.card-delivery-plan .actions {
  margin: 0;
}
.trello-add-card,
.trello-add-list {
  margin-top: 6px;
}
.trello-add-card > summary,
.trello-add-list > summary,
.trello-add-card-link,
.trello-add-list-link {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  color: #5e6c84;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
  text-decoration: none;
}
.trello-add-card > summary::-webkit-details-marker,
.trello-add-list > summary::-webkit-details-marker { display: none; }
.trello-add-card > summary:hover,
.trello-add-list > summary:hover,
.trello-add-card-link:hover,
.trello-add-list-link:hover {
  background: rgba(9, 30, 66, 0.08);
  color: var(--ink);
  text-decoration: none;
}
.trello-add-card-form,
.trello-add-list-form {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.trello-add-card-form textarea,
.trello-add-list-form input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  font: inherit;
}
.trello-list-add {
  background: rgba(255,255,255,0.45);
  border: 1px dashed rgba(0,0,0,0.12);
}
.trello-filters-panel {
  margin-bottom: 10px;
  padding: 12px 14px;
}
.activity-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.activity-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.board-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 4px;
}
.board-filters label {
  display: grid;
  gap: 4px;
}
@media (max-width: 900px) {
  .board-filters { grid-template-columns: 1fr 1fr; }
}
.label-pick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.label-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}
.label-pick input { width: auto; margin: 0; }
.label-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  color: #fff;
  background: var(--label-color, #d35400);
}
.label-chip.tiny { font-size: 0.72rem; padding: 2px 7px; }
.kanban-card.is-overdue {
  border-color: #fca5a5;
  box-shadow: inset 3px 0 0 #b42318;
}
.kanban-card.is-due-today {
  border-color: #fcd34d;
  box-shadow: inset 3px 0 0 #a85a08;
}
.due-badge.due-overdue { background: var(--danger-soft); color: var(--danger); }
.due-badge.due-today { background: var(--warn-soft); color: var(--warn); }
.due-badge.due-soon { background: #fff7ed; color: #c2410c; }
.due-badge.due-later { background: #e8eef3; color: var(--ink); }
.due-overdue { color: var(--danger); font-weight: 700; }
.due-today { color: var(--warn); font-weight: 700; }
.kanban-due input[type="date"] {
  font-size: 0.78rem;
  padding: 4px 6px;
}
.ceo-brief-body {
  white-space: normal;
  line-height: 1.55;
  font-size: 0.98rem;
  padding: 4px 2px 8px;
  color: var(--ink);
}
.today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.kanban-card-links {
  margin-top: 4px;
}
.kanban-people .kanban-col-head strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.inline-status label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.inline-status select {
  min-width: 160px;
}
@media (max-width: 960px) {
  .kanban { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .today-grid { grid-template-columns: 1fr; }
}





/* —— Trello-style card modal —— */
body.card-modal-open { overflow: hidden !important; }
#card-modal-root.card-modal-root,
.card-modal-root {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
#card-modal-root.card-modal-root.is-open,
.card-modal-root.is-open {
  display: block !important;
}
.card-modal-root[hidden] {
  display: none !important;
}
.card-modal-backdrop {
  position: absolute !important;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
}
.card-modal-scroll {
  position: absolute !important;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: auto;
  padding: 48px 16px 64px;
  -webkit-overflow-scrolling: touch;
}
.card-modal-mount {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  pointer-events: none;
}
.card-modal-mount > * {
  pointer-events: auto;
}
.card-modal-loading {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.card-modal-dialog {
  position: relative;
  background: #f7f8f9;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  padding: 16px 20px 24px;
}
.card-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #6b778c;
  cursor: pointer;
  box-shadow: none;
}
.card-modal-close:hover { background: rgba(9,30,66,0.08); color: #172b4d; }
.card-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 40px 4px 0;
}
.card-modal-close-btn {
  display: none;
}
.card-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
  gap: 20px 28px;
  align-items: start;
}
.card-modal-list-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #6b778c;
  margin: 0;
  letter-spacing: 0;
}
.card-modal-list-pill strong {
  font-weight: 700;
  color: #44546f;
}
.card-modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card-modal-title-input {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  color: #172b4d;
  padding: 2px 4px;
  border-radius: 8px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.card-modal-title-row .card-modal-title-input {
  flex: 1;
  min-width: 0;
}
.card-modal-title-row .btn,
.card-modal-save-name {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.card-modal-title-form:focus-within .card-modal-save-name,
.card-modal-title-row:focus-within .btn {
  opacity: 1;
  pointer-events: auto;
}
.card-modal-save-name {
  flex: 0 0 auto;
  margin-top: 4px;
}
.card-modal-delete-form {
  display: inline;
  margin: 0;
}
.card-modal-delete-btn,
.trello-delete-card-btn {
  color: #b42318 !important;
  border-color: #f0c2c0 !important;
}
.card-attach-head {
  align-items: center;
}
.card-attach-form-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.card-attach-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.card-attach-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 6px 4px 6px 0;
  border-radius: 8px;
}
.card-attach-row:hover {
  background: #f7f8fa;
}
.card-attach-preview {
  width: 72px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f4;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.card-attach-preview.is-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-attach-preview.is-file {
  background: #e8edf2;
}
.card-attach-ext {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #5b6b7c;
}
.card-attach-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.card-attach-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-attach-title:hover {
  text-decoration: underline;
}
.card-attach-added {
  font-size: 0.78rem;
  color: var(--muted);
}
.card-attach-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.85;
}
.card-attach-row:hover .card-attach-row-actions {
  opacity: 1;
}
.card-attach-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #445566;
  cursor: pointer;
  text-decoration: none;
  list-style: none;
}
.card-attach-icon-btn::-webkit-details-marker {
  display: none;
}
.card-attach-icon-btn:hover {
  background: #e8ecef;
  color: var(--ink);
}
.card-attach-more {
  position: relative;
}
.card-attach-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 5;
}
.card-attach-more-menu form {
  margin: 0;
}
.card-attach-more-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}
.card-attach-more-item:hover {
  background: #f2f4f6;
}
.card-attach-more-item.is-danger {
  color: #b42318;
}
.card-attach-more-item.is-danger:hover {
  background: #fef3f2;
}
.card-attach-show-all {
  margin-top: 8px;
  width: 100%;
  border: none;
  background: #f1f2f4;
  color: #172b4d;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.card-attach-show-all:hover {
  background: #e6e8eb;
}
.card-attach-drop {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  padding: 18px 14px;
  border: 1.5px dashed #c5d0d8;
  border-radius: 12px;
  background: #fbfcfd;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card-attach-drop:hover,
.card-attach-drop.is-dragover {
  border-color: #3d8bfd;
  background: #f0f7ff;
}
.card-attach-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.card-attach-drop-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}
.card-attach-actions {
  align-items: center;
}
.card-attach-del-btn {
  color: #b42318 !important;
  border-color: #f0c2c0 !important;
}
.card-attach-del-btn:hover {
  background: #fef3f2 !important;
}
.card-modal-title-input:hover,
.card-modal-title-input:focus {
  background: #fff;
  outline: 2px solid var(--accent);
}
.card-modal-sub { margin: 2px 0 14px; font-size: 0.88rem; color: #6b778c; }
.card-modal-sub-sep { margin: 0 2px; opacity: 0.7; }
.card-modal-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 16px;
  position: relative;
}
.card-modal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #eaecf0;
  color: #172b4d;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
}
.card-modal-action-btn:hover {
  background: #dcdfe4;
  color: #172b4d;
  text-decoration: none;
}
.card-modal-action-btn.is-add {
  background: #0c66e4;
  color: #fff;
}
.card-modal-action-btn.is-add:hover {
  background: #0055cc;
  color: #fff;
}
.card-modal-action-btn.is-more {
  min-width: 34px;
  justify-content: center;
  padding: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.card-modal-status-form {
  display: block;
  margin: 0;
}
.card-modal-action-btn.is-status {
  background: linear-gradient(135deg, #0f1b2d, #f05000);
  color: #fff;
}
.card-modal-action-btn.is-status:hover {
  filter: brightness(1.06);
  color: #fff;
}
.card-modal-status-pop {
  position: relative;
}
.card-modal-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(280px, 80vw);
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}
.card-modal-status-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #172b4d;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.card-modal-status-item:hover,
.card-modal-status-item.is-active {
  background: #f3f4f8;
  text-decoration: none;
}
.card-modal-status-item strong { font-size: 0.92rem; }
.card-modal-status-item span {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.3;
}
.card-modal-status-item.is-complete.is-active,
.card-modal-status-item.is-complete:hover {
  background: #ecfdf3;
}
.card-modal-status-item.is-cancel.is-active,
.card-modal-status-item.is-cancel:hover {
  background: #fef3f2;
}
.client-proj-status select {
  min-height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}
.card-modal-add,
.card-modal-more {
  position: relative;
}
.card-modal-add > summary,
.card-modal-more > summary {
  list-style: none;
}
.card-modal-add > summary::-webkit-details-marker,
.card-modal-more > summary::-webkit-details-marker {
  display: none;
}
.card-modal-add-menu,
.card-modal-more-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: min(280px, 78vw);
  background: #fff;
  border: 1px solid #dfe1e6;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.18);
  padding: 8px;
  display: grid;
  gap: 2px;
}
.card-modal-more-menu {
  left: auto;
  right: 0;
  width: 200px;
}
.card-modal-add-heading {
  margin: 4px 8px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b778c;
}
.card-modal-add-item,
.card-modal-more-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 10px 10px;
  cursor: pointer;
  font: inherit;
  color: #172b4d;
  text-decoration: none;
}
.card-modal-add-item:hover,
.card-modal-more-item:hover {
  background: #f1f2f4;
  text-decoration: none;
}
.card-modal-add-item strong {
  font-size: 0.92rem;
  font-weight: 700;
}
.card-modal-add-item span {
  font-size: 0.78rem;
  color: #6b778c;
  font-weight: 500;
}
.card-modal-more-item {
  font-size: 0.9rem;
  font-weight: 650;
}
.card-modal-more-item.is-danger {
  color: #ae2a19;
}
.card-modal-delete-form {
  display: block;
  margin: 0;
}
.card-modal-quick .btn.secondary.small,
.card-modal-pop > summary.btn {
  background: #eaecf0;
  border-color: transparent;
  color: #172b4d;
  font-weight: 650;
  border-radius: 8px;
  box-shadow: none;
}
.card-modal-quick .btn.secondary.small:hover,
.card-modal-pop > summary.btn:hover {
  background: #dcdfe4;
  color: #172b4d;
}
.card-modal-pop { position: relative; }
.card-modal-pop[hidden] { display: none !important; }
.card-modal-pop > summary {
  list-style: none;
  cursor: pointer;
}
.card-modal-pop > summary::-webkit-details-marker { display: none; }
.card-modal-pop-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 28;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.card-labels-panel {
  min-width: 320px;
  max-width: min(380px, 92vw);
  max-height: min(70vh, 480px);
  overflow: auto;
  z-index: 30;
}
.card-labels-assign {
  display: grid;
  gap: 8px;
  margin: 0;
}
.card-label-row {
  display: grid;
  grid-template-columns: auto 14px minmax(0, 1fr) 88px auto;
  gap: 6px;
  align-items: center;
}
.card-label-check { margin: 0; }
.card-label-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}
.card-label-name {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.88rem;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.card-label-color {
  width: 100%;
  margin: 0;
  padding: 5px 4px;
  font-size: 0.78rem;
}
.card-label-del {
  border: none;
  background: none;
  color: #99a;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.card-label-del:hover { color: #b42318; }
.card-label-add {
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.card-label-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px auto;
  gap: 6px;
  align-items: center;
}
.card-label-add-row input,
.card-label-add-row select {
  margin: 0;
  width: 100%;
}
.card-modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.card-modal-check input {
  width: auto !important;
  min-width: 16px;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
}
.card-modal-pop-panel .card-modal-check {
  width: 100%;
}
.card-modal-section {
  background: transparent;
  margin-top: 18px;
}
.seo-month-progress-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}
.seo-month-form {
  margin: 0 0 12px;
}
.seo-month-controls {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}
@media (min-width: 720px) {
  .seo-month-controls {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .seo-month-controls .seo-month-form {
    margin: 0;
  }
}
.seo-month-label,
.seo-target-label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
}
.seo-month-label select,
.seo-target-label select {
  max-width: 100%;
  font-weight: 650;
  color: var(--ink);
}
.seo-month-progress-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}
.seo-month-progress-count {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.05rem;
}
.seo-target-form {
  margin: 0;
}
.seo-target-label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  width: auto !important;
  grid-template-columns: none !important;
}
.seo-target-label select {
  width: auto;
  min-width: 64px;
  padding: 5px 8px;
}
.seo-month-bar {
  height: 8px;
  border-radius: 999px;
  background: #edf2f4;
  overflow: hidden;
}
.seo-month-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  min-width: 0;
  transition: width 0.2s ease;
}
.seo-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.seo-share-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
}
.seo-share-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
  align-items: baseline;
}
.seo-share-date {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.82rem;
}
.seo-share-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #445;
  font-size: 0.92rem;
}
.seo-share-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #e7f6ec;
  color: #1f7a3c;
  font-size: 0.72rem;
  font-weight: 750;
}
.seo-share-del {
  margin: 0;
}
.seo-share-del button {
  border: none;
  background: none;
  color: #99a;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.seo-share-del button:hover {
  color: #b42318;
}
.seo-share-form {
  margin-top: 2px;
}
.seo-share-form .actions {
  margin-top: 4px;
  align-items: center;
}
.seo-report-drop {
  margin-bottom: 4px;
}
.seo-share-note {
  color: inherit;
  text-decoration: none;
}
a.seo-share-note:hover {
  text-decoration: underline;
}
.card-modal-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card-modal-section-head strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #172b4d;
  letter-spacing: -0.01em;
}
.card-modal-tabs {
  display: flex;
  gap: 0;
  margin: 12px 0 14px;
  border-bottom: 1px solid #e5e7eb;
}
.card-modal-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
}
.card-modal-tab:hover { color: #111827; }
.card-modal-tab.is-active {
  color: #1e293b;
  border-bottom-color: #1e293b;
  font-weight: 600;
}
.card-modal-tab-panel[hidden] { display: none !important; }
.card-internal-hint { margin: 0 0 12px; }
.card-modal-desc {
  background: #fff;
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #172b4d;
}
.card-modal-description-input {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  background: #fff;
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #172b4d;
}
.card-modal-description-input:focus {
  outline: 2px solid rgba(12, 102, 228, 0.35);
  border-color: #0c66e4;
}
.card-revision-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.card-revision {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #f1c9a8;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: #fff;
}
.card-revision.is-done {
  border-color: var(--line);
  border-left-color: var(--ok);
  background: #fbfffc;
}
.card-revision p {
  margin: 0 0 5px;
  white-space: pre-wrap;
}
.card-revision-rounds {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.card-revision-round {
  background: #fff;
  border: 1px solid #f1c9a8;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px 12px;
}
.card-revision-round.is-done {
  border-color: var(--line);
  border-left-color: var(--ok);
  background: #fbfffc;
}
.card-revision-round > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-weight: 650;
}
.card-revision-round > summary::-webkit-details-marker { display: none; }
.card-revision-round > summary span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.card-revision-summary {
  margin: 8px 0 10px;
  white-space: pre-wrap;
}
.card-revision-items {
  display: grid;
  gap: 8px;
}
.card-revision-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}
.card-revision-item.is-done {
  opacity: 0.72;
  text-decoration: none;
}
.card-revision-item.is-done p {
  text-decoration: line-through;
  color: var(--muted);
}
.card-revision-item p {
  margin: 0 0 4px;
}
.card-revision-add-item,
.card-revision-complete-form {
  margin-top: 10px;
}
.card-revision-complete-form .btn {
  width: 100%;
}
.card-comment-form {
  margin: 0 0 16px;
}
.card-comment-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  min-height: 72px;
}
.card-comment-form textarea:focus {
  outline: 2px solid rgba(12, 102, 228, 0.28);
  border-color: #0c66e4;
}
.card-modal-side {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  position: sticky;
  top: 0;
}
.card-modal-activity {
  display: grid;
  gap: 14px;
}
.card-modal-activity-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  font-size: 0.9rem;
  align-items: start;
  color: #172b4d;
}
.card-modal-activity-item .avatar-chip.tiny {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}
.card-modal-activity-item strong {
  font-weight: 700;
  color: #172b4d;
}
.card-modal-activity-meta {
  display: inline;
  margin-left: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #0c66e4;
}
.card-modal-activity-item.is-system .card-modal-activity-summary {
  color: #44546f;
}
.card-modal-activity-summary {
  margin: 4px 0 0;
}
@media (max-width: 900px) {
  .card-modal-layout {
    grid-template-columns: 1fr;
  }
  .card-modal-side {
    position: static;
  }
}
.trello-card {
  cursor: pointer;
}
.trello-card .trello-card-title {
  pointer-events: none;
}
.trello-card .trello-card-menu {
  pointer-events: auto;
}
.upwork-metrics {
  margin: 12px 0 18px;
}
.upwork-log-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: #f8fbfb;
  margin-bottom: 18px;
}
.upwork-log-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.upwork-followups {
  margin-bottom: 22px;
}
.upwork-sheet-block {
  margin-top: 8px;
}
.upwork-prop-board {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.upwork-prop-head,
.upwork-prop-row {
  display: grid;
  grid-template-columns: 72px 110px 64px 72px minmax(100px, 1.4fr) 68px 68px 68px 56px;
  gap: 0;
  width: 100%;
  align-items: center;
}
.upwork-prop-head {
  background: #f3f8f8;
  border-bottom: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #667;
}
.upwork-prop-head span,
.upwork-prop-row > span,
.upwork-prop-row > label,
.upwork-prop-row > button {
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.upwork-prop-head span:last-child,
.upwork-prop-row > :last-child {
  border-right: none;
}
.upwork-prop-head span:nth-child(n+6),
.upwork-prop-row > label,
.upwork-prop-row > button {
  text-align: center;
  justify-self: stretch;
}
.upwork-prop-row {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.upwork-prop-row > input[type="hidden"] {
  display: none;
}
.upwork-prop-row:last-child {
  border-bottom: none;
}
.upwork-prop-row.is-closed {
  background: #fbfffc;
}
.upwork-prop-date {
  font-weight: 700;
  color: var(--accent);
}
.upwork-prop-person {
  font-weight: 650;
}
.upwork-prop-num {
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.upwork-prop-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #556;
  font-size: 0.88rem;
}
label.upwork-tick {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  font-weight: 500;
  cursor: pointer;
}
label.upwork-tick input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.upwork-prop-del {
  justify-self: center;
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  border-right: none !important;
}
.upwork-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  width: 100%;
}
.upwork-excel {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}
.upwork-excel th,
.upwork-excel td {
  padding: 8px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upwork-excel th:last-child,
.upwork-excel td:last-child {
  border-right: none;
}
.upwork-excel thead th {
  background: #f3f8f8;
  font-weight: 700;
  font-size: 0.8rem;
}
.upwork-excel th.person-head {
  background: #eaf4f3;
  border-bottom: 1px solid var(--line);
}
.upwork-excel th.sub {
  background: #f8fbfb;
  font-weight: 600;
  color: #667;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.upwork-excel .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  text-align: left;
  font-weight: 600;
  border-right: 2px solid var(--line);
  width: 72px;
}
.upwork-excel thead .sticky-col,
.upwork-excel tfoot .sticky-col {
  background: #f3f8f8;
  z-index: 2;
}
.upwork-excel th:nth-child(2),
.upwork-excel td:nth-child(2) {
  width: 48px;
}
.upwork-excel tr.is-weekend td {
  background: #fafafa;
}
.upwork-excel tr.is-weekend .sticky-col {
  background: #fafafa;
}
.upwork-excel tr.has-row td.has-val {
  background: #f7fcfb;
}
.upwork-excel td.empty-cell {
  color: #c5cccc;
}
.upwork-excel tfoot td {
  background: #f8fbfb;
  font-weight: 600;
}
.upwork-day-groups {
  display: grid;
  gap: 8px;
}
.upwork-add-details {
  margin-bottom: 16px;
}
.upwork-add-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  background: #fff;
  user-select: none;
}
.upwork-add-summary::-webkit-details-marker { display: none; }
.upwork-add-details[open] .upwork-add-summary {
  margin-bottom: 10px;
}
.upwork-log-card-nested {
  margin-top: 0;
}
.upwork-filter-chips {
  margin-bottom: 16px;
}
.chip.chip-quiet {
  opacity: 0.85;
  font-size: 0.86rem;
}
.upwork-section-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.upwork-section-sub {
  margin: 0 0 12px;
}
.upwork-mock-board {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.upwork-mock-head,
.upwork-mock-row {
  display: grid;
  grid-template-columns: 78px 68px minmax(80px, 1fr) 56px 64px 64px minmax(120px, 1.3fr) auto;
  align-items: center;
  width: 100%;
}
.upwork-mock-head-day,
.upwork-mock-row-day {
  grid-template-columns: 40px minmax(80px, 1fr) 56px 64px 64px minmax(120px, 1.2fr) auto;
}
.upwork-mock-head {
  background: #f4f8f8;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #667;
}
.upwork-mock-head span,
.upwork-mock-row > span,
.upwork-mock-row > label {
  padding: 11px 10px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.upwork-mock-row > :last-child,
.upwork-mock-head span:last-child {
  border-right: none;
}
.upwork-mock-row {
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.upwork-mock-row > input[type="hidden"] {
  display: none;
}
.upwork-mock-row:last-child {
  border-bottom: none;
}
.upwork-mock-row.is-closed {
  background: #fbfffc;
}
.upwork-mock-row.is-cancelled {
  opacity: 0.8;
  background: #fafbfc;
}
.upwork-mock-closed {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}
.upwork-mock-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px !important;
  white-space: nowrap;
}
.upwork-link-btn {
  border: none;
  background: none;
  color: #7a8694;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.upwork-link-btn:hover {
  color: var(--accent);
}
.upwork-icon-del {
  border: none;
  background: none;
  color: #9aa;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}
.upwork-icon-del:hover {
  color: #b42318;
}
.upwork-mock-board-nested {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--line);
}
.upwork-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}
.upwork-action-board .upwork-action-head,
.upwork-action-board .upwork-prop-row-action {
  grid-template-columns: 72px 64px minmax(72px, 0.9fr) 52px 110px minmax(90px, 1.4fr) 64px 44px;
}
.upwork-prop-ticks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.upwork-status-pill.is-muted {
  background: #eef1f3;
  color: #667;
}
.upwork-prop-row.is-cancelled {
  opacity: 0.78;
  background: #fafbfc;
}
.upwork-refund {
  color: #b42318;
  font-weight: 700;
}
.upwork-prop-cancel {
  white-space: nowrap;
}
.upwork-prop-board-nested .upwork-prop-head,
.upwork-prop-board-nested .upwork-prop-row {
  grid-template-columns: 40px minmax(72px, 0.9fr) 52px 64px minmax(80px, 1.2fr) 52px 52px 52px 64px 44px;
}
.upwork-day-group-static .upwork-day-summary {
  cursor: default;
}
.upwork-day-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.upwork-day-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background: #f8fbfb;
}
.upwork-day-summary::-webkit-details-marker {
  display: none;
}
.upwork-day-group:not(.upwork-day-group-static) > summary.upwork-day-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: #789;
  transition: transform 0.15s ease;
}
.upwork-day-group[open] > summary.upwork-day-summary::before {
  transform: rotate(90deg);
}
.upwork-day-summary-left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.upwork-day-summary-left strong {
  color: var(--accent);
}
.upwork-day-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3f5;
  font-size: 0.78rem;
  font-weight: 650;
  color: #445;
}
.upwork-prop-board-nested {
  border: none;
  border-radius: 0;
  border-top: 1px solid var(--line);
}
.upwork-day-group[open] .upwork-day-summary {
  border-bottom: 1px solid var(--line);
}
.upwork-contract-list {
  display: grid;
  gap: 10px;
}
.upwork-contract-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}
.upwork-contract-main h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.upwork-contract-main p {
  margin: 0 0 4px;
}
.upwork-contract-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.upwork-sync-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: #f8fbfb;
  max-width: 640px;
}
.upwork-sync-panel h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.upwork-convert-card {
  border: 1px solid #e4b89a;
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: #fff8f3;
  margin-bottom: 18px;
}
.upwork-convert-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.upwork-prop-row.is-converted {
  background: #fbfffc;
}
.upwork-prop-links {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  font-size: 0.8rem;
}
.upwork-prop-links a,
.upwork-convert-link {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.upwork-prop-links a:hover,
.upwork-convert-link:hover {
  text-decoration: underline;
}
.upwork-people-settings {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.upwork-people-settings summary {
  cursor: pointer;
  font-weight: 600;
}
@media (max-width: 900px) {
  .upwork-prop-head,
  .upwork-prop-row {
    grid-template-columns: 64px 90px 52px 64px minmax(80px, 1fr) 56px 56px 56px 48px;
  }
  .upwork-prop-head span:nth-child(4),
  .upwork-prop-row > span:nth-child(4) {
    display: none;
  }
}
@media (max-width: 640px) {
  .upwork-prop-board {
    overflow-x: auto;
  }
  .upwork-prop-head,
  .upwork-prop-row {
    min-width: 640px;
  }
}
@media (max-width: 820px) {
  .card-modal-layout { grid-template-columns: 1fr; }
  .card-modal-side { position: static; }
  .card-modal-scroll { padding: 24px 10px 48px; }
}

/* Lead Manager */
.leads-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.leads-tabs a {
  padding: 7px 12px;
  border-radius: 8px;
  background: #f3f5f6;
  color: #445;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
}
.leads-tabs a:hover { color: var(--accent); text-decoration: none; }
.leads-tabs a.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.leads-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.leads-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.leads-stat span { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.leads-stat strong { font-size: 1.35rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.leads-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.leads-filters label {
  margin: 0;
  font-size: 0.78rem;
}
.leads-filters .leads-search { flex: 1 1 180px; min-width: 160px; }
.leads-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.leads-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.leads-table th, .leads-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.leads-table th { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.leads-avatar span,
.leads-avatar img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  object-fit: cover;
  font-size: 0.75rem;
  font-weight: 700;
}
.lead-cat-agencies { background: #e8f5ee; color: #1b6b3a; }
.lead-cat-clinics { background: #e7f2fb; color: #1a5f8a; }
.lead-cat-shopify { background: #eef7f5; color: #0b6e66; }
.lead-cat-uncategorized { background: #f1f1f1; color: #666; }
.lead-status-uploaded { background: #eef0f2; color: #556; }
.lead-status-queued { background: #fff3df; color: #8a5a00; }
.lead-status-sent { background: #ffe8d6; color: #b84700; }
.lead-status-accepted { background: #e8f5ee; color: #1b6b3a; }
.lead-status-replied { background: #e7f2fb; color: #1a5f8a; }
.lead-status-won { background: #e8f5ee; color: #0f5132; }
.lead-status-lost, .lead-status-not_now { background: #fde8e6; color: #9b1c1c; }
.leads-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.leads-drop {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 28px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: #fbfcfc;
  text-align: center;
  cursor: pointer;
}
.leads-drop input[type="file"] { max-width: 100%; }
.leads-account-grid,
.leads-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.leads-account-card,
.leads-kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.leads-account-card h2,
.leads-kpi-card h2 {
  margin: 0;
  font-size: 1.05rem;
}
.leads-account-metrics,
.leads-kpi-meters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.leads-account-metrics div,
.leads-kpi-meters div {
  background: #fbfcfc;
  border-radius: 10px;
  padding: 8px;
}
.leads-account-metrics span,
.leads-kpi-meters span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.leads-account-metrics strong,
.leads-kpi-meters strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.leads-kpi-meters strong.ok { color: #1b6b3a; }
.leads-kpi-inputs { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.leads-quick-export { margin-top: 22px; }
.leads-quick-export h3 { margin: 0 0 10px; font-size: 1rem; }
@media (max-width: 900px) {
  .leads-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { overflow-x: auto; }
  .leads-table { min-width: 860px; }
}

/* AI Lead Intelligence */
.leads-ai-cell { white-space: nowrap; }
.btn-research {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--accent);
}
.btn-research:hover { background: var(--accent-soft); }
.btn-research:disabled { opacity: 0.55; cursor: wait; }
.fit-score {
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  font-family: inherit;
}
.fit-score-high { background: #e8f5ee; color: #1b6b3a; }
.fit-score-mid { background: #fff3df; color: #8a5a00; }
.fit-score-low { background: #fde8e6; color: #9b1c1c; }
.leads-bulk-progress {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef6fb;
  border: 1px solid #cfe3f2;
  font-size: 0.9rem;
}
.research-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.28);
  z-index: 1200;
}
.research-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  z-index: 1201;
  overflow-y: auto;
  padding: 20px 18px 40px;
}
.research-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.research-panel-header h3 { margin: 0 0 2px; font-size: 1.15rem; }
.research-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
}
.fit-score-large { text-align: center; padding: 8px 0 12px; }
.fit-score-large .score-number {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.fit-score-large .score-den { font-size: 1.1rem; color: var(--muted); font-weight: 650; }
.fit-score-large .score-label {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 650;
}
.fit-reasoning { font-size: 0.92rem; color: #445; margin: 0 0 14px; }
.disqualifier-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  color: #9b1c1c;
  font-size: 0.9rem;
}
.research-section { margin-bottom: 16px; }
.research-section h4 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}
.research-section p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: #334; }
.research-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reply-box {
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.reply-box p { font-style: italic; margin: 0 0 10px; }
#rp-talking-points { margin: 0; padding-left: 18px; }
#rp-talking-points li { margin: 0 0 6px; font-size: 0.9rem; }
.research-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.research-actions { margin-top: 12px; }
.ai-usage-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 4px;
}
.ai-usage-stat {
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.ai-usage-stat strong {
  display: block;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.ai-usage-stat span {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
@media (max-width: 720px) {
  .ai-usage-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-panel { width: 100vw; }
}

/* Google Search Console */
.gsc-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 4px;
}
.gsc-stat {
  background: #f7f3ee;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.gsc-stat strong {
  display: block;
  font-size: 1.15rem;
  line-height: 1.2;
}
.gsc-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.gsc-queries-table th,
.gsc-queries-table td {
  font-size: 0.84rem;
}
.gsc-link-form {
  margin-bottom: 4px;
}
.gsc-query-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 8px;
}
.gsc-query-chips .chip em {
  font-style: normal;
  opacity: 0.7;
  margin-left: 4px;
}
.gsc-portfolio-queries td {
  background: #fbfaf8;
  border-top: 0;
}
@media (max-width: 720px) {
  .gsc-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Client Hosting — disk / bandwidth usage */
.host-table-wrap { overflow-x: auto; }
.host-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.host-table th,
.host-table td {
  vertical-align: middle;
  padding: 10px 12px;
  text-align: left;
}
.host-table thead th {
  white-space: nowrap;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.host-table .col-domain { width: 20%; }
.host-table .col-sites { width: 16%; }
.host-table .col-status { width: 8%; }
.host-table .col-disk,
.host-table .col-bw { width: 13%; }
.host-table .col-due { width: 10%; }
.host-table .col-actions { width: 20%; }
.host-sites-cell { font-size: 0.82rem; line-height: 1.35; }
.host-site-mini {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.75rem;
}
.host-site-mini li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .host-detail-grid { grid-template-columns: 1fr; }
}
.host-detail-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}
.host-detail-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.host-creds {
  margin: 0;
  display: grid;
  gap: 10px;
}
.host-creds > div {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: center;
}
.host-creds dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.host-creds dd { margin: 0; }
.host-pass-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.host-site-block { margin-top: 10px; }
.host-site-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.host-site-list {
  margin: 0;
  padding-left: 18px;
}
.host-site-list a { word-break: break-all; }
.host-raw summary { cursor: pointer; }
.host-domain {
  display: block;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-domain:hover { color: var(--accent); }
.host-user {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.host-table .col-client,
.host-table .col-due {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}
.host-due { display: block; color: var(--ink); font-weight: 600; }
.host-cycle { display: block; margin-top: 2px; font-size: 0.75rem; }
.host-usage { display: grid; gap: 5px; min-width: 0; }
.host-usage-line {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.host-usage-track {
  height: 6px;
  border-radius: 999px;
  background: #e8eef3;
  overflow: hidden;
}
.host-usage-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #38bdf8;
}
.host-usage.is-elevated .host-usage-line { color: #b45309; }
.host-usage.is-elevated .host-usage-track > span { background: #f59e0b; }
.host-usage.is-warn .host-usage-line { color: #c2410c; }
.host-usage.is-warn .host-usage-track > span { background: #f97316; }
.host-usage.is-critical .host-usage-line { color: #b91c1c; }
.host-usage.is-critical .host-usage-track > span { background: #ef4444; }
.host-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.host-actions form { margin: 0; display: inline; }
.host-actions .btn.small {
  padding: 4px 8px;
  font-size: 0.75rem;
  white-space: nowrap;
}
.host-table tr.is-disk-warn td.col-domain { box-shadow: inset 3px 0 0 #f97316; }
.host-table tr.is-disk-critical td.col-domain { box-shadow: inset 3px 0 0 #ef4444; }
.host-table tr.is-host-suspended { opacity: 0.85; }
.host-table tr.is-host-suspended td.col-domain { box-shadow: inset 3px 0 0 #ef4444; }
@media (max-width: 1100px) {
  .host-table { table-layout: auto; }
  .host-actions { flex-wrap: wrap; justify-content: flex-start; }
}

.host-client-link {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent, #c45c26);
  text-decoration: none;
}
.host-client-link:hover { text-decoration: underline; }

body.host-modal-open { overflow: hidden !important; }
.host-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
}
.host-modal-root.is-open,
.host-modal-root:not([hidden]) {
  display: block;
}
.host-modal-root[hidden] { display: none !important; }
.host-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.host-modal-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: auto;
  padding: 32px 16px 48px;
  box-sizing: border-box;
}
.host-modal-mount {
  max-width: 920px;
  margin: 0 auto;
}
.host-modal-loading {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.host-modal-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--line);
}
.host-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.host-modal-close:hover { background: rgba(15, 23, 42, 0.06); color: var(--ink); }
.host-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-right: 28px;
}
.host-modal-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}
.host-modal-sub { margin: 4px 0 0; }
.host-suggest-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.host-suggest {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.host-suggest:has(input:checked) {
  border-color: var(--accent, #c45c26);
  background: rgba(196, 92, 38, 0.06);
}
.host-suggest span { display: grid; gap: 2px; }
.host-attach-form .form-grid { margin-top: 4px; }
@media (max-width: 720px) {
  .host-modal-scroll { padding: 16px 10px 40px; }
  .host-modal-head { flex-direction: column; }
}

/* Sites uptime / WP manager */
.sites-table {
  table-layout: fixed;
  width: 100%;
}
.sites-table th:nth-child(1),
.sites-table td:nth-child(1) { width: 36px; }
.sites-table th:nth-child(2),
.sites-table td:nth-child(2) { width: 24%; }
.sites-table th:nth-child(3),
.sites-table td:nth-child(3) { width: 16%; }
.sites-table th:nth-child(4),
.sites-table td:nth-child(4) { width: 8%; }
.sites-table th:nth-child(5),
.sites-table td:nth-child(5),
.sites-table th:nth-child(6),
.sites-table td:nth-child(6) { width: 12%; }
.sites-table th:nth-child(7),
.sites-table td:nth-child(7) { width: 14%; }
.sites-table th:nth-child(8),
.sites-table td:nth-child(8) { width: 56px; }
.sites-table tr.is-site-down td:nth-child(2) {
  box-shadow: inset 3px 0 0 #ef4444;
}
.sites-table tr.is-site-security td:nth-child(2) {
  box-shadow: inset 3px 0 0 #f59e0b;
}
.sites-table tr.is-site-down.is-site-security td:nth-child(2) {
  box-shadow: inset 3px 0 0 #ef4444;
}
.sites-bulk-bar {
  margin: 0 0 12px;
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Security tab detail */
.sn-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .sn-detail-grid { grid-template-columns: 1fr; }
}
.sn-table th:nth-child(6),
.sn-table td:nth-child(6) { width: 16%; }
.sn-table th:nth-child(7),
.sn-table td:nth-child(7) { width: 12%; }
.sn-modal-scroll {
  padding-top: 18px !important;
  align-items: flex-start;
}
.sn-modal-dialog {
  width: min(920px, 96vw);
  max-width: 96vw;
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.sn-site-form {
  gap: 12px;
}
.sn-site-form .form-grid {
  margin: 0;
  gap: 10px 14px;
}
.sn-site-form .form-grid label {
  min-width: 0;
  display: grid;
  gap: 6px;
  font-weight: 600;
}
.sn-site-form .form-grid input,
.sn-site-form .form-grid select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.sn-form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 2px 0 0;
}
.sn-form-checks .check-inline {
  margin: 0;
}
.sn-form-actions {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sites-notify summary {
  cursor: pointer;
  user-select: none;
}
.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-weight: 600;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Team access matrix */
.team-hr-page .team-hr-toolbar {
  align-items: center;
}
.team-hr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.team-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.team-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.team-tab:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.7);
}
.team-tab.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
/* CRM-style profile layout for Team & roles */
.team-crm-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 18px;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
}
.team-crm-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.team-crm-tab:hover {
  color: #111827;
}
.team-crm-tab.is-active {
  color: #1e3a5f;
  border-bottom-color: #1e3a5f;
}
.team-profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.team-profile-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.team-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8eef5;
  color: #1e3a5f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.35rem;
  flex: 0 0 auto;
  border: 1px solid #d7e0ea;
}
.team-profile-avatar.sm {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}
.team-profile-hero-copy h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}
.team-profile-hero-copy p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}
.team-profile-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.team-profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}
.team-profile-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.team-profile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.team-profile-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f4;
}
.team-profile-card-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}
.team-profile-card-body {
  padding: 14px 16px 16px;
}
.team-profile-fields {
  display: flex;
  flex-direction: column;
}
.team-profile-field {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 600;
}
.team-profile-field:last-child {
  border-bottom: 0;
}
.team-profile-field > span {
  color: #6b7280;
  font-size: 0.86rem;
  font-weight: 600;
}
.team-profile-field > span em {
  font-style: normal;
  font-weight: 500;
  color: #9ca3af;
  font-size: 0.75rem;
}
.team-profile-field input,
.team-profile-field select {
  width: 100%;
  min-height: 38px;
  margin: 0;
  font-weight: 500;
}
.team-section-hint {
  margin: 0 0 10px;
}
.team-people-panel {
  margin-bottom: 8px;
}
.team-people-panel .team-people-list {
  padding: 0;
  gap: 0;
}
.team-person-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
}
.team-person-row:last-child {
  border-bottom: 0;
}
.team-person-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.team-person-identity strong {
  display: block;
  font-size: 0.98rem;
  color: #111827;
}
.team-person-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.82rem;
}
.team-person-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.team-person-stat {
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.team-person-stat-val {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  line-height: 1.2;
}
.team-person-stat-lbl {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.team-people-panel .team-role-guide {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid #eef1f4;
}
@media (max-width: 900px) {
  .team-profile-layout {
    grid-template-columns: 1fr;
  }
  .team-profile-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .team-person-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .team-person-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
.team-section-card {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}
.team-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.team-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
.team-form-actions {
  justify-content: flex-start;
}
.team-access-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.team-access-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.team-access-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.team-access-card.is-inactive {
  opacity: 0.6;
}
.team-access-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.team-access-summary::-webkit-details-marker {
  display: none;
}
.team-access-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1c2124;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}
.team-access-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.team-access-meta strong {
  font-size: 0.98rem;
}
.team-access-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.team-access-chevron {
  color: #9ca3af;
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}
.team-access-card[open] .team-access-chevron {
  transform: rotate(180deg);
}
.team-access-body {
  padding: 0 14px 14px;
  border-top: 1px solid #f3f4f6;
}
.team-access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}
.team-access-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.team-access-chip:hover {
  border-color: #9ca3af;
}
.team-access-chip.is-on {
  background: #1c2124;
  border-color: #1c2124;
  color: #fff;
}
.team-access-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.team-matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.team-matrix-hint {
  margin: 0;
  flex: 1 1 240px;
  min-width: 0;
}
.team-matrix-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.team-matrix-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.team-role-guide {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #e5e7eb);
  color: #6b7280;
  font-size: 0.85rem;
}
.team-roles-table {
  width: 100%;
  table-layout: fixed;
}
.team-roles-table th,
.team-roles-table td {
  vertical-align: middle;
  text-align: left;
  padding: 10px 12px;
}
.team-roles-table th:nth-child(1),
.team-roles-table td:nth-child(1) { width: 18%; }
.team-roles-table th:nth-child(2),
.team-roles-table td:nth-child(2) { width: 24%; }
.team-roles-table th:nth-child(3),
.team-roles-table td:nth-child(3) { width: 14%; }
.team-roles-table th:nth-child(4),
.team-roles-table td:nth-child(4) { width: 18%; }
.team-roles-table th:nth-child(5),
.team-roles-table td:nth-child(5) { width: 14%; }
.team-roles-table th:nth-child(6),
.team-roles-table td:nth-child(6) { width: 12%; }
.org-board-portal {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}
.org-board-portal-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 6px;
}
.team-people-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 800px) {
  .team-roles-table {
    table-layout: auto;
  }
}
.team-matrix-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.team-matrix {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 920px;
  margin: 0;
  width: 100%;
}
.team-matrix th,
.team-matrix td {
  vertical-align: middle;
  white-space: nowrap;
}
.team-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f4f6;
  box-shadow: 0 1px 0 var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  padding: 10px 8px;
  text-align: center;
}
.team-matrix thead .team-matrix-sticky,
.team-matrix thead .team-matrix-actions {
  text-align: left;
}
.team-matrix-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  min-width: 168px;
  padding-left: 12px !important;
  box-shadow: 1px 0 0 var(--line);
}
.team-matrix thead .team-matrix-sticky {
  z-index: 3;
  background: #f3f4f6;
}
.team-matrix-mod {
  text-align: center;
  min-width: 72px;
  max-width: 88px;
}
.team-matrix-mod span {
  display: inline-block;
  white-space: normal;
  line-height: 1.2;
  max-width: 4.8rem;
}
.team-matrix-check {
  text-align: center;
  padding: 6px 4px !important;
}
.team-matrix-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  min-height: 36px;
  width: 100%;
}
.team-matrix-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.team-matrix-actions {
  white-space: nowrap;
  text-align: left;
  padding-right: 12px !important;
}
.team-matrix-actions .btn {
  margin-left: 0;
  margin-right: 4px;
}
.team-matrix tr.is-inactive {
  opacity: 0.55;
}
.team-matrix tbody tr:hover td {
  background: #f9fafb;
}
.team-matrix tbody tr:hover .team-matrix-sticky {
  background: #f9fafb;
}
.warn-text { color: #c2410c; font-weight: 700; }
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
  color: var(--muted);
}
.stat-pill strong {
  color: var(--ink);
  font-weight: 700;
}
.table-wrap tr.is-expiring td:first-child {
  box-shadow: inset 3px 0 0 #f59e0b;
}

/* Shared create/edit form popups (Sales, CRM, Clients…) */
body.form-modal-open { overflow: hidden !important; }
.form-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: stretch;
  justify-content: center;
}
.form-modal-root.is-open {
  display: flex;
}
.form-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(9, 30, 66, 0.52);
  cursor: pointer;
}
.form-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px));
  max-height: min(92vh, 940px);
  margin: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(9, 30, 66, 0.28);
  overflow: hidden;
}
.form-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.form-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.form-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #445;
  text-decoration: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.form-modal-close:hover {
  background: rgba(9, 30, 66, 0.06);
  color: #172b4d;
}
.form-modal-body {
  padding: 16px 18px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.form-modal-body .crm-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 640px) {
  .form-modal-dialog {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
}

/* Draft domain on Website cards */
.trello-card-badge.domain-chip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #eef6ff;
  color: #1d4f91;
  border-color: #c9ddf5;
}
.card-domain-linked {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}
.card-domain-linked a {
  color: #1d4f91;
  text-decoration: none;
}
.card-domain-linked a:hover {
  text-decoration: underline;
}
.trello-add-card-form select[name="draft_domain_id"] {
  margin-top: 6px;
}

/* Content calendar */
.calendar-editor textarea.calendar-body-input {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}
.calendar-table .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.calendar-tools .inline-form label.tiny {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Organization home + portal switcher */
.org-shell {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(30, 90, 70, 0.12), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(40, 70, 110, 0.1), transparent 50%),
    var(--bg, #f3f1ec);
}
.org-shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px);
}
.org-shell-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}
.org-shell-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.org-home-hero {
  margin-bottom: 28px;
}
.org-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 8px;
}
.org-home-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 10px;
}
.org-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.org-portal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.org-portal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(20, 40, 30, 0.08);
  border-color: rgba(20, 80, 60, 0.25);
  text-decoration: none;
  color: inherit;
}
.org-portal-card.is-current {
  border-color: rgba(20, 80, 60, 0.45);
}
.org-portal-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.org-portal-name {
  font-size: 1.25rem;
  font-weight: 700;
}
.org-portal-desc {
  font-size: 0.9rem;
  color: var(--muted);
}
.org-portal-cta {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 650;
  color: #1f5c45;
}
.portal-switcher {
  padding: 0 14px 12px;
}
.portal-switcher select {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
}
html.nav-collapsed .portal-switcher {
  display: none;
}

/* ===== Technologia CRM theme (navy + orange from logo) ===== */
body.theme-crm {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --ink-soft: #243447;
  --muted: #5b6b7c;
  --line: #e4e8ef;
  --brand-navy: #0f1b2d;
  --brand-navy-mid: #1e3a5f;
  --brand-orange: #f05000;
  --brand-orange-hot: #ff7a1a;
  --accent: #f05000;
  --accent-hover: #d64500;
  --accent-soft: #fff0e8;
  --accent-wash: #fff6f0;
  --accent-grad: linear-gradient(135deg, #0f1b2d 0%, #1e3a5f 42%, #f05000 100%);
  --brand-grad: linear-gradient(120deg, #0f1b2d 0%, #1e3a5f 45%, #e85a10 78%, #ff7a1a 100%);
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.05), 0 8px 20px rgba(15, 27, 45, 0.06);
  --display: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(240, 80, 0, 0.08), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(30, 58, 95, 0.08), transparent 50%),
    #f4f6fa;
  font-family: var(--font);
}
body.theme-crm a { color: var(--brand-navy-mid); }
body.theme-crm a:hover { color: var(--brand-orange); }
body.theme-crm .btn,
body.theme-crm button.btn {
  background: var(--brand-grad);
  border-color: transparent;
  color: #fff;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(240, 80, 0, 0.22);
}
body.theme-crm .btn:hover { background: linear-gradient(135deg, #0f1b2d 0%, #f05000 100%); filter: brightness(1.03); }
body.theme-crm .btn.secondary,
body.theme-crm button.btn.secondary {
  background: #fff;
  color: var(--brand-navy-mid);
  border: 1px solid #d7dee8;
  box-shadow: none;
}
body.theme-crm .btn.secondary:hover {
  background: var(--accent-soft);
  border-color: #f0b48a;
  color: var(--brand-orange);
  filter: none;
}

/* Light sidebar like CRM */
body.theme-crm .sidebar {
  color: #1f2937;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}
body.theme-crm .sidebar-brand-text {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #111827;
}
body.theme-crm .crm-sidebar-logo {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
html.nav-collapsed body.theme-crm .crm-sidebar-logo,
body.theme-crm.html.nav-collapsed .crm-sidebar-logo {
  height: 22px;
  max-width: 36px;
  object-fit: cover;
  object-position: left center;
}
body.theme-crm .sidebar-toggle {
  color: #6b7280;
  border-color: #e5e7eb;
  background: #f9fafb;
}
body.theme-crm .sidebar-link {
  color: #4b5563;
  border-radius: 8px;
}
body.theme-crm .sidebar-link:hover {
  background: #f3f4f8;
  color: #111827;
  text-decoration: none;
}
body.theme-crm .sidebar-link.active {
  background: linear-gradient(90deg, rgba(240, 80, 0, 0.12), rgba(30, 58, 95, 0.08));
  color: var(--brand-navy);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand-orange);
}
body.theme-crm .sidebar-ico svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
body.theme-crm .sidebar-section-label,
body.theme-crm .sidebar-account-email {
  color: #9ca3af;
}
body.theme-crm .sidebar-account-btn {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111827;
}
body.theme-crm .sidebar-account-menu a {
  color: #374151;
}
body.theme-crm .sidebar-account-menu a:hover,
body.theme-crm .sidebar-account-menu a.active {
  background: #eef2ff;
  color: #1e3a5f;
}
body.theme-crm .portal-switcher-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 6px;
}
body.theme-crm .portal-switcher select {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
  border-radius: 6px;
}
body.theme-crm .app-mobile-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
body.theme-crm .panel,
body.theme-crm .card,
body.theme-crm table.data-table,
body.theme-crm .shell > section {
  border-radius: 8px;
}

/* Org / workspace picker — CRM table style */
body.theme-crm .org-shell {
  background: #f3f4f8;
}
body.theme-crm .org-shell-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  backdrop-filter: none;
}
body.theme-crm .crm-brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
body.theme-crm .org-shell-body {
  max-width: 1100px;
}
.crm-org-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
.crm-org-top-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.crm-org-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}
.org-portal-access {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.org-portal-access legend {
  padding: 0 6px;
  font-weight: 600;
}
.org-portal-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.crm-org-logo {
  height: 40px;
  width: auto;
  flex: 0 0 auto;
}
.crm-org-top-meta h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  font-family: var(--font);
}
.crm-org-top-meta p {
  margin: 0;
  color: #6b7280;
  max-width: 52ch;
}
.crm-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.crm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.crm-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.crm-panel-count {
  font-size: 0.8rem;
  color: #6b7280;
}
.crm-table-wrap { overflow-x: auto; }
.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.crm-table th,
.crm-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.crm-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  background: #fafafa;
  font-weight: 700;
}
.crm-table tr.is-current td {
  background: #f8fafc;
}
.crm-muted {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 2px;
}
.crm-col-action { text-align: right !important; white-space: nowrap; }
.crm-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f3f4f8;
  color: #4b5563;
}
.crm-badge-ok {
  background: #ecfdf5;
  color: #047857;
}
.crm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 6px;
  background: #1e3a5f;
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none !important;
  border: 1px solid #1e3a5f;
}
.crm-btn:hover { background: #152a45; color: #fff !important; }
.crm-btn-ghost {
  background: #fff;
  color: #1e3a5f !important;
  border-color: #d1d5db;
}
.crm-btn-ghost:hover { background: #f9fafb; }
.crm-btn-sm { padding: 6px 10px; font-size: 0.8rem; }

body.theme-crm .login-wrap {
  background: #f3f4f8;
}
body.theme-crm .login-card {
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
  border-radius: 10px;
}
body.theme-crm .login-brand img {
  max-height: 42px;
  width: auto;
}

/* ===== CRM layout structure (Worksuite-like) ===== */
body.theme-crm {
  --font: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
}
body.theme-crm h1,
body.theme-crm h2,
body.theme-crm h3,
body.theme-crm .sidebar-brand-text,
body.theme-crm .crm-org-top-meta h1 {
  font-family: var(--font);
}

body.theme-crm .app-frame {
  min-height: 100vh;
}
body.theme-crm .sidebar {
  width: 230px;
  flex-basis: 230px;
  padding: 0;
  gap: 0;
}
body.theme-crm .sidebar-head {
  padding: 14px 14px 10px;
  min-height: 58px;
  border-bottom: 1px solid #eef0f4;
  margin: 0;
}
body.theme-crm .crm-sidebar-logo {
  height: 26px;
  max-width: 150px;
}
body.theme-crm .sidebar-nav {
  padding: 10px 8px;
  overflow-y: auto;
  flex: 1;
}
body.theme-crm .sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
}
body.theme-crm .sidebar-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
body.theme-crm .sidebar-ico svg {
  width: 18px;
  height: 18px;
}
body.theme-crm .crm-sidebar-version {
  border-top: 1px solid #eef0f4;
  padding: 10px 16px 14px;
  font-size: 11px;
  color: #9aa3b2;
}
body.theme-crm .sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 8px 0 12px;
  border-top: 1px solid #eef0f4;
}
body.theme-crm .sidebar-settings-link {
  margin: 0 8px;
  font-weight: 600;
}
body.theme-crm .sidebar-settings-link.active {
  background: #eef2ff;
  color: #1e3a8a;
}
html.nav-collapsed body.theme-crm .sidebar-settings-link .sidebar-label {
  display: none;
}

.settings-breadcrumb {
  margin: 0 0 4px;
}
.settings-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}
.settings-notify-list {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
}
.settings-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.settings-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.settings-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.settings-dot.is-on { background: #16a34a; }
.settings-dot.is-off { background: #ef4444; }
.settings-profile-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .settings-two-col,
  .settings-check-grid {
    grid-template-columns: 1fr;
  }
}

/* Top header like CRM (always visible, not mobile-only) */
body.theme-crm .app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  background: #f2f4f7;
}
body.theme-crm .crm-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
body.theme-crm .crm-topbar-left,
body.theme-crm .crm-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
body.theme-crm .crm-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: #6b7280;
}
body.theme-crm .crm-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}
body.theme-crm .crm-breadcrumb a:hover { color: #1e3a5f; }
body.theme-crm .crm-breadcrumb strong {
  color: #111827;
  font-weight: 500;
}
body.theme-crm .crm-bc-sep {
  color: #c4c9d4;
}
body.theme-crm .crm-topbar-select {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  color: #374151;
  max-width: 180px;
}
body.theme-crm .crm-topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  color: #6b7280;
}
body.theme-crm .crm-topbar-icon:hover {
  background: #f3f4f8;
  color: #111827;
  text-decoration: none;
}
body.theme-crm .crm-topbar-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
body.theme-crm .crm-user-menu {
  position: relative;
}
body.theme-crm .crm-user-btn {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}
body.theme-crm .crm-user-btn::-webkit-details-marker { display: none; }
body.theme-crm .crm-user-btn:hover {
  background: #f3f4f8;
}
body.theme-crm .crm-user-name {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.theme-crm .crm-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 50;
}
body.theme-crm .crm-user-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  color: #374151;
  font-size: 13px;
  text-decoration: none;
}
body.theme-crm .crm-user-dropdown a:hover {
  background: #eef2ff;
  color: #1e3a5f;
}
body.theme-crm .sidebar-open {
  display: none;
  border: 0;
  background: transparent;
  color: #6b7280;
  padding: 6px;
}
body.theme-crm .app-mobile-bar { display: none !important; }

body.theme-crm .shell {
  padding: 18px 20px 28px;
  max-width: none;
  width: 100%;
}
body.theme-crm .shell-org {
  max-width: 1100px;
}
body.theme-crm .shell-board {
  padding: 0;
}

/* Hide old org-only shell leftovers */
body.theme-crm.is-org-home .org-shell { display: contents; }

@media (max-width: 900px) {
  body.theme-crm .sidebar-open { display: inline-flex; }
  body.theme-crm .crm-user-name { display: none; }
  body.theme-crm .crm-topbar-select { max-width: 120px; }
  body.theme-crm .shell { padding: 14px 12px 24px; }
}

/* Sidebar = Technologia logo background */
body.theme-crm .sidebar {
  color: #e8e6e1;
  background: #1c2124;
  border-right: 1px solid #14181b;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.25);
}
body.theme-crm .sidebar-head {
  border-bottom-color: rgba(255,255,255,0.08);
}
body.theme-crm .sidebar-toggle {
  color: #c5c2bb;
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
body.theme-crm .sidebar-link {
  color: #c9c6c0;
}
body.theme-crm .sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #f3f1ec;
}
body.theme-crm .sidebar-link.active {
  background: rgba(217, 84, 30, 0.18);
  color: #fff;
  font-weight: 700;
}
body.theme-crm .crm-sidebar-version {
  border-top-color: rgba(255,255,255,0.08);
  color: #8b9096;
}
body.theme-crm .sidebar-ico svg {
  stroke: currentColor;
}

/* ===== Worksuite profile (CRM-matched) ===== */
body.theme-crm .panel.ws-page {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.ws-page {
  font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1f2937;
}

.ws-page-title h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  font-family: inherit;
}

.ws-page-title .muted {
  font-size: 13px;
  color: #6b7280;
}

.ws-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.ws-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  cursor: pointer;
}

.ws-tab:hover {
  color: #1e293b;
}

.ws-tab.is-active {
  color: #0f1b2d;
  border-bottom-color: #f05000;
  font-weight: 600;
}

.ws-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.ws-summary-profile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 96px;
}

.ws-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8eef5;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.ws-avatar.lg {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.ws-summary-profile h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #111827;
}

.ws-summary-profile p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.ws-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 16px 18px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ws-stat-card .ws-stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.ws-stat-card .ws-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

.ws-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}

.ws-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  margin-bottom: 16px;
}

.ws-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid #eef1f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ws-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

.ws-card-body {
  padding: 0;
}

.ws-info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid #f3f4f6;
  min-height: 48px;
}

.ws-info-row:last-child {
  border-bottom: 0;
}

.ws-info-label {
  color: #8b95a5;
  font-size: 13px;
  font-weight: 500;
}

.ws-info-value {
  color: #111827;
  font-size: 13.5px;
  font-weight: 500;
}

.ws-info-row input,
.ws-info-row select,
.ws-info-row textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
}

.ws-info-row textarea {
  min-height: 72px;
  resize: vertical;
}

.ws-info-row-top {
  align-items: flex-start;
}

.repeat-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.repeat-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.repeat-field-row-social {
  grid-template-columns: minmax(118px, 138px) minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
}

.repeat-field-row-compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.repeat-field-row-compact.repeat-field-row-social {
  grid-template-columns: minmax(108px, 128px) minmax(0, 1fr) auto;
}

.repeat-field-row-social .social-value-input {
  min-width: 0;
}

.repeat-field-row-social .social-label-input {
  grid-column: 1 / -2;
}

.repeat-field-row-social .social-label-input[hidden] {
  display: none;
}

.repeat-field-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.repeat-field-row input,
.repeat-field-row select {
  width: 100%;
  min-width: 0;
}

.repeat-field-add,
.repeat-field-remove {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.repeat-field-add:hover,
.repeat-field-remove:hover {
  background: #f3f4f6;
}

.repeat-field-hint {
  margin: 0 0 10px;
}

.client-social-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.client-social-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.client-social-chip:hover {
  background: #e0e7ff;
}

.client-social-chip.is-website {
  background: #fff4eb;
  color: #b45309;
}

.client-social-chip.is-website:hover {
  background: #ffe8d6;
}

.ws-profile-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: start;
}

.ws-profile-main,
.ws-profile-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

@media (max-width: 960px) {
  .ws-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .repeat-field-row-social {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .repeat-field-row-social .social-platform-select {
    grid-column: 1 / -2;
  }

  .repeat-field-row-social .social-value-input {
    grid-column: 1 / -2;
  }

  .repeat-field-row-social .social-label-input {
    grid-column: 1 / -2;
  }
}

.ws-table-wrap {
  overflow: auto;
}

.ws-table {
  width: 100%;
  border-collapse: collapse;
}

.ws-table th {
  background: #f8fafc;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.ws-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13.5px;
  color: #111827;
}

.ws-table tr:last-child td {
  border-bottom: 0;
}

.ws-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-user-cell .ws-avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.ws-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2f7;
  color: #475569;
}

.ws-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 4px;
  border: 0;
  background: linear-gradient(135deg, #0f1b2d 0%, #1e3a5f 45%, #f05000 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(240, 80, 0, 0.18);
}

.ws-btn:hover {
  filter: brightness(1.05);
  color: #fff;
}

.ws-btn-secondary {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.ws-btn-secondary:hover {
  background: #f9fafb;
  color: #111827;
}

.ws-empty {
  padding: 28px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

.ws-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ws-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: #4b5563;
}

.ws-chip.is-on {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}

.ws-check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-hint {
  font-size: 12.5px;
  color: #6b7280;
  margin: 0 0 10px;
  padding: 0 18px;
}

.ws-card-body > .ws-hint {
  padding: 12px 18px 0;
}

body.theme-crm .ws-page h1,
body.theme-crm .ws-page h2,
body.theme-crm .ws-page h3 {
  font-family: inherit;
}

@media (max-width: 960px) {
  .ws-summary {
    grid-template-columns: 1fr 1fr;
  }

  .ws-summary-profile {
    grid-column: 1 / -1;
  }

  .ws-grid {
    grid-template-columns: 1fr;
  }

  .ws-info-row {
    grid-template-columns: 1fr;
  }
}

/* Finance module */
.finance-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.finance-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}
.finance-filters input,
.finance-filters select {
  min-height: 36px;
  min-width: 160px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  color: #111827;
  background: #fff;
}
.finance-filters input[type=search] {
  min-width: 220px;
}
.finance-table .badge + .badge {
  margin-left: 4px;
}
.finance-tabs {
  margin-bottom: 12px;
}
.finance-doc-form .finance-lines-table input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  box-sizing: border-box;
}
.finance-doc-form .finance-lines-table input[readonly] {
  background: #f8fafc;
  color: #475569;
}

/* Deep Settings hub (CRM-style secondary nav + detail tabs) */
.settings-hub {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.settings-hub-nav {
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 96px);
  overflow: auto;
}
.settings-hub-nav-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.settings-hub-nav-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.settings-hub-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.settings-hub-list {
  display: grid;
  gap: 2px;
}
.settings-hub-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.settings-hub-item:hover {
  background: #e5e7eb;
  color: #111827;
}
.settings-hub-item.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.settings-hub-panel {
  min-width: 0;
}
.settings-detail-tabs {
  margin: 0 0 14px;
}
.settings-hub-body {
  min-width: 0;
}
@media (max-width: 900px) {
  .settings-hub {
    grid-template-columns: 1fr;
  }
  .settings-hub-nav {
    position: static;
    max-height: none;
  }
  .settings-hub-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .settings-hub-item {
    background: #fff;
    border: 1px solid #e5e7eb;
  }
}
/* GHL-style staff editor */
.staff-edit {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.staff-edit-alert {
  margin: 0;
  padding: 12px 20px;
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 1px solid #fecaca;
  font-size: .92rem;
  font-weight: 500;
}
.staff-advanced {
  margin-top: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}
.staff-advanced > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 600;
  color: #155eef;
  user-select: none;
}
.staff-advanced > summary::-webkit-details-marker {
  display: none;
}
.staff-advanced > summary::after {
  content: " ›";
  font-weight: 700;
}
.staff-advanced[open] > summary::after {
  content: " ˅";
}
.staff-advanced-body {
  padding: 0 14px 16px;
  display: grid;
  gap: 12px;
}
.staff-password-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-top: 6px;
}
.staff-password-wrap input {
  flex: 1 1 auto;
  min-width: 0;
}
.staff-password-toggle {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}
.staff-password-toggle:hover {
  background: #f3f4f6;
}
.staff-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #eef1f4;
}
.staff-edit-head h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}
.staff-edit-head .muted {
  margin: 0;
}
.staff-edit-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 520px;
}
.staff-edit-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-right: 1px solid #eef1f4;
  background: #fafbfc;
}
.staff-edit-nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}
.staff-edit-nav-item:hover {
  background: #f3f4f6;
}
.staff-edit-nav-item.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 0 0 1px #e5e7eb;
}
.staff-edit-main {
  min-width: 0;
  padding: 18px 20px 8px;
}
.staff-pane {
  display: none;
}
.staff-pane.is-active {
  display: block;
}
.staff-pane-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 14px;
  color: #111827;
}
.staff-roles-top {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f4;
}
.staff-role-field {
  display: grid;
  gap: 6px;
  max-width: 320px;
  font-weight: 600;
  font-size: .9rem;
}
.staff-restrict-row {
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafbfc;
}
.staff-restrict-row span {
  display: grid;
  gap: 4px;
}
.staff-restrict-hint {
  display: block;
  font-weight: 400;
}
.staff-boards-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.staff-boards-title {
  font-weight: 600;
  margin-bottom: 10px;
}
.staff-boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
}
.staff-perm-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  min-height: 340px;
}
.staff-perm-side {
  border-right: 1px solid #eef1f4;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.staff-perm-search {
  margin: 12px;
  width: calc(100% - 24px);
  box-sizing: border-box;
}
.staff-perm-cats {
  overflow: auto;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
}
.staff-perm-cat {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  color: #374151;
  cursor: pointer;
}
.staff-perm-cat:hover {
  background: #f3f4f6;
}
.staff-perm-cat.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px #e5e7eb;
  font-weight: 600;
  color: #111827;
}
.staff-perm-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  flex: 0 0 auto;
}
.staff-perm-cat.is-on .staff-perm-cat-dot {
  background: #155eef;
}
.staff-perm-detail {
  padding: 18px 20px;
  min-width: 0;
}
.staff-perm-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.staff-perm-panel-head strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.staff-perm-panel-head .muted {
  margin: 0;
  max-width: 42ch;
}
.staff-perm-tabs {
  margin-top: 4px;
  padding: 12px 16px 16px;
  border-top: 1px solid #eef1f4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.staff-perm-tabs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}
.staff-perm-tab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}
.staff-perm-tab-label {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}
.staff-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.staff-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.staff-toggle-ui {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background .15s ease;
}
.staff-toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .15s ease;
}
.staff-toggle input:checked + .staff-toggle-ui {
  background: #155eef;
}
.staff-toggle input:checked + .staff-toggle-ui::after {
  transform: translateX(20px);
}
.staff-edit-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #eef1f4;
  background: #fafbfc;
}
@media (max-width: 900px) {
  .staff-edit-layout,
  .staff-perm-layout {
    grid-template-columns: 1fr;
  }
  .staff-edit-nav {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid #eef1f4;
    overflow-x: auto;
  }
  .staff-perm-side {
    border-right: 0;
    border-bottom: 1px solid #eef1f4;
  }
  .staff-perm-cats {
    max-height: 220px;
  }
}

/* Seat setups (Login & Password) */
.pw-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1f4;
}
.pw-subtabs a,
.pw-subtab-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -11px;
}
.pw-subtabs a:hover,
.pw-subtab-btn:hover { color: #1e3a5f; }
.pw-subtabs a.active,
.pw-subtab-btn.active {
  color: #1e3a5f;
  border-bottom-color: #1e3a5f;
}
.pw-subtabs-form { margin-top: 4px; }
.pw-panel { display: none; }
.pw-panel.is-active { display: block; }
.pw-form-grid select,
.pw-form-grid textarea {
  min-height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
}
.pw-form-grid textarea { min-height: 72px; resize: vertical; }
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.vm-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 14px 16px;
  background: #fff;
}
.vm-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.vm-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vm-checklist a {
  font-size: 12.5px;
  color: #6b7280;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}
.vm-checklist a.is-set {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.vm-checklist a:hover { color: #1e3a5f; }
.vm-notes { margin: 10px 0 0; }
