/**
 * ==============================================================================
 * VINEN EXECUTIVE MEMBER APP (PWA / MOBILE-FIRST)
 * Design System: Luxury Deep Navy & Gold Metallic
 * Inspired by kh.hairnova.vn Executive UI
 * ==============================================================================
 */

:root {
  --navy-950: #061126;
  --navy-900: #0b1e42;
  --navy-850: #0f2756;
  --navy-800: #14326e;
  --navy-700: #1d4594;
  --gold-500: #d4af37;
  --gold-400: #e5c158;
  --gold-300: #f3d782;
  --gold-100: #fef9c3;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d4af37 50%, #b45309 100%);
  --red-600: #dc2626;
  --red-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --emerald-600: #059669;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --white: #ffffff;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.12);
  --shadow-gold: 0 8px 24px rgba(212, 175, 55, 0.35);
  --app-max-width: 390px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #030814;
  font-family: var(--font-family);
  color: var(--slate-900);
  line-height: 1.45;
  overflow: hidden;
}

/* Outer Wrapper: Center on PC, Fullscreen on Mobile */
.app-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 10%, #0d224d 0%, #040916 100%);
}

.app-frame {
  width: 100%;
  max-width: var(--app-max-width);
  height: 100%;
  background-color: var(--slate-50);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

@media (min-width: 481px) {
  .app-viewport {
    padding: 16px 0;
  }
  .app-frame {
    height: min(94vh, 844px);
    border-radius: 36px;
    border: 5px solid #14223d;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.75), 0 0 0 1.5px rgba(212, 175, 55, 0.45);
  }
}

/* App Scrollable Content Area */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 84px; /* Space for Bottom Navigation Bar */
  -webkit-overflow-scrolling: touch;
}

.app-content::-webkit-scrollbar {
  display: none;
}
.app-content {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==============================================================================
   1. TOPBAR HEADER (Inspired by kh.hairnova.vn)
   ============================================================================== */
.app-topbar {
  background: linear-gradient(180deg, #061126 0%, #0b1e42 100%);
  padding: 12px 16px;
  color: var(--white);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  box-shadow: 0 4px 18px rgba(11, 30, 66, 0.35);
  position: relative;
  z-index: 10;
}

.topbar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

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

.topbar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--navy-950);
  font-weight: 800;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  box-shadow: 0 3px 10px rgba(212, 175, 55, 0.35);
  flex-shrink: 0;
}

.topbar-user-text {
  display: flex;
  flex-direction: column;
}

.topbar-greeting-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
}

.topbar-greeting {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1;
  font-weight: 500;
}

.topbar-user-text h4 {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
}

.topbar-badge-rank {
  background: rgba(212, 175, 55, 0.2);
  color: #fff2a6;
  border: 1px solid rgba(212, 175, 55, 0.6);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

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

.topbar-btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.topbar-btn-icon:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.7);
  color: #fef08a;
  transform: translateY(-1px);
}

.topbar-btn-icon.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  transform: translateY(-1px);
}

.topbar-btn-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
}

/* Sub-view Navigation Bar (Active on inner panes) */
.topbar-subview-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.topbar-btn-back {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #fff2a6;
  border-radius: 20px;
  padding: 6px 12px 6px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.topbar-btn-back:hover,
.topbar-btn-back:active {
  background: rgba(212, 175, 55, 0.3);
  border-color: rgba(212, 175, 55, 0.9);
  color: #ffffff;
  transform: translateX(-2px);
}

.topbar-btn-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.topbar-page-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

/* Breadcrumb Back Bar inside Content Panes */
.pane-back-bar {
  margin-bottom: 12px;
}

.btn-pane-back {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  color: var(--navy-900);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-pane-back:hover,
.btn-pane-back:active {
  background: #f8fafc;
  border-color: var(--slate-300);
  color: #1e3a8a;
  transform: translateX(-2px);
}

/* Location / Chapter Bar */
.topbar-location-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.topbar-location-pill strong {
  color: #fef08a;
  font-weight: 700;
}

/* ==============================================================================
   2. HERO 3D DIGITAL BUSINESS CARD (VIP SPOTLIGHT)
   ============================================================================== */
.hero-card-container {
  padding: 16px 16px 8px;
  margin-top: -10px;
  position: relative;
  z-index: 12;
}

.vinen-mobile-card {
  background: linear-gradient(135deg, #091734 0%, #030a1c 100%);
  border-radius: 18px;
  border: 1.5px solid var(--gold-500);
  padding: 20px;
  color: var(--white);
  box-shadow: 0 12px 28px rgba(11, 30, 66, 0.35);
  position: relative;
  overflow: hidden;
}

.vinen-mobile-card::before {
  content: "VINEN";
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 5rem;
  font-weight: 900;
  color: rgba(212, 175, 55, 0.05);
  pointer-events: none;
  line-height: 1;
}

.vcard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.vcard-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vcard-logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #fef08a 0%, #d4af37 60%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.vcard-title-tag {
  font-size: 0.58rem;
  color: rgba(212, 175, 55, 0.9);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* EMV Smart Chip Gold Simulation */
.vcard-smart-chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd700 0%, #d4af37 40%, #b45309 100%);
  position: relative;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 1px solid #92400e;
}

.vcard-smart-chip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.3);
}

