/* ============================================
   ZX JOURNAL — COMPONENTS
   ============================================ */

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(100px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.12) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}

.btn:hover::after {
  opacity: 1;
}

.btn-ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  animation: ripple 600ms ease-out forwards;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--emerald-dim) 0%, var(--emerald) 50%, var(--teal) 100%);
  color: var(--text-on-accent);
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(var(--emerald-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(var(--emerald-rgb), 0.5), 0 0 40px rgba(var(--emerald-rgb), 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary (glass) */
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-glow);
  box-shadow: var(--glow-emerald);
}

/* Danger */
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--loss);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--surface-1);
  border-color: var(--border-dim);
  color: var(--text-primary);
}

/* Icon button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Sizes */
.btn-sm {
  padding: 5px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}

.btn-xl {
  padding: 16px 36px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

/* =====================
   INPUTS & FORMS
   ===================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-label .required {
  color: var(--loss);
}

.form-label .optional {
  color: var(--text-faint);
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

.form-control {
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all var(--t-base);
  outline: none;
  width: 100%;
  backdrop-filter: blur(8px);
}

.form-control::placeholder {
  color: var(--text-faint);
}

.form-control:focus {
  border-color: var(--emerald);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(var(--emerald-rgb), 0.12), var(--glow-emerald);
}

.form-control:hover:not(:focus) {
  border-color: var(--border-soft);
  background: var(--surface-2);
}

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

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper .form-control {
  padding-left: 38px;
}

.input-wrapper .input-icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* =====================
   CUSTOM SELECT / DROPDOWN
   ===================== */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
  transition: transform var(--t-base);
}

.select-wrapper.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.custom-select {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--t-base);
  user-select: none;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.select-trigger:hover {
  border-color: var(--border-soft);
  background: var(--surface-3);
}

.select-trigger.open {
  border-color: var(--emerald);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(var(--emerald-rgb), 0.12);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.select-trigger-placeholder {
  color: var(--text-faint);
}

.select-chevron {
  color: var(--text-muted);
  transition: transform var(--t-base);
  flex-shrink: 0;
}

.select-trigger.open .select-chevron {
  transform: rotate(180deg);
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-2);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  animation: fadeIn 150ms ease both;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.select-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-dim);
  position: sticky;
  top: 0;
  background: var(--surface-2);
  z-index: 1;
}

.select-search input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 32px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.select-search input:focus {
  border-color: var(--emerald);
}

.select-group-label {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all var(--t-fast);
  color: var(--text-secondary);
}

.select-option:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.select-option.selected {
  color: var(--emerald);
  background: rgba(var(--emerald-rgb), 0.08);
}

/* =====================
   TOGGLE SWITCH
   ===================== */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  transition: all var(--t-base);
}

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

.toggle input:checked+.toggle-slider {
  background: rgba(var(--emerald-rgb), 0.2);
  border-color: var(--emerald);
  box-shadow: 0 0 12px rgba(var(--emerald-rgb), 0.3);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(18px);
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(var(--emerald-rgb), 0.6);
}

/* =====================
   TAGS INPUT
   ===================== */
.tags-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  cursor: text;
  min-height: 42px;
  transition: all var(--t-base);
}

.tags-input-wrapper:focus-within {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(var(--emerald-rgb), 0.12);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--emerald-rgb), 0.12);
  color: var(--emerald);
  border: 1px solid rgba(var(--emerald-rgb), 0.25);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}

.tag-chip-remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--t-fast);
  display: flex;
  align-items: center;
}

.tag-chip-remove:hover {
  opacity: 1;
}

.tags-input {
  flex: 1;
  min-width: 80px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
}

/* =====================
   DATE PICKER
   ===================== */
.date-picker-wrapper {
  position: relative;
}

.date-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--t-base);
  font-size: 0.9rem;
}

.date-display:hover {
  border-color: var(--border-soft);
}

.date-display.open {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(var(--emerald-rgb), 0.12);
}

.date-display .calendar-icon {
  color: var(--emerald);
}

