/*
 * Surf Suite — Shared Shell & Design System
 * ==========================================
 * This file is the single source of truth for all visual tokens and shell
 * components (topbar, sidebar, app switcher, cards, badges, layout).
 *
 * Version:  1.0
 * Applies to: SurfCRM, SurfSDR, SurfRecruiter, SurfAPI Portal
 *
 * Usage:
 *   <link rel="stylesheet" href="/static/surf/shell.css">
 *   Load AFTER Google Fonts / Tailwind CDN.
 *   Tailwind utility classes still work — this extends, not replaces, them.
 */

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --surf-orange:        #FF6A1A;
  --surf-orange-hover:  #E85E10;
  --surf-orange-light:  #FFF3ED;
  --surf-orange-border: #FDDCC8;

  /* Neutrals */
  --surf-bg:            #F5F7FB;
  --surf-white:         #FFFFFF;
  --surf-text:          #0A0A0A;
  --surf-text-2:        #374151;
  --surf-text-3:        #6B7280;
  --surf-text-4:        #9CA3AF;
  --surf-border:        #E5E7EB;
  --surf-border-2:      #F3F4F6;
  --surf-hover:         #F9FAFB;

  /* Shadows */
  --surf-sh-xs:  0 1px 2px rgba(0,0,0,.04);
  --surf-sh-sm:  0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --surf-sh-md:  0 4px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --surf-sh-lg:  0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.04);
  --surf-sh-xl:  0 20px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);

  /* Radius */
  --surf-r-sm:   6px;
  --surf-r-md:   10px;
  --surf-r-lg:   14px;
  --surf-r-xl:   18px;
  --surf-r-full: 9999px;

  /* Typography */
  --surf-font:   'Inter', system-ui, -apple-system, sans-serif;
  --surf-fs-xs:  11px;
  --surf-fs-sm:  12px;
  --surf-fs-base:13px;
  --surf-fs-md:  14px;
  --surf-fs-lg:  16px;
  --surf-fs-xl:  18px;
  --surf-fs-2xl: 22px;

  /* Shell dimensions */
  --surf-topbar: 60px;
  --surf-sidebar: 220px;

  /* App brand colors (for app switcher + badges) */
  --surf-app-crm:       #FF6A1A;
  --surf-app-sdr:       #8B5CF6;
  --surf-app-recruiter: #10B981;
  --surf-app-offers:    #3B82F6;
  --surf-app-cv:        #EC4899;
  --surf-app-market:    #F59E0B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

body.surf-shell {
  font-family: var(--surf-font);
  font-size: var(--surf-fs-md);
  color: var(--surf-text);
  background: var(--surf-bg);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════════════════ */

.surf-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.surf-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--surf-topbar));
}

.surf-main {
  flex: 1;
  overflow-y: auto;
  background: var(--surf-bg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════════════════════ */

.surf-topbar {
  height: var(--surf-topbar);
  background: var(--surf-white);
  border-bottom: 1px solid var(--surf-border);
  display: flex;
  align-items: center;
  padding: 0 16px 0 0;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

/* Logo zone */
.surf-tb-logo {
  width: var(--surf-sidebar);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 9px;
  text-decoration: none;
  border-right: 1px solid var(--surf-border);
  height: 100%;
}

.surf-tb-logo-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.surf-tb-logo-text {
  font-size: var(--surf-fs-lg);
  font-weight: 700;
  color: var(--surf-text);
  letter-spacing: -.3px;
  white-space: nowrap;
}

.surf-tb-logo-text em {
  font-style: normal;
  color: var(--surf-orange);
}

/* Workspace selector */
.surf-tb-workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-left: 12px;
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-md);
  background: transparent;
  cursor: pointer;
  font-size: var(--surf-fs-sm);
  font-family: var(--surf-font);
  color: var(--surf-text);
  white-space: nowrap;
  transition: background .15s, border-color .15s;
  min-width: 0;
  max-width: 200px;
}

.surf-tb-workspace:hover {
  background: var(--surf-hover);
  border-color: #D1D5DB;
}

.surf-tb-workspace-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surf-tb-workspace-plan {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--surf-r-full);
  background: var(--surf-orange-light);
  color: var(--surf-orange);
  border: 1px solid var(--surf-orange-border);
  white-space: nowrap;
}

.surf-tb-workspace-chevron {
  width: 14px;
  height: 14px;
  color: var(--surf-text-3);
  flex-shrink: 0;
}

/* Separator */
.surf-tb-sep {
  width: 1px;
  height: 28px;
  background: var(--surf-border);
  margin: 0 8px;
  flex-shrink: 0;
}

