/* ═══════════════════════════════════════════
   CSS VARIABLES & RESET
   ═══════════════════════════════════════════ */
:root {
  --bg-darkest: #0a0a0a;
  --bg-dark: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-elevated: #252525;
  --bg-input: #1e1e1e;
  --border: #2a2a2a;
  --border-light: #333333;
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #777777;
  --red-primary: #e63946;
  --red-hover: #ff4757;
  --red-dark: #c1121f;
  --red-glow: rgba(230, 57, 70, 0.15);
  --red-subtle: rgba(230, 57, 70, 0.08);
  --green: #2ecc71;
  --green-bg: rgba(46, 204, 113, 0.1);
  --yellow: #f39c12;
  --yellow-bg: rgba(243, 156, 18, 0.1);
  --blue: #3498db;
  --blue-bg: rgba(52, 152, 219, 0.1);
  --purple: #9b59b6;
  --purple-bg: rgba(155, 89, 182, 0.1);
  --sidebar-w: 240px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg-darkest);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}

.sidebar-brand:hover {
  opacity: 0.75;
}

.brand-icon {
  width: 36px; height: 36px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pt-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.brand-text span { color: var(--red-primary); }

/* Club Selector */
.club-section {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.club-create-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

.club-create-btn:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: var(--red-subtle);
}

.club-create-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.club-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.club-display:hover {
  background: var(--red-subtle);
  border-color: var(--border);
}

.club-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--red-primary);
  overflow: hidden;
}

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

.club-display-info {
  flex: 1;
  min-width: 0;
}

.club-display-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.club-display-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* Club Popup */
.club-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.club-popup-overlay.show {
  display: block;
  opacity: 1;
}

.club-popup {
  position: absolute;
  left: 12px;
  top: 120px;
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.15s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.club-popup-section {
  padding: 8px;
}

.club-popup-section + .club-popup-section {
  border-top: 1px solid var(--border);
}

.club-popup-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 8px 4px;
}

.club-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}

.club-popup-item:hover {
  background: var(--red-subtle);
}

.club-popup-item.active {
  background: var(--red-glow);
}

.club-popup-item .club-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.club-popup-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.club-popup-item .check-icon {
  width: 16px;
  height: 16px;
  color: var(--red-primary);
}

.club-popup-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.club-popup-add:hover {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.club-popup-add svg {
  width: 16px;
  height: 16px;
}

/* Members section */
.member-list {
  max-height: 180px;
  overflow-y: auto;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.member-row:hover {
  background: rgba(255,255,255,0.03);
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.member-info {
  flex: 1;
  min-width: 0;
}

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

.member-email {
  font-size: 10px;
  color: var(--text-muted);
}

.member-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}

.member-row:hover .member-actions {
  opacity: 1;
}

.member-action-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.member-action-btn:hover {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.member-action-btn svg {
  width: 12px;
  height: 12px;
}

.member-empty {
  text-align: center;
  padding: 12px 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: var(--red-subtle);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--red-glow);
  color: var(--red-primary);
  font-weight: 600;
}

.nav-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', sans-serif;
}

.sidebar-footer-link:hover {
  background: var(--red-subtle);
  color: var(--text-primary);
}

.sidebar-footer-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-footer-link:hover svg {
  opacity: 1;
}

/* User Profile */
.user-profile {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}

.user-profile-btn:hover {
  background: var(--red-subtle);
  border-color: var(--border);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.user-profile.open .user-chevron {
  transform: rotate(180deg);
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 60;
  overflow: hidden;
}

.user-profile.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', sans-serif;
}

.dropdown-item:hover {
  background: var(--red-subtle);
  color: var(--text-primary);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.dropdown-item:hover svg {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   NOTIFICATION BELL
   ═══════════════════════════════════════════ */
.notification-bell {
  position: relative;
}

.notification-bell-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
}

.notification-bell-btn:hover {
  background: var(--red-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}

.notification-bell-btn svg {
  width: 22px;
  height: 22px;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  background: var(--red-primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  pointer-events: none;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 60;
  overflow: hidden;
}

.notification-bell.open .notification-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.notification-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.notification-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.invite-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.invite-card:last-child {
  border-bottom: none;
}

.invite-club-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.invite-club-logo-default {
  background: var(--red-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

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

.invite-card-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.invite-card-actions {
  display: flex;
  gap: 8px;
}

.invite-accept-btn,
.invite-deny-btn {
  flex: 1;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.15s;
}

.invite-accept-btn {
  background: var(--red-primary);
  color: #fff;
}

.invite-accept-btn:hover {
  background: #d32f3f;
}

.invite-deny-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.invite-deny-btn:hover {
  background: var(--red-subtle);
  color: var(--text-primary);
}

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

/* Feedback star rating */
.star-rating {
  display: flex;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--border);
  transition: color 0.15s, transform 0.15s;
}

.star-btn:hover {
  transform: scale(1.15);
}

.star-btn.active {
  color: #f5a623;
}

.star-btn svg {
  width: 22px;
  height: 22px;
}

/* ═══════════════════════════════════════════
   ACCOUNT SETTINGS
   ═══════════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -4px -24px 20px;
  padding: 0 24px;
}

.settings-tab {
  padding: 10px 16px;
  border: none;
  background: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

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

.settings-tab.active {
  color: var(--red-primary);
  border-bottom-color: var(--red-primary);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.settings-row-label {
  width: 140px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-top: 8px;
}

.settings-row-content {
  flex: 1;
  min-width: 0;
}

.settings-row-content .form-input {
  width: 100%;
}

.settings-row-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Avatar Upload */
.settings-avatar-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s;
}

.settings-avatar:hover {
  border-color: var(--red-primary);
}

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

.settings-avatar-placeholder {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.settings-avatar-placeholder svg {
  width: 24px;
  height: 24px;
}

.settings-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 50%;
}

.settings-avatar:hover .settings-avatar-overlay {
  opacity: 1;
}

.settings-avatar-overlay svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.settings-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-avatar-actions .btn { font-size: 12px; padding: 6px 12px; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

/* 2FA Setup */
.tfa-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.tfa-status.enabled {
  background: rgba(46, 204, 113, 0.1);
  color: var(--green);
}

.tfa-status.disabled {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.tfa-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tfa-setup-area {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tfa-code-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.tfa-code-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.tfa-verify-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tfa-verify-row .form-input {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 4px;
  text-align: center;
}

/* Password strength */
.pw-strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: all 0.3s;
  width: 0;
}

.pw-strength-label {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-darkest);
}

/* When ledger is active, lock layout to viewport — no body scroll */
.main.ledger-active {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

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

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

/* Mobile burger */
.burger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.burger svg { width: 24px; height: 24px; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--red-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230,57,70,0.25);
}
.btn-primary:hover {
  background: var(--red-hover);
  box-shadow: 0 4px 16px rgba(230,57,70,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated); }

.btn-success {
  background: var(--green);
  color: #fff;
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: var(--red-primary);
  color: #fff;
}
.btn-danger:hover { background: var(--red-hover); transform: translateY(-1px); }

.btn-sm { padding: 6px 10px; font-size: 12px; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ═══════════════════════════════════════════
   SUMMARY CARDS
   ═══════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-accent, var(--border-light));
}

.summary-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.card-red { --card-accent: var(--red-primary); }
.card-green { --card-accent: var(--green); }
.card-yellow { --card-accent: var(--yellow); }
.card-blue { --card-accent: var(--blue); }
.card-purple { --card-accent: var(--purple); }

/* ═══════════════════════════════════════════
   DASHBOARD CHART
   ═══════════════════════════════════════════ */
.dash-range-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.dash-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.dash-chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-width: 0;
}

.dash-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* Preset pill buttons */
.chart-presets {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-preset-btn {
  padding: 5px 11px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 6px;
}

.chart-preset-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.chart-preset-btn.active {
  background: rgba(230,57,70,0.12);
  color: var(--red-primary);
  font-weight: 600;
}

/* Date range trigger button */
.date-range-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}

.date-range-trigger:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.date-range-trigger.open,
.date-range-trigger.has-range {
  border-color: var(--red-primary);
  color: var(--text-primary);
}

.date-range-trigger svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.date-range-trigger .dr-label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Calendar popover */
.dr-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  padding: 0;
  min-width: 300px;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dr-popover.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dr-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.dr-popover-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dr-nav-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.dr-nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.dr-nav-btn svg { width: 16px; height: 16px; }

/* Calendar grid */
.dr-calendar {
  padding: 0 12px 12px;
}

.dr-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 4px;
}

.dr-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dr-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dr-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.12s;
  position: relative;
}

.dr-day:hover:not(.empty):not(.disabled) {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.dr-day.today {
  color: var(--red-primary);
  font-weight: 700;
}

.dr-day.in-range {
  background: rgba(230,57,70,0.08);
  border-radius: 0;
}

.dr-day.range-start {
  background: var(--red-primary);
  color: #fff !important;
  border-radius: 8px 0 0 8px;
  font-weight: 600;
}

.dr-day.range-end {
  background: var(--red-primary);
  color: #fff !important;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

.dr-day.range-start.range-end {
  border-radius: 8px;
}

.dr-day.empty {
  cursor: default;
}

.dr-day.disabled {
  color: rgba(255,255,255,0.12);
  cursor: default;
}

/* Selection summary bar */
.dr-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  gap: 10px;
}

.dr-selection-text {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.dr-selection-text span {
  color: var(--text-primary);
  font-weight: 600;
}

.dr-apply-btn {
  padding: 5px 14px;
  background: var(--red-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.dr-apply-btn:hover {
  background: var(--red-hover);
}

.dr-apply-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.dr-clear-btn {
  padding: 5px 10px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.dr-clear-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.dr-clear-x {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 2px;
}

.dr-clear-x svg { width: 14px; height: 14px; }

.dr-clear-x:hover {
  background: rgba(230,57,70,0.12);
  color: var(--red-primary);
}

.dash-chart-legend {
  display: flex;
  gap: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dash-chart-container {
  position: relative;
  width: 100%;
  height: 240px;
}

.dash-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.dash-chart-tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  background: var(--bg-darkest);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-primary);
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  white-space: nowrap;
  line-height: 1.7;
}

.dash-chart-tooltip .tt-date {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-chart-tooltip .tt-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-chart-tooltip .tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-chart-tooltip .tt-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-open { background: var(--blue-bg); color: var(--blue); }
.badge-claimed { background: var(--yellow-bg); color: var(--yellow); }
.badge-waiting-match { background: var(--purple-bg); color: var(--purple); }
.badge-match-found { background: var(--green-bg); color: var(--green); }
.badge-closed { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.badge-deposit { background: var(--green-bg); color: var(--green); }
.badge-withdrawal { background: var(--red-glow); color: var(--red-primary); }

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Matched pair connector */
.matched-row.matched-top td { border-bottom: none; }
.matched-row.matched-bottom td { border-top: none; }

.matched-connector-row {
  pointer-events: none;
}
.matched-connector-row td {
  padding: 0 !important;
  border-bottom: none !important;
  border-top: none !important;
}

.matched-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 16px;
}

.matched-connector-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.35;
}

.matched-connector-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px;
  border-radius: 100px;
  background: rgba(42, 157, 143, 0.08);
  border: 1px solid rgba(42, 157, 143, 0.18);
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Subtle highlight on matched rows */
.matched-row.matched-top td {
  background: rgba(42, 157, 143, 0.03);
}
.matched-row.matched-bottom td {
  background: rgba(230, 57, 70, 0.03);
}

/* Clear divider between matched pairs */
.matched-pair-divider td {
  padding: 0 !important;
  border: none !important;
}
.matched-pair-divider-line {
  height: 3px;
  margin: 24px 0;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.04);
}

/* ═══════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════ */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.table-title {
  font-size: 15px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

tr:hover td { background: rgba(255,255,255,0.02); }

#ticketTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
#ticketTable th {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
#ticketTable td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
#ticketTable th:first-child,
#ticketTable td:first-child {
  padding-left: 28px;
}
#ticketTable th:last-child,
#ticketTable td:last-child {
  padding-right: 28px;
  overflow: visible;
  white-space: normal;
}
#ticketTable .matched-connector-row td,
#ticketTable .matched-pair-divider td {
  overflow: visible;
  white-space: normal;
  padding: 0 !important;
}

/* Flush-align badges and pills to match header text position */
#ticketTable .badge {
  margin-left: -2px;
}
#ticketTable .method-pill {
  margin-left: -2px;
}