.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  background: var(--surface-2);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  width: 280px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), var(--glow-emerald);
  animation: scalePop 200ms ease both;
  transform-origin: top left;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.cal-month-year {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-nav-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.cal-nav-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

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

.cal-day-header {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  color: var(--text-secondary);
}

.cal-day:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.cal-day.today {
  color: var(--emerald);
  font-weight: 600;
  border: 1px solid rgba(var(--emerald-rgb), 0.3);
}

.cal-day.selected {
  background: var(--emerald);
  color: var(--text-on-accent);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(var(--emerald-rgb), 0.5);
}

.cal-day.other-month {
  opacity: 0.25;
}

/* =====================
   MACROS / TRAFFIC LIGHTS
   ===================== */
.mac-traffic-lights {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mac-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  border: none;
  outline: none;
  flex-shrink: 0;
}

.mac-btn::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.mac-btn:hover::after {
  opacity: 1;
}

.mac-btn-close {
  background: var(--mac-close);
  box-shadow: 0 0 6px rgba(255, 95, 87, 0.4);
}

.mac-btn-close::after {
  background: radial-gradient(circle, rgba(255, 95, 87, 0.3), transparent 70%);
}

.mac-btn-close:hover {
  box-shadow: 0 0 12px rgba(255, 95, 87, 0.7);
}

.mac-btn-minimize {
  background: var(--mac-minimize);
  box-shadow: 0 0 6px rgba(254, 188, 46, 0.4);
}

.mac-btn-minimize:hover {
  box-shadow: 0 0 12px rgba(254, 188, 46, 0.7);
}

.mac-btn-maximize {
  background: var(--mac-maximize);
  box-shadow: 0 0 6px rgba(40, 200, 64, 0.4);
}

.mac-btn-maximize:hover {
  box-shadow: 0 0 12px rgba(40, 200, 64, 0.7);
}

/* =====================
   MODAL / WINDOW
   ===================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdropEnter 200ms ease both;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-window {
  background: var(--surface-1);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--emerald-rgb), 0.08) inset, var(--glow-emerald);
  animation: modalEnter 300ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-window-lg {
  max-width: 900px;
}

.modal-window-xl {
  max-width: 1100px;
}

.modal-titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
  position: sticky;
  top: 0;
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  z-index: 2;
}

.modal-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: var(--z-sidebar);
  background: var(--surface-1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  transition: width var(--t-base);
  overflow: hidden;
  will-change: width;
  contain: layout;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-tagline,
.sidebar.collapsed .sidebar-item-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user div:last-child {
  display: none !important;
}

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

.star-item {
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.star-item:hover {
  transform: scale(1.2);
}

.star-item.active {
  color: var(--warn);
  /* yellow-400 */
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-tagline,
.sidebar.collapsed .sidebar-item-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-user-name,
.sidebar.collapsed .sidebar-user div:last-child {
  opacity: 0;
  visibility: hidden;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--emerald-dim), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-on-accent);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(var(--emerald-rgb), 0.4);
  letter-spacing: -0.05em;
}

.sidebar-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-text span {
  color: var(--emerald);
}

.sidebar-tagline {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 12px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--emerald);
  border-radius: 1px;
  opacity: 0;
  transition: opacity var(--t-base);
}

.sidebar-item:hover {
  background: var(--surface-1);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(var(--emerald-rgb), 0.1);
  color: var(--emerald);
  border: 1px solid rgba(var(--emerald-rgb), 0.15);
}

.sidebar-item.active::before {
  opacity: 1;
}

.sidebar-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-text {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
}

.sidebar-item-badge {
  background: rgba(var(--emerald-rgb), 0.15);
  color: var(--emerald);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-base);
}

.sidebar-user:hover {
  background: var(--surface-1);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-dim), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-on-accent);
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

/* =====================
   TOP BAR
   ===================== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  z-index: var(--z-topbar);
  background: var(--surface-1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-xl);
  transition: left var(--t-base);
}

.topbar.sidebar-collapsed {
  left: var(--sidebar-collapsed);
}

.topbar-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-spacer {
  flex: 1;
}

.spotlight-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 7px 16px;
  cursor: pointer;
  transition: all var(--t-base);
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 280px;
}

.spotlight-trigger:hover {
  border-color: var(--border-soft);
  color: var(--text-secondary);
  box-shadow: var(--glow-emerald);
}

.spotlight-trigger kbd {
  margin-left: auto;
  background: var(--surface-3);
  border: 1px solid var(--border-dim);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.75rem;
  font-family: inherit;
}

/* =====================
   SPOTLIGHT MODAL
   ===================== */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-spotlight);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  animation: backdropEnter 150ms ease both;
}

.spotlight-panel {
  width: 600px;
  background: var(--surface-2);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-2xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), var(--glow-emerald-strong);
  overflow: hidden;
  animation: modalEnter 200ms ease both;
}

.spotlight-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dim);
}

.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: inherit;
}

.spotlight-input::placeholder {
  color: var(--text-faint);
}

.spotlight-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.spotlight-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald);
  padding: 8px 12px 4px;
}

.spotlight-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
}

.spotlight-result:hover,
.spotlight-result.focused {
  background: var(--surface-active);
}

.spotlight-result-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald);
  flex-shrink: 0;
}

.spotlight-result-text {
  flex: 1;
}

.spotlight-result-title {
  font-size: 0.9rem;
  font-weight: 500;
}

