/* ══════════════════════════════════════════════════════════════════
   ZW REALTY CRM — DESIGN SYSTEM IMPLEMENTATION
   Strict adherence to design-system/DESIGN.md
   Warm paper, navy ink, one loud green. Everything else gets out of the way.
   ══════════════════════════════════════════════════════════════════ */

@import "./design-system/styles.css";

/* Reset & Page Foundations */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--surface-app);
  background-image: var(--gradient-ambient);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

#app-root {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   RETRACTABLE SIDEBAR (MORPHOGLASS)
   ══════════════════════════════════════════════════════════════════ */
.sidebar {
  height: 100vh;
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass-strong)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-glass-strong)) saturate(150%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.5);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--dur-base) var(--ease-out);
  position: relative;
  z-index: 40;
  overflow: hidden;
  user-select: none;
}

.sidebar.expanded {
  width: var(--size-sidebar);
  min-width: var(--size-sidebar);
}

.sidebar.collapsed {
  width: var(--size-sidebar-collapsed);
  min-width: var(--size-sidebar-collapsed);
}

/* Sidebar Brand Header */
.sidebar-header {
  height: var(--size-topbar);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo-img {
  width: 36px;
  height: auto;
  display: block;
  transition: width var(--dur-base) var(--ease-out);
}

.sidebar.collapsed .brand-logo-img {
  width: 26px;
}

.sidebar.collapsed .brand-info-text {
  display: none;
}

.brand-info-text {
  display: flex;
  flex-direction: column;
}

.brand-org-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: var(--fw-regular);
  color: var(--text-strong);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-org-sub {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}

.btn-sidebar-toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.btn-sidebar-toggle:hover {
  background: var(--zw-ink-050);
  color: var(--text-strong);
  border-color: var(--border-default);
}

.sidebar.collapsed .btn-sidebar-toggle {
  margin: 0 auto;
}

/* Sidebar Navigation Items */
.sidebar-nav-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar.collapsed .sidebar-nav-content {
  padding: 16px 8px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: var(--text-micro);
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--text-faint);
  padding: 6px 8px 4px;
  white-space: nowrap;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: var(--transition-control);
  text-align: left;
  white-space: nowrap;
  position: relative;
}

.sidebar.collapsed .nav-btn {
  justify-content: center;
  padding: 0;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-strong);
}

.nav-btn.active {
  background: var(--zw-navy-700);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-inverse);
  box-shadow: 0 6px 16px -10px rgba(17, 39, 73, 0.75);
  font-weight: var(--fw-semibold);
}

.nav-btn-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.nav-btn-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav-btn-label {
  display: none;
}

.nav-count-badge {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(17, 39, 73, 0.06);
  color: var(--text-muted);
}

.nav-btn.active .nav-count-badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-inverse);
}

.sidebar.collapsed .nav-count-badge {
  display: none;
}

/* Tooltips in Collapsed Sidebar */
.sidebar.collapsed .nav-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--zw-navy-700);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  z-index: 100;
}

.sidebar.collapsed .nav-btn:hover::after {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 6px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-footer-info {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   TOPBAR & APPLICATION VIEWPORT
   ══════════════════════════════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.topbar {
  height: var(--size-topbar);
  padding: 0 var(--gutter-page);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--glass-fill-strong);
  backdrop-filter: blur(var(--blur-glass-strong)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-glass-strong)) saturate(150%);
  box-shadow: inset 0 -1px 0 var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 30;
}


/* Topbar Search */
.topbar-search-box {
  width: 320px;
  position: relative;
}

.search-input-field {
  width: 100%;
  height: var(--size-control-sm);
  padding: 0 12px 0 34px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-strong);
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-fast) var(--ease-out);
}

.search-input-field:focus {
  border-color: var(--zw-navy-700);
  box-shadow: var(--shadow-focus);
}

.search-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Content Area */
.content-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--gutter-page);
}

.content-max-wrap {
  max-width: var(--maxw-content);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ══════════════════════════════════════════════════════════════════
   CARDS & MORPHOGLASS PANELS
   ══════════════════════════════════════════════════════════════════ */
.ds-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: var(--gutter-card);
  position: relative;
}