.td-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.td-player {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 13px;
}

.td-claimed-by {
  color: var(--text-muted);
  font-size: 12px;
}

.td-amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.td-method {
  font-weight: 500;
  color: var(--text-primary);
}

/* Method pill badges */
.method-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.method-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.select-method-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  border: 1px dashed var(--border-light);
  color: var(--text-muted);
  transition: all 0.15s;
}
.method-cell-clickable:hover .select-method-pill {
  border-color: var(--red-primary);
  color: var(--text-secondary);
  background: rgba(230,57,70,0.06);
}

.method-cashapp { background: rgba(0, 212, 72, 0.12); color: #00d448; }
.method-venmo { background: rgba(0, 141, 237, 0.12); color: #008ded; }
.method-zelle { background: rgba(108, 29, 186, 0.12); color: #8a5cf5; }
.method-btc { background: rgba(247, 147, 26, 0.12); color: #f7931a; }
.method-eth { background: rgba(98, 126, 234, 0.12); color: #627eea; }
.method-paypal { background: rgba(0, 112, 186, 0.12); color: #0070ba; }

.td-time {
  font-size: 12px;
  color: var(--text-muted);
}

.td-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   FILTERS / TABS
   ═══════════════════════════════════════════ */
.filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: #fff;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.filter-btn.active .filter-count {
  background: rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-elevated); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.form-select { cursor: pointer; }
option { background: var(--bg-dark); }

.form-textarea { resize: vertical; min-height: 80px; }

.file-upload-area {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  background: rgba(255,255,255,0.02);
}

.file-upload-area:hover {
  border-color: var(--red-primary);
  background: var(--red-subtle);
}

.file-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.file-upload-placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.file-upload-placeholder span {
  font-size: 13px;
}

.file-upload-preview {
  display: flex;
  justify-content: center;
}

.file-upload-preview img {
  max-width: 80px;
  max-height: 80px;
  border-radius: 10px;
  object-fit: cover;
}

/* ═══════════════════════════════════════════
   CLUB SETTINGS — DANGER ZONE
   ═══════════════════════════════════════════ */
.cs-danger-zone {
  margin: 0 24px 24px;
  padding: 16px;
  border: 1px solid rgba(230,57,70,0.25);
  border-radius: var(--radius);
  background: rgba(230,57,70,0.05);
}

.cs-danger-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--red-primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.cs-danger-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════ */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.activity-icon.created { background: var(--blue-bg); color: var(--blue); }
.activity-icon.claimed { background: var(--yellow-bg); color: var(--yellow); }
.activity-icon.closed { background: var(--green-bg); color: var(--green); }
.activity-icon.matched { background: var(--purple-bg); color: var(--purple); }

.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Section heading */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   TICKET DETAIL DRAWER
   ═══════════════════════════════════════════ */
.ticket-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ticket-modal-overlay.show {
  display: flex;
}

.ticket-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  animation: ticketModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes ticketModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ticket-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.ticket-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.ticket-modal-body .detail-label {
  color: #aaa;
}
.ticket-modal-body .detail-value {
  color: #fff;
}
.ticket-modal-body .msg-bubble {
  color: #ddd;
}
.ticket-modal-body .msg-meta {
  color: #999;
}
.ticket-modal-body .form-label {
  color: #bbb;
}

.ticket-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ticket-modal-footer:empty {
  display: none;
}
.ticket-modal-footer-left {
  flex-shrink: 0;
}
.ticket-modal-footer-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#inlineReplyArea {
  animation: inlineReplySlide 0.2s ease-out;
}
@keyframes inlineReplySlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
#inlineReplyArea .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  resize: vertical;
}
#inlineReplyArea .form-textarea:focus {
  border-color: var(--red-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(230,57,70,0.1);
}
.btn-danger {
  background: var(--red-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover {
  background: var(--red-hover);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text-primary); text-align: right; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
  background: var(--bg-elevated);
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.msg-bubble.staff {
  background: var(--red-glow);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  margin-left: 24px;
}

.msg-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.match-indicator {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px dashed;
  margin: 16px 0;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.match-indicator.found {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green);
}

.match-indicator.waiting {
  border-color: var(--purple);
  background: var(--purple-bg);
  color: var(--purple);
}

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

.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .burger { display: block; }
  .topbar { padding: 12px 16px; }
  .page-content { padding: 20px 16px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { overflow-x: auto; }
  table { min-width: 700px; }
  .ticket-modal { width: 95vw; max-height: 90vh; }
  .hide-mobile { display: none !important; }
  .dash-charts-row { grid-template-columns: 1fr; }
  .dash-range-bar { flex-direction: column; align-items: flex-start; }
  .ledger-block { position: static !important; width: 100% !important; min-width: 0; }
  .block-resize-handle { display: none; }
  .ledger-fab { bottom: 16px; right: 16px; }
  .ledger-zoom-controls { bottom: 16px; right: 80px; }
  #ledgerContainer { min-height: auto; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
}

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

/* Subtle noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.015;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Toast */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-icon { font-size: 16px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}

/* ═══════════════════════════════════════════
   LEDGER SYSTEM
   ═══════════════════════════════════════════ */
.ledger-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.ledger-empty-icon {
  width: 64px; height: 64px;
  border: 2px dashed var(--border-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 28px;
}

.ledger-empty p { color: var(--text-muted); font-size: 14px; }

.ledger-add-btn-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--red-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(230,57,70,0.3);
}

.ledger-add-btn-big:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(230,57,70,0.4);
}

.ledger-add-btn-big svg { width: 20px; height: 20px; }

/* Floating add button */
.ledger-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px; height: 52px;
  background: var(--red-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(230,57,70,0.4);
  transition: all var(--transition);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ledger-fab:hover {
  background: var(--red-hover);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(230,57,70,0.5);
}

/* Zoom controls */
.ledger-zoom-controls {
  position: fixed;
  bottom: 28px;
  right: 92px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 90;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.ledger-zoom-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.ledger-zoom-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.ledger-zoom-btn:active {
  background: rgba(230,57,70,0.12);
  color: var(--red-primary);
}
.ledger-zoom-btn svg { width: 18px; height: 18px; }
.ledger-zoom-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  width: 42px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  user-select: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 2px;
  outline: none;
  transition: all 0.15s;
  cursor: pointer;
  -moz-appearance: textfield;
}
.ledger-zoom-level:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}
.ledger-zoom-level:focus {
  border-color: var(--red-primary);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: text;
  user-select: all;
}
.ledger-zoom-level::-webkit-inner-spin-button,
.ledger-zoom-level::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Zoom transform wrapper */
#ledgerZoomWrapper {
  transform-origin: 0 0;
  transition: transform 0.15s ease;
}
#ledgerZoomWrapper.no-transition {
  transition: none;
}

/* Block type picker */
.block-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.block-picker-overlay.show { display: flex; }

.block-picker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.block-picker-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.block-picker-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .block-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

.block-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.3;
}

.block-type-btn:hover {
  border-color: var(--red-primary);
  color: var(--text-primary);
  background: var(--red-subtle);
  transform: translateY(-2px);
}

.block-type-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-primary);
}