.vcard-smart-chip::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 35%;
  width: 30%;
  border-left: 1px solid rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

.vcard-body {
  margin: 20px 0 18px;
}

.vcard-member-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.vcard-member-subtitle {
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-top: 5px;
  letter-spacing: 0.01em;
}

.vcard-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.vcard-id-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vcard-id-label {
  font-size: 0.58rem;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vcard-id-val {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.08em;
}

.vcard-contactless-wave {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vcard-badge-verified {
  font-size: 0.7rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 9999px;
}

/* ==============================================================================
   3. EVENT BANNER TICKER (Khóa học & Hội nghị cấp cao)
   ============================================================================== */
.app-section-box {
  padding: 10px 16px;
}

.event-ticker-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border-radius: 14px;
  padding: 12px 16px;
  color: var(--white);
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25);
  cursor: pointer;
}

.ticker-content {
  flex: 1;
}

.ticker-tag {
  font-size: 0.65rem;
  background: var(--red-gradient);
  color: #fff;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 4px;
}

.ticker-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.ticker-status {
  font-size: 0.74rem;
  color: #a7f3d0;
  font-weight: 700;
  margin-top: 2px;
}

.ticker-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ==============================================================================
   4. QUICK UTILITIES GRID (Lưới Tiện Ích Tròn kiểu kh.hairnova.vn)
   ============================================================================== */
.utilities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  background: var(--white);
  padding: 18px 12px;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}

.util-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.util-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.util-item:active .util-icon-circle {
  transform: scale(0.92);
}

.util-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--slate-700);
  line-height: 1.25;
}

.util-badge-num {
  font-size: 0.65rem;
  background: var(--red-600);
  color: #fff;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 800;
  margin-top: 2px;
}

/* Circle Colors */
.bg-blue   { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.bg-amber  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.bg-green  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.bg-purple { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.bg-rose   { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.bg-cyan   { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.bg-indigo { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.bg-slate  { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

/* ==============================================================================
   5. APP TABS & VIEWS
   ============================================================================== */
.app-view-pane {
  display: none;
}

.app-view-pane.active {
  display: block;
}

/* Section Header in Panes */
.pane-head-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.pane-head-title h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--navy-900);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane-btn-add {
  background: var(--navy-900);
  color: #fff2a6;
  border: 1px solid var(--gold-500);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* List Item Cards (Companies & Offerings) */
.app-card-item {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.app-card-item h4 {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 6px;
  line-height: 1.35;
}

.app-card-meta {
  font-size: 0.78rem;
  color: var(--slate-600);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-card-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-card-del {
  background: none;
  border: none;
  color: var(--red-600);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

/* Empty States */
.app-empty-state {
  text-align: center;
  padding: 36px 16px;
  background: var(--white);
  border: 1.5px dashed var(--slate-300);
  border-radius: 16px;
  margin-bottom: 16px;
}

.app-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.app-empty-state h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 4px;
}

.app-empty-state p {
  font-size: 0.8rem;
  color: var(--slate-500);
  margin-bottom: 14px;
}

/* ==============================================================================
   6. BOTTOM NAVIGATION BAR (Fixed at bottom like kh.hairnova.vn)
   ============================================================================== */
.app-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 6px 6px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px 0;
  transition: all 0.2s ease;
}

.bottom-nav-item .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-bottom: 3px;
}

.bottom-nav-item .nav-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bottom-nav-item.active {
  color: var(--navy-900);
}

.bottom-nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Center Highlight Button: Digital ID Card */
.bottom-nav-item.center-highlight {
  position: relative;
  top: -12px;
}

.center-highlight-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--navy-900);
  border: 3px solid var(--white);
  box-shadow: 0 6px 16px rgba(11, 30, 66, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-size: 1.4rem;
  margin-bottom: 2px;
  border: 2px solid var(--gold-500);
}

/* ==============================================================================
   7. MODAL STYLES (Bottom-Sheet / Popups)
   ============================================================================== */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.app-modal-overlay.active {
  display: flex;
}

.app-modal-sheet {
  width: 100%;
  max-width: var(--app-max-width);
  background: var(--white);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px 20px 32px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.28s ease;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
}

.modal-sheet-head h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy-900);
}

.modal-btn-close {
  background: var(--slate-100);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--slate-600);
  cursor: pointer;
}

/* Form Controls */
.app-form-group {
  margin-bottom: 14px;
}

.app-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 5px;
}

.app-input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--slate-300);
  padding: 0 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.app-input:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(20, 50, 110, 0.1);
}