.ds-card.glass {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.ds-card.navy-hero {
  background: var(--zw-navy-700);
  border-radius: var(--radius-panel);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
  padding: var(--gutter-panel);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Two-tone Headline */
.two-tone-headline {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.016em;
  line-height: 1.2;
}

.two-tone-line1 {
  font-weight: var(--fw-regular);
  display: block;
}

.two-tone-line2 {
  font-weight: var(--fw-light);
  opacity: 0.65;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT & RESPONSIVE GRID
   ══════════════════════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-subgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 12px;
}

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

/* ══════════════════════════════════════════════════════════════════
   STAT TILES ROW
   ══════════════════════════════════════════════════════════════════ */
.stat-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1360px) {
  .stat-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .stat-tiles-grid {
    grid-template-columns: 1fr;
  }
}

.stat-tile-card {
  background: var(--glass-fill);
  backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  border-radius: var(--radius-card);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.stat-tile-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.stat-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.stat-tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.stat-tile-label {
  font-size: 12px;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-tile-delta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  padding: 2px 7px;
  border-radius: var(--radius-chip);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  line-height: 1;
}

.stat-tile-delta.up {
  background: var(--zw-success-100);
  color: var(--zw-success-600);
}

.stat-tile-delta.down {
  background: var(--zw-danger-100);
  color: var(--zw-danger-600);
}

.stat-tile-val-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-tile-value {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.018em;
  font-feature-settings: var(--ff-numeric);
  color: var(--text-strong);
  white-space: nowrap;
}

.stat-tile-unit {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
}

.stat-tile-caption {
  font-size: var(--text-caption);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Viewing Row Interactive Hover */
.viewing-row-interactive {
  transition: background-color var(--dur-fast) var(--ease-out);
}

.viewing-row-interactive:hover {
  background: var(--zw-ink-050);
}

/* Activity Item Timeline */
.activity-item {
  display: flex;
  gap: 11px;
  min-width: 0;
}

.activity-item-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.activity-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-item-line {
  flex: 1;
  width: 1px;
  background: var(--border-subtle);
  margin-top: 4px;
  min-height: 14px;
}

.activity-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
  min-width: 0;
  flex: 1;
}

.activity-item:last-child .activity-item-content {
  padding-bottom: 0;
}

.activity-item:last-child .activity-item-line {
  display: none;
}

.activity-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.activity-item-title {
  font-size: 12.5px;
  color: var(--text-strong);
  font-weight: var(--fw-medium);
  flex: 1;
  min-width: 0;
}

.activity-item-time {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  flex: 0 0 auto;
  letter-spacing: -0.01em;
}

.activity-item-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS & CONTROLS (DESIGN SYSTEM CONFORMANT)
   ══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--size-control-md);
  padding: 0 16px;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: var(--transition-control);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--action-primary);
  color: var(--text-inverse);
  border-color: var(--action-primary);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--action-primary-hover);
  border-color: var(--action-primary-hover);
}

.btn-secondary {
  background: var(--action-secondary);
  color: var(--text-strong);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--action-secondary-hover);
  border-color: var(--border-strong);
}

.btn-highlight {
  background: var(--action-highlight);
  color: var(--text-on-highlight);
  border-color: var(--action-highlight);
  box-shadow: var(--shadow-xs);
}

.btn-highlight:hover {
  background: var(--action-highlight-hover);
  border-color: var(--action-highlight-hover);
}

.btn-sm {
  height: var(--size-control-sm);
  padding: 0 12px;
  font-size: var(--text-body-s);
  gap: 6px;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: var(--fw-medium);
  line-height: 1.3;
}

.badge.azure { background: var(--zw-navy-050); color: var(--zw-navy-600); border: 1px solid var(--zw-navy-100); }
.badge.clay { background: var(--zw-sand-100); color: var(--zw-clay-700); border: 1px solid var(--zw-sand-300); }
.badge.success { background: var(--zw-success-100); color: var(--zw-success-600); border: 1px solid var(--zw-success-200); }
.badge.warning { background: var(--zw-warning-100); color: var(--zw-warning-600); border: 1px solid var(--zw-warning-200); }

/* Highlight Pill (Scarce signal lime highlight) */
.highlight-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-chip);
  background: var(--zw-lime-500);
  color: var(--text-on-highlight);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-xs);
}

/* ══════════════════════════════════════════════════════════════════
   KANBAN DEAL PIPELINE (DESIGN SYSTEM SIZED)
   ══════════════════════════════════════════════════════════════════ */
.pipeline-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.pipeline-summary-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow-xs);
}

.pipeline-summary-card.highlight {
  background: var(--surface-card);
  border-color: var(--zw-navy-700);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.pipeline-summary-card.highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--zw-signal-lime);
}