.block-type-icon svg {
  width: 24px;
  height: 24px;
}

/* Note Block */
.note-block-body {

}

/* Method Picker Popup */
.method-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  justify-content: center;
  align-items: center;
}

.method-picker-overlay.show {
  display: flex;
}

.method-picker-popup {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  width: 320px;
  animation: popIn 0.15s ease;
}

.method-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.method-picker-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.method-picker-close {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition);
}

.method-picker-close:hover {
  background: var(--red-subtle);
  color: var(--red-primary);
}

.method-picker-close svg {
  width: 16px;
  height: 16px;
}

.method-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.method-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.method-picker-option:hover {
  border-color: var(--red-primary);
  background: var(--red-subtle);
  color: var(--text-primary);
}

.method-picker-option.selected {
  border-color: var(--red-primary);
  background: var(--red-glow);
  color: var(--text-primary);
}

.note-block-body {
  padding: 16px 20px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.note-textarea {
  width: 100%;
  min-height: 160px;
  flex: 1 1 auto;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 14px 16px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.note-textarea:focus {
  border-color: var(--red-primary);
}

.note-textarea::placeholder {
  color: var(--text-muted);
}

/* Calculator block */
.calc-body { padding: 12px; flex: 1 1 auto; display: flex; flex-direction: column; }
.calc-display {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  margin-bottom: 10px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  word-break: break-all;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex: 1 1 auto;
  grid-auto-rows: 1fr;
}
.calc-btn {
  padding: 14px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.calc-btn:hover { background: rgba(255,255,255,0.1); }
.calc-btn:active { background: rgba(255,255,255,0.14); }
.calc-fn { color: var(--text-secondary); }
.calc-op { background: rgba(230,57,70,0.12); color: var(--red-primary); font-weight: 600; }
.calc-op:hover { background: rgba(230,57,70,0.2); }
.calc-eq { background: var(--red-primary); color: #fff; font-weight: 700; }
.calc-eq:hover { background: var(--red-hover); }
.calc-zero { grid-column: span 2; }

/* Ledger Block Card */
.ledger-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: absolute;
  min-width: 340px;
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
}
.ledger-block.block-new {
  animation: blockIn 0.3s ease;
}
.block-inner {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.block-inner::-webkit-scrollbar { width: 4px; }
.block-inner::-webkit-scrollbar-track { background: transparent; }
.block-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.block-inner::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Free-position canvas */
#ledgerContainer {
  position: relative;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: var(--radius);
  transition: min-height 0.3s ease, min-width 0.3s ease;
  min-height: 100%;
}

/* Disable smooth transition during drag for responsive feel */
#ledgerContainer.is-dragging {
  transition: none;
}

#page-ledger {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* allow flex shrink */
}

#page-ledger.is-panning {
  cursor: grabbing !important;
  user-select: none !important;
}
#page-ledger.is-panning * {
  cursor: grabbing !important;
}

#ledgerContainer {
  cursor: grab;
}
#ledgerContainer .ledger-block,
#ledgerContainer .ledger-block * {
  cursor: default;
}
#ledgerContainer .ledger-block .block-drag-handle,
#ledgerContainer .ledger-block .block-drag-handle * {
  cursor: grab;
}
#ledgerContainer .ledger-block .block-drag-handle:active,
#ledgerContainer .ledger-block .block-drag-handle:active * {
  cursor: grabbing;
}
#ledgerContainer .ledger-block input,
#ledgerContainer .ledger-block textarea {
  cursor: text;
}
#ledgerContainer .ledger-block button,
#ledgerContainer .ledger-block .block-action-btn,
#ledgerContainer .ledger-block .block-color-dot,
#ledgerContainer .ledger-block .method-cell-clickable,
#ledgerContainer .ledger-block .cell-balance-clickable,
#ledgerContainer .ledger-block .inline-add-icon,
#ledgerContainer .ledger-block .add-member-btn,
#ledgerContainer .ledger-block .member-rename-btn,
#ledgerContainer .ledger-block .member-delete-btn,
#ledgerContainer .ledger-block .row-delete-btn,
#ledgerContainer .ledger-block .calc-btn {
  cursor: pointer;
}
#ledgerContainer.is-dragging {
  cursor: default;
}

#ledgerContainer .ledger-empty {
  position: static;
  width: 100%;
}

/* Resize handles — 8 zones: 4 corners + 4 edges */
.block-resize-handle {
  position: absolute;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.ledger-block:hover .block-resize-handle { opacity: 1; pointer-events: auto; }
.block-resize-handle.active { opacity: 1; pointer-events: auto; }

/* Corners — 24×24 hit area, z-index above block-header */
.block-resize-handle.rh-tl { top: 0; left: 0; width: 24px; height: 24px; z-index: 12; }
.block-resize-handle.rh-tr { top: 0; right: 0; width: 24px; height: 24px; z-index: 12; }
.block-resize-handle.rh-bl { bottom: 0; left: 0; width: 24px; height: 24px; }
.block-resize-handle.rh-br { bottom: 0; right: 0; width: 24px; height: 24px; }

/* Corner visual indicators */
.block-resize-handle.rh-br::after,
.block-resize-handle.rh-tl::after,
.block-resize-handle.rh-tr::after,
.block-resize-handle.rh-bl::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: transparent;
  transition: border-color 0.2s;
}
.block-resize-handle.rh-br::after { bottom: 2px; right: 2px; border-right: 2px solid transparent; border-bottom: 2px solid transparent; }
.block-resize-handle.rh-tl::after { top: 2px; left: 2px; border-left: 2px solid transparent; border-top: 2px solid transparent; }
.block-resize-handle.rh-tr::after { top: 2px; right: 2px; border-right: 2px solid transparent; border-top: 2px solid transparent; }
.block-resize-handle.rh-bl::after { bottom: 2px; left: 2px; border-left: 2px solid transparent; border-bottom: 2px solid transparent; }
.block-resize-handle:hover::after, .block-resize-handle.active::after {
  border-color: var(--red-primary) !important;
}