/* App switcher */
.surf-tb-apps {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  padding: 0 4px;
}

.surf-tb-apps::-webkit-scrollbar { display: none; }

.surf-tb-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px 5px;
  border-radius: var(--surf-r-md);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--surf-font);
  transition: background .12s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.surf-tb-app:hover {
  background: var(--surf-hover);
}

.surf-tb-app.is-current {
  background: transparent;
}

.surf-tb-app.is-current::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--surf-orange);
  border-radius: 1px 1px 0 0;
}

.surf-tb-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.surf-tb-app-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--surf-text-3);
  line-height: 1;
}

.surf-tb-app.is-current .surf-tb-app-label {
  color: var(--surf-orange);
  font-weight: 600;
}

/* Right actions */
.surf-tb-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 8px;
  flex-shrink: 0;
}

.surf-tb-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surf-hover);
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-md);
  padding: 5px 10px;
  cursor: text;
  font-size: var(--surf-fs-sm);
  color: var(--surf-text-3);
  min-width: 180px;
  transition: border-color .15s, box-shadow .15s;
}

.surf-tb-search:focus-within {
  border-color: var(--surf-orange);
  box-shadow: 0 0 0 3px rgba(255,106,26,.1);
  background: var(--surf-white);
}

.surf-tb-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--surf-fs-sm);
  color: var(--surf-text);
  font-family: var(--surf-font);
  width: 100%;
}

.surf-tb-search input::placeholder { color: var(--surf-text-4); }

.surf-tb-search-key {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--surf-text-4);
  font-size: 10px;
  white-space: nowrap;
}

.surf-tb-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  border-radius: var(--surf-r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--surf-text-3);
  position: relative;
  transition: background .12s, color .12s;
}

.surf-tb-icon-btn:hover {
  background: var(--surf-hover);
  color: var(--surf-text);
}

.surf-tb-icon-btn svg { width: 18px; height: 18px; }

.surf-tb-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--surf-orange);
  border-radius: 50%;
  border: 1.5px solid var(--surf-white);
}

/* User button */
.surf-tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: none;
  background: transparent;
  border-radius: var(--surf-r-lg);
  cursor: pointer;
  font-family: var(--surf-font);
  transition: background .12s;
  margin-left: 4px;
}

.surf-tb-user:hover { background: var(--surf-hover); }

.surf-tb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surf-orange) 0%, #FF8C42 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.surf-tb-user-info { text-align: left; }

.surf-tb-user-name {
  font-size: var(--surf-fs-sm);
  font-weight: 600;
  color: var(--surf-text);
  line-height: 1.3;
}

.surf-tb-user-role {
  font-size: 11px;
  color: var(--surf-text-3);
  line-height: 1.2;
}

.surf-tb-user-chevron {
  width: 14px;
  height: 14px;
  color: var(--surf-text-4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════════════════ */

.surf-sidebar {
  width: var(--surf-sidebar);
  flex-shrink: 0;
  background: var(--surf-white);
  border-right: 1px solid var(--surf-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--surf-border) transparent;
}

.surf-sidebar::-webkit-scrollbar { width: 4px; }
.surf-sidebar::-webkit-scrollbar-track { background: transparent; }
.surf-sidebar::-webkit-scrollbar-thumb { background: var(--surf-border); border-radius: 2px; }

/* Sidebar section label */
.surf-sidebar-label {
  padding: 16px 16px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--surf-text-4);
}

/* Nav items */
.surf-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 16px;
  margin: 1px 8px;
  border-radius: var(--surf-r-md);
  text-decoration: none;
  font-size: var(--surf-fs-md);
  font-weight: 500;
  color: var(--surf-text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
  border: none;
  background: transparent;
  font-family: var(--surf-font);
  width: calc(100% - 16px);
  text-align: left;
}

.surf-nav-item:hover {
  background: var(--surf-bg);
  color: var(--surf-text);
}

.surf-nav-item.active,
.surf-nav-item[aria-current="page"] {
  background: var(--surf-orange-light);
  color: var(--surf-orange);
  font-weight: 600;
}

.surf-nav-item.active .surf-nav-icon,
.surf-nav-item[aria-current="page"] .surf-nav-icon {
  color: var(--surf-orange);
}

.surf-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--surf-text-4);
  transition: color .12s;
}

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

.surf-nav-badge.secondary {
  background: var(--surf-border);
  color: var(--surf-text-3);
}

/* Sidebar footer */
.surf-sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--surf-border-2);
}

/* Plan widget */
.surf-plan-widget {
  background: var(--surf-bg);
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-lg);
  padding: 12px 14px;
  margin: 8px;
}