.pipeline-summary-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.pipeline-summary-val-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.pipeline-summary-val {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  font-size: 20px;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
}

.pipeline-summary-unit {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-muted);
}

.pipeline-summary-caption {
  font-size: 11px;
  color: var(--text-muted);
}

.pipeline-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(290px, 1fr);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 24px;
  padding-top: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.pipeline-board::-webkit-scrollbar {
  height: 7px;
}

.pipeline-board::-webkit-scrollbar-track {
  background: var(--surface-sunken);
  border-radius: 4px;
}

.pipeline-board::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.pipeline-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 14px;
  min-height: 520px;
  box-sizing: border-box;
}

.pipeline-col-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

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

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

.stage-name {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.stage-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.stage-metrics-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11.5px;
}

.stage-total {
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  font-size: 13px;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
}

.stage-comm-total {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--zw-clay-700);
  font-feature-settings: var(--ff-numeric);
  background: var(--zw-clay-100);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Deal Card component styling */
.deal-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
}

.deal-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--zw-navy-300);
  transform: translateY(-2px);
}

.deal-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.deal-stage-bar {
  width: 3.5px;
  align-self: stretch;
  min-height: 36px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.deal-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.deal-client-name {
  font-size: 14.5px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.deal-property-title {
  font-size: 12px;
  font-weight: var(--fw-regular);
  color: var(--text-muted);
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Financials Block with Prominent Commission */
.deal-financials-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 2px 0;
}

.deal-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.deal-val-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deal-val-figure {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.deal-price-num {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.015em;
  font-feature-settings: var(--ff-numeric);
  color: var(--text-strong);
}

.deal-currency {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-muted);
}

.deal-comm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px dashed var(--border-subtle);
}

.deal-comm-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--zw-clay-700);
  display: flex;
  align-items: center;
  gap: 4px;
}

.deal-comm-amount {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: var(--fw-semibold);
  color: var(--zw-navy-900);
  font-feature-settings: var(--ff-numeric);
}

.deal-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
}

.deal-advance-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}

.deal-advance-btn:hover {
  background: var(--zw-navy-700);
  color: #fff;
  border-color: var(--zw-navy-700);
}

/* ══════════════════════════════════════════════════════════════════
   DATA TABLES & LEAD ROWS
   ══════════════════════════════════════════════════════════════════ */
.lead-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
  min-width: 0;
}

.lead-row:hover {
  background: var(--zw-ink-050);
}

.lead-row:last-child {
  border-bottom: none;
}

/* Slide-over Dossier Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 39, 73, 0.25);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.slide-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 920px;
  max-width: 96vw;
  background: var(--surface-card);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out);
  overflow: hidden;
}

.slide-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

/* ══════════════════════════════════════════════════════════════════
   LEAD DOSSIER PANEL
   ══════════════════════════════════════════════════════════════════ */

.dossier-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.dossier-header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.dossier-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--zw-navy-050);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--zw-navy-700);
  flex-shrink: 0;
}

.dossier-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.dossier-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dossier-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}

.dossier-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.dossier-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dossier-budget {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.dossier-budget-label {
  font-size: 12px;
  color: var(--text-muted);
}

.dossier-budget-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  letter-spacing: -0.018em;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
  line-height: 1;
}

.dossier-budget-meta {
  font-size: 11px;
  color: var(--text-faint);
}

.dossier-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
}

.dossier-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
  align-items: start;
}

.dossier-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.dossier-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dossier-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.dossier-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.dossier-tab:hover {
  color: var(--text-strong);
}

.dossier-tab.active {
  color: var(--text-strong);
  font-weight: 600;
  border-bottom-color: var(--zw-navy-700);
}

.dossier-tab-content {
  min-height: 200px;
}

.engagement-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.engagement-card-title {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  align-self: flex-start;
}