#ledgerContainer .ledger-block .block-resize-handle.rh-tl { cursor: nwse-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-tr { cursor: nesw-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-bl { cursor: nesw-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-br { cursor: nwse-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-t { cursor: ns-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-b { cursor: ns-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-l { cursor: ew-resize; }
#ledgerContainer .ledger-block .block-resize-handle.rh-r { cursor: ew-resize; }

/* Edges — thinner hit zones */
.block-resize-handle.rh-t { top: 0; left: 24px; right: 24px; height: 8px; z-index: 12; }
.block-resize-handle.rh-b { bottom: 0; left: 24px; right: 24px; height: 8px; }
.block-resize-handle.rh-l { left: 0; top: 24px; bottom: 24px; width: 8px; }
.block-resize-handle.rh-r { right: 0; top: 24px; bottom: 24px; width: 8px; }

.ledger-block.resizing {
  user-select: none;
}

body.block-resizing {
  user-select: none !important;
}
body.block-resizing.resize-nwse, body.block-resizing.resize-nwse * { cursor: nwse-resize !important; }
body.block-resizing.resize-nesw, body.block-resizing.resize-nesw * { cursor: nesw-resize !important; }
body.block-resizing.resize-ns, body.block-resizing.resize-ns * { cursor: ns-resize !important; }
body.block-resizing.resize-ew, body.block-resizing.resize-ew * { cursor: ew-resize !important; }

/* Snap guide lines */
.snap-guide {
  position: absolute;
  background: var(--red-primary);
  z-index: 200;
  pointer-events: none;
  opacity: 0.6;
}

.snap-guide-v {
  width: 1px;
  top: 0;
  bottom: 0;
}

.snap-guide-h {
  height: 1px;
  left: 0;
  right: 0;
}

@keyframes blockIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.ledger-block.dragging {
  opacity: 0.85;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 2px var(--red-primary);
  z-index: 100;
  cursor: grabbing;
  transition: none;
  will-change: left, top;
  pointer-events: none;
}

body.block-dragging {
  cursor: grabbing !important;
  user-select: none !important;
}

body.block-dragging * {
  cursor: grabbing !important;
}

.block-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 11;
}

.block-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  flex-shrink: 0;
  transition: color var(--transition);
}
.block-drag-handle, .block-drag-handle * {
  cursor: grab;
}

.block-drag-handle:active, .block-drag-handle:active * { cursor: grabbing; }
.block-drag-handle:hover { color: var(--text-secondary); }
.block-drag-handle svg { width: 16px; height: 16px; }

.block-header-info { flex: 1; min-width: 0; }

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

.block-meta {
  display: flex;
  gap: 16px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.block-meta span { white-space: nowrap; }
.block-total-val { color: var(--red-primary); font-weight: 600; font-family: 'JetBrains Mono', monospace; }

.block-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.block-action-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.block-action-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.block-action-btn.danger:hover { background: rgba(230,57,70,0.15); color: var(--red-primary); }
.block-action-btn svg { width: 16px; height: 16px; }
.block-action-btn.transcript-btn { color: var(--text-secondary); }
.block-action-btn.transcript-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* Block color indicator */
.block-color-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  position: relative;
}
.block-color-dot:hover {
  transform: scale(1.15);
  border-color: var(--text-secondary);
}

/* Block color picker popup */
.block-color-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
}
.block-color-picker-overlay.show { display: block; }
.block-color-picker {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 301;
  animation: popIn 0.15s ease;
  width: 200px;
}
.block-color-picker-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.block-color-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.block-color-swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.block-color-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.3);
}
.block-color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--red-primary);
}
.block-color-swatch.none-swatch {
  background: var(--bg-card);
  border-color: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.block-color-swatch.none-swatch::after {
  content: '✕';
  font-size: 10px;
  color: var(--text-muted);
}

/* Block table */
.block-table-wrap {
  overflow-x: auto;
  padding: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.block-table {
  width: 100%;
  border-collapse: collapse;
  flex: 1 1 auto;
}

.block-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  white-space: nowrap;
  position: relative;
}

.block-table td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
}

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

.block-table .row-total td {
  background: rgba(255,255,255,0.025);
  font-weight: 600;
  color: var(--text-primary);
  border-top: 2px solid var(--border-light);
}

/* Editable cell */
.cell-edit {
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  transition: background var(--transition);
  min-width: 80px;
}

.cell-edit:focus {
  background: rgba(230,57,70,0.06);
  color: var(--text-primary);
}

.cell-edit::placeholder {
  color: rgba(255,255,255,0.15);
  font-style: italic;
  font-weight: 400;
}

select.cell-edit.cell-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a5a72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  color: var(--text-secondary);
}

select.cell-edit.cell-select:focus {
  background-color: rgba(230,57,70,0.06);
  color: var(--text-primary);
}

select.cell-edit.cell-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.cell-balance-clickable {
  font-weight: 600 !important;
  transition: background 0.15s !important;
}

.cell-balance-clickable:hover {
  background: var(--red-subtle) !important;
}

.cell-balance-clickable:focus {
  background: var(--red-subtle) !important;
  box-shadow: inset 0 0 0 1px var(--red-primary);
}

/* Balance Adjustment Modal */
.adjust-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1150;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.adjust-modal-overlay.show {
  display: flex;
  opacity: 1;
}

.adjust-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: popIn 0.15s ease;
  overflow: hidden;
  position: relative;
}

.adjust-modal-header {
  padding: 18px 20px 0;
}

.adjust-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.adjust-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.adjust-modal-body {
  padding: 16px 20px;
}

.adjust-current {
  text-align: center;
  padding: 12px 0;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}

.adjust-current-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.adjust-current-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.adjust-input-wrap {
  position: relative;
}

.adjust-input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.adjust-input {
  width: 100%;
  padding: 12px 14px 12px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
  font-variant-numeric: tabular-nums;
}

.adjust-input:focus {
  border-color: var(--red-primary);
}

.adjust-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.adjust-modal-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 18px;
}

.adjust-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.adjust-btn svg {
  width: 16px;
  height: 16px;
}

.adjust-btn-add {
  background: var(--green);
  color: #fff;
}

.adjust-btn-add:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.adjust-btn-subtract {
  background: var(--red-primary);
  color: #fff;
}

.adjust-btn-subtract:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.cell-edit.cell-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
}

.cell-edit.cell-total {
  font-weight: 600;
  color: var(--red-primary);
  pointer-events: none;
  background: transparent;
}

.cell-edit.cell-date {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  cursor: pointer;
  padding-left: 30px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 13px 13px;
}

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

.cell-date-wrap .cell-date-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  opacity: 0.6;
}

/* Single date picker popup */
.sdp-overlay {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: none;
}
.sdp-overlay.show { display: block; }

.sdp-popup {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 311;
  width: 260px;
  animation: popIn 0.15s ease;
  overflow: hidden;
}

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

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

.sdp-nav-btn {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.sdp-nav-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.sdp-nav-btn svg { width: 16px; height: 16px; }

.sdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 6px 10px 2px;
}

.sdp-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.sdp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 2px 10px 8px;
  gap: 2px;
}

.sdp-day {
  width: 100%; aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.1s;
  font-family: 'Outfit', sans-serif;
}
.sdp-day:hover:not(.empty) { background: var(--red-subtle); color: var(--text-primary); }
.sdp-day.today { color: var(--red-primary); font-weight: 700; }
.sdp-day.selected { background: var(--red-primary); color: #fff; font-weight: 600; }
.sdp-day.empty { cursor: default; }

.sdp-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.sdp-time-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sdp-time-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  text-align: center;
}
.sdp-time-input:focus { border-color: var(--red-primary); }

.sdp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.sdp-footer-btn {
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sdp-footer-btn.cancel { background: transparent; color: var(--text-muted); }
.sdp-footer-btn.cancel:hover { color: var(--text-primary); }
.sdp-footer-btn.apply { background: var(--red-primary); color: #fff; }
.sdp-footer-btn.apply:hover { background: var(--red-hover); }

/* Member column header */
.member-col-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.member-rename-btn, .member-delete-btn {
  width: 18px; height: 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
  font-size: 11px;
  padding: 0;
}

.block-table th:hover .member-rename-btn,
.block-table th:hover .member-delete-btn { opacity: 1; }

.member-rename-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }
.member-delete-btn:hover { color: var(--red-primary); background: rgba(230,57,70,0.15); }

.add-member-btn {
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--red-primary);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.add-member-btn:hover { background: var(--red-subtle); }

/* Add row bar (kept for stop loss Apply Data) */
.block-add-row {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

/* Inline add-row icon on divider */
.inline-add-divider {
  position: relative;
  height: 0;
}
.inline-add-divider td {
  padding: 0 !important;
  border-bottom: none !important;
  position: relative;
  height: 0;
  line-height: 0;
}
.inline-add-icon {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  opacity: 0.45;
  transition: all 0.15s;
  z-index: 2;
}
.inline-add-icon:hover {
  opacity: 1;
  color: var(--red-primary);
  border-color: var(--red-primary);
  background: var(--bg-elevated);
}

.apply-data-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--red-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.apply-data-btn:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230,57,70,0.3);
}