.app-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--slate-300);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.btn-app-submit {
  width: 100%;
  height: 46px;
  background: var(--navy-900);
  color: #fff2a6;
  border: 1.5px solid var(--gold-500);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: var(--shadow-gold);
}

/* Toast System */
.app-toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  z-index: 300;
  pointer-events: none;
}

.app-toast {
  background: var(--navy-950);
  color: #fff;
  border: 1px solid var(--gold-500);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: fadeInDown 0.25s ease;
  pointer-events: auto;
}

.app-toast.success { border-color: #10b981; }
.app-toast.error { border-color: #ef4444; }
.app-toast.warning { border-color: #f59e0b; }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   REFERRAL MINI CRM (SÀN GIAO THƯƠNG B2B PORTAL)
   ============================================================================== */
.referral-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.referral-stat-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.referral-stat-card.won-highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}
.referral-stat-label {
  font-size: 0.68rem;
  color: var(--slate-500);
  font-weight: 700;
  text-transform: uppercase;
}
.referral-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-top: 4px;
}
.referral-stat-card.won-highlight .referral-stat-val {
  color: #15803d;
}

/* Segmented Control Tabs */
.referral-tab-switcher {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 14px;
  gap: 4px;
}
.referral-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.referral-tab-btn.active {
  background: #fff;
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

/* Deal Card */
.deal-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.deal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.deal-code {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--navy-900);
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.deal-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.deal-badge-NEW { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.deal-badge-CONTACTING { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.deal-badge-NEGOTIATING { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.deal-badge-WON { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.deal-badge-LOST { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.deal-customer-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy-900);
  margin-bottom: 4px;
}
.deal-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--slate-600);
  margin-bottom: 4px;
}
.deal-meta-row a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 700;
}
.deal-desc-box {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.76rem;
  color: var(--slate-700);
  margin: 8px 0;
  line-height: 1.4;
  border-left: 3px solid var(--navy-800);
}
.deal-values-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px dashed var(--slate-200);
  margin-top: 8px;
}
.deal-val-item {
  display: flex;
  flex-direction: column;
}
.deal-val-title {
  font-size: 0.65rem;
  color: var(--slate-500);
  font-weight: 700;
}
.deal-val-num {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy-900);
}
.deal-val-won {
  color: #15803d;
}
.deal-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.btn-deal-action {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--navy-900);
  cursor: pointer;
  text-align: center;
}
.btn-deal-won {
  background: #15803d;
  color: #fff;
  border-color: #166534;
}
.btn-deal-contact {
  background: #1e40af;
  color: #fff;
  border-color: #1d4ed8;
}

/* Directory Sheet Styles */
.btn-directory-tag {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--slate-700);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.btn-directory-tag.active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fde047;
}
.directory-member-item {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.directory-member-item:hover, .directory-member-item:active {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateY(-1px);
}
.directory-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0b1e42 0%, #1e3a8a 100%);
  color: #fde047;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--gold-500);
}
.directory-member-info {
  flex: 1;
  margin-left: 10px;
  overflow: hidden;
  line-height: 1.35;
}
.directory-member-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.directory-member-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy-900);
}
.directory-member-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: #1e40af;
  background: #eff6ff;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}
.directory-member-meta {
  font-size: 0.74rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.btn-select-member-badge {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-left: 8px;
}

