/* ============================================================
   RTROP — Rock Town River Operations Platform
   Design System & Stylesheet
   ============================================================ */

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  --river-blue:    #0A4F7A;
  --deep-water:    #07304A;
  --sunset-orange: #F28C28;
  --river-foam:    #F6F9FB;
  --forest-green:  #4C7A4F;
  --sandstone:     #D8C3A5;
  --white:         #FFFFFF;

  --river-blue-lt: #1A6FA0;
  --river-blue-dk: #083D5E;
  --orange-lt:     #F9A953;
  --green-lt:      #6B9E6E;
  --red:           #D64545;
  --yellow:        #E6A817;

  --text-primary:   #0D1B2A;
  --text-secondary: #4A5568;
  --text-muted:     #9AABB9;

  --border:        #DDE5ED;
  --border-lt:     #EEF3F7;
  --shadow-sm:     0 1px 4px rgba(7,48,74,0.08);
  --shadow-md:     0 4px 16px rgba(7,48,74,0.10);
  --shadow-lg:     0 8px 32px rgba(7,48,74,0.14);

  --sidebar-w:     248px;
  --topbar-h:      60px;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     16px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --transition: 0.18s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font-sans); background: var(--river-foam); color: var(--text-primary); line-height: 1.5; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── LAYOUT ── */
#app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--deep-water);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-mark {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-primary {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--white);
}

.logo-secondary {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-label {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 6px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 450;
  color: rgba(255,255,255,0.65);
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: var(--white);
  background: rgba(10,79,122,0.6);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--sunset-orange);
  border-radius: 0 2px 2px 0;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--river-blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-badge--orange {
  background: var(--sunset-orange);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.1);
}

.sidebar-weather {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}

.sidebar-weather svg {
  stroke: var(--sunset-orange);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

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

.user-avatar {
  width: 34px; height: 34px;
  background: var(--river-blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
  flex-shrink: 0;
}

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

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

.user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}

/* ── MAIN CONTENT ── */
#main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
#topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-input {
  background: var(--river-foam);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px 7px 32px;
  font-size: 12.5px;
  color: var(--text-primary);
  width: 240px;
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--river-blue);
  box-shadow: 0 0 0 3px rgba(10,79,122,0.08);
  background: var(--white);
}

.role-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--river-foam);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
}

.role-pill svg {
  stroke: var(--river-blue);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

.role-pill select {
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--river-blue);
  cursor: pointer;
}

.role-pill select:focus { outline: none; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--river-foam);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.icon-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: var(--river-blue);
  border-color: var(--river-blue);
  color: var(--white);
}

.notification-btn { position: relative; }

.notification-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--sunset-orange);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* ── MODULE CONTENT ── */
#module-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ── LOADING STATE ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: 16px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--river-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── GRID SYSTEM ── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--river-blue);
}

.kpi-card.orange::before { background: var(--sunset-orange); }
.kpi-card.green::before  { background: var(--forest-green); }
.kpi-card.sand::before   { background: var(--sandstone); }

.kpi-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(10,79,122,0.08);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.kpi-icon.orange { background: rgba(242,140,40,0.1); }
.kpi-icon.green  { background: rgba(76,122,79,0.1); }
.kpi-icon.sand   { background: rgba(216,195,165,0.2); }

