/* ============================================================
   Compass ERP — Apple Human Interface Guidelines (HIG) Stylesheet
   ============================================================ */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Inter", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", system-ui, sans-serif;

  /* Apple System Palette */
  --primary:        #0071E3;
  --primary-hover:  #0077ED;
  --primary-active: #0062C4;
  --primary-light:  rgba(0, 113, 227, 0.08);
  --accent:         #5856D6;
  --purple:         #AF52DE;
  --success:        #34C759;
  --success-light:  rgba(52, 199, 89, 0.12);
  --warning:        #FF9500;
  --warning-light:  rgba(255, 149, 0, 0.12);
  --danger:         #FF3B30;
  --danger-light:   rgba(255, 59, 48, 0.12);

  /* Materials & Translucency */
  --bg:             #E9E9EE;
  --surface:        #FFFFFF;
  --surface-2:      #F8F8FA;
  --surface-3:      #EFEFF4;
  --surface-glass:  rgba(255, 255, 255, 0.76);

  /* Borders & Specular Refraction */
  --border:         rgba(60, 60, 67, 0.12);
  --border-light:   rgba(60, 60, 67, 0.07);
  --border-specular: rgba(255, 255, 255, 0.85);

  /* Typography Colors */
  --text:           #1D1D1F;
  --text-2:         #48484A;
  --text-3:         #86868B;
  --text-4:         #AEAEB2;

  /* Apple Squircle Radii */
  --radius-xs:      8px;
  --radius-sm:      12px;
  --radius:         18px;
  --radius-lg:      24px;
  --radius-pill:    9999px;

  /* Multi-Tiered Ambient Shadows */
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow:         0 4px 16px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-md:      0 10px 28px -4px rgba(0, 0, 0, 0.06), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg:      0 20px 44px -8px rgba(0, 0, 0, 0.08), 0 8px 18px -4px rgba(0, 0, 0, 0.04);
  --shadow-premium: 0 12px 36px -6px rgba(0, 113, 227, 0.12), 0 4px 14px rgba(0, 0, 0, 0.03);

  /* Spring Physics Curves */
  --ease-spring:    cubic-bezier(0.32, 0.72, 0, 1);
  --ease-momentum:  cubic-bezier(0.34, 1.35, 0.64, 1);
}

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

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Instant 1:1 Press Scale on All Interactive Controls */
button:active, .btn:active, .tab-item:active, .kpi-card:active {
  transform: scale(0.978) !important;
  transition: transform 100ms cubic-bezier(0.2, 0, 0, 1) !important;
}