.engagement-meter {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.engagement-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.engagement-meter-label {
  color: var(--text-muted);
}

.engagement-meter-value {
  color: var(--text-strong);
  font-weight: 500;
  font-feature-settings: var(--ff-numeric);
}

.engagement-meter-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.engagement-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.requirements-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.requirements-card-title {
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

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

.requirement-pill {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: var(--zw-sand-200, #e8e2d8);
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.requirements-meta {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.requirements-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.requirements-meta-key {
  color: var(--text-muted);
}

.requirements-meta-val {
  color: var(--text-strong);
  font-weight: 500;
}

.commission-card {
  background: var(--zw-sand-100, #f0ebe3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commission-card-label {
  font-size: 12px;
  color: var(--zw-clay-700);
  font-weight: 600;
}

.commission-card-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 32px;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
  line-height: 1;
}

.commission-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.dossier-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-logger {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.timeline-logger input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control, 8px);
  background: var(--surface-card);
  font-size: 13px;
  color: var(--text-body);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.timeline-logger input:focus {
  border-color: var(--zw-navy-700);
}

.timeline-logger input::placeholder {
  color: var(--text-faint);
}

.timeline-entry {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.timeline-entry-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-entry-line {
  width: 2px;
  flex: 1;
  background: var(--border-subtle);
  min-height: 12px;
}

.timeline-entry:last-child .timeline-entry-line {
  display: none;
}

.timeline-entry-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding-top: 5px;
}

.timeline-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-entry-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}

.timeline-entry-time {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.timeline-entry-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.dossier-notes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.note-add-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.note-add-section textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-size: 13px;
  color: var(--text-body);
  font-family: var(--font-ui);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.note-add-section textarea:focus {
  border-color: var(--zw-navy-700);
}

.note-add-section textarea::placeholder {
  color: var(--text-faint);
}

.note-add-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-add-controls select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control, 8px);
  background: var(--surface-card);
  font-size: 12px;
  color: var(--text-body);
  outline: none;
}

.note-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-card-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
}

.note-card-time {
  font-size: 11px;
  color: var(--text-faint);
}

.note-card-type {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--zw-navy-050);
  color: var(--zw-navy-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.note-card-text {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.45;
}

.dossier-documents {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-card);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.doc-upload-zone:hover {
  border-color: var(--zw-navy-700);
  background: var(--zw-ink-050);
}

.document-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}

.document-row:hover {
  background: var(--zw-ink-050);
}

.doc-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.doc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  font-size: 11px;
  color: var(--text-faint);
}

.doc-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.doc-status.verified {
  background: rgba(46, 160, 67, 0.1);
  color: #1a7f37;
}

.doc-status.pending {
  background: rgba(210, 153, 34, 0.1);
  color: #9a6700;
}

.doc-status.expired {
  background: rgba(207, 34, 46, 0.1);
  color: #cf222e;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.profile-field input,
.profile-field select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-control, 8px);
  background: var(--surface-card);
  font-size: 13px;
  color: var(--text-body);
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.profile-field input:focus,
.profile-field select:focus {
  border-color: var(--zw-navy-700);
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.portfolio-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.portfolio-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 500;
}

.portfolio-stat-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
}

.portfolio-asset-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  margin-bottom: 8px;
}

.portfolio-asset-row:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--zw-navy-300);
}

.portfolio-asset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.portfolio-asset-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}

.portfolio-asset-address {
  font-size: 11px;
  color: var(--text-muted);
}

.portfolio-asset-value {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-strong);
  font-feature-settings: var(--ff-numeric);
  text-align: right;
}

.portfolio-asset-growth {
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

.portfolio-asset-growth.positive {
  color: #1a7f37;
}

.portfolio-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-card);
}

@media (max-width: 960px) {
  .dossier-body {
    grid-template-columns: 1fr;
  }
  .dossier-right {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .engagement-card, .requirements-card, .commission-card {
    flex: 1;
    min-width: 200px;
  }
  .dossier-budget-value {
    font-size: 22px;
  }
  .portfolio-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 39, 73, 0.32);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-warm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notification (Sentence case, no emoji, capable colleague tone) */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
  pointer-events: none;
}

.toast {
  background: var(--zw-navy-700);
  color: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  pointer-events: auto;
  animation: toast-fade 0.2s ease-out;
}

@keyframes toast-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════
   PROPERTY WALLET
   ══════════════════════════════════════════════════════════════════ */

.wallet-portfolio-card:hover {
  box-shadow: var(--shadow-md);
}

.wallet-asset-card:hover {
  box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════════════════════════
   FINANCIAL DEPARTMENT — COMMISSIONS & QUARTER SCORE
   ══════════════════════════════════════════════════════════════════ */

/* Finance Summary Strip */
.finance-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.finance-metric-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Clickable KPI Cards */
.clickable-kpi {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform var(--dur-fast, 140ms) var(--ease-out, ease-out),
              box-shadow var(--dur-fast, 140ms) var(--ease-out, ease-out),
              border-color var(--dur-fast, 140ms) var(--ease-out, ease-out),
              background var(--dur-fast, 140ms) var(--ease-out, ease-out);
}

.clickable-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(17, 39, 73, 0.08));
  border-color: var(--zw-azure-500, #7593B6);
}