.kpi-icon svg {
  width: 18px; height: 18px;
  stroke: var(--river-blue);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon.orange svg { stroke: var(--sunset-orange); }
.kpi-icon.green svg  { stroke: var(--forest-green); }
.kpi-icon.sand svg   { stroke: #8B7355; }

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.kpi-trend {
  font-size: 11.5px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-trend.up { color: var(--forest-green); }
.kpi-trend.down { color: var(--red); }
.kpi-trend.neutral { color: var(--text-muted); }

/* ── CHART CARDS ── */
.chart-row {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.chart-row-2 { grid-template-columns: 3fr 2fr; }
.chart-row-equal { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-lt);
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 16px 20px;
}

.chart-wrap {
  position: relative;
  padding: 16px 20px 20px;
}

.chart-wrap canvas {
  max-height: 220px;
}

.chart-wrap-tall canvas {
  max-height: 280px;
}

/* ── TABLE STYLES ── */
.table-wrap {
  overflow-x: auto;
}

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

thead th {
  background: var(--river-foam);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-lt);
  transition: background var(--transition);
}

tbody tr:hover {
  background: rgba(246,249,251,0.8);
}

tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr:last-child {
  border-bottom: none;
}

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green  { background: rgba(76,122,79,0.1);  color: var(--forest-green); }
.badge-blue   { background: rgba(10,79,122,0.1);  color: var(--river-blue); }
.badge-orange { background: rgba(242,140,40,0.12); color: #C46E10; }
.badge-red    { background: rgba(214,69,69,0.1);  color: var(--red); }
.badge-sand   { background: rgba(216,195,165,0.25); color: #7D6848; }
.badge-gray   { background: rgba(154,171,185,0.15); color: var(--text-muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--river-blue);
  color: var(--white);
  border-color: var(--river-blue);
}

.btn-primary:hover {
  background: var(--river-blue-lt);
  border-color: var(--river-blue-lt);
}

.btn-orange {
  background: var(--sunset-orange);
  color: var(--white);
  border-color: var(--sunset-orange);
}

.btn-orange:hover {
  background: var(--orange-lt);
  border-color: var(--orange-lt);
}

.btn-outline {
  background: transparent;
  color: var(--river-blue);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--river-blue);
  background: rgba(10,79,122,0.04);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--river-foam);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-header-text h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-header-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-primary);
  background: var(--river-foam);
  transition: all var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--river-blue);
  background: var(--white);
}

.filter-bar input { width: 200px; }
.filter-bar select { min-width: 130px; }

/* ── TABS ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab-item:hover { color: var(--text-secondary); }

.tab-item.active {
  color: var(--river-blue);
  border-bottom-color: var(--river-blue);
  font-weight: 600;
}

/* ── CUSTOMER CARD ── */
.customer-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  cursor: pointer;
}

.customer-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--river-blue);
  transform: translateY(-2px);
}

.customer-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--white);
}

.avatar-blue   { background: var(--river-blue); }
.avatar-orange { background: var(--sunset-orange); }
.avatar-green  { background: var(--forest-green); }
.avatar-sand   { background: #8B7355; }

.customer-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.customer-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-lt);
}

.cstat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cstat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--river-blue);
  margin-top: 1px;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--river-blue);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--river-blue);
}

.timeline-dot.orange { background: var(--sunset-orange); box-shadow: 0 0 0 2px var(--sunset-orange); }
.timeline-dot.green  { background: var(--forest-green); box-shadow: 0 0 0 2px var(--forest-green); }

.timeline-content {
  background: var(--river-foam);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

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

.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── LEAD KANBAN ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  overflow-x: auto;
}

.kanban-column {
  background: var(--river-foam);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  min-height: 400px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kanban-col-count {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
}

.kanban-col-body { padding: 10px; }

.lead-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.lead-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--river-blue);
}

.lead-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.lead-source {
  font-size: 11px;
  color: var(--text-muted);
}

.lead-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--forest-green);
  margin-top: 6px;
}

/* ── FLEET ASSET CARD ── */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.asset-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.asset-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--river-blue);
}

.asset-header {
  background: linear-gradient(135deg, var(--deep-water), var(--river-blue));
  padding: 14px 16px;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asset-name {
  font-size: 13px;
  font-weight: 600;
}

.asset-id {
  font-size: 10px;
  opacity: 0.6;
}

.asset-emoji {
  font-size: 24px;
}

.asset-body {
  padding: 14px 16px;
}

.asset-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.asset-stat { }

.asset-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.asset-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1px;
}

.util-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.util-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--river-blue);
  transition: width 0.5s ease;
}

.util-bar-fill.high { background: var(--forest-green); }
.util-bar-fill.med  { background: var(--sunset-orange); }
.util-bar-fill.low  { background: var(--red); }

/* ── STAFF CARDS ── */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.staff-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
}

.staff-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.staff-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--river-blue);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  margin: 0 auto 12px;
}

.staff-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.staff-role {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.staff-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-lt);
}

.staff-stat-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.staff-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--river-blue);
  margin-top: 2px;
}

/* ── CERT BADGE ── */
.cert-tag {
  display: inline-block;
  background: rgba(76,122,79,0.1);
  color: var(--forest-green);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  margin: 2px;
  border: 1px solid rgba(76,122,79,0.2);
}