/* Translucent Apple Glass Header */
.compass-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 68px;
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 1px 0 var(--border-specular);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}
.brand-title-wrap h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}
.brand-title-wrap span {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Apple Segmented Control Navigation */
.segmented-nav-container {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.segmented-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  user-select: none;
}
.segmented-tab:hover:not(.active) {
  color: var(--text);
}
.segmented-tab.active {
  background: #FFFFFF;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.segmented-tab .tab-icon {
  font-size: 0.95rem;
}

/* User & Quick Action Hub */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #FFFFFF !important;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}
.quick-action-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
  color: var(--text);
  transition: all 0.2s var(--ease-spring);
}
.user-pill:hover {
  background: var(--surface-2);
  border-color: rgba(60, 60, 67, 0.2);
}
.avatar-frame {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background: rgba(0, 113, 227, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-details-inline {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-details-inline .u-name {
  font-size: 0.8125rem;
  font-weight: 600;
}
.user-details-inline .u-role {
  font-size: 0.6875rem;
  color: var(--text-3);
}

/* Apple SVG Tab & Action Icons */
.tab-svg, .btn-svg, .brand-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.segmented-tab .tab-svg {
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), stroke 0.2s ease;
}
.segmented-tab:hover .tab-svg {
  transform: translateY(-0.5px);
}
.segmented-tab.active .tab-svg {
  stroke: var(--primary);
}
.brand-logo-icon svg {
  color: #FFFFFF;
}

/* Page Layout */
.compass-page-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 32px;
  flex: 1;
}

/* Section Header */
.page-hero-header {
  margin-bottom: 28px;
}
.page-hero-header h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.page-hero-header p {
  font-size: 0.95rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* KPI Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.28s var(--ease-spring);
  text-decoration: none !important;
  color: inherit;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 113, 227, 0.2);
}
.kpi-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: var(--surface-2);
}
.kpi-stat-val {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}
.kpi-stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* Main Two-Column Section */
.modules-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 900px) {
  .modules-split-grid {
    grid-template-columns: 1fr;
  }
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.module-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.module-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.module-card-body {
  padding: 20px 24px;
  flex: 1;
}

/* Task Item */
.task-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
  transition: all 0.2s var(--ease-spring);
  text-decoration: none !important;
  color: inherit;
}
.task-item-row:hover {
  background: #FFFFFF;
  border-color: rgba(0, 113, 227, 0.25);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.task-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.task-item-icon {
  font-size: 1.1rem;
}
.task-item-info .title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.task-item-info .subtitle {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 1px;
}

/* Badge */
.apple-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-done { background: var(--success-light); color: var(--success); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-urgent { background: var(--danger-light); color: var(--danger); }
.badge-blue { background: var(--primary-light); color: var(--primary); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .compass-navbar {
    padding: 0 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .segmented-nav-container {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .compass-page-container {
    padding: 18px 16px;
  }
}

/* ============================================================
   APPLE HIG MODAL SHEET & TEAM MEMBER EDITOR
   ============================================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: all 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-backdrop.active .modal-sheet {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.65);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

.modal-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.avatar-edit-section {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.avatar-preview-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.avatar-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-preview-box .initial-letter {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.avatar-edit-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avatar-edit-controls p {
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
}

.form-group-apple {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-apple label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.form-control-apple {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-1);
  outline: none;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.form-control-apple:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

@media (max-width: 540px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.65);
}

/* Edit action button in table */
.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(0, 113, 227, 0.18);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}

.btn-action-edit:hover {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
  transform: translateY(-1px);
}

.btn-action-edit:active {
  transform: scale(0.96);
}

/* Floating Toast */
.apple-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(29, 29, 31, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.apple-toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   FULL-PAGE APP VIEW — Checklist / Delegation tabs fill the
   whole viewport under the Compass navbar (no hero, no frame)
   ============================================================ */
body.app-full { overflow: hidden; }
body.app-full .compass-page-container { max-width: none; padding: 0; margin: 0; }
body.app-full .page-hero-header { display: none !important; }
body.app-full .iframe-container {
  height: calc(100vh - var(--compass-nav-h, 68px));
  height: calc(100dvh - var(--compass-nav-h, 68px));
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.app-full .tab-pane { animation: none; }

/* ============================================================
   BLACK HEADER & FOOTER
   ============================================================ */
.compass-navbar {
  background: #0B0B0C !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}
.compass-navbar .brand-title-wrap h1 { color: #FFFFFF !important; }
.compass-navbar .brand-title-wrap h1 span { color: rgba(255, 255, 255, 0.45) !important; }
.compass-navbar .brand-title-wrap > span { color: rgba(255, 255, 255, 0.55) !important; }

.compass-navbar .segmented-nav-container {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: none !important;
}
.compass-navbar .segmented-tab {
  color: rgba(255, 255, 255, 0.72) !important; background: transparent !important;
  border: 0 !important; box-shadow: none !important;
}
.compass-navbar .segmented-tab:hover:not(.active) { color: #FFFFFF !important; background: rgba(255, 255, 255, 0.06) !important; }
.compass-navbar .segmented-tab.active { background: #FFFFFF !important; color: #0B0B0C !important; }
.compass-navbar .segmented-tab .tab-svg, .compass-navbar .segmented-tab svg { color: inherit !important; stroke: currentColor; }

.compass-navbar .user-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important; box-shadow: none !important;
}
.compass-navbar .user-pill:hover { background: rgba(255, 255, 255, 0.14) !important; }
.compass-navbar .u-name { color: #FFFFFF !important; }
.compass-navbar .u-role { color: rgba(255, 255, 255, 0.55) !important; }
.compass-navbar .user-pill a, .compass-navbar .user-pill svg { color: #FF6961 !important; }

.compass-footer {
  background: #0B0B0C !important;
  color: rgba(255, 255, 255, 0.55) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.app-full .compass-footer { display: none; } /* full-page apps: no footer below the frame */

/* ============================================================
   FLOATING 3D MENU BAR (greyish) — overrides the flat black bar
   ============================================================ */
.compass-navbar {
  position: sticky !important; top: 10px !important;
  margin: 10px 16px 0 !important;
  height: 64px !important;
  padding: 0 14px 0 10px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #4A4A50 0%, #2E2E33 48%, #232327 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.35) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),      /* top specular edge */
    inset 0 -2px 6px rgba(0, 0, 0, 0.35),         /* bottom inner shade */
    0 10px 28px -8px rgba(0, 0, 0, 0.45),         /* drop shadow */
    0 2px 6px rgba(0, 0, 0, 0.18) !important;
}
.compass-navbar .brand-logo-icon {
  background: linear-gradient(180deg, #FFFFFF 0%, #E9E9EE 100%) !important;
  color: #1D1D1F !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 #fff, 0 3px 8px rgba(0, 0, 0, 0.35) !important;
}
.compass-navbar .brand-logo-icon svg { color: #1D1D1F !important; stroke: currentColor; }
.compass-navbar .segmented-nav-container {
  background: rgba(0, 0, 0, 0.28) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35) !important;   /* recessed track */
  border-radius: 999px !important; padding: 4px !important;
}
.compass-navbar .segmented-tab { border-radius: 999px !important; }
.compass-navbar .segmented-tab.active {
  background: linear-gradient(180deg, #FFFFFF 0%, #ECECF0 100%) !important;
  color: #1D1D1F !important;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, 0.35) !important;  /* raised key */
}
.compass-navbar .quick-action-btn, .compass-navbar .header-actions > button, .compass-navbar .header-actions > a:not(.user-pill) {
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 12px rgba(0, 122, 255, 0.35) !important;
}
.compass-navbar .user-pill {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}

/* 3D cards on the Compass pages */
.compass-page-container .card, .compass-page-container .kpi-card, .compass-page-container .module-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: inset 0 1px 0 #FFFFFF, 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 28px -14px rgba(0, 0, 0, 0.22) !important;
}

.compass-footer {
  margin: 0 16px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #3A3A3F 0%, #232327 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 20px -10px rgba(0, 0, 0, 0.4);
  padding: 14px 24px !important;
}
@media (max-width: 768px) {
  .compass-navbar { border-radius: 22px !important; height: auto !important; padding: 10px 12px !important; margin: 8px 8px 0 !important; top: 8px !important; }
  .compass-footer { border-radius: 18px; margin: 0 8px 8px; }
}
body.app-full .iframe-container { margin: 10px 16px 0; width: auto; border-radius: 18px !important; overflow: hidden;
  height: calc(100vh - var(--compass-nav-h, 84px) - 10px) !important; height: calc(100dvh - var(--compass-nav-h, 84px) - 10px) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 16px 36px -18px rgba(0,0,0,.3) !important; }
@media (max-width: 768px) { body.app-full .iframe-container { margin: 8px 8px 0; border-radius: 14px !important; } }

/* ============================================================
   TEAM DIRECTORY REDESIGN + navbar overflow guard
   ============================================================ */
html, body { overflow-x: hidden; }
.compass-navbar { width: auto !important; max-width: calc(100% - 32px); box-sizing: border-box; }

#pane-team .page-hero-header { align-items: flex-end !important; margin-bottom: 18px; }
#pane-team .page-hero-header h2 { font-size: 24px; }
#pane-team .search-input-apple { width: 280px; max-width: 100%; padding-top: 9px; padding-bottom: 9px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06); background-color: #fff; }
.compass-page-container .btn.btn-primary, #pane-team .btn-primary {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; cursor: pointer;
  font: 600 13px/1 inherit; color: #fff; border-radius: 999px; border: 1px solid #0066D6;
  background: linear-gradient(180deg, #1A8CFF 0%, #007AFF 55%, #006EE6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 8px -2px rgba(0,102,214,.45);
}
.compass-page-container .btn.btn-primary:hover { filter: brightness(1.05); }
.compass-page-container .btn.btn-primary svg { stroke: currentColor; }

.team-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.team-stat {
  display: flex; align-items: baseline; gap: 8px; padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 100%); border: 1px solid rgba(0,0,0,.06);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.05), 0 12px 28px -14px rgba(0,0,0,.22);
}
.team-stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.team-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }

.team-card { overflow: hidden; border-radius: 18px !important; }
#teamTable thead tr { background: #F6F6F9 !important; }
#teamTable th {
  padding: 11px 18px !important; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); border-bottom: 1px solid rgba(0,0,0,.06); white-space: nowrap;
}
#teamTable td { padding: 11px 18px !important; vertical-align: middle; }
#teamTable td:first-child { font-size: 13.5px; }
#teamTable td:nth-child(2) { font-size: 12.5px !important; line-height: 1.45; }
#teamTable td:nth-child(4), #teamTable td:nth-child(5) { font-size: 12.5px !important; }
#teamTable .team-member-row { transition: background-color .15s ease; }
#teamTable .team-member-row:hover { background: rgba(0,122,255,.035); }
#teamTable .team-member-row:last-child { border-bottom: 0 !important; }
#teamTable .apple-badge { font-size: 10px; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
#teamTable .btn-action-edit {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F4F7 100%); border: 1px solid rgba(0,0,0,.10);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.08);
}
#teamTable .btn-action-edit:hover { color: #fff; background: linear-gradient(180deg, #1A8CFF, #007AFF); border-color: #0066D6; }

@media (max-width: 900px) {
  .team-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #pane-team .page-hero-header > div:last-child { width: 100%; }
  #pane-team .search-input-apple { flex: 1; width: auto; }
  /* table rows become compact cards */
  #teamTable, #teamTable tbody, #teamTable tr, #teamTable td { display: block; width: 100%; }
  #teamTable thead { display: none; }
  .team-card { background: transparent !important; box-shadow: none !important; border: 0 !important; }
  #teamTable .team-member-row {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin-bottom: 10px; padding: 12px 14px;
    border-radius: 14px; border: 1px solid rgba(0,0,0,.06) !important;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 100%);
    box-shadow: inset 0 1px 0 #fff, 0 6px 16px -10px rgba(0,0,0,.25);
  }
  #teamTable td { padding: 0 !important; }
  #teamTable td:nth-child(1) { grid-column: 1; }
  #teamTable td:nth-child(6) { grid-column: 2; grid-row: 1; text-align: right; }
  #teamTable td:nth-child(2) { grid-column: 1 / -1; padding-left: 48px !important; }
  #teamTable td:nth-child(3) { grid-column: 1; padding-left: 48px !important; }
  #teamTable td:nth-child(4), #teamTable td:nth-child(5) { display: none; }
  #teamTable td:nth-child(7) { grid-column: 2; grid-row: 3; text-align: right !important; }
}