.spotlight-result-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.spotlight-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--text-faint);
}

.spotlight-footer kbd {
  background: var(--surface-3);
  border: 1px solid var(--border-dim);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
  font-family: inherit;
}

/* =====================
   TRADE CARDS (Grid)
   ===================== */
.trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.trade-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-base);
  background: var(--surface-1);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-dim);
}

.trade-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-soft);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), var(--glow-emerald);
}

.trade-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.trade-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}

.trade-card:hover .trade-card-image img {
  transform: scale(1.05);
}

.trade-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  color: var(--text-faint);
}

.trade-card-footer {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trade-card-instrument {
  font-weight: 700;
  font-size: 0.95rem;
}

.trade-card-pnl {
  font-weight: 700;
  font-size: 0.95rem;
}

.trade-card-pnl.positive {
  color: var(--win);
}

.trade-card-pnl.negative {
  color: var(--loss);
}

.trade-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trade-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* =====================
   TRADE TABLE (List)
   ===================== */
.trades-table {
  width: 100%;
  border-collapse: collapse;
}

.trades-table th,
.trades-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-dim);
}

.trades-table th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

.trades-table th:hover {
  color: var(--emerald);
}

.trades-table tbody tr {
  transition: background var(--t-fast);
  cursor: pointer;
}

.trades-table tbody tr:hover {
  background: var(--surface-1);
}

.trades-table td {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.trades-table td.instrument {
  font-weight: 600;
  color: var(--text-primary);
}

/* =====================
   UPLOAD ZONE
   ===================== */
.upload-zone {
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
  background: var(--surface-1);
}

.upload-zone:hover {
  border-color: var(--emerald);
  background: rgba(var(--emerald-rgb), 0.04);
  box-shadow: var(--glow-emerald);
}

.upload-zone.dragover {
  border-color: var(--emerald);
  background: rgba(var(--emerald-rgb), 0.08);
  box-shadow: var(--glow-emerald-strong);
  transform: scale(1.01);
}

.upload-zone-icon {
  color: var(--emerald);
  margin-bottom: var(--space-sm);
  animation: float 3s ease-in-out infinite;
}

.upload-zone-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.upload-zone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.attachment-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-dim);
  cursor: pointer;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(239, 68, 68, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-fast);
  cursor: pointer;
}

.attachment-thumb:hover .attachment-thumb-remove {
  opacity: 1;
}

/* =====================
   CHECKLIST
   ===================== */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  transition: color var(--t-fast);
}

.checklist-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border-soft);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-base);
}

.checklist-item.checked .checklist-checkbox {
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 0 8px rgba(var(--emerald-rgb), 0.4);
}

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* =====================
   SECTION HEADERS
   ===================== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-dim);
}

.section-header-icon {
  color: var(--emerald);
  display: flex;
  align-items: center;
}

.section-header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* =====================
   TOAST NOTIFICATIONS
   ===================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 280px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), var(--glow-emerald);
  animation: toastIn 300ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
  pointer-events: all;
}

.toast.removing {
  animation: toastOut 250ms ease forwards;
}

.toast-icon {
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.toast-message {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toast-success {
  border-color: rgba(var(--emerald-rgb), 0.3);
}

.toast-success .toast-icon {
  color: var(--emerald);
}

.toast-error {
  border-color: rgba(248, 113, 113, 0.3);
}

.toast-error .toast-icon {
  color: var(--loss);
}

/* =====================
   VIEW TOGGLE
   ===================== */
.view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-muted);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: inherit;
}

.view-toggle-btn.active {
  background: rgba(var(--emerald-rgb), 0.12);
  color: var(--emerald);
}

.view-toggle-btn:hover:not(.active) {
  background: var(--surface-3);
  color: var(--text-secondary);
}

/* =====================
   PULSE ITEM
   ===================== */
.pulse-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-dim);
}

.pulse-time {
  font-size: 0.72rem;
  color: var(--emerald);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 64px;
}

.pulse-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex: 1;
}

/* =====================
   FILTER BAR
   ===================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
}

.filter-chip:hover {
  border-color: var(--border-soft);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(var(--emerald-rgb), 0.1);
  border-color: rgba(var(--emerald-rgb), 0.3);
  color: var(--emerald);
}

/* =====================
   EQUITY CHART WRAPPER
   ===================== */
.chart-wrapper {
  position: relative;
  padding: var(--space-lg);
}

/* =====================
   CALENDAR HEATMAP
   ===================== */
.cal-heatmap-grid {
  display: grid;
  grid-template-columns: 40px repeat(7, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--border-dim);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}

.heatmap-cell:hover {
  transform: scale(1.04);
  z-index: 1;
}

.heatmap-cell.win {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.25);
}

.heatmap-cell.loss {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
}