.apply-data-btn svg { width: 14px; height: 14px; }

/* Row delete button */
.row-delete-cell {
  width: 36px;
  text-align: center;
}

.row-delete-btn {
  width: 24px; height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
  font-size: 13px;
}

.block-table tr:hover .row-delete-btn { opacity: 1; }
.row-delete-btn:hover { background: rgba(230,57,70,0.15); color: var(--red-primary); }

/* ═══════════════════════════════════════════
   TEAM PAGE
   ═══════════════════════════════════════════ */
.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.team-header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.team-table {
  width: 100%;
  border-collapse: collapse;
}

.team-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.team-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.team-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.team-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.team-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: -10px;
}

.team-status.active {
  background: rgba(34,197,94,0.12);
  color: var(--green);
}

.team-status.pending {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}

.team-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  margin-left: -10px;
}

.team-role-badge svg {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

/* Custom Role Picker */
.role-picker {
  position: relative;
}

.role-picker-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.role-picker-trigger:hover {
  border-color: var(--border-light);
}

.role-picker-trigger .role-pill-display {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.role-picker-trigger .role-pill-display svg {
  opacity: 0.9;
}

.role-picker-trigger .role-pill-display span {
  font-size: 13px;
  font-weight: 500;
}

.role-picker-trigger .rp-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.role-picker.open .rp-chevron {
  transform: rotate(180deg);
}

.role-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
}

.role-picker.open .role-picker-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.role-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', sans-serif;
}

.role-picker-option:hover {
  background: rgba(255,255,255,0.05);
}

.role-picker-option.selected {
  background: var(--red-subtle);
}

.role-picker-option .rp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.role-picker-option .rp-pill svg {
  opacity: 0.9;
}

.role-picker-option .rp-check {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--red-primary);
  opacity: 0;
  flex-shrink: 0;
}

.role-picker-option.selected .rp-check {
  opacity: 1;
}

.team-actions {
  display: flex;
  gap: 4px;
}

.team-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.team-action-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.team-action-btn.danger:hover {
  background: rgba(230,57,70,0.12);
  color: var(--red-primary);
}

.team-action-btn svg {
  width: 16px;
  height: 16px;
}

.team-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.team-empty p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   CLIENTS PAGE
   ═══════════════════════════════════════════ */
.client-tier-icon {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}
.client-tier-icon.whale { background: rgba(69,123,157,0.12); }
.client-tier-icon.shrimp { background: rgba(244,162,97,0.12); }

.client-contact-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.client-platform-icon { width: 20px; height: 20px; flex-shrink: 0; }
.client-platform-icon.discord { color: #5865F2; }
.client-platform-icon.telegram { color: #26A5E4; }

.client-fh-list { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -8px; }
.client-fh-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.client-fh-tag-type { font-weight: 600; color: var(--text-muted); font-size: 11px; }

.client-tier-pick { display: flex; gap: 8px; }
.client-tier-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.client-tier-btn:hover { border-color: var(--border-light); background: var(--bg-elevated); }
.client-tier-btn.active {
  border-color: var(--red-primary);
  background: rgba(230,57,70,0.06);
  color: var(--text-primary);
}
.client-tier-emoji { font-size: 18px; }

/* App Dropdown */
.app-dropdown {
  position: relative;
}
.app-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.app-dropdown-trigger:hover { border-color: var(--border-light); }
.app-dropdown-trigger:focus,
.app-dropdown.open .app-dropdown-trigger {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px var(--red-glow);
  outline: none;
}
.app-dropdown-trigger img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.app-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 4px;
  z-index: 30;
  box-shadow: var(--shadow-lg);
}
.app-dropdown.open .app-dropdown-menu { display: block; }
.app-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.app-dropdown-item:hover { background: rgba(255,255,255,0.06); }
.app-dropdown-item.selected { background: rgba(230,57,70,0.08); }
.app-dropdown-logo {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Poker Name Pill in table */
.poker-name-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.poker-name-pill.neutral {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.poker-name-pill.branded {
  border: 1px solid transparent;
}
.poker-name-pill img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Icon Picker for Tier/Platform */
.icon-text-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.icon-text-row .form-input { flex: 1; min-width: 0; }
.icon-pick-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  position: relative;
}
.icon-pick-btn:hover { border-color: var(--border-light); }
.icon-pick-btn.active { border-color: var(--red-primary); color: var(--text-primary); }
.icon-pick-btn svg { width: 20px; height: 20px; }

.icon-picker-grid {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  z-index: 20;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
}
.icon-picker-grid.show { display: grid; }
.icon-picker-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.1s;
  border: none;
  background: transparent;
  font-family: inherit;
}
.icon-picker-item:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.icon-picker-item.selected { background: rgba(230,57,70,0.12); color: var(--red-primary); }
.icon-picker-item svg { width: 16px; height: 16px; }

/* Bonus pill styles */
.bonus-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.15s;
}
.bonus-pill:hover {
  background: rgba(255,255,255,0.06);
}
.bonus-pill-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bonus-pill-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bonus-pill-name { font-weight: 500; }
.bonus-pill-pct {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--green);
  font-size: 13px;
}
.bonus-pill-date {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}
.bonus-pill-check {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,197,94,0.15);
  border-radius: 50%;
  color: var(--green);
  flex-shrink: 0;
}
.bonus-pill-check svg { width: 12px; height: 12px; }
.bonus-pill-remove {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.bonus-pill-remove:hover { background: rgba(230,57,70,0.15); color: var(--red-primary); }

/* Bonus View button in clients table */
.bonus-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.bonus-view-btn:hover {
  background: rgba(230,57,70,0.08);
  border-color: rgba(230,57,70,0.3);
  color: var(--text-primary);
}
.bonus-view-btn svg {
  width: 13px;
  height: 13px;
  opacity: 0.6;
}
.bonuses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.bonus-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bonus-add-row .form-input { flex: 1; min-width: 0; }
.bonus-add-row .form-input.bonus-pct-input { width: 70px; flex: 0; text-align: center; }
.bonuses-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  background: rgba(230,57,70,0.12);
  color: var(--red-primary);
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.client-fh-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.client-fh-row:last-child { border-bottom: none; padding-bottom: 0; }
.client-fh-row .client-fh-pills { width: 100%; }
.client-fh-row .form-input { flex: 1; min-width: 0; }
.client-fh-row .form-select { width: 120px; flex-shrink: 0; }
.client-fh-remove {
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--text-muted); font-size: 18px;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.client-fh-remove:hover { background: rgba(230,57,70,0.1); color: var(--red-primary); }

.client-add-fh {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-family: inherit;
}
.client-add-fh:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: rgba(230,57,70,0.04);
}

.client-fh-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

.client-fh-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.client-fh-pill:hover {
  border-color: var(--border-light);
  color: var(--text-secondary);
}
.client-fh-pill.selected {
  border-color: transparent;
}
.client-fh-pill svg { width: 12px; height: 12px; }

.client-fh-pill.selected.fh-cashapp { background: rgba(0,212,72,0.12); color: #00d448; border-color: rgba(0,212,72,0.25); }
.client-fh-pill.selected.fh-venmo { background: rgba(0,141,237,0.12); color: #008ded; border-color: rgba(0,141,237,0.25); }
.client-fh-pill.selected.fh-zelle { background: rgba(108,29,186,0.12); color: #8a5cf5; border-color: rgba(108,29,186,0.25); }
.client-fh-pill.selected.fh-crypto { background: rgba(247,147,26,0.12); color: #f7931a; border-color: rgba(247,147,26,0.25); }
.client-fh-pill.selected.fh-paypal { background: rgba(0,112,186,0.12); color: #0070ba; border-color: rgba(0,112,186,0.25); }
.client-fh-pill.selected.fh-other { background: rgba(255,255,255,0.08); color: var(--text-secondary); border-color: var(--border-light); }

/* Roles Manager */
.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg-elevated);
}

.role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.role-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.role-card-actions {
  display: flex;
  gap: 4px;
}

.role-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

.role-perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.role-perm-item:hover {
  background: rgba(255,255,255,0.03);
}

.role-perm-item input[type="checkbox"] {
  accent-color: var(--red-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.role-color-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.role-color-pick .color-preview {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.15s;
  cursor: pointer;
}

.role-color-pick .color-preview:hover {
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.1);
}

.role-color-pick .color-change-label {
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.role-color-pick:hover .color-change-label {
  color: var(--text-secondary);
}

.color-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transform: scale(0.9) translateY(-4px);
  pointer-events: none;
  transition: all 0.15s ease;
}

.color-popover.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.color-popover-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
}

.color-popover-swatch:hover {
  transform: scale(1.2);
  border-color: rgba(255,255,255,0.3);
}

.color-popover-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

/* Edit Role – Color & Icon grids */
.edit-role-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.edit-role-color-grid .color-popover-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
}

.edit-role-color-grid .color-popover-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.3);
}