/* ── STAR RATING ── */
.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  width: 12px; height: 12px;
  fill: #E6A817;
  stroke: #E6A817;
  stroke-width: 1;
}

.star.empty {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

/* ── METRIC ROW ── */
.metric-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.metric-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.metric-chip strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── REVIEW CARD ── */
.review-card {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}

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

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.review-source {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 7px;
  background: var(--river-foam);
  border-radius: 4px;
  border: 1px solid var(--border);
}

.review-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 6px 0;
}

.review-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── MEMBERSHIP CARD ── */
.member-tier {
  border-radius: var(--radius);
  padding: 20px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.member-tier-explorer {
  background: linear-gradient(135deg, var(--river-blue), var(--deep-water));
}

.member-tier-adventure {
  background: linear-gradient(135deg, #4C7A4F, #2D5A30);
}

.member-tier-elite {
  background: linear-gradient(135deg, #C46E10, #8B4E0A);
}

.member-tier::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.member-tier-name {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

.member-tier-count {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.member-tier-revenue {
  font-size: 12px;
  opacity: 0.7;
}

/* ── GEOGRAPHIC MAP ── */
.geo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.market-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.market-bar-city {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  width: 130px;
  flex-shrink: 0;
}

.market-bar-track {
  flex: 1;
  height: 8px;
  background: var(--river-foam);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-lt);
}

.market-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--river-blue);
  transition: width 0.8s ease;
}

.market-bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7,48,74,0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden { display: none; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--river-foam);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--red);
  border-color: var(--red);
}

.modal-close:hover svg { stroke: var(--white); }

.modal-close svg {
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.modal-body {
  padding: 20px 24px 24px;
}

/* ── TOAST NOTIFICATIONS ── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-primary);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease;
  max-width: 300px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.toast.success { background: var(--forest-green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--river-blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── PROGRESS BARS ── */
.progress {
  height: 6px;
  background: var(--river-foam);
  border: 1px solid var(--border-lt);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progress-blue   { background: var(--river-blue); }
.progress-orange { background: var(--sunset-orange); }
.progress-green  { background: var(--forest-green); }

/* ── SUMMARY STATS STRIP ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.stats-strip-item {
  background: var(--white);
  padding: 14px 16px;
  text-align: center;
}

.strip-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--river-blue);
  letter-spacing: -0.5px;
}

.strip-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── DATA LABELS ── */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dl-item {}

.dl-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.dl-value {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── SECTION DIVIDER ── */
.section-divider {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-lt);
  margin: 16px 0 12px;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px; height: 48px;
  stroke: var(--border);
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto 14px;
}

.empty-state p {
  font-size: 13px;
}

/* ── FUNNEL CHART ── */
.funnel-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.funnel-track {
  flex: 1;
  height: 28px;
  background: var(--river-foam);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-lt);
  position: relative;
}

.funnel-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  transition: width 0.8s ease;
}

.funnel-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

/* ── CALENDAR ── */
.booking-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-header {
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
  padding: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-day {
  background: var(--white);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  min-height: 80px;
  cursor: pointer;
  transition: all var(--transition);
}

.cal-day:hover { border-color: var(--river-blue); }
.cal-day.today { border-color: var(--sunset-orange); background: rgba(242,140,40,0.03); }
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-day.today .cal-day-num {
  color: var(--sunset-orange);
}

.cal-event {
  font-size: 10px;
  background: var(--river-blue);
  color: var(--white);
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event.orange { background: var(--sunset-orange); }
.cal-event.green  { background: var(--forest-green); }

/* ── FINANCIAL ── */
.pl-table td:last-child {
  text-align: right;
  font-weight: 600;
}

.pl-section-header td {
  background: var(--river-foam);
  font-weight: 700;
  color: var(--river-blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pl-total td {
  border-top: 2px solid var(--river-blue);
  font-weight: 700;
  font-size: 14px;
  color: var(--forest-green);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row-3 { grid-template-columns: 1fr 1fr; }
  .chart-row-3 .col-span-2 { grid-column: span 1; }
}

@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(3, 240px); }
  .geo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #module-content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chart-row-2, .chart-row-equal { grid-template-columns: 1fr; }
  .search-input { width: 160px; }
  .topbar-date { display: none; }
}