.heatmap-cell.today {
  border-color: var(--emerald);
  box-shadow: 0 0 8px rgba(var(--emerald-rgb), 0.3);
}

.heatmap-cell .cell-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.heatmap-cell .cell-pnl {
  font-size: 0.78rem;
  font-weight: 600;
}

.heatmap-cell .cell-pnl.pos {
  color: var(--win);
}

.heatmap-cell .cell-pnl.neg {
  color: var(--loss);
}

/* =====================
   CHECK-IN TAB & PANEL
   ===================== */
.checkin-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 400;
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-soft);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 20px 8px;
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform-origin: right center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  transition: all var(--t-base);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.checkin-tab:hover,
.checkin-tab.open {
  background: rgba(var(--emerald-rgb), 0.1);
  border-color: var(--border-glow);
  color: var(--emerald);
  box-shadow: -4px 0 20px rgba(var(--emerald-rgb), 0.2);
}

.checkin-panel {
  position: fixed;
  right: -320px;
  top: var(--topbar-height);
  bottom: 0;
  width: 300px;
  z-index: 399;
  background: var(--surface-1);
  backdrop-filter: blur(24px) saturate(200%);
  border-left: 1px solid var(--border-soft);
  transition: right var(--t-base);
  overflow-y: auto;
}

.checkin-panel.open {
  right: 0;
}

/* =====================
   DROPDOWN MENU
   ===================== */
.dropdown-menu {
  position: absolute;
  z-index: 500;
  background: var(--surface-2);
  backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 150ms ease both;
  min-width: 160px;
}

.dropdown-item {
  padding: 9px 14px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

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

.dropdown-item.active {
  background: rgba(var(--emerald-rgb), 0.1);
  color: var(--emerald);
  font-weight: 600;
}

/* =====================
   MODAL ALIAS
   ===================== */
.modal {
  background: var(--surface-1);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), var(--glow-emerald);
  animation: modalEnter 300ms cubic-bezier(0.34, 1.2, 0.64, 1) both;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
}

/* =====================
   EXTRA UTILITIES
   ===================== */
/* =====================
   EXTRA UTILITIES
   ===================== */
.justify-end {
  justify-content: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* =====================
   TAHOE SELECT (Custom Dropdown)
   ===================== */
.tahoe-select {
  position: relative;
  width: 100%;
}

.tahoe-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--t-base);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.tahoe-select-trigger:hover {
  border-color: var(--border-soft);
  background: var(--surface-3);
  box-shadow: var(--glow-emerald);
}

.tahoe-select-trigger.active {
  border-color: var(--emerald);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(var(--emerald-rgb), 0.12);
}

.tahoe-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: modalEnter 200ms ease both;
}

.tahoe-dropdown.open {
  display: flex;
}

.tahoe-search-wrapper {
  padding: 10px;
  border-bottom: 1px solid var(--border-dim);
  background: rgba(255, 255, 255, 0.02);
}

.tahoe-search-input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.tahoe-options {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
}

.tahoe-option {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.tahoe-option:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.tahoe-option.selected {
  background: rgba(var(--emerald-rgb), 0.1);
  color: var(--emerald);
  font-weight: 600;
}

/* =====================
   SEGMENTED CONTROL
   ===================== */
.segmented-control {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.segment-btn.active-win {
  background: rgba(74, 222, 128, 0.15);
  color: var(--win);
  font-weight: 700;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.segment-btn.active-loss {
  background: rgba(248, 113, 113, 0.15);
  color: var(--loss);
  font-weight: 700;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Animated background for onboarding */
@keyframes onboardCardReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes zxTaglineReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 0.6;
    transform: translateY(0);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* --- Pro Calendar Grid --- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.cal-header-cell {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0;
  letter-spacing: 0.05em;
}

.cal-day-cell {
  min-height: 80px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

.cal-day-cell:hover {
  border-color: var(--border-soft);
  z-index: 10;
}

.cal-day-cell.today {
  border: 1px solid var(--warn) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

.cal-day-pnl {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.01em;
}

.cal-day-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: auto;
}

.cal-summary-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border-radius: var(--radius-sm);
}

.cell-win {
  background: rgba(74, 222, 128, 0.12);
}

.cell-loss {
  background: rgba(248, 113, 113, 0.12);
}

.cell-empty {
  opacity: 0.3;
}

/* =====================
   TRADE CHART & MODAL REPLAY
   ===================== */

@media (max-width: 992px) {
  .modal-two-col {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }

  .modal-col-left {
    border-right: none !important;
    border-bottom: 1px solid var(--border-dim) !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .modal-col-right {
    min-height: 400px;
    flex: none !important;
  }
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(var(--emerald-rgb), 0.2);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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