.edit-role-color-grid .color-popover-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

.edit-role-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.icon-picker-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.icon-picker-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.icon-picker-btn.active {
  border-color: var(--red-primary);
  color: var(--red-primary);
  background: var(--red-subtle);
  box-shadow: 0 0 0 1px var(--red-primary);
}

.create-role-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg-elevated);
}

.create-role-form .form-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.create-role-form .form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  margin-bottom: 12px;
}

.create-role-form .form-input:focus {
  outline: none;
  border-color: var(--red-primary);
}

.create-role-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* ═══════════════════════════════════════════
   AUTH SCREENS
   ═══════════════════════════════════════════ */
.auth-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-darkest);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-screen.hidden { display: none; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.35s ease;
}

.auth-header {
  text-align: center;
  padding: 36px 32px 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-brand .brand-icon {
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-brand .brand-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-brand .brand-text span {
  color: var(--red-primary);
}

.auth-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

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

.auth-body {
  padding: 28px 32px;
}

.auth-body .form-group { margin-bottom: 16px; }

.auth-error {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--red-primary);
  margin-bottom: 16px;
  display: none;
}

.auth-error.show { display: block; }

.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--red-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.auth-submit:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230,57,70,0.35);
}

.auth-footer {
  text-align: center;
  padding: 0 32px 28px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--red-primary);
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════
   ADMIN MISSION CONTROL
   ═══════════════════════════════════════════ */

/* Push admin nav to bottom of sidebar */
.nav-link[data-page="admin"] {
  margin-top: auto;
}
.nav-link[data-page="admin"].active {
  background: rgba(52, 152, 219, 0.15);
  color: var(--blue);
}
.nav-link[data-page="admin"]:hover {
  background: rgba(52, 152, 219, 0.08);
}