.surf-plan-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--surf-fs-sm);
  font-weight: 700;
  color: var(--surf-text);
  margin-bottom: 4px;
}

.surf-plan-seats {
  font-size: 11px;
  color: var(--surf-text-3);
  margin-bottom: 8px;
}

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

.surf-plan-bar-fill {
  height: 100%;
  background: var(--surf-orange);
  border-radius: 2px;
  transition: width .4s ease;
}

.surf-plan-link {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--surf-text-3);
  text-decoration: none;
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-md);
  padding: 5px;
  transition: color .12s, border-color .12s, background .12s;
}

.surf-plan-link:hover {
  color: var(--surf-orange);
  border-color: var(--surf-orange-border);
  background: var(--surf-orange-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DROPDOWNS (notifications, user menu)
═══════════════════════════════════════════════════════════════════════════ */

.surf-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surf-white);
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-xl);
  box-shadow: var(--surf-sh-lg);
  z-index: 200;
  min-width: 200px;
  overflow: hidden;
  animation: surf-dropdown-in .12s ease;
}

.surf-dropdown-wide { min-width: 320px; max-width: 360px; }

@keyframes surf-dropdown-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.surf-dropdown-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--surf-border-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.surf-dropdown-title {
  font-size: var(--surf-fs-md);
  font-weight: 600;
  color: var(--surf-text);
}

.surf-dropdown-subtitle {
  font-size: var(--surf-fs-sm);
  color: var(--surf-text-3);
  margin-top: 1px;
}

.surf-dropdown-body {
  max-height: 340px;
  overflow-y: auto;
}

.surf-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: var(--surf-fs-md);
  color: var(--surf-text-2);
  text-decoration: none;
  transition: background .1s;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--surf-font);
  width: 100%;
  text-align: left;
}

.surf-dropdown-item:hover { background: var(--surf-hover); }

.surf-dropdown-item svg { width: 15px; height: 15px; color: var(--surf-text-3); }

.surf-dropdown-item.danger { color: #DC2626; }
.surf-dropdown-item.danger svg { color: #DC2626; }
.surf-dropdown-item.danger:hover { background: #FEF2F2; }

.surf-dropdown-sep {
  height: 1px;
  background: var(--surf-border-2);
  margin: 4px 0;
}

/* User info row in user dropdown */
.surf-dropdown-user {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--surf-border-2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.surf-dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surf-orange) 0%, #FF8C42 100%);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Notification items */
.surf-notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surf-border-2);
  cursor: pointer;
  transition: background .1s;
}

.surf-notif-item:last-child { border-bottom: none; }
.surf-notif-item:hover { background: var(--surf-hover); }
.surf-notif-item.unread { background: #FFFBF7; }

.surf-notif-item.unread:hover { background: #FFF3ED; }

.surf-notif-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.surf-notif-msg {
  font-size: var(--surf-fs-sm);
  color: var(--surf-text-2);
  line-height: 1.5;
  margin: 0;
}

.surf-notif-time {
  font-size: 11px;
  color: var(--surf-text-4);
  margin-top: 3px;
}

.surf-notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--surf-text-3);
  font-size: var(--surf-fs-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP-SPECIFIC SECTIONS IN SIDEBAR (legacy CRM sections)
═══════════════════════════════════════════════════════════════════════════ */

/* Map existing CRM sidebar classes to new tokens */
.sidebar-section-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--surf-text-4);
  padding: 12px 16px 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 16px;
  margin: 1px 8px;
  border-radius: var(--surf-r-md);
  text-decoration: none;
  font-size: var(--surf-fs-md);
  font-weight: 500;
  color: var(--surf-text-3);
  cursor: pointer;
  transition: background .12s, color .12s;
  width: calc(100% - 16px);
}

.nav-link:hover {
  background: var(--surf-bg);
  color: var(--surf-text);
}

.nav-link.active {
  background: var(--surf-orange-light);
  color: var(--surf-orange);
  font-weight: 600;
}

.nav-link.active .nav-icon { color: var(--surf-orange); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--surf-text-4);
}

/* Collapsible section */
.sidebar-section { }

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px 4px;
  cursor: pointer;
  font-family: var(--surf-font);
}

.sidebar-section-toggle:hover .sidebar-section-heading { color: var(--surf-text-3); }

.sidebar-section-caret {
  width: 14px;
  height: 14px;
  color: var(--surf-text-4);
  transition: transform .2s;
  flex-shrink: 0;
}