.clickable-kpi:active {
  transform: translateY(0);
}

.clickable-kpi:focus-visible {
  outline: 2px solid var(--zw-navy-700);
  outline-offset: 2px;
}

.clickable-kpi.active-kpi-filter,
.clickable-kpi.active {
  border-color: var(--zw-navy-700, #112749);
  background: rgba(17, 39, 73, 0.035);
  box-shadow: 0 0 0 1.5px var(--zw-navy-700, #112749), var(--shadow-sm);
}

.kpi-active-pill {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--zw-navy-700, #112749);
  color: #ffffff;
}

.finance-metric-card .metric-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.finance-metric-card .metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--text-strong);
  font-feature-settings: "tnum";
  line-height: 1.1;
}

.finance-metric-card .metric-sub {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Market Type Badges */
.market-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.market-badge.off-plan {
  background: rgba(117, 147, 182, 0.12);
  color: #4a6a8a;
}

.market-badge.secondary {
  background: rgba(161, 135, 94, 0.12);
  color: #7a6340;
}

/* Deal card market indicator (small badge for pipeline) */
.deal-market-indicator {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.deal-market-indicator.off-plan {
  background: rgba(117, 147, 182, 0.15);
  color: #5a7a9a;
}

.deal-market-indicator.secondary {
  background: rgba(161, 135, 94, 0.15);
  color: #8a7350;
}

/* Commission Follow-up Status Badges */
.commission-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
}

.commission-status.payment_received,
.commission-status.done {
  background: rgba(46, 160, 67, 0.1);
  color: #1a7f37;
}

.commission-status.invoice_sent,
.commission-status.commission_protocoled {
  background: rgba(117, 147, 182, 0.12);
  color: #4a6a8a;
}

.commission-status.documents_received {
  background: rgba(210, 153, 34, 0.1);
  color: #9a6700;
}

.commission-status.documents_pending,
.commission-status.current {
  background: rgba(210, 153, 34, 0.1);
  color: #9a6700;
}

.commission-status.pending {
  background: rgba(117, 147, 182, 0.08);
  color: #6b8db5;
}

/* Status Dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.payment_received,
.status-dot.done { background: #2ea043; }
.status-dot.invoice_sent,
.status-dot.commission_protocoled { background: #7593B6; }
.status-dot.documents_received { background: #d29922; }
.status-dot.documents_pending,
.status-dot.current { background: #d29922; }
.status-dot.pending { background: #b8cce0; }

/* Commission Table */
.commission-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.commission-table th {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--surface-card);
  z-index: 1;
}

.commission-table td {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-default);
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.commission-table tr:hover td {
  background: rgba(17, 39, 73, 0.03);
}

.commission-table .deal-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.commission-table .deal-title {
  font-weight: 500;
  color: var(--text-strong);
}

.commission-table .deal-client {
  font-size: 11px;
  color: var(--text-faint);
}

.commission-table .amount-cell {
  font-family: var(--font-display);
  font-feature-settings: "tnum";
  font-weight: 400;
}

.commission-table .amount-gross {
  color: var(--text-strong);
  font-size: 13px;
}

.commission-table .amount-net {
  font-size: 11px;
  color: var(--text-muted);
}

/* Clickable commission row */
.commission-row-clickable {
  cursor: pointer;
  transition: background 140ms ease-out;
}

.commission-row-clickable:hover td {
  background: rgba(17, 39, 73, 0.04);
}

/* Filter Tabs */
.finance-filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 3px;
  background: var(--surface-sunken, #ede9e3);
  border-radius: 10px;
  width: fit-content;
}

.finance-filter-tab {
  padding: 6px 16px;
  border: none;
  background: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 140ms ease-out;
}

.finance-filter-tab:hover {
  color: var(--text-strong);
  background: rgba(255, 255, 255, 0.5);
}

.finance-filter-tab.active {
  background: var(--surface-card);
  color: var(--text-strong);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Commission Follow-up Timeline (in drawer) */
.followup-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  position: relative;
}

.followup-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--border-subtle);
}

.followup-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  position: relative;
}

.followup-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
  border: 3px solid var(--surface-card, #fff);
}

.followup-dot.done {
  background: #2ea043;
}

