:root {
  /* Base palette */
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e6e8ee;
  --text: #151823;
  --muted: #6c7386;
  --accent: #d8ff2d;
  --event: #eaf1fe;
  --danger: #dc2626;

  /* Client pipeline status */
  --status-new: #bde0fe;
  --status-new-fg: #0b4f82;
  --status-discussion: #2563eb;
  --status-discussion-fg: #ffffff;
  --status-proposal: #8b5cf6;
  --status-proposal-fg: #ffffff;
  --status-negotiation: #16a34a;
  --status-negotiation-fg: #ffffff;
  --status-active: #d8ff2d;
  --status-active-fg: #111111;

  /* Client tag colours */
  --tag-publisher: #2563eb;
  --tag-tournament: #f97316;
  --tag-mobile: #0d9488;
  --tag-pc: #4f46e5;
  --tag-console: #475569;
  --tag-media: #ec4899;

  /* Approval workflow colours */
  --approval-accent: #d8ff2d;
  --approval-line: #e6e8ee;
  --approval-muted: #6c7386;
  --approval-text: #1a1f2c;
  --approval-card: #ffffff;
  --approval-bg-soft: #f7f8fb;

  --status-DRAFT-bg: #f1f2f5;
  --status-DRAFT-fg: #4b5566;
  --status-IN_REVIEW-bg: #ecf0ff;
  --status-IN_REVIEW-fg: #2f3da5;
  --status-APPROVED-bg: #e3f7e6;
  --status-APPROVED-fg: #1f7c39;
  --status-SENT-bg: #ddebff;
  --status-SENT-fg: #1f4ea3;
  --status-CANCELLED-bg: #f5d8d8;
  --status-CANCELLED-fg: #8e1f1f;

  --approver-pending-bg: #f1f2f5;
  --approver-pending-fg: #4b5566;
  --approver-approved-bg: #e3f7e6;
  --approver-approved-fg: #1f7c39;
  --approver-rejected-bg: #fde0e0;
  --approver-rejected-fg: #9a2828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}


/* import Studio Feixen Edgy Font from /public/fonts/StudioFeixenEdgy-Regular.ttf */
@font-face {
  font-family: 'Studio Feixen Edgy';
  src: url('/fonts/StudioFeixenEdgy-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-feature-settings: "calt", "liga", "ordn" 0, "ss04", "ss05", "ss06", "ss10", "zero" 0;
}

/* medium weight */
@font-face {
  font-family: 'Studio Feixen Edgy';
  src: url('/fonts/StudioFeixenEdgy-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-feature-settings: "calt", "liga", "ordn" 0, "ss04", "ss05", "ss06", "ss10", "zero" 0;
}



.runestone-font {
  font-family: 'Studio Feixen Edgy', sans-serif;
}

.calendar-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.calendar-sidebar {
  border-right: 1px solid var(--line);
  background: #f4f5f7;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-user {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
}

.sidebar-user-photo {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}

.sidebar-user-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1f2c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-title {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-logout {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 6px;
  margin-top: 2px;
}

.sidebar-user-logout:hover {
  background: #eceff4;
  color: var(--text);
}

.sidebar-brand {
  display: flex;
  gap: 5px;
  align-items: center;
  /* margin-bottom: 30px; */
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.2;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #3f475b;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.nav-link-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-link:hover {
  background: #eceff4;
}

.nav-link-active {
  background: var(--accent);
  color: #111111;
  font-weight: 600;
}

.calendar-content {
  padding: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.calendar-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
}

.calendar-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
}

.calendar-filter {
  min-width: 130px;
}

.button-primary {
  background: var(--accent);
  border-color: #c5eb1f;
  font-weight: 600;
}

.button-icon {
  width: 38px;
  font-size: 22px;
  line-height: 1;
  padding: 4px 0;
}

.calendar-grid-shell,
.events-table-shell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.calendar-grid-shell {
  padding: 16px;
}

.calendar-grid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.calendar-grid-header h2 {
  margin: 0;
  width: 200px;
  text-align: center;
  font-size: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.calendar-weekdays span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.calendar-day.muted {
  background: #fafbfc;
  color: #a3a8b5;
}

.day-number {
  font-size: 12px;
  margin-bottom: 8px;
}

.day-events {
  display: grid;
  gap: 5px;
}

.event-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.game-pill {
  display: inline-block;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.events-table-shell {
  margin-top: 16px;
  overflow: hidden;
}

.events-table-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.events-table-header h3 {
  margin: 0 0 4px;
}

.events-table-header p {
  margin: 0;
  color: var(--muted);
}

.events-table-row {
  display: grid;
  grid-template-columns: 220px 2fr 1fr 1.5fr 120px;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #eef0f5;
  font-size: 13px;
  align-items: center;
}

.events-table-row span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.events-table-head {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
}

.events-table-empty {
  padding: 14px 16px;
  color: var(--muted);
}

.calendar-error {
  margin-top: 14px;
  background: #fff5f5;
  border: 1px solid #ffc8c8;
  color: #9f2b2b;
  border-radius: 8px;
  padding: 12px 14px;
}

@media (max-width: 1120px) {
  .calendar-page {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}


/* =========================================================
   Client Relationship Maps — maps.css
   ========================================================= */

/* Ensure the hub page grid fills the viewport height */
.maps-page.calendar-page {
  height: 100vh;
  overflow: hidden;
}

/* Override calendar-content padding for the maps layout */
.maps-page .calendar-content.maps-content {
  padding: 0;
  display: grid;
  grid-template-columns: 250px 1fr 340px;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

/* Shared sidebar section label (needed on pages that don't include dashboard.css) */
.sidebar-section-label {
  display: block;
  padding: 2px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9097a9;
  text-transform: uppercase;
}

/* ---- Left panel: maps list ---- */
.maps-panel {
  border-right: 1px solid var(--line);
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  min-height: 0;
  padding: 16px 0 16px;
}

.maps-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
}

.maps-panel-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.maps-panel-header .button-primary {
  padding: 4px 10px;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
}

.maps-search {
  padding: 0 10px 10px;
}

.maps-search-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.maps-search-input:focus {
  border-color: #9ca3af;
}

.maps-section-label {
  display: block;
  padding: 10px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9097a9;
  text-transform: uppercase;
}

.maps-list {
  list-style: none;
  padding: 0 6px;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.maps-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #3f475b;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.maps-list-item:hover {
  background: #eceff4;
}

.maps-list-item.active {
  background: var(--accent);
  color: #111;
  font-weight: 600;
}

.maps-list-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.maps-list-item-badge.hot { background: #fef2f2; color: #dc2626; }
.maps-list-item-badge.warm { background: #fff7ed; color: #c2410c; }
.maps-list-item-badge.cold { background: #f3f4f6; color: #6b7280; }

.maps-filter-list {
  list-style: none;
  padding: 0 6px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.maps-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #3f475b;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}

.maps-filter:hover {
  background: #eceff4;
}

.maps-filter.maps-filter-active {
  background: #eceff4;
  font-weight: 600;
  color: var(--text);
}

.maps-filter-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  opacity: 0.55;
}

/* ---- Main content area ---- */
.maps-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ---- Header ---- */
.maps-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.maps-header-left {
  min-width: 0;
}

.maps-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.maps-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.maps-status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.maps-status-badge-small {
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10px;
}

.maps-sidebar-org .detail-row > .maps-status-badge {
  justify-self: start;
}

.maps-status-badge.hot { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.maps-status-badge.warm { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
.maps-status-badge.cold { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.maps-status-badge.active { background: #ecfdf3; color: #15803d; border: 1px solid #86efac; }
.maps-status-badge.high { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.maps-status-badge.medium { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.maps-status-badge.low { background: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }
.maps-status-badge.monitor { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }

.maps-meta {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.maps-header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.button-group {
  display: flex;
}

.button-group .button:first-child {
  border-radius: 6px 0 0 6px;
}

.button-group .button:last-child {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

/* ---- Toolbar ---- */
.maps-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-shrink: 0;
}

.maps-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Edit Mode toggle button */
.maps-edit-toggle {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: #fff;
  color: #3f475b;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.maps-edit-toggle:hover {
  background: #f3f4f6;
}

.maps-edit-toggle.active {
  background: var(--accent);
  color: #1f2333;
  border-color: var(--accent);
}

.maps-edit-toggle.active:hover {
  background: var(--accent);
  filter: brightness(0.93);
}

.maps-status-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.maps-status-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #3f475b;
  transition: all 0.1s;
}

.maps-status-filter-btn:hover {
  border-color: #9ca3af;
}

.maps-status-filter-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.maps-status-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.maps-view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.maps-view-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: #fff;
  cursor: pointer;
  color: #6c7386;
  border-right: 1px solid var(--line);
  transition: background 0.1s, color 0.1s;
}

.maps-view-btn:last-child {
  border-right: none;
}

.maps-view-btn:hover {
  background: #f3f4f6;
}

.maps-view-btn.maps-view-btn-active {
  background: var(--text);
  color: #fff;
}

.maps-view-btn.maps-view-btn-active .maps-view-btn-icon {
  filter: invert(1);
}

.maps-view-toggle.view-toggle-disabled .maps-view-btn {
  opacity: 0.45;
  cursor: not-allowed;
}

.maps-view-toggle.view-toggle-disabled .maps-view-btn-active {
  background: #9ca3af;
  color: #fff;
  border-color: transparent;
}

/* ---- Canvas / diagram area ---- */
.maps-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #f0f2f5;
  /* background-image, background-size and background-position are all driven by maps.js */
}

.maps-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

.maps-canvas.panning {
  cursor: grabbing;
}

.maps-canvas-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.maps-diagram {
  position: relative;
  padding: 40px 60px 60px;
  display: flex;
  flex-direction: column;
  gap: 0;
  isolation: isolate;
}

.maps-connections {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.diagram-tier {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  padding: 16px 18px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.diagram-tier:last-child {
  margin-bottom: 0;
}

.diagram-tier.l1         { background: rgba(234, 88, 12, 0.06); border-color: rgba(234, 88, 12, 0.18); }
.diagram-tier.l2         { background: rgba(79, 70, 229, 0.06); border-color: rgba(79, 70, 229, 0.18); }
.diagram-tier.l3         { background: rgba(22, 163, 74, 0.06); border-color: rgba(22, 163, 74, 0.18); }
.diagram-tier.l4         { background: rgba(8, 145, 178, 0.06); border-color: rgba(8, 145, 178, 0.18); }
.diagram-tier.former     { background: rgba(75, 85, 99, 0.06); border-color: rgba(75, 85, 99, 0.18); }
.diagram-tier.unassigned { background: rgba(148, 163, 184, 0.06); border-color: rgba(148, 163, 184, 0.18); }

.tier-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 14px;
}

.diagram-tier.l1 .tier-label         { background: #ea580c; }
.diagram-tier.l2 .tier-label         { background: #4f46e5; }
.diagram-tier.l3 .tier-label         { background: #16a34a; }
.diagram-tier.l4 .tier-label         { background: #0891b2; }
.diagram-tier.former .tier-label     { background: #4b5563; }
.diagram-tier.unassigned .tier-label { background: #94a3b8; }

.tier-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---- Contact cards ---- */
.contact-card {
  width: 180px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
}

/* ---- Hover highlight ---- */

.contact-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: #c0c5d0;
}

.contact-card.filtered-out {
  opacity: 0.2;
  pointer-events: none;
}

.card-tier-band {
  height: 5px;
}

.contact-card.l1 .card-tier-band         { background: #ea580c; }
.contact-card.l2 .card-tier-band         { background: #4f46e5; }
.contact-card.l3 .card-tier-band         { background: #16a34a; }
.contact-card.l4 .card-tier-band         { background: #0891b2; }
.contact-card.former .card-tier-band     { background: #4b5563; }
.contact-card.unassigned .card-tier-band { background: #94a3b8; }

.card-body {
  padding: 10px 12px 12px;
}

.card-tier-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 3px;
  padding-bottom: 0px;
  margin-bottom: 7px;
  color: #fff;
}

.card-tier-badge-inline {
  margin-bottom: 0;
  margin-right: 4px;
  vertical-align: middle;
}

.contact-card.l1 .card-tier-badge         { background: #ea580c; }
.contact-card.l2 .card-tier-badge         { background: #4f46e5; }
.contact-card.l3 .card-tier-badge         { background: #16a34a; }
.contact-card.l4 .card-tier-badge         { background: #0891b2; }
.contact-card.former .card-tier-badge     { background: #4b5563; }
.contact-card.unassigned .card-tier-badge { background: #94a3b8; }

.card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 3px;
  line-height: 1.3;
}

.card-title {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.card-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: capitalize;
}

.card-status-pill.hot { background: #fef2f2; color: #dc2626; }
.card-status-pill.warm { background: #fff7ed; color: #c2410c; }
.card-status-pill.cold { background: #f3f4f6; color: #6b7280; }

/* ---- Connection lines (base rules, full rules at bottom) ---- */

/* ---- Canvas controls ---- */
.maps-canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #9097a9;
  background: rgba(255,255,255,0.85);
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

.maps-canvas-controls {
  position: absolute;
  bottom: 12px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.maps-zoom-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: background 0.1s;
}

.maps-zoom-btn:hover {
  background: #f3f4f6;
}

/* ---- List view ---- */

.maps-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.maps-list-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.maps-list-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f1f4;
  vertical-align: middle;
}

.maps-list-table tr:hover td {
  background: #fafbfc;
}

.list-tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
}

.list-tier-badge.l1         { background: #ea580c; }
.list-tier-badge.l2         { background: #4f46e5; }
.list-tier-badge.l3         { background: #16a34a; }
.list-tier-badge.l4         { background: #0891b2; }
.list-tier-badge.former     { background: #4b5563; }
.list-tier-badge.unassigned { background: #94a3b8; }

/* ---- Right sidebar (summary / contact detail) ---- */
.maps-summary {
  border-left: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.maps-sidebar-summary {
  padding: 18px 16px;
  overflow-y: auto;
  flex: 1;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.maps-sidebar-summary[hidden] {
  display: none;
}

.client-detail-panel[hidden] {
  display: none;
}

.maps-summary-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.maps-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.maps-summary-label {
  font-size: 12px;
  color: var(--muted);
}

.maps-summary-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.maps-summary-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0 12px;
}

.maps-summary-section {
  margin-bottom: 6px;
}

.maps-summary-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9097a9;
  margin-bottom: 8px;
}

.maps-summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.maps-summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.maps-summary-list .summary-row-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}

.maps-summary-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.maps-summary-num {
  font-weight: 600;
  color: var(--text);
}

/* ---- Legend ---- */
.maps-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.maps-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.maps-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.maps-legend-dot.maps-legend-dot-status {
  border-radius: 50%;
}

/* ---- Empty / loading states ---- */
.maps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
  gap: 10px;
}

/* ---- Edit Mode ---- */
.maps-canvas.edit-mode {
  cursor: default;
}

.maps-canvas.edit-mode.panning {
  cursor: grabbing;
}

/* In edit mode, card body is not draggable via canvas pan - card drag takes priority.
   z-index: 1 ensures cards sit above the SVG layer (z-index: 0) so handle clicks register
   and connections render behind cards, not on top of them. */
.maps-canvas.edit-mode .contact-card {
  position: relative;
  cursor: grab;
  outline: 1px dashed rgba(100, 116, 139, 0.3);
  z-index: 1;
}

.maps-canvas.edit-mode .contact-card:hover {
  outline-color: #94a3b8;
}

.contact-card.card-dragging {
  cursor: grabbing !important;
  opacity: 0.75;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  z-index: 100;
}

/* ---- Connection handle ---- */
.connection-handle {
  display: none;
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #94a3b8;
  cursor: crosshair;
  z-index: 10;
  transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.maps-canvas.edit-mode .connection-handle {
  display: block;
}

.maps-canvas.edit-mode .connection-handle:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  transform: translateY(-50%) scale(1.25);
}

/* During active connection draw */
.maps-diagram.drawing-connection .contact-card {
  cursor: crosshair !important;
}

/* ---- Connection lines ---- */
.connection-line {
  fill: none;
  stroke: #c8cdd8;
  stroke-width: 1.5;
  transition: opacity 0.15s, stroke 0.15s, stroke-width 0.15s;
}

.connection-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: default;
}

.maps-canvas.edit-mode .connection-hit {
  cursor: pointer;
  pointer-events: stroke;
}

/* Enable SVG interaction in edit mode */
.maps-canvas.edit-mode .maps-connections {
  pointer-events: all;
}

.maps-canvas.edit-mode .connection-line {
  pointer-events: none;
}

/* Break preview: hover over a connection in edit mode */
.connection-line.connection-break-preview {
  stroke: #ef4444;
  stroke-dasharray: 6 4;
  stroke-width: 2.5;
  opacity: 1;
}

.connection-hit.connection-break-preview {
  cursor: not-allowed;
}

/* ---- Pending connection line (while drawing) ---- */
.connection-pending {
  stroke: #3b82f6;
  stroke-width: 2;
  stroke-dasharray: 7 4;
  pointer-events: none;
  animation: dash-flow 0.8s linear infinite;
}

@keyframes dash-flow {
  to { stroke-dashoffset: -22; }
}

/* ---- Hover highlight (view mode) ---- */
.maps-diagram.has-highlight .contact-card:not(.card-highlighted) {
  opacity: 0.2;
}

.maps-diagram.has-highlight .card-highlighted {
  box-shadow: 0 4px 18px rgba(0,0,0,0.16);
  border-color: #9ca3af;
}

.maps-diagram.has-highlight .connection-line:not(.line-highlighted) {
  opacity: 0.08;
}

.maps-diagram.has-highlight .line-highlighted {
  stroke: #374151;
  stroke-width: 2.5;
  opacity: 1;
}

/* ---- Pipeline status badge in list view ---- */
.pipeline-status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: #f1f2f5;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Free-position canvas (edit mode) ---- */
.maps-canvas.edit-mode .maps-diagram {
  min-width: 800px;
  min-height: 600px;
}

/* ---- Scrollbar for list view ---- */
.maps-list-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ---- Org list row with action button ---- */
.maps-list-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 6px;
  transition: background 0.1s;
}
.maps-list-row:hover {
  background: #eceff4;
}
.maps-list-row:hover .maps-list-item {
  background: none;
}
.maps-list-row .maps-list-item {
  flex: 1;
  border-radius: 6px 0 0 6px;
}
.maps-list-row .maps-list-item:hover {
  background: none;
}
.maps-list-row .maps-list-item.active {
  border-radius: 6px 0 0 6px;
}
.maps-list-item-menu-btn {
  flex-shrink: 0;
  width: 26px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #9ca3af;
  border-radius: 0 6px 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.1s, background 0.1s, color 0.1s;
  line-height: 1;
}
.maps-list-row:hover .maps-list-item-menu-btn {
  opacity: 1;
}
.maps-list-item-menu-btn:hover {
  background: #d1d5db;
  color: #374151;
}

/* ---- Org actions dropdown ---- */
.org-actions-dropdown {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  min-width: 140px;
  z-index: 200;
}
.org-actions-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}
.org-actions-item:hover {
  background: #f3f4f6;
}
.org-actions-item-danger {
  color: #dc2626;
}
.org-actions-item-danger:hover {
  background: #fef2f2;
}

/* ---- Button variants ---- */
.button-subtle {
  background: #f7f8fa;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
}

/* ---- Modal (shared with rename org modal) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 23, 41, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 12px;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(17, 23, 41, 0.25);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
}
.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.form-field > span {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}
.form-field textarea {
  resize: vertical;
  min-height: 90px;
}
.form-field-full { grid-column: 1 / -1; }
.contact-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  gap: 8px;
}
.contact-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-field-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.form-field-label-with-icon img {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}
.form-error {
  margin-top: 12px;
  color: var(--danger);
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}
.form-footer {
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

/* ---- Contact detail panel (right sidebar) ---- */
.detail-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

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

.detail-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #f3f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #475569;
  overflow: hidden;
  flex-shrink: 0;
}

.detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  min-width: 0;
}

.detail-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.detail-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.detail-actions-wrap {
  position: relative;
}

.detail-actions-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.detail-actions-toggle:hover,
.detail-actions-toggle[aria-expanded="true"] {
  background: #f3f4f6;
  color: var(--text);
}

.detail-actions-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 140px;
  overflow: hidden;
  z-index: 210;
}

.detail-actions-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
}

.detail-actions-item:hover {
  background: #f3f4f6;
}

.detail-actions-item-danger {
  color: #dc2626;
}

.detail-actions-item-danger:hover {
  background: #fef2f2;
}

.detail-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

.detail-close:hover {
  color: var(--text);
}

.detail-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-section-title-row h3 {
  margin-bottom: 0;
}

.detail-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-inline-action-btn {
  border: 1px solid #d6dae6;
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.detail-inline-action-btn:hover:not(:disabled) {
  background: #f3f4f7;
  border-color: #bcc3d3;
  color: var(--text);
}

.detail-inline-action-btn:disabled {
  color: #a0a8bb;
  border-color: #e3e6ef;
  background: #f8f9fc;
  cursor: not-allowed;
}

.detail-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  /* padding: 10px; */
  padding-top: 10px;
}

.detail-contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-contact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}

.detail-contact-action.is-empty {
  min-width: 0;
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-copy-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s, border-color 0.12s;
}

.detail-copy-icon-btn:hover {
  background: #f3f4f7;
  border-color: #c9ced8;
}

.detail-copy-icon-btn img {
  width: 14px;
  height: 14px;
  opacity: 0.72;
}

.detail-copy-icon-btn.is-missing {
  opacity: 0.48;
  border-style: dashed;
  cursor: default;
}

.detail-copy-icon-btn.is-missing:hover {
  background: #fff;
  border-color: var(--line);
}

.tiny-ui-tooltip {
  position: fixed;
  z-index: 9999;
  background: #1f2333;
  color: #fff;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tiny-date-note-popover {
  position: fixed;
  z-index: 10000;
  width: min(280px, calc(100vw - 16px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.tiny-date-note-popover[hidden] {
  display: none !important;
}

.tiny-date-note-popover-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tiny-date-note-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tiny-date-note-field span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tiny-date-note-field input {
  width: 100%;
  border: 1px solid #d7dbe7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
}

.tiny-date-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

.tiny-date-note-btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.tiny-date-note-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.tiny-date-note-btn-subtle {
  background: #fff;
  color: var(--muted);
}

.tiny-date-note-btn-subtle:hover:not(:disabled) {
  background: #f7f8fb;
}

.tiny-date-note-btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.tiny-date-note-btn-primary:hover:not(:disabled) {
  background: #111827;
}

.tiny-history-popover {
  position: fixed;
  z-index: 10000;
  width: min(320px, calc(100vw - 16px));
  max-height: min(320px, calc(100vh - 24px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tiny-history-popover[hidden] {
  display: none !important;
}

.tiny-history-popover-head {
  border-bottom: 1px solid #eef1f6;
  padding: 8px 10px;
}

.tiny-history-popover-title {
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tiny-history-popover-body {
  padding: 8px 10px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tiny-history-loading,
.tiny-history-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0;
}

.tiny-history-item {
  border: 1px solid #eef1f6;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fafbfe;
}

.tiny-history-item-when {
  font-size: 11px;
  color: #4b5565;
  margin-bottom: 3px;
}

.tiny-history-item-note {
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #f1f2f5;
}

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

.detail-label {
  color: var(--muted);
}

.detail-value {
  color: var(--text);
  word-break: break-word;
}

.detail-value a {
  color: #4f46e5;
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-notes {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-last-contacted {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.org-recent-last-contacted {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.org-recent-last-contacted.is-empty {
  color: var(--muted);
  font-size: 12px;
}

.org-last-contact-item {
  border: 1px solid #ebedf4;
  border-radius: 8px;
  background: #fafbfe;
  padding: 7px 8px;
}

.org-last-contact-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.org-last-contact-name {
  font-size: 12px;
  color: var(--text);
}

.org-last-contact-when {
  font-size: 11px;
  color: var(--muted);
}

.org-last-contact-note {
  margin: 3px 0 0;
  font-size: 12px;
  color: #4b5565;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Selected card highlight */
.contact-card.card-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(31, 35, 51, 0.18);
}


/* =========================================================
   Dashboard
   ========================================================= */

.calendar-sidebar .sidebar-divider {
  height: 1px;
  margin: 14px 4px 6px;
  background: #e6e8ee;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 40px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.stat-card-accent {
  background: linear-gradient(135deg, #f7ffd0 0%, #ffffff 70%);
  border-color: #e1f19a;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f3f5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-accent .stat-icon {
  background: rgba(216, 255, 45, 0.45);
}

.stat-icon img {
  width: 22px;
  height: 22px;
}

.stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-helper {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dashboard-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
}

.panel-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-link {
  font-size: 12px;
  color: #3f475b;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  background: #fafbfc;
}

.panel-link:hover {
  background: #eceff4;
}

.agenda-list {
  display: flex;
  flex-direction: column;
}

.agenda-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #eef0f5;
  align-items: center;
}

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

.agenda-row-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f6f7f9;
  padding: 8px 4px;
  font-weight: 600;
}

.agenda-row-date .agenda-day {
  font-size: 20px;
  line-height: 1;
}

.agenda-row-date .agenda-month {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.agenda-row-date.is-today {
  background: var(--accent);
  color: #111;
}

.agenda-row-date.is-today .agenda-month {
  color: #111;
}

.agenda-row-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.agenda-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-row-title img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: cover;
}

.agenda-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-row-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c4c8d4;
}

.agenda-row-prize {
  font-size: 13px;
  font-weight: 600;
  color: #3f475b;
  white-space: nowrap;
}

.agenda-row-game-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.agenda-empty {
  padding: 22px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.dashboard-error {
  background: #fff5f5;
  border: 1px solid #ffc8c8;
  color: #9f2b2b;
  border-radius: 8px;
  padding: 12px 14px;
}

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


/* =========================================================
   Clients — Kanban pipeline
   ========================================================= */

.clients-content {
  padding-right: 360px;
}

.clients-board-shell {
  background: transparent;
  border: 0;
  padding: 0;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-column {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  max-height: calc(100vh - 180px);
}

.kanban-column.drop-target {
  outline: 2px dashed #94a3b8;
  outline-offset: -4px;
}

.kanban-column-header {
  padding: 12px 14px 10px;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-column[data-status="IN_DISCUSSION"] .kanban-column-header { border-bottom-color: var(--status-discussion); }
.kanban-column[data-status="PROPOSAL_SENT"] .kanban-column-header { border-bottom-color: var(--status-proposal); }
.kanban-column[data-status="NEGOTIATION"] .kanban-column-header { border-bottom-color: var(--status-negotiation); }
.kanban-column[data-status="ACTIVE_PARTNER"] .kanban-column-header { border-bottom-color: var(--status-active); }

.kanban-column-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f2333;
}

.kanban-column-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f2f5;
  border-radius: 999px;
  padding: 2px 8px;
}

.kanban-column-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.kanban-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.client-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(17, 23, 41, 0.04);
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.client-card:hover {
  box-shadow: 0 4px 12px rgba(17, 23, 41, 0.08);
}

.client-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.client-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  overflow: hidden;
  flex-shrink: 0;
}

.client-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-subname {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-meta {
  font-size: 12px;
  color: #475569;
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.client-card-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-meta-row .muted {
  color: var(--muted);
}

.client-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: #eef0f5;
  color: #1f2333;
}

.tag-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.tag-pill[data-tag="Publisher"] { background: rgba(37, 99, 235, 0.12); color: var(--tag-publisher); }
.tag-pill[data-tag="Tournament Organizer"] { background: rgba(249, 115, 22, 0.14); color: var(--tag-tournament); }
.tag-pill[data-tag="Mobile Games"] { background: rgba(13, 148, 136, 0.14); color: var(--tag-mobile); }
.tag-pill[data-tag="PC Games"] { background: rgba(79, 70, 229, 0.14); color: var(--tag-pc); }
.tag-pill[data-tag="Console Games"] { background: rgba(71, 85, 105, 0.14); color: var(--tag-console); }
.tag-pill[data-tag="Media Partner"] { background: rgba(236, 72, 153, 0.14); color: var(--tag-media); }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill[data-status="NEW"] { background: var(--status-new); color: var(--status-new-fg); }
.status-pill[data-status="IN_DISCUSSION"] { background: var(--status-discussion); color: var(--status-discussion-fg); }
.status-pill[data-status="PROPOSAL_SENT"] { background: var(--status-proposal); color: var(--status-proposal-fg); }
.status-pill[data-status="NEGOTIATION"] { background: var(--status-negotiation); color: var(--status-negotiation-fg); }
.status-pill[data-status="ACTIVE_PARTNER"] { background: var(--status-active); color: var(--status-active-fg); }

/* Client detail panel */
.client-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -6px 0 18px rgba(17, 23, 41, 0.06);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  z-index: 20;
}

.detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
}

.detail-empty[hidden] {
  display: none;
}

.detail-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f3f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.detail-empty-icon img {
  width: 26px;
  height: 26px;
  opacity: 0.55;
}

.detail-empty h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.detail-empty p {
  margin: 0;
  font-size: 12px;
  max-width: 220px;
  line-height: 1.45;
}

.button-danger {
  background: #fff;
  border-color: #fca5a5;
  color: var(--danger);
  font-weight: 600;
}

.button-danger:hover {
  background: #fff5f5;
}

/* Form extras */
.form-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-field-row select {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.form-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-logo-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f3f4f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.form-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.form-tag-option {
  cursor: pointer;
}

.form-tag-option input {
  display: none;
}

.form-tag-option .tag-pill {
  border: 1px solid transparent;
  user-select: none;
}

.form-tag-option input:not(:checked) + .tag-pill {
  background: #f4f5f7;
  color: #64748b;
}

.form-tag-option input:checked + .tag-pill {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

.form-tag-option input:not(:checked) + .card-status-pill {
  opacity: 0.45;
}

.form-tag-option input:checked + .card-status-pill {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.clients-error {
  margin-top: 14px;
  background: #fff5f5;
  border: 1px solid #ffc8c8;
  color: #9f2b2b;
  border-radius: 8px;
  padding: 12px 14px;
}

/* Tier badges on contact kanban cards */
.tier-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  color: #fff;
}

.tier-badge.tier-l1        { background: #ea580c; }
.tier-badge.tier-l2        { background: #4f46e5; }
.tier-badge.tier-l3        { background: #16a34a; }
.tier-badge.tier-l4        { background: #0891b2; }
.tier-badge.tier-former    { background: #4b5563; }
.tier-badge.tier-unassigned { background: #94a3b8; }

.contact-kanban-card .client-subname.contact-org-name {
  font-size: 11px;
  color: var(--muted);
}

.contact-org-logo {
  background: #e8eaf0;
}

.client-detail-panel.is-empty .detail-body,
.client-detail-panel.is-empty .detail-header {
  display: none;
}

/* Parked / Unassigned tray */
.parked-tray {
  border-bottom: 1px solid var(--line);
  background: #f8f9fb;
  display: flex;
  flex-direction: column;
  max-height: 300px;
  flex-shrink: 0;
  transition: max-height 220ms ease;
}

.parked-tray.collapsed {
  max-height: 36px;
}

.parked-tray.drop-target {
  outline: 2px dashed #94a3b8;
  outline-offset: -4px;
  background: #f0f4ff;
}

.parked-tray-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.parked-tray-header:hover {
  background: #f0f1f5;
}

.parked-tray-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parked-tray-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.parked-tray-count {
  font-size: 11px;
  font-weight: 600;
  background: #e2e5ec;
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 7px;
}

.parked-tray-chevron {
  font-size: 16px;
  color: var(--muted);
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 220ms ease;
  display: inline-block;
}

.parked-tray.collapsed .parked-tray-chevron {
  transform: rotate(-90deg);
}

.parked-tray-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.parked-tray.collapsed .parked-tray-body {
  overflow: hidden;
  padding: 0;
  gap: 0;
}

.parked-empty {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 12px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.parked-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: grab;
  flex-shrink: 0;
  transition: box-shadow 120ms ease;
}

.parked-card:hover {
  box-shadow: 0 2px 6px rgba(17, 23, 41, 0.08);
}

.parked-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.parked-card-avatar {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #e8eaf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  overflow: hidden;
  flex-shrink: 0;
}

.parked-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parked-card-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.parked-card-name {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.parked-card-org {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parked-card-new-badge {
  display: inline-block;
  margin-left: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #16a34a;
  background: #dcfce7;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  line-height: 1.5;
}

@media (max-width: 1280px) {
  .kanban-board {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .detail-top-grid {
    grid-template-columns: 1fr;
  }
  .clients-content {
    padding-right: 24px;
  }
  .client-detail-panel {
    width: 100%;
  }
  .client-detail-panel.is-empty {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Staff admin
   ========================================================= */

.staff-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 40px;
}

.staff-table-shell {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e6e8ee;
  overflow: hidden;
}

.staff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.staff-table thead {
  background: #f7f8fb;
  color: #5b6477;
}

.staff-table th,
.staff-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eef0f5;
  vertical-align: middle;
}

.staff-table tbody tr:last-child td {
  border-bottom: none;
}

.staff-table th {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.staff-col-photo { width: 56px; }
.staff-col-actions { width: 220px; text-align: right; }

.staff-loading {
  text-align: center;
  color: #8d94a3;
  padding: 28px 16px;
}

.staff-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.staff-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.staff-name-cell {
  font-weight: 600;
  color: #1a1f2c;
}

.staff-master-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #5b8def;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.staff-muted {
  color: #8d94a3;
  font-size: 13px;
}

.staff-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.staff-row-actions .button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.staff-row-actions .button-danger {
  background: #fdecec;
  color: #b21f2d;
  border-color: #f4c2c2;
}

.staff-row-actions .button-danger:hover {
  background: #f9d6d6;
  border-color: #ec9b9b;
}

.staff-error {
  background: #fdecec;
  color: #b21f2d;
  border: 1px solid #f4c2c2;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.form-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-photo-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid #d6dae3;
}

.form-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* =========================================================
   Document Pre-Approvals
   ========================================================= */

.approvals-content {
  padding-bottom: 40px;
}

.approvals-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
}

.approvals-filters {
  background: var(--approval-card);
  border: 1px solid var(--approval-line);
  border-radius: 12px;
  padding: 14px 8px;
  position: sticky;
  top: 24px;
}

.approvals-filters-title {
  margin: 0 12px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d94a3;
}

.approvals-filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.approvals-filter {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: #3f475b;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  text-align: left;
}

.approvals-filter:hover {
  background: #eceff4;
}

.approvals-filter-active {
  background: #1a1f2c;
  color: #ffffff;
}

.approvals-filter-active:hover {
  background: #1a1f2c;
}

.approvals-filter-icon {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}

.approvals-filter-active .approvals-filter-icon {
  filter: brightness(0) invert(1);
}

.approvals-filter-label {
  flex: 1;
}

.approvals-filter-count {
  font-size: 11px;
  font-weight: 600;
  background: #f1f2f5;
  color: #4b5566;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

.approvals-filter-active .approvals-filter-count {
  background: var(--approval-accent);
  color: #1a1f2c;
}

.approvals-list-shell {
  background: var(--approval-card);
  border: 1px solid var(--approval-line);
  border-radius: 14px;
  overflow: hidden;
}

.approvals-list-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--approval-line);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.approvals-list-header h2 {
  margin: 0;
  font-size: 18px;
}

.approvals-list-subtitle {
  margin: 0;
  color: var(--approval-muted);
  font-size: 13px;
}

.approvals-list {
  display: flex;
  flex-direction: column;
}

.approvals-loading,
.approvals-empty {
  padding: 32px 20px;
  text-align: center;
  color: #8d94a3;
  font-size: 14px;
}

.approval-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #eef0f5;
  text-decoration: none;
  color: inherit;
}

.approval-card:hover {
  background: #fafbfc;
}

.approval-card:last-child {
  border-bottom: 0;
}

.approval-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.approval-card-code {
  font-size: 12px;
  font-weight: 600;
  color: var(--approval-muted);
  font-variant-numeric: tabular-nums;
}

.approval-card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--approval-text);
}

.approval-card-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--approval-muted);
}

.approval-card-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--approval-muted);
}

.approval-card-counts {
  font-weight: 600;
  color: var(--approval-text);
  font-size: 13px;
}

/* Approval status pills */
.approval-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-DRAFT { background: var(--status-DRAFT-bg); color: var(--status-DRAFT-fg); }
.status-IN_REVIEW { background: var(--status-IN_REVIEW-bg); color: var(--status-IN_REVIEW-fg); }
.status-APPROVED { background: var(--status-APPROVED-bg); color: var(--status-APPROVED-fg); }
.status-SENT { background: var(--status-SENT-bg); color: var(--status-SENT-fg); }
.status-CANCELLED { background: var(--status-CANCELLED-bg); color: var(--status-CANCELLED-fg); }

.approvals-error {
  margin: 14px 0;
  background: #fff5f5;
  color: #b21f2d;
  border: 1px solid #f4c2c2;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

/* Wide modal variant */
.modal-card-wide {
  width: min(820px, 100%);
}

/* Approver picker */
.form-approvers-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  padding: 6px;
  border: 1px dashed var(--approval-line);
  border-radius: 8px;
  background: #fafbfc;
}

.form-approvers-empty {
  font-size: 12px;
  color: var(--approval-muted);
  padding: 4px 6px;
}

.form-approver-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--approval-line);
  border-radius: 999px;
  padding: 3px 6px 3px 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--approval-text);
}

.form-approver-chip-photo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.form-approver-chip-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-approver-chip-remove {
  border: 0;
  background: transparent;
  color: var(--approval-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.form-approvers-options {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--approval-line);
  border-radius: 8px;
}

.form-approver-option {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--approval-line);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.form-approver-option:hover {
  background: #f7f8fb;
}

.form-approver-option-on {
  border-color: #1a1f2c;
  background: #1a1f2c;
  color: #fff;
}

.form-approver-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.form-approver-option-on .form-approver-photo {
  background: var(--approval-accent);
  color: #1a1f2c;
}

.form-approver-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.form-approver-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.form-approver-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-approver-title {
  font-size: 11px;
  color: var(--approval-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-approver-option-on .form-approver-title {
  color: rgba(255, 255, 255, 0.7);
}

.form-approver-toggle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-approver-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--approval-muted);
  font-size: 12px;
  padding: 14px;
}

.form-attachment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--approval-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.form-attachment-file input[type="file"] {
  display: none;
}

.form-attachment-url {
  flex: 1;
  min-width: 220px;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--approval-line);
  border-radius: 8px;
}

/* Approval detail page */
.approval-detail-content {
  padding-bottom: 40px;
}

.approval-detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 18px;
  align-items: end;
}

.approval-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--approval-muted);
  text-decoration: none;
  margin-bottom: 8px;
}

.approval-detail-back:hover {
  color: var(--approval-text);
}

.approval-detail-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.approval-detail-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.approval-detail-subtitle {
  margin: 4px 0 0;
  color: var(--approval-muted);
  font-size: 13px;
}

.approval-detail-meta-right {
  text-align: right;
  font-size: 12px;
  color: var(--approval-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.approval-detail-meta-right .approval-detail-code {
  font-weight: 700;
  color: var(--approval-text);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.approval-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.approval-panel {
  background: var(--approval-card);
  border: 1px solid var(--approval-line);
  border-radius: 14px;
  padding: 18px 20px;
}

.approval-panel + .approval-panel {
  margin-top: 16px;
}

.approval-panel-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #8d94a3;
  text-transform: uppercase;
  border-bottom: 2px solid var(--approval-accent);
  padding-bottom: 6px;
  display: inline-block;
}

.approval-doc {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.approval-doc-icon {
  width: 56px;
  height: 64px;
  background: #fdecec;
  color: #b21f2d;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.approval-doc-icon.icon-link {
  background: #e3f0ff;
  color: #1f4ea3;
}

.approval-doc-info-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.approval-doc-info-version {
  font-size: 12px;
  color: var(--approval-muted);
  margin-bottom: 10px;
}

.approval-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.approval-doc-actions .button {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.approval-doc-actions .approval-doc-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.approval-doc-actions .approval-doc-action-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 61, 165, 0.2);
}

.approval-doc-actions .approval-doc-action-preview {
  background: #f5f7ff;
  border-color: #d8dff8;
  color: #2f3da5;
}

.approval-doc-actions .approval-doc-action-preview:hover {
  background: #e9eeff;
  border-color: #c9d4fb;
  color: #243287;
}

.approval-doc-actions .approval-doc-action-download {
  background: #ffffff;
  border-color: #d7deea;
  color: #1f2a40;
}

.approval-doc-actions .approval-doc-action-download:hover {
  background: #f8fafc;
  border-color: #c5cedf;
  color: #161f33;
}

.approval-changelog {
  background: var(--approval-bg-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--approval-text);
}

.approval-changelog-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--approval-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.approval-changelog-summary {
  white-space: pre-wrap;
}

/* Approval stepper */
.approval-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  align-items: start;
  margin-bottom: 12px;
}

.approval-step {
  text-align: center;
  position: relative;
}

.approval-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--approval-line);
  z-index: 0;
}

.approval-step:first-child::before {
  display: none;
}

.approval-step.step-done::before,
.approval-step.step-current::before {
  background: #2563eb;
}

.approval-step.step-done .approval-step-circle,
.approval-step.step-current .approval-step-circle {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.approval-step.step-current .approval-step-circle {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.approval-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--approval-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--approval-muted);
  position: relative;
  z-index: 1;
}

.approval-step-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--approval-text);
}

.approval-step-sub {
  font-size: 11px;
  color: var(--approval-muted);
}

.approval-stepper-note {
  margin-top: 10px;
  background: #fff8e1;
  border: 1px solid #ffe49a;
  color: #6f5a00;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

.approval-stepper-note-strong {
  font-weight: 700;
}

/* Approval link panel */
.approval-link-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  margin-bottom: 8px;
}

.approval-link-input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--approval-line);
  border-radius: 8px;
  background: var(--approval-bg-soft);
  color: var(--approval-text);
  min-width: 0;
}

.approval-link-copy {
  padding: 6px 10px;
  font-size: 12px;
}

.approval-link-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.approval-link-actions .button {
  flex: 1;
  font-size: 12px;
  padding: 7px 10px;
}

.approval-link-expiry {
  font-size: 11px;
  color: var(--approval-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Approvers panel */
.approver-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eef0f5;
}

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

.approver-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e6e8ee;
  color: #5b6477;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}

.approver-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.approver-info {
  min-width: 0;
}

.approver-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--approval-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approver-title {
  font-size: 11px;
  color: var(--approval-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approver-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

.approver-status-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.approver-status-PENDING { background: var(--approver-pending-bg); color: var(--approver-pending-fg); }
.approver-status-APPROVED { background: var(--approver-approved-bg); color: var(--approver-approved-fg); }
.approver-status-REJECTED { background: var(--approver-rejected-bg); color: var(--approver-rejected-fg); }

.approver-status-when {
  font-size: 10px;
  color: var(--approval-muted);
}

.approver-status-comment {
  font-size: 11px;
  color: var(--approval-muted);
  font-style: italic;
}

/* Approval detail panel rows */
.approval-detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 13px;
}

.approval-detail-row:last-child {
  border-bottom: 0;
}

.approval-detail-row-label {
  color: var(--approval-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.approval-detail-row-value {
  word-break: break-word;
}

.approval-detail-row-value.muted {
  color: var(--approval-muted);
}

/* Timeline */
.approval-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 30px;
}

.approval-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #eef0f5;
}

.approval-timeline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  position: relative;
}

.approval-timeline-dot {
  position: absolute;
  left: -30px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--approval-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--approval-muted);
}

.approval-timeline-dot.dot-APPROVED { border-color: #1f7c39; color: #1f7c39; background: #e3f7e6; }
.approval-timeline-dot.dot-REJECTED { border-color: #9a2828; color: #9a2828; background: #fde0e0; }
.approval-timeline-dot.dot-VERSION_UPLOADED { border-color: #6b46c1; color: #6b46c1; background: #efe7fb; }
.approval-timeline-dot.dot-REQUEST_SENT { border-color: #2563eb; color: #2563eb; background: #ecf0ff; }
.approval-timeline-dot.dot-CREATED { border-color: #4b5566; color: #4b5566; background: #f1f2f5; }
.approval-timeline-dot.dot-COMMENT { border-color: #2f3da5; color: #2f3da5; background: #ecf0ff; }
.approval-timeline-dot.dot-APPROVERS_CHANGED { border-color: #4b5566; color: #4b5566; background: #f1f2f5; }
.approval-timeline-dot.dot-TOKEN_REGENERATED { border-color: #4b5566; color: #4b5566; background: #f1f2f5; }
.approval-timeline-dot.dot-REVIEW_CANCELLED { border-color: #4b5566; color: #4b5566; background: #f1f2f5; }
.approval-timeline-dot.dot-CANCELLED { border-color: #8e1f1f; color: #8e1f1f; background: #f5d8d8; }
.approval-timeline-dot.dot-SENT_TO_DOCUSIGN { border-color: #1f4ea3; color: #1f4ea3; background: #ddebff; }

.approval-timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--approval-text);
}

.approval-timeline-meta {
  font-size: 12px;
  color: var(--approval-muted);
  margin-top: 2px;
}

.approval-timeline-when {
  text-align: right;
  font-size: 11px;
  color: var(--approval-muted);
  white-space: nowrap;
}

/* Footer action bar */
.approval-action-bar {
  position: sticky;
  bottom: 0;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--approval-line);
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 18px rgba(17, 23, 41, 0.06);
}

.approval-action-bar-status {
  flex: 1;
  font-size: 13px;
  color: var(--approval-muted);
}

.approval-action-bar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.approval-action-bar-status strong {
  color: var(--approval-text);
}

.approval-action-bar .button {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.approval-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.approval-checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.button-disabled,
.button:disabled {
  background: #f1f2f5;
  color: #a3a8b5;
  border-color: #e6e8ee;
  cursor: not-allowed;
}

.button-decision-approve {
  background: #1f7c39;
  border-color: #1f7c39;
  color: #fff;
  font-weight: 600;
}

.button-decision-reject {
  background: #b21f2d;
  border-color: #b21f2d;
  color: #fff;
  font-weight: 600;
}

.approval-detail-loading,
.approval-detail-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--approval-muted);
  font-size: 14px;
}

@media (max-width: 1100px) {
  .approvals-shell {
    grid-template-columns: 1fr;
  }
  .approvals-filters {
    position: relative;
    top: 0;
  }
  .approval-detail-grid {
    grid-template-columns: 1fr;
  }
  .form-approvers-options {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Login
   ========================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  /* align-items: center; */
  justify-content: flex-end;
  background: #cccccc;
  /* padding: 32px; */
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
  /* background: url('/images/login_splash.gif') no-repeat; */
  /* background-size: cover; */
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border-radius: 0px;
  border: 1px solid var(--line);
  padding: 32px;
  color: var(--text);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-brand img {
  width: 38px;
  height: 38px;
}

.login-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.login-brand-copy strong {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text);
}

.login-brand-copy span {
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 1px;
}

.login-heading {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}

.login-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-field input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
}

/* Login-scoped button overrides (distinct from hub button styles) */
.login-page .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.login-page .button:hover { background: var(--line); }
.login-page .button:disabled { opacity: 0.55; cursor: not-allowed; }

.login-page .button-primary {
  background: var(--accent);
  color: #111111;
  border-color: var(--accent);
}

.login-page .button-primary:hover { background: #c8ef1f; border-color: #c8ef1f; }

.login-page .button-subtle {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.login-page .button-subtle:hover { background: var(--bg); color: var(--text); }

.login-submit {
  margin-top: 4px;
  padding: 12px 16px;
  width: 100%;
}

.login-error {
  background: #fdecec;
  color: #d9192b;
  /* border: 1px solid #f4c2c2; */
  /* border-radius: 8px; */
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
  margin-top: 14px;
}

.login-success {
  text-align: center;
  padding: 8px 0 4px;
}

.login-success h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 8px;
  color: var(--text);
}

.login-success p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.login-success p strong {
  color: var(--text);
}

.login-success-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}


/* =========================================================
   Calendar admin
   ========================================================= */

.admin-shell {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 10px;
  overflow: hidden;
}

.admin-row {
  display: grid;
  grid-template-columns: 2fr 100px 140px 220px 140px;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid #eef0f5;
}

.admin-head {
  text-transform: uppercase;
  font-size: 11px;
  color: #6c7386;
  font-weight: 700;
}

.admin-game {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-game img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e6e8ee;
}

.admin-game-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-color {
  width: 46px;
  height: 32px;
  border: 1px solid #d5d9e3;
  border-radius: 6px;
  background: #fff;
}

.admin-icon-input {
  width: 100%;
  font-size: 12px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-save,
.admin-clear {
  border: 1px solid #d5d9e3;
  background: #fff;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.admin-save {
  background: #d8ff2d;
  border-color: #c5eb1f;
}

/* =========================================================
   Org Picker — custom org dropdown component
   ========================================================= */
.org-picker {
  position: relative;
  width: 100%;
}

.org-picker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  min-height: 36px;
  user-select: none;
  transition: border-color 0.15s;
}

.org-picker-trigger:hover {
  border-color: #bfc6d3;
}

.org-picker-trigger:focus,
.org-picker-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.org-picker-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #e8eaf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
  overflow: hidden;
  text-align: center;
  line-height: 1;
}

.org-picker-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.org-picker-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-picker-label.placeholder {
  color: #94a3b8;
}

.org-picker-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 11px;
}

.org-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13);
  z-index: 1100;
  overflow: hidden;
}

.org-picker-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.org-picker-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}

.org-picker-search:focus {
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.org-picker-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.org-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.org-picker-item:hover {
  background: #f1f5f9;
}

.org-picker-item.selected {
  background: #eff6ff;
  color: var(--brand, #2563eb);
}

.org-picker-item-logo {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #e8eaf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
  overflow: hidden;
  text-align: center;
  line-height: 1;
}

.org-picker-item-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.org-picker-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-picker-item-edit {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  color: #94a3b8;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

.org-picker-item:hover .org-picker-item-edit {
  display: flex;
}

.org-picker-item-edit:hover {
  color: var(--text);
  background: #e2e8f0;
}

.org-picker-create {
  padding: 4px 8px 8px;
  border-top: 1px solid var(--line);
}

.org-picker-create-btn {
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 6px;
  background: none;
  border: 1px dashed transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--brand, #2563eb);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s;
}

.org-picker-create-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.org-picker-create-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.org-picker-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

/* Count badge in maps org list (replaces status badge) */
.maps-list-item-badge.count {
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 2px 7px;
  border-radius: 10px;
}



.login-splash {
	background: url(/images/login_splash.gif) no-repeat;
	background-size: cover;
	height: 100%;
	width: 100%;
	min-height: 100vh;
	flex: 1;
}

/* ============================================================
   Comments System
   ============================================================ */

/* Comments section in detail panels */
.comments-section {
  padding-top: 2px;
}

.comments-section h3 {
  margin: 0 0 8px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.comment-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  padding-right: 8px;
  border-bottom: 1px solid var(--line);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-avatar-sm {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 12px;
}

.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-author-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}

.comment-author-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.comment-body {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Seen-by indicators (Google Photos style — floated right below last seen comment) */
.comment-seen-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  padding: 2px 10px 6px;
}

.comment-seen-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px solid var(--panel);
  cursor: default;
  flex-shrink: 0;
  margin-top: 5px;
}

.comment-seen-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-seen-avatar.is-me {
  border-color: var(--accent);
}

.comment-seen-more {
  font-size: 7px;
  background: var(--bg);
  color: var(--muted);
}

/* Comment compose area */
.comment-compose {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  align-items: stretch;
  margin-bottom: 8px;
}

.comment-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  resize: none;
  transition: border-color 0.15s;
  overflow-y: auto;
}

.comment-input:focus {
  outline: none;
  border-color: #94a3b8;
  background: var(--panel);
}

.comment-input:disabled {
  opacity: 0.6;
}

.comment-submit-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 6px;
  align-self: stretch;
}

.comment-submit-btn img {
  width: 14px;
  height: 14px;
  display: block;
  /* filter: brightness(0) invert(1); */
}

.comment-submit-btn:disabled {
  opacity: 0.5;
}

.button-sm {
  padding: 5px 12px;
  font-size: 12px;
  align-self: flex-end;
}

.comment-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
}

.comment-loading {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 0;
}

.comment-error {
  color: var(--danger);
}

/* Unread dot on cards and org list items */
.comment-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.maps-list-item-name {
  display: block;
  width: 143px;
  min-width: 143px;
  max-width: 143px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maps-list-item.has-logo .maps-list-item-name {
  width: 119px;
  min-width: 119px;
  max-width: 119px;
}

.maps-list-item-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---- Org detail sidebar (maps page) ---- */
.maps-sidebar-org {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.maps-sidebar-org[hidden] {
  display: none;
}

.client-detail-panel .detail-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.client-detail-panel .detail-body {
  flex: 1;
  padding: 0px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  overflow: hidden;
  padding-bottom: 0;
}

.client-detail-panel .detail-section {
  padding: 12px 0 0 0;
  border-top: 1px solid var(--line);
  /* margin-top: 12px; */
  padding: 10px;
}

.client-detail-panel .detail-section:first-child {
  border-top: none;
  margin-top: 8px;
}

.maps-sidebar-org .detail-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.maps-sidebar-org .detail-body {
  flex: 1;
  padding: 0 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.maps-sidebar-org .detail-section {
  padding: 12px 0 0 0;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.maps-sidebar-org .detail-section:first-child {
  border-top: none;
  margin-top: 8px;
}

/* ---- Dashboard Comment Timeline ---- */
.dashboard-columns-full {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.dashboard-columns-full .dashboard-panel {
  width: 100%;
}

.comment-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0px 18px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.comment-timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.comment-timeline-item:last-child {
  border-bottom: none;
}

.comment-timeline-item.is-unread {
  background: #fafffe;
}

.comment-timeline-item.is-unread .timeline-entity {
  font-weight: 700;
}

.timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.timeline-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 1px;
}

.timeline-entity {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-entity-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 4px;
}

.timeline-author {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.timeline-comment-body {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* =========================================================
   Parked / Unassigned bottom-left drawer
   ========================================================= */

.parked-drawer {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 340px;
  z-index: 15;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(17, 23, 41, 0.07);
  display: flex;
  flex-direction: column;
  max-height: 280px;
  transition: max-height 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.parked-drawer.collapsed {
  max-height: 44px;
}

.parked-drawer.drop-target {
  outline: 2px dashed #94a3b8;
  outline-offset: -4px;
  background: #f0f4ff;
}

.parked-drawer-handle {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  gap: 8px;
}

.parked-drawer-handle:hover {
  background: #f8f9fb;
}

.parked-drawer-handle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parked-drawer-icon {
  width: 14px;
  height: 14px;
  opacity: 0.45;
  flex-shrink: 0;
}

.parked-drawer-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.parked-drawer-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  transform: rotate(0deg);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  flex-shrink: 0;
}

.parked-drawer.collapsed .parked-drawer-chevron {
  transform: rotate(180deg);
}

.parked-drawer-body {
  flex: 1;
  padding: 4px 14px 12px;
  display: block;
  opacity: 1;
  transition: opacity 180ms ease;
}

.parked-drawer.collapsed .parked-drawer-body {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.parked-drawer-handle-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 250px));
  z-index: 1;
  opacity: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

.parked-drawer.collapsed .parked-drawer-handle-search {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
}

.parked-drawer-search-input {
  width: 100%;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
}

.parked-drawer-search-input::placeholder {
  color: var(--muted);
}

.parked-drawer-cards {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* Cards inside the drawer are fixed-width in a horizontal row */
.parked-drawer .client-card {
  flex-shrink: 0;
  width: 196px;
}

.parked-drawer .parked-empty {
  align-self: center;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}


/* =========================================================
   Comment count badge on client / map cards
   ========================================================= */

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.client-card-footer-comment {
  margin-left: auto;
  display: inline-flex;
}

.card-comment-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
}

.card-comment-icon {
  width: 11px;
  height: 11px;
  opacity: 0.45;
  flex-shrink: 0;
}

/* In the map diagram card-body, align comment count to the right */
.card-body .card-comment-count {
  margin-top: 5px;
  justify-content: flex-end;
}


/* =========================================================
   Org info hover popup in client detail sidebar
   ========================================================= */

.detail-org-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.detail-org-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 3px;
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
  /* white-space: nowrap; */
  display: block;
  max-width: 100%;
}

.detail-org-name:hover {
  color: var(--brand);
}

.org-info-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(17, 23, 41, 0.12);
  padding: 10px 14px;
  min-width: 230px;
  pointer-events: none;
}

.detail-org-wrap:hover .org-info-popup {
  display: block;
}

.org-popup-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid #f1f2f5;
}

.org-popup-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.org-popup-label {
  color: var(--muted);
}

.org-popup-value {
  color: var(--text);
  word-break: break-word;
}

.org-popup-value a {
  color: #4f46e5;
  text-decoration: none;
}

.org-popup-value a:hover {
  text-decoration: underline;
}


/* =========================================================
   Contact detail sidebar — full-height comments, no body scroll
   Shared rules apply to the client-detail-panel across pages.
   ========================================================= */

/* Comments section grows to fill the remaining body height */
.client-detail-panel .comments-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 0px;
}

.client-detail-panel .comments-section h3 {
  flex-shrink: 0;
  margin-bottom: 8px;
}

/* The scrollable list fills all available space */
.client-detail-panel .comments-section .comments-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  margin-bottom: 0;
}

/* Compose area is always visible at the bottom */
.client-detail-panel .comments-section .comment-compose {
  flex-shrink: 0;
  padding-top: 8px;
}

/* Keep top summary sections compact when displayed side-by-side */
.client-detail-panel .detail-top-grid .detail-section {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0pc;
}


/* =========================================================
   Load older comments button
   ========================================================= */

.comments-load-older {
  display: block;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}

.comments-load-older:hover {
  background: #f3f4f7;
  border-color: #94a3b8;
  color: var(--text);
}

.card-bottom-row {
	display: flex;
	justify-content: space-between;
}