.sidebar-section[data-section-active="false"] .sidebar-section-caret {
  transform: rotate(-90deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════════════════════════════════════ */

.surf-content {
  padding: 28px 32px;
}

.surf-page-header {
  margin-bottom: 24px;
}

.surf-page-title {
  font-size: var(--surf-fs-xl);
  font-weight: 700;
  color: var(--surf-text);
  letter-spacing: -.3px;
}

.surf-page-subtitle {
  font-size: var(--surf-fs-md);
  color: var(--surf-text-3);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════════════════ */

.surf-card {
  background: var(--surf-white);
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-lg);
  box-shadow: var(--surf-sh-xs);
}

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

.surf-card-title {
  font-size: var(--surf-fs-md);
  font-weight: 600;
  color: var(--surf-text);
}

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

/* Stat cards */
.surf-stat-card {
  background: var(--surf-white);
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-lg);
  padding: 20px 22px;
  box-shadow: var(--surf-sh-xs);
}

.surf-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.surf-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--surf-text);
  letter-spacing: -.5px;
  line-height: 1;
}

.surf-stat-label {
  font-size: var(--surf-fs-sm);
  color: var(--surf-text-3);
  margin-top: 4px;
}

.surf-stat-delta {
  font-size: var(--surf-fs-sm);
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.surf-stat-delta.up   { color: #16A34A; }
.surf-stat-delta.down { color: #DC2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════════════════ */

.surf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--surf-r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}

.surf-badge-orange { background: var(--surf-orange-light); color: var(--surf-orange); border: 1px solid var(--surf-orange-border); }
.surf-badge-green  { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.surf-badge-red    { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.surf-badge-blue   { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.surf-badge-purple { background: #F5F3FF; color: #7C3AED; border: 1px solid #DDD6FE; }
.surf-badge-gray   { background: var(--surf-bg); color: var(--surf-text-3); border: 1px solid var(--surf-border); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════════════ */

.surf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--surf-r-md);
  font-size: var(--surf-fs-md);
  font-weight: 600;
  font-family: var(--surf-font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .12s, box-shadow .12s, transform .06s;
  white-space: nowrap;
}

.surf-btn:active { transform: scale(.98); }

.surf-btn-primary {
  background: var(--surf-orange);
  color: white;
}

.surf-btn-primary:hover { background: var(--surf-orange-hover); }

.surf-btn-secondary {
  background: var(--surf-white);
  color: var(--surf-text);
  border: 1px solid var(--surf-border);
}

.surf-btn-secondary:hover { background: var(--surf-hover); }

.surf-btn-ghost {
  background: transparent;
  color: var(--surf-text-3);
}

.surf-btn-ghost:hover { background: var(--surf-hover); color: var(--surf-text); }

.surf-btn-sm { padding: 5px 12px; font-size: var(--surf-fs-sm); border-radius: var(--surf-r-sm); }
.surf-btn-lg { padding: 11px 22px; font-size: var(--surf-fs-lg); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════════════════════ */

.surf-table-wrap {
  overflow-x: auto;
  border-radius: var(--surf-r-lg);
  border: 1px solid var(--surf-border);
  background: var(--surf-white);
}

.surf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--surf-fs-md);
}

.surf-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: var(--surf-fs-xs);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--surf-text-3);
  background: var(--surf-bg);
  border-bottom: 1px solid var(--surf-border);
  white-space: nowrap;
}

.surf-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surf-border-2);
  color: var(--surf-text-2);
  vertical-align: middle;
}

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

.surf-table tbody tr:hover { background: var(--surf-hover); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════════════════ */

.surf-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--surf-border);
  border-radius: var(--surf-r-md);
  font-size: var(--surf-fs-md);
  font-family: var(--surf-font);
  color: var(--surf-text);
  background: var(--surf-white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.surf-input:focus {
  border-color: var(--surf-orange);
  box-shadow: 0 0 0 3px rgba(255,106,26,.12);
}

.surf-input::placeholder { color: var(--surf-text-4); }

.surf-label {
  display: block;
  font-size: var(--surf-fs-sm);
  font-weight: 600;
  color: var(--surf-text-2);
  margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IMPERSONATION BANNER
═══════════════════════════════════════════════════════════════════════════ */

.surf-impersonation-banner {
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--surf-fs-sm);
  color: #92400E;
}

.surf-impersonation-banner a {
  margin-left: auto;
  font-weight: 600;
  color: #B45309;
  text-decoration: none;
}

.surf-impersonation-banner a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   APP SVG WAVE MARKS (inline SVG helper)
═══════════════════════════════════════════════════════════════════════════ */

.surf-app-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--surf-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════════════════════ */

.surf-hidden { display: none !important; }
.surf-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Relative wrapper for dropdown positioning */
.surf-rel { position: relative; }