.followup-dot.current {
  background: #d29922;
  animation: pulse-dot 2s ease-in-out infinite;
}

.followup-dot.pending {
  background: #b8cce0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210, 153, 34, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(210, 153, 34, 0); }
}

.followup-dot i {
  color: #fff;
}

.followup-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.followup-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}

.followup-label.pending {
  color: var(--text-muted);
}

.followup-date {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-faint);
}

/* Quarter Score Hero Strip */
.quarter-hero-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

/* Market Comparison Cards */
.market-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.market-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
}

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

.market-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.market-card-icon.off-plan {
  background: rgba(117, 147, 182, 0.15);
  color: #5a7a9a;
}

.market-card-icon.secondary {
  background: rgba(161, 135, 94, 0.15);
  color: #8a7350;
}

.market-card-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.market-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.market-stat-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.market-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  color: var(--text-strong);
  font-feature-settings: "tnum";
}

.market-stat-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
}

/* Quarter Bar Chart (stacked) */
.quarter-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  height: 180px;
  padding: 0 12px;
  margin-top: 16px;
}

.quarter-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.quarter-bar-stack {
  width: 100%;
  max-width: 64px;
  display: flex;
  flex-direction: column;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.quarter-bar-segment {
  width: 100%;
  transition: height 340ms cubic-bezier(.22,.61,.36,1);
}

.quarter-bar-segment.off-plan {
  background: #8fa8c4;
}

.quarter-bar-segment.secondary {
  background: #b9a07a;
}

.quarter-bar-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.quarter-bar-value {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
  font-feature-settings: "tnum";
}

/* Agent Rankings Table */
.rankings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.rankings-table th {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.rankings-table td {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-default);
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.rankings-table .rank-number {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-strong);
  font-feature-settings: "tnum";
  width: 32px;
}

.rankings-table .agent-name {
  font-weight: 500;
  color: var(--text-strong);
}

.rankings-table .tnum {
  font-family: var(--font-display);
  font-feature-settings: "tnum";
}

/* Quarter Trend (mini) */
.quarter-trend {
  display: flex;
  gap: 16px;
}

.quarter-trend-item {
  flex: 1;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: transform var(--dur-fast, 140ms) var(--ease-out, ease-out),
              box-shadow var(--dur-fast, 140ms) var(--ease-out, ease-out),
              border-color var(--dur-fast, 140ms) var(--ease-out, ease-out),
              background var(--dur-fast, 140ms) var(--ease-out, ease-out);
}

.quarter-trend-item.current {
  border-color: #7593B6;
  box-shadow: var(--shadow-sm);
}

.quarter-trend-item.clickable-trend,
.quarter-trend-item[data-quarter] {
  cursor: pointer;
  user-select: none;
}

.quarter-trend-item.clickable-trend:hover,
.quarter-trend-item[data-quarter]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(17, 39, 73, 0.08));
  border-color: var(--zw-azure-500, #7593B6);
}

.quarter-trend-item.clickable-trend:active,
.quarter-trend-item[data-quarter]:active {
  transform: translateY(0);
}

.quarter-trend-item.clickable-trend:focus-visible {
  outline: 2px solid var(--zw-navy-700);
  outline-offset: 2px;
}

.quarter-trend-item.selected,
.quarter-trend-item.active-quarter {
  border-color: var(--zw-navy-700, #112749);
  background: rgba(17, 39, 73, 0.035);
  box-shadow: 0 0 0 1.5px var(--zw-navy-700, #112749), var(--shadow-sm);
}

.quarter-trend-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
}

.quarter-trend-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  color: var(--text-strong);
  font-feature-settings: "tnum";
}

.quarter-trend-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .finance-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .quarter-hero-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .market-comparison {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .finance-summary-strip,
  .quarter-hero-strip {
    grid-template-columns: 1fr;
  }
  .quarter-trend {
    flex-direction: column;
  }
}

.avatar-upload-target:hover .avatar-hover-overlay { opacity: 1 !important; }
 
/* Commission Drawer: Documents & Comments */
.commission-docs-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commission-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card, 10px);
  transition: all var(--dur-fast, 180ms) var(--ease-out, ease-out);
}

.commission-doc-card:hover {
  border-color: var(--zw-navy-300, #b8cce0);
  background: var(--zw-ink-050, rgba(17, 39, 73, 0.02));
}

.commission-comments-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.commission-comments-timeline {
  display: flex;
  flex-direction: column;
}