/* Breadcrumb */
.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
}
.admin-bc-link {
  color: var(--blue);
  cursor: pointer;
  transition: opacity var(--transition);
}
.admin-bc-link:hover { opacity: 0.7; }
.admin-bc-sep {
  color: var(--text-muted);
  font-size: 11px;
}
.admin-bc-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Section bars */
.admin-section-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.admin-section-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* User detail header */
.admin-user-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.admin-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Loading / empty states */
.admin-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.admin-empty {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Section spacing */
.admin-section { margin-bottom: 8px; }

/* Clickable rows */
.admin-row-click { cursor: pointer; }
.admin-row-click:hover { background: var(--bg-elevated); }

/* Role badges */
.admin-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

/* Color dot for roles */
.admin-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Ticket status badges */
.admin-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.admin-status-open { background: var(--blue); }
.admin-status-claimed { background: var(--yellow); color: #000; }
.admin-status-waiting_match { background: var(--purple); }
.admin-status-match_found { background: var(--green); }
.admin-status-closed { background: var(--text-muted); }

/* Activity list */
.admin-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-activity-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.admin-activity-text { color: var(--text-secondary); flex: 1; }
.admin-activity-time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

/* ═══════════════════════════════════════════
   LANDING PAGE STYLES
   ═══════════════════════════════════════════ */
/* grain overlay */
#landingPage::after{
  content:'';position:fixed;inset:0;z-index:9999;pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat:repeat;background-size:256px 256px;opacity:0.4;
}
#landingPage{font-family:'Outfit',-apple-system,sans-serif;background:#050507;color:#f0f0f5;line-height:1.6}
#landingPage *{box-sizing:border-box}
.lp-ctr{max-width:1180px;margin:0 auto;padding:0 24px}
.lp-sec{padding:130px 0;position:relative}

/* Scroll reveal */
#landingPage .rv{opacity:0;transform:translateY(44px);transition:opacity .75s cubic-bezier(.16,1,.3,1),transform .75s cubic-bezier(.16,1,.3,1)}
#landingPage .rv.vis{opacity:1;transform:translateY(0)}
.d1{transition-delay:.1s}.d2{transition-delay:.2s}.d3{transition-delay:.3s}.d4{transition-delay:.4s}

/* Utility */
.lp-tag{display:inline-flex;align-items:center;gap:8px;padding:7px 18px;background:rgba(230,57,70,.07);border:1px solid rgba(230,57,70,.14);border-radius:100px;font-size:11px;font-weight:700;color:#e63946;letter-spacing:.1em;text-transform:uppercase;margin-bottom:26px}
.lp-h{font-size:clamp(34px,5vw,54px);font-weight:800;line-height:1.08;letter-spacing:-.035em;margin-bottom:20px}
.lp-p{font-size:17px;color:#8e8ea8;max-width:560px;line-height:1.72}
.lp-tg{background:linear-gradient(135deg,#fff 10%,#e63946 100%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.lp-tr{color:#e63946}

/* Glow orbs */
.lp-go{position:absolute;border-radius:50%;filter:blur(100px);pointer-events:none;z-index:0}
.lp-go-r{background:radial-gradient(circle,rgba(230,57,70,.35)0%,transparent 70%)}
.lp-go-b{background:radial-gradient(circle,rgba(69,123,157,.12)0%,transparent 70%)}

/* NAV */
.lp-nav{position:fixed;top:0;left:0;right:0;z-index:1000;padding:18px 0;transition:all .35s}
.lp-nav.scrolled{background:rgba(5,5,7,.82);backdrop-filter:blur(24px) saturate(180%);-webkit-backdrop-filter:blur(24px) saturate(180%);border-bottom:1px solid rgba(255,255,255,.05);padding:11px 0}
.lp-nav-in{display:flex;align-items:center;justify-content:space-between}
.lp-nav-b{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:800;text-decoration:none;color:#f0f0f5}
.lp-nav-bi{width:36px;height:36px;background:transparent;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.lp-nav-b span span{color:#e63946}
.lp-nav-ls{display:flex;align-items:center;gap:34px}
.lp-nav-l{font-size:14px;font-weight:500;color:#8e8ea8;transition:color .2s;position:relative;text-decoration:none}
.lp-nav-l:hover{color:#f0f0f5}
.lp-nav-l::after{content:'';position:absolute;bottom:-4px;left:0;width:0;height:2px;background:#e63946;border-radius:1px;transition:width .25s}
.lp-nav-l:hover::after{width:100%}
.lp-nav-acts{display:flex;align-items:center;gap:12px}

.lp-btn-g{padding:9px 20px;background:0 0;color:#8e8ea8;font-size:14px;font-weight:500;border-radius:9px;transition:all .2s;font-family:inherit;border:none;cursor:pointer}
.lp-btn-g:hover{color:#f0f0f5;background:rgba(255,255,255,.04)}
.lp-btn-p{padding:10px 24px;background:#e63946;color:#fff;font-size:14px;font-weight:600;border-radius:10px;transition:all .25s;box-shadow:0 0 24px rgba(230,57,70,.22);font-family:inherit;border:none;cursor:pointer}
.lp-btn-p:hover{background:#ff4757;box-shadow:0 0 36px rgba(230,57,70,.4);transform:translateY(-1px)}
.lp-btn-s{padding:10px 24px;background:rgba(255,255,255,.05);color:#f0f0f5;font-size:14px;font-weight:600;border-radius:10px;border:1px solid rgba(255,255,255,.09);transition:all .25s;font-family:inherit;cursor:pointer}
.lp-btn-s:hover{background:rgba(255,255,255,.09);border-color:rgba(255,255,255,.18)}

/* Profile Dropdown */
.lp-prof-wrap{position:relative}
.lp-prof-trig{display:flex;align-items:center;gap:10px;padding:5px 14px 5px 5px;background:rgba(255,255,255,.04);border-radius:100px;border:1px solid rgba(255,255,255,.05);cursor:pointer;transition:all .2s}
.lp-prof-trig:hover{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.09)}
.lp-prof-av{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#e63946,#ff6b81);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff}
.lp-prof-name{font-size:13px;font-weight:500;color:#f0f0f5}
.lp-prof-dd{position:absolute;top:calc(100% + 8px);right:0;min-width:200px;background:#10111a;border:1px solid rgba(255,255,255,.09);border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.55);opacity:0;transform:translateY(-8px) scale(.96);pointer-events:none;transition:all .2s;overflow:hidden;z-index:100}
.lp-prof-dd.show{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}
.lp-prof-di{display:flex;align-items:center;gap:10px;padding:11px 16px;font-size:13px;font-weight:500;color:#8e8ea8;transition:all .15s;cursor:pointer}
.lp-prof-di:hover{background:rgba(255,255,255,.04);color:#f0f0f5}
.lp-prof-di svg{width:16px;height:16px;opacity:.5}
.lp-prof-dv{height:1px;background:rgba(255,255,255,.05);margin:4px 0}
.lp-prof-di.dng{color:#e63946}.lp-prof-di.dng:hover{background:rgba(230,57,70,.07)}

.lp-burger{display:none;width:36px;height:36px;background:0 0;color:#f0f0f5;align-items:center;justify-content:center;border-radius:8px;border:none;cursor:pointer}
.lp-burger svg{width:22px;height:22px}

/* HERO */
.lp-hero{position:relative;padding:170px 0 80px;overflow:hidden;min-height:100vh;display:flex;align-items:center}
.lp-hero-bg{position:absolute;inset:0;overflow:hidden}
.lp-hero-bg .lp-go.g1{width:800px;height:800px;top:-25%;left:50%;transform:translateX(-50%)}
.lp-hero-bg .lp-go.g2{width:400px;height:400px;bottom:5%;left:-8%}
.lp-hero-bg .lp-go.g3{width:360px;height:360px;top:35%;right:-4%}
.lp-hero-grid{position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.018)1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.018)1px,transparent 1px);background-size:64px 64px;mask-image:radial-gradient(ellipse 55% 50% at 50% 35%,black,transparent);-webkit-mask-image:radial-gradient(ellipse 55% 50% at 50% 35%,black,transparent)}
.lp-hero-c{position:relative;z-index:2;text-align:center;max-width:820px;margin:0 auto}
.lp-hero-badge{display:inline-flex;align-items:center;gap:8px;padding:6px 20px 6px 10px;background:rgba(230,57,70,.05);border:1px solid rgba(230,57,70,.1);border-radius:100px;font-size:13px;font-weight:500;color:#8e8ea8;margin-bottom:36px;animation:lp-fsu .8s ease both}
.lp-hero-dot{width:8px;height:8px;border-radius:50%;background:#e63946;box-shadow:0 0 12px rgba(230,57,70,.35);animation:lp-pdot 2s infinite}
@keyframes lp-pdot{0%,100%{box-shadow:0 0 12px rgba(230,57,70,.35)}50%{box-shadow:0 0 24px rgba(230,57,70,.35),0 0 48px rgba(230,57,70,.18)}}
.lp-hero h1{font-size:clamp(42px,7.5vw,82px);font-weight:900;line-height:1.04;letter-spacing:-.045em;margin-bottom:26px;animation:lp-fsu .8s ease .1s both}
.lp-hero-sub{font-size:clamp(16px,2vw,19px);color:#8e8ea8;line-height:1.72;max-width:580px;margin:0 auto 44px;animation:lp-fsu .8s ease .2s both}
.lp-hero-ctas{display:flex;align-items:center;justify-content:center;gap:14px;margin-bottom:90px;animation:lp-fsu .8s ease .3s both}
.lp-hero-ctas .lp-btn-p{padding:15px 36px;font-size:15px;border-radius:13px}
.lp-hero-ctas .lp-btn-s{padding:15px 36px;font-size:15px;border-radius:13px}
@keyframes lp-fsu{from{opacity:0;transform:translateY(32px)}to{opacity:1;transform:translateY(0)}}

/* Laptop Mockup — Real MacBook image */
.lp-hero-mock{position:relative;z-index:2;max-width:980px;margin:0 auto;animation:lp-fsu 1s ease .4s both}
.lp-lp-frame{position:relative;width:100%}
.lp-lp-frame img{display:block;width:100%;height:auto;position:relative;z-index:2;pointer-events:none}
/* Dashboard screenshot positioned over the MacBook screen area */
.lp-lp-scr-in{position:absolute;z-index:1;top:5.705%;left:10.899%;width:78.383%;height:84.231%;overflow:hidden;background:#0a0a0a}
.lp-lp-scr-in img{width:100%;height:100%;display:block}
/* Shadow under laptop */
.lp-lp-shadow{height:40px;background:radial-gradient(ellipse 80% 100% at 50% 0%,rgba(0,0,0,.55)0%,transparent 100%);margin-top:-4px}
/* Glow removed — clean MacBook image frame */

/* Stats */
.lp-stats{padding:65px 0;border-top:1px solid rgba(255,255,255,.05);border-bottom:1px solid rgba(255,255,255,.05);background:rgba(10,11,14,.5)}
.lp-stats-g{display:grid;grid-template-columns:repeat(4,1fr);gap:40px;text-align:center}
.lp-stat-n{font-size:44px;font-weight:800;letter-spacing:-.03em;font-family:'JetBrains Mono',monospace}
.lp-stat-n .lp-tr{-webkit-text-fill-color:#e63946}
.lp-stat-l{font-size:14px;color:#52526e;margin-top:4px}

/* Feature cards */
.lp-feat-g{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:64px}
.lp-feat-c{position:relative;background:#10111a;border:1px solid rgba(255,255,255,.05);border-radius:22px;padding:36px 30px;transition:all .38s;overflow:hidden}
.lp-feat-c::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent,rgba(230,57,70,0)20%,rgba(230,57,70,.45)50%,rgba(230,57,70,0)80%,transparent);opacity:0;transition:opacity .38s}
.lp-feat-c::after{content:'';position:absolute;top:0;left:50%;width:180px;height:80px;transform:translateX(-50%);background:radial-gradient(ellipse,rgba(230,57,70,.08),transparent 70%);opacity:0;transition:opacity .38s;pointer-events:none}
.lp-feat-c:hover{background:#161722;border-color:rgba(255,255,255,.07);transform:translateY(-5px);box-shadow:0 24px 70px rgba(0,0,0,.35),0 0 50px rgba(230,57,70,.04)}
.lp-feat-c:hover::before,.lp-feat-c:hover::after{opacity:1}
.lp-feat-i{width:50px;height:50px;border-radius:15px;background:linear-gradient(135deg,rgba(230,57,70,.1),rgba(230,57,70,.02));border:1px solid rgba(230,57,70,.1);display:flex;align-items:center;justify-content:center;margin-bottom:22px;color:#e63946}
.lp-feat-i svg{width:22px;height:22px}
.lp-feat-c h3{font-size:17px;font-weight:700;margin-bottom:10px;color:#f0f0f5}
.lp-feat-c p{font-size:14px;color:#52526e;line-height:1.68}

/* Detail sections */
.lp-det{display:grid;grid-template-columns:1fr 1fr;gap:80px;align-items:center;padding:90px 0}
.lp-det.rev{direction:rtl}.lp-det.rev>*{direction:ltr}
.lp-det-txt h2{font-size:clamp(26px,3.5vw,40px);font-weight:800;line-height:1.14;letter-spacing:-.02em;margin-bottom:18px}
.lp-det-txt p{font-size:15px;color:#8e8ea8;line-height:1.78;margin-bottom:24px}
.lp-det-pts{display:flex;flex-direction:column;gap:13px}
.lp-det-pt{display:flex;align-items:center;gap:12px;font-size:14px;color:#8e8ea8}
.lp-det-pt-d{width:6px;height:6px;border-radius:50%;background:#e63946;flex-shrink:0;box-shadow:0 0 8px rgba(230,57,70,.5)}
.lp-det-vis{position:relative;border-radius:22px;overflow:hidden;background:#10111a;border:1px solid rgba(255,255,255,.05);aspect-ratio:4/3;display:flex;align-items:center;justify-content:center}
.lp-det-vis::before{content:'';position:absolute;inset:0;border-radius:22px;padding:1px;background:linear-gradient(135deg,rgba(230,57,70,.2),transparent 40%,transparent 60%,rgba(69,123,157,.15));-webkit-mask:linear-gradient(#fff 0 0)content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}
.lp-det-vis-glow{position:absolute;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,rgba(230,57,70,.12),transparent 70%);filter:blur(40px)}
.lp-det-vis-c{position:relative;z-index:1;text-align:center;padding:32px}
.lp-det-vis-ic{width:64px;height:64px;border-radius:20px;background:linear-gradient(135deg,rgba(230,57,70,.12),rgba(230,57,70,.03));border:1px solid rgba(230,57,70,.12);display:flex;align-items:center;justify-content:center;margin:0 auto 16px;color:#e63946}
.lp-det-vis-ic svg{width:28px;height:28px}
.lp-det-vis-l{font-size:18px;font-weight:700;color:#f0f0f5}
.lp-det-vis-s{font-size:13px;color:#52526e;margin-top:6px}
.lp-mini-cards{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.lp-mini-c{position:absolute;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.05);border-radius:10px;padding:10px 14px;font-size:10px;color:#52526e;font-family:'JetBrains Mono',monospace;animation:lp-mcf 8s ease-in-out infinite}
.lp-mini-c:nth-child(1){top:12%;left:8%;animation-delay:0s}.lp-mini-c:nth-child(2){top:18%;right:10%;animation-delay:2s}.lp-mini-c:nth-child(3){bottom:16%;left:12%;animation-delay:4s}.lp-mini-c:nth-child(4){bottom:22%;right:8%;animation-delay:1s}
@keyframes lp-mcf{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}

/* Pricing */
.lp-pr-g{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:64px;align-items:stretch}
.lp-pr-c{position:relative;background:#10111a;border:1px solid rgba(255,255,255,.05);border-radius:30px;padding:42px 32px;transition:all .38s;display:flex;flex-direction:column}
.lp-pr-c:hover{transform:translateY(-5px);box-shadow:0 24px 60px rgba(0,0,0,.35)}
.lp-pr-c.pop{border-color:rgba(230,57,70,.25);background:linear-gradient(180deg,rgba(230,57,70,.04)0%,#10111a 50%);box-shadow:0 0 80px rgba(230,57,70,.06)}
.lp-pr-c.pop:hover{box-shadow:0 0 100px rgba(230,57,70,.1),0 24px 60px rgba(0,0,0,.35)}
.lp-pr-badge{position:absolute;top:-13px;left:50%;transform:translateX(-50%);padding:5px 20px;background:#e63946;border-radius:100px;font-size:11px;font-weight:700;color:#fff;text-transform:uppercase;letter-spacing:.06em;box-shadow:0 6px 24px rgba(230,57,70,.4)}
.lp-pr-name{font-size:18px;font-weight:700;margin-bottom:6px;color:#f0f0f5}
.lp-pr-desc{font-size:13px;color:#52526e;margin-bottom:26px}
.lp-pr-amt{display:flex;align-items:baseline;gap:4px;margin-bottom:6px}
.lp-pr-cur{font-size:22px;font-weight:700;color:#8e8ea8}
.lp-pr-val{font-size:54px;font-weight:900;letter-spacing:-.04em;line-height:1;color:#f0f0f5}
.lp-pr-per{font-size:14px;color:#52526e;margin-bottom:32px}
.lp-pr-fs{flex:1;display:flex;flex-direction:column;gap:14px;margin-bottom:32px}
.lp-pr-f{display:flex;align-items:center;gap:10px;font-size:14px;color:#8e8ea8}
.lp-pr-chk{width:18px;height:18px;border-radius:50%;background:rgba(46,204,113,.08);color:#2ecc71;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.lp-pr-chk svg{width:11px;height:11px}
.lp-pr-c .lp-btn-p,.lp-pr-c .lp-btn-s{width:100%;text-align:center;padding:14px;font-size:15px}

/* Testimonials */
.lp-test-g{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:64px}
.lp-test-c{background:#10111a;border:1px solid rgba(255,255,255,.05);border-radius:22px;padding:30px;transition:all .3s}
.lp-test-c:hover{border-color:rgba(255,255,255,.07);background:#161722}
.lp-test-stars{display:flex;gap:2px;margin-bottom:16px;color:#e9c46a;font-size:14px}
.lp-test-txt{font-size:14px;color:#8e8ea8;line-height:1.72;margin-bottom:22px;font-style:italic}
.lp-test-au{display:flex;align-items:center;gap:12px}
.lp-test-av{width:40px;height:40px;border-radius:50%;background:linear-gradient(135deg,#1a1a28,#2a2a3a);display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:700;color:#52526e}
.lp-test-name{font-size:14px;font-weight:600;color:#f0f0f5}
.lp-test-role{font-size:12px;color:#52526e}

/* FAQ */
.lp-faq-list{max-width:720px;margin:64px auto 0}
.lp-faq-i{border-bottom:1px solid rgba(255,255,255,.05)}
.lp-faq-q{display:flex;align-items:center;justify-content:space-between;padding:24px 0;font-size:16px;font-weight:600;color:#f0f0f5;cursor:pointer;background:0 0;width:100%;text-align:left;transition:color .2s;border:none;font-family:inherit}
.lp-faq-q:hover{color:#e63946}
.lp-faq-ch{width:20px;height:20px;color:#52526e;transition:transform .3s;flex-shrink:0}
.lp-faq-i.open .lp-faq-ch{transform:rotate(180deg)}
.lp-faq-a{max-height:0;overflow:hidden;transition:max-height .35s ease}
.lp-faq-i.open .lp-faq-a{max-height:300px}
.lp-faq-a-in{padding:0 0 24px;font-size:14px;color:#8e8ea8;line-height:1.72}

/* Final CTA */
.lp-fcta{position:relative;text-align:center;padding:110px 0;overflow:hidden}
.lp-fcta-bg{position:absolute;inset:0;background:radial-gradient(ellipse 55% 75% at 50% 50%,rgba(230,57,70,.05)0%,transparent 70%)}
.lp-fcta h2{font-size:clamp(32px,5vw,54px);font-weight:900;letter-spacing:-.03em;margin-bottom:20px;color:#f0f0f5}
.lp-fcta p{font-size:17px;color:#8e8ea8;max-width:500px;margin:0 auto 40px;line-height:1.72}
.lp-fcta-btns{display:flex;align-items:center;justify-content:center;gap:14px}

/* Footer */
.lp-foot{border-top:1px solid rgba(255,255,255,.05);padding:64px 0 40px}
.lp-foot-g{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:60px;margin-bottom:50px}
.lp-foot-b{display:flex;align-items:center;gap:10px;font-size:18px;font-weight:700;margin-bottom:14px;color:#f0f0f5}
.lp-foot-b span span{color:#e63946}
.lp-foot-desc{font-size:13px;color:#52526e;line-height:1.72;max-width:280px}
.lp-foot-ct{font-size:12px;font-weight:700;color:#f0f0f5;text-transform:uppercase;letter-spacing:.07em;margin-bottom:16px}
.lp-foot-ls{display:flex;flex-direction:column;gap:10px}
.lp-foot-l{font-size:13px;color:#52526e;transition:color .2s;text-decoration:none}
.lp-foot-l:hover{color:#f0f0f5}
.lp-foot-bot{border-top:1px solid rgba(255,255,255,.05);padding-top:24px;display:flex;align-items:center;justify-content:space-between}
.lp-foot-copy{font-size:12px;color:#52526e}
.lp-foot-soc{display:flex;gap:10px}
.lp-foot-si{width:34px;height:34px;border-radius:9px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.05);display:flex;align-items:center;justify-content:center;color:#52526e;transition:all .2s;text-decoration:none}
.lp-foot-si:hover{background:rgba(255,255,255,.07);color:#f0f0f5}
.lp-foot-si svg{width:14px;height:14px}

/* Landing Responsive */
@media(max-width:960px){
  .lp-feat-g,.lp-pr-g,.lp-test-g{grid-template-columns:1fr 1fr}
  .lp-det{grid-template-columns:1fr;gap:40px}.lp-det.rev{direction:ltr}
  .lp-foot-g{grid-template-columns:1fr 1fr;gap:40px}
  .lp-stats-g{grid-template-columns:repeat(2,1fr);gap:30px}
}
@media(max-width:768px){
  .lp-nav-ls{display:none}.lp-burger{display:flex}
  .lp-hero{padding:130px 0 60px}.lp-hero h1{font-size:38px}
  .lp-hero-ctas,.lp-fcta-btns{flex-direction:column;width:100%}.lp-hero-ctas>*,.lp-fcta-btns>*{width:100%;text-align:center}
  .lp-sec{padding:80px 0}
  .lp-feat-g,.lp-pr-g,.lp-test-g{grid-template-columns:1fr}
  .lp-foot-g{grid-template-columns:1fr;gap:32px}
  .lp-foot-bot{flex-direction:column;gap:16px;text-align:center}
}
@media(max-width:480px){.lp-stats-g{grid-template-columns:1fr}}
