@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  /* ═══════════════════════════════════════════════════════ */
  /* PRIMITIVE PALETTE — Apollo/Loom inspired warm sand base */
  /* ═══════════════════════════════════════════════════════ */

  /* Sand — warm neutrals (replaces cool gray) */
  --sand-0:  #ffffff;
  --sand-10: #f8f7f7;
  --sand-20: #ebebea;
  --sand-30: #d8d6d4;
  --sand-40: #b0adab;
  --sand-50: #77736e;
  --sand-60: #585450;
  --sand-70: #3f3c39;
  --sand-80: #2b2926;
  --sand-90: #000000;

  /* Ocean — primary action blue */
  --ocean-10: #ecf3fe;
  --ocean-20: #dae5fc;
  --ocean-30: #a8c3eb;
  --ocean-40: #6697c9;
  --ocean-50: #447aaf;
  --ocean-60: #2b5782;
  --ocean-70: #1d3d58;
  --ocean-80: #122536;

  /* Pebble — brand accent (warm tan) */
  --pebble-10: #f6f2ef;
  --pebble-20: #e8e2d8;
  --pebble-30: #cdbea8;
  --pebble-40: #a7906c;
  --pebble-50: #867250;
  --pebble-60: #66583d;
  --pebble-70: #493b2c;
  --pebble-80: #2f271c;

  /* Evergreen — positive/success */
  --evergreen-10: #ebf4eb;
  --evergreen-20: #d8e8da;
  --evergreen-30: #a5caa9;
  --evergreen-40: #62a265;
  --evergreen-50: #4b814f;
  --evergreen-60: #396039;
  --evergreen-70: #274427;

  /* Ember — caution/warning */
  --ember-10: #f9f1ed;
  --ember-20: #f3e2d3;
  --ember-30: #e4bc9b;
  --ember-40: #ce8345;
  --ember-50: #b16120;
  --ember-60: #884411;
  --ember-70: #602f0c;

  /* Rust — destructive/error */
  --rust-10: #fff1ee;
  --rust-20: #fedbd7;
  --rust-30: #fea99f;
  --rust-40: #e86f5f;
  --rust-50: #d14532;
  --rust-60: #9e3225;
  --rust-70: #6a2419;

  /* Iris — AI/special accent */
  --iris-10: #f5f1fd;
  --iris-20: #e4dcf9;
  --iris-30: #c3b8f4;
  --iris-40: #9d84dc;
  --iris-50: #7f63c5;
  --iris-60: #603fab;
  --iris-70: #3f2b73;

  /* Sakura — pink accent */
  --sakura-10: #fbf0fb;
  --sakura-20: #f6daf5;
  --sakura-50: #bc44b1;
  --sakura-70: #5f235b;

  /* ═══════════════════════════════════════════════════════ */
  /* SEMANTIC TOKENS — use these in components               */
  /* ═══════════════════════════════════════════════════════ */

  /* Backgrounds */
  --color-bg-primary:   var(--sand-0);   /* cards, modals */
  --color-bg-secondary: var(--sand-10);  /* page bg */
  --color-bg-tertiary:  var(--sand-20);  /* subtle bg */

  /* Text */
  --color-text-primary:    var(--sand-80);
  --color-text-secondary:  var(--sand-70);
  --color-text-tertiary:   var(--sand-60);
  --color-text-quaternary: var(--sand-50);
  --color-text-disabled:   var(--sand-40);
  --color-text-inverse:    var(--sand-0);
  --color-text-link:       var(--ocean-60);

  /* Borders */
  --color-border-light:   var(--sand-10);
  --color-border-default: var(--sand-20);
  --color-border-dark:    var(--sand-30);

  /* Icons */
  --color-icon-primary:   var(--sand-80);
  --color-icon-secondary: var(--sand-60);
  --color-icon-tertiary:  var(--sand-50);
  --color-icon-disabled:  var(--sand-40);

  /* Feedback */
  --color-positive-bg:   var(--evergreen-10);
  --color-positive:      var(--evergreen-50);
  --color-positive-text: var(--evergreen-70);
  --color-caution-bg:    var(--ember-10);
  --color-caution:       var(--ember-50);
  --color-caution-text:  var(--ember-70);
  --color-negative-bg:   var(--rust-10);
  --color-negative:      var(--rust-50);
  --color-negative-text: var(--rust-70);
  --color-info-bg:       var(--ocean-10);
  --color-info:          var(--ocean-50);
  --color-info-text:     var(--ocean-70);

  /* Brand */
  --color-brand:         var(--pebble-50);
  --color-action:        var(--ocean-50);
  --color-action-hover:  var(--ocean-60);

  /* ═══════════════════════════════════════════════════════ */
  /* SPACING (Loom-inspired) */
  /* ═══════════════════════════════════════════════════════ */
  --spacing-xxs: 2px;
  --spacing-xs:  4px;
  --spacing-sm:  8px;
  --spacing-md:  12px;
  --spacing-lg:  16px;
  --spacing-xl:  20px;
  --spacing-xxl: 24px;
  --spacing-xxxl: 32px;

  /* ═══════════════════════════════════════════════════════ */
  /* RADIUS */
  /* ═══════════════════════════════════════════════════════ */
  --radius-xxs:  2px;
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 100px;

  /* ═══════════════════════════════════════════════════════ */
  /* SHADOWS (layered, subtle) */
  /* ═══════════════════════════════════════════════════════ */
  --shadow-xs: 0 1px 2px rgba(46, 43, 41, 0.05);
  --shadow-sm: 0 1px 3px rgba(46, 43, 41, 0.08), 0 1px 2px rgba(46, 43, 41, 0.04);
  --shadow-md: 0 4px 8px rgba(46, 43, 41, 0.08), 0 2px 4px rgba(46, 43, 41, 0.04);
  --shadow-lg: 0 12px 24px rgba(46, 43, 41, 0.10), 0 4px 8px rgba(46, 43, 41, 0.06);
  --shadow-xl: 0 24px 48px rgba(46, 43, 41, 0.14), 0 8px 16px rgba(46, 43, 41, 0.08);

  /* ═══════════════════════════════════════════════════════ */
  /* LAYOUT */
  /* ═══════════════════════════════════════════════════════ */
  --sidebar-width: 224px;

  /* ═══════════════════════════════════════════════════════ */
  /* LEGACY ALIASES — maps old variable names to new system */
  /* Allows existing CSS to keep working without being rewritten */
  /* ═══════════════════════════════════════════════════════ */
  --blue:       var(--ocean-50);
  --blue-dark:  var(--ocean-60);
  --blue-light: var(--ocean-10);
  --green:      var(--evergreen-50);
  --orange:     var(--ember-50);
  --red:        var(--rust-50);
  --gray-50:    var(--sand-10);
  --gray-100:   var(--sand-20);
  --gray-200:   var(--sand-30);
  --gray-300:   var(--sand-30);
  --gray-400:   var(--sand-40);
  --gray-500:   var(--sand-50);
  --gray-600:   var(--sand-60);
  --gray-700:   var(--sand-70);
  --gray-800:   var(--sand-80);
  --gray-900:   var(--sand-80);
  --radius:     var(--radius-md);
  --shadow:     var(--shadow-sm);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  line-height: 1.5;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv01', 'cv02', 'cv03', 'cv04', 'ss01';
  text-rendering: optimizeLegibility;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.nav-menu-toggle,
.nav-backdrop {
  display: none;
}

.nav-menu-toggle {
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--gray-800);
  cursor: pointer;
  box-shadow: var(--shadow);
  position: fixed;
  top: 12px;
  left: 12px;
  right: auto;
  z-index: 950;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-menu-toggle:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 880;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-layout.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sand-10);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--sand-20);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--sand-80);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--gray-400);
  padding: 12px 13px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-item.active {
  background: var(--sand-20);
  color: var(--sand-80);
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--gray-100);
  margin-top: auto;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.user-info:hover { background: var(--gray-100); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #5856d6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.user-email {
  font-size: 11px;
  color: var(--gray-400);
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: rgba(248, 247, 247, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sand-20);
  padding: 24px 48px;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.page-header.page-header-detail {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.page-header-detail-wrap {
  width: 100%;
}

.page-header-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 4px;
  align-items: center;
  margin-top: 4px;
}

.page-header-detail-left {
  display: contents;
}

.page-header-detail-status {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.page-header-detail-scanning {
  grid-column: 1;
  grid-row: 2;
  font-size: 12px;
  color: var(--gray-400);
  font-style: italic;
  line-height: 1.4;
}

.page-header-detail-scanning:empty {
  display: none;
}

.page-header-detail-mid {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  color: var(--gray-400);
}

.page-header-detail-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-self: end;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--sand-80);
}

.page-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

.page-body {
  padding: 40px 48px 80px;
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* CARDS */
.card {
  background: var(--sand-0);
  border-radius: var(--radius-md);
  border: 1px solid var(--sand-20);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  font-size: 18px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--gray-900);
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 2px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ocean-50);
  color: white;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--ocean-60);
  box-shadow: var(--shadow-sm);
}

.btn-primary:active {
  background: var(--ocean-70);
}

.btn-secondary {
  background: var(--sand-0);
  color: var(--sand-80);
  border: 1px solid var(--sand-30);
}

.btn-secondary:hover {
  background: var(--sand-10);
  border-color: var(--sand-40);
}

.btn-danger {
  background: var(--rust-50);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: var(--rust-60);
}

.btn-success {
  background: #f0fff4;
  color: var(--green);
}

.btn-success:hover { background: #d0f0dc; }

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

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 10px;
}

/* FORMS */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sand-30);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--sand-80);
  background: var(--sand-0);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ocean-50);
  box-shadow: 0 0 0 3px var(--ocean-10);
}

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

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-blue { background: var(--ocean-10); color: var(--ocean-70); }
.badge-green { background: var(--evergreen-10); color: var(--evergreen-70); }
.badge-orange { background: var(--ember-10); color: var(--ember-70); }
.badge-red { background: var(--rust-10); color: var(--rust-70); }
.badge-gray { background: var(--sand-20); color: var(--sand-70); }

/* TABLES */
.table-wrap { overflow-x: auto; }

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

th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* AUTH */
.auth-wrap {
  min-height: 100vh;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: 12px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.8);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #0071e3, #0047ab);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--gray-900);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray-400);
  font-size: 13px;
}

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

/* ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error { background: #fff0f0; color: var(--red); border: 1px solid #ffd0d0; }
.alert-success { background: #e8f8ec; color: #1a8c3a; border: 1px solid #c0e8cc; }
.alert-info { background: var(--blue-light); color: var(--blue); border: 1px solid #c0d8f8; }

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}

.tab {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.15s;
  border: none;
  background: none;
}

.tab.active {
  background: white;
  color: var(--gray-900);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

/* TOGGLE */
.toggle {
  position: relative;
  width: 44px; height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--gray-300);
  border-radius: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* PROGRESS */
.progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--blue);
  transition: width 0.3s ease;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay .modal {
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity:0; transform: scale(0.96) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--sand-20);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  font-size: 18px;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--gray-200); }

/* TAG INPUT */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  min-height: 44px;
  cursor: text;
  transition: border-color 0.15s;
  background: white;
}

.tag-container:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
}

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

.tag-input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  flex: 1;
  min-width: 120px;
  background: transparent;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--gray-400);
  margin-bottom: 24px;
}

/* SPINNER */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* LINKEDIN STATUS */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected { background: var(--green); }
.status-dot.disconnected { background: var(--gray-300); }
.status-dot.pending { background: var(--orange); }
.status-dot.reconnect_required { background: var(--orange); }

/* GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* ─── LOOM-STYLE v4 ─── */
.hero-lavender { background: #E8E3FC; }
.card-peach { background: #FFE4D6; }
.card-mint { background: #D4F4DD; }
.card-lemon { background: #FFF5B8; }
.card-lavender { background: #E8E3FC; }
.card-soft { border-radius: 20px; padding: 32px; border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.btn-lime { background: #DFFF5C; color: #1A1A1A; border-radius: 100px; font-weight: 700; padding: 14px 28px; border: none; transition: transform 0.15s; cursor: pointer; }
.btn-lime:hover { background: #D5F547; transform: translateY(-1px); }
.btn-outline-dark { background: white; color: #1A1A1A; border: 1.5px solid #1A1A1A; border-radius: 100px; padding: 14px 28px; font-weight: 600; }
.display-hero { font-size: 60px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; color: #1A1A1A; }
.display-xl { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.display-lg { font-size: 36px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }

/* Dark sidebar override */
.sidebar-dark {
  background: #1A1A1A !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
}
.sidebar-dark .nav-item {
  color: rgba(255,255,255,0.7) !important;
}
.sidebar-dark .nav-item:hover {
  background: rgba(255,255,255,0.06) !important;
  color: white !important;
}
.sidebar-dark .nav-item.active {
  background: rgba(195,184,244,0.15) !important;
  color: #C3B8F4 !important;
  border-left: 3px solid #C3B8F4 !important;
}
.sidebar-dark .nav-section-label {
  color: rgba(255,255,255,0.35) !important;
}
.sidebar-dark .user-name { color: white !important; }
.sidebar-dark .user-email { color: rgba(255,255,255,0.5) !important; }
.sidebar-dark .sidebar-logo-icon {
  background: linear-gradient(135deg, #C3B8F4, #9D84DC) !important;
}
.sidebar-dark .sidebar-brand-text { color: white !important; }
.sidebar-dark .sidebar-brand-sub { color: rgba(255,255,255,0.5) !important; }
.sidebar-dark .sidebar-footer { border-top-color: rgba(255,255,255,0.08) !important; }
.sidebar-dark .user-info:hover { background: rgba(255,255,255,0.06) !important; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-menu-toggle {
    display: flex;
  }
  .nav-backdrop {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease, visibility 0.22s ease;
    z-index: 900;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    visibility: hidden;
  }
  .app-layout.nav-open .sidebar {
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
    z-index: 960;
  }
  .main-content { margin-left: 0; }
  .page-header {
    padding-left: 58px;
    padding-right: 20px;
    box-sizing: border-box;
  }
  .page-body { padding: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .page-title { font-size: 18px; }
  .nav-item { min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .search-wrap { max-width: 100%; width: 100%; }
  .list-toolbar { flex-direction: column; align-items: stretch; }
  .list-meta { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 24px; }
  .sidebar { transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.28s ease; }
  .nav-item, .btn, .filter-pill { -webkit-tap-highlight-color: transparent; }
  .toast-container { bottom: max(16px, env(safe-area-inset-bottom)); right: 16px; left: 16px; width: auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 28px; }
  .modal { padding: 24px 20px; }
}

/* SEARCH RESULT CARD */
.person-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.person-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.08);
}

.person-card.selected {
  border-color: var(--blue);
  background: var(--blue-light);
}

.person-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #5856d6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.person-name { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.person-headline { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* NOTIFICATION BANNER */
.waiting-banner {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid #ffd54f;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.waiting-icon { font-size: 28px; }
.waiting-title { font-size: 16px; font-weight: 600; color: #6d4c00; }
.waiting-desc { font-size: 13px; color: #8a6200; margin-top: 2px; }

/* TOOLTIP */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

[data-tooltip]:hover::after { opacity: 1; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sand-30); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sand-40); }

/* TRANSITIONS */
.fade-in {
  animation: pageIn 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── CARD VARIANTS ─── */
.card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.card-elevated { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.card-elevated:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.card-outlined { box-shadow: none; border: 1.5px solid var(--gray-200); }
.card-outlined:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08); }
.card-interactive { cursor: pointer; box-shadow: none; border: 1.5px solid var(--gray-200); }
.card-interactive:hover { border-color: var(--blue); background: var(--blue-light); }

@media (prefers-reduced-motion: reduce) {
  .card, .card-elevated, .card-interactive, .stat-card { transition: none; }
  .skeleton::after, .btn.loading::after, .list-stagger > *, .toast-progress-bar, .fade-in, .spinner { animation: none; }
}

/* ─── FORM FOCUS GLOW ─── */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ocean-50);
  box-shadow: 0 0 0 3px var(--ocean-10), 0 1px 3px rgba(0, 0, 0, 0.06);
  outline: none;
}
.form-input.is-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1); }
.form-error-msg { font-size: 12px; color: var(--red); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-error-msg::before { content: '⚠'; font-size: 11px; }

/* ─── LOADING BUTTON ─── */
.btn { position: relative; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white; border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
}
.btn-secondary.loading::after { border-color: rgba(0,0,0,0.15); border-top-color: var(--gray-700); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATES v2 ─── */
.empty-state-icon-wrap {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--gray-100); display: flex; align-items: center;
  justify-content: center; font-size: 36px; margin-bottom: 20px;
}
.empty-state-icon-wrap.tint-blue { background: var(--blue-light); }
.empty-state-icon-wrap.tint-green { background: #e8f8ec; }
.empty-state-icon-wrap.tint-orange { background: #fff3e0; }

/* ─── TOAST v2 ─── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 10px;
  pointer-events: none; width: 340px; max-width: calc(100vw - 48px);
}
.toast-v2 {
  background: white; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 1px 4px rgba(0,0,0,0.08);
  display: flex; align-items: flex-start; gap: 12px;
  position: relative; overflow: hidden; pointer-events: all;
  transform: translateX(calc(100% + 32px)); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  border-left: 4px solid var(--toast-color, var(--blue));
}
.toast-v2.toast-show { transform: translateX(0); opacity: 1; }
.toast-v2.toast-hide { transform: translateX(calc(100% + 32px)); opacity: 0; transition: transform 0.25s ease, opacity 0.2s ease; }
.toast-v2.toast-success { --toast-color: var(--green); }
.toast-v2.toast-error { --toast-color: var(--red); }
.toast-v2.toast-info { --toast-color: var(--blue); }
.toast-v2.toast-warning { --toast-color: var(--orange); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--toast-color, var(--blue)); margin-top: 5px; flex-shrink: 0; }
.toast-body { flex: 1; font-size: 14px; font-weight: 500; color: var(--gray-900); line-height: 1.45; }
.toast-close { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 16px; padding: 0; line-height: 1; transition: color 0.15s; }
.toast-close:hover { color: var(--gray-700); }
.toast-progress { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(0,0,0,0.06); }
.toast-progress-bar { height: 100%; background: var(--toast-color, var(--blue)); width: 100%; transform-origin: left; animation: toast-drain var(--toast-duration, 4000ms) linear forwards; }
@keyframes toast-drain { to { transform: scaleX(0); } }

/* ─── SKELETON LOADING ─── */
.skeleton { background: var(--gray-200); border-radius: 6px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-text { height: 14px; width: 100%; border-radius: 4px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 45%; border-radius: 4px; margin-bottom: 12px; }
.skeleton-circle { border-radius: 50%; }

/* ─── LIST TOOLBAR ─── */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-400); pointer-events: none; }
.search-input { width: 100%; padding: 9px 14px 9px 36px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--gray-900); background: white; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.search-input::placeholder { color: var(--gray-400); }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 100px; font-size: 13px; font-weight: 500; background: var(--gray-100); color: var(--gray-600); border: 1.5px solid transparent; cursor: pointer; transition: all 0.15s; user-select: none; }
.filter-pill:hover { background: var(--gray-200); color: var(--gray-900); }
.filter-pill.active { background: var(--blue-light); color: var(--blue); border-color: rgba(0,113,227,0.2); font-weight: 600; }
.list-meta { font-size: 13px; color: var(--gray-400); margin-left: auto; white-space: nowrap; }

/* ─── STAGGERED LIST ANIMATION ─── */
.list-stagger > * { opacity: 0; animation: listItemIn 0.25s ease forwards; }
.list-stagger > *:nth-child(1) { animation-delay: 0ms; }
.list-stagger > *:nth-child(2) { animation-delay: 40ms; }
.list-stagger > *:nth-child(3) { animation-delay: 80ms; }
.list-stagger > *:nth-child(4) { animation-delay: 120ms; }
.list-stagger > *:nth-child(5) { animation-delay: 160ms; }
.list-stagger > *:nth-child(n+6) { animation-delay: 200ms; }
@keyframes listItemIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── COLOR EXTENSIONS ─── */
:root {
  --green-light: #e8f8ec;
  --green-dark: #1a8c3a;
  --orange-light: #fff3e0;
  --red-light: #fff0f0;
  --purple: #5856d6;
  --purple-light: #f0effe;
}

.badge-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.badge-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.badge-dot.status-active { color: var(--green-dark); }
.badge-dot.status-active::before { background: var(--green); }
.badge-dot.status-paused { color: var(--orange); }
.badge-dot.status-paused::before { background: var(--orange); }
.badge-dot.status-draft { color: var(--gray-600); }
.badge-dot.status-draft::before { background: var(--gray-400); }
.badge-dot.status-failed { color: var(--red); }
.badge-dot.status-failed::before { background: var(--red); }

/* ─── STAT CARDS v2 ─── */
.stat-card { position: relative; overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.stat-card:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); }
.stat-card.stat-blue { --stat-accent: #0071e3; }
.stat-card.stat-green { --stat-accent: #34c759; }
.stat-card.stat-orange { --stat-accent: #ff9500; }
.stat-card.stat-purple { --stat-accent: #5856d6; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 18px; }
.stat-card.stat-blue .stat-icon { background: #e8f0fe; }
.stat-card.stat-green .stat-icon { background: #e8f8ec; }
.stat-card.stat-orange .stat-icon { background: #fff3e0; }
.stat-card.stat-purple .stat-icon { background: #f0effe; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--gray-900); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 100px; margin-top: 10px; }
.stat-trend.up { background: #e8f8ec; color: #1a8c3a; }
.stat-trend.down { background: #fff0f0; color: var(--red); }
.stat-trend.neutral { background: var(--gray-100); color: var(--gray-500); }
.stat-trend.up::before { content: '↑'; }
.stat-trend.down::before { content: '↓'; }
.stat-trend.neutral::before { content: '→'; }

/* ─── COMMAND PALETTE ─── */
.cmd-overlay {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.cmd-overlay[hidden] { display: none; }

.cmd-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}

.cmd-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  animation: cmdIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.cmd-search {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.cmd-search svg { color: var(--gray-400); flex-shrink: 0; }
.cmd-input {
  flex: 1; border: none; outline: none;
  font-size: 15px; font-family: inherit;
  color: var(--gray-900);
  background: transparent;
}
.cmd-input::placeholder { color: var(--gray-400); }
.cmd-esc { margin-left: auto; font-size: 10px; }

.cmd-results { max-height: 360px; overflow-y: auto; padding: 6px 0; }
.cmd-results:empty { padding: 0; }

.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-900);
  transition: background 100ms ease;
}
.cmd-item:hover, .cmd-item.selected { background: var(--gray-100); }
.cmd-item svg { color: var(--gray-400); flex-shrink: 0; }
.cmd-empty { padding: 32px 16px; text-align: center; color: var(--gray-400); font-size: 13px; }

.cmd-footer {
  display: flex; gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.cmd-hint { font-size: 11px; color: var(--gray-400); display: inline-flex; align-items: center; gap: 4px; }
.cmd-footer kbd, .cmd-esc, .cmd-hint kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 4px; padding: 1px 5px;
  font-size: 10px; font-family: inherit; font-weight: 500;
  color: var(--gray-600);
}

/* ─── FILTER PILLS (pending/sent/rejected/all style segmented control) ─── */
button.filter-btn,
.filter-btn {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #6B7280 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s !important;
  white-space: nowrap !important;
  box-shadow: none;
  line-height: 1.2 !important;
}
button.filter-btn:hover,
.filter-btn:hover { color: #111827 !important; }
button.filter-btn.active,
.filter-btn.active {
  background: #FFFFFF !important;
  color: #0A66C2 !important;
  box-shadow: 0 1px 2px rgba(15,30,60,0.08), 0 0 0 1px rgba(15,30,60,0.05) !important;
}
button.filter-btn:focus-visible,
.filter-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(10,102,194,0.2) !important;
}

/* ─── TABS ─── */
.tab-btn {
  position: relative;
  padding: 12px 4px;
  margin-right: 20px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: #111827; }
.tab-btn.active {
  color: #0A66C2;
  border-bottom-color: #0A66C2;
}
.tab-btn:focus-visible {
  outline: none;
  color: #0A66C2;
}

/* ─── FORM CONTROL (generic input/textarea) ─── */
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sand-30);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--sand-90, #111827);
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control::placeholder { color: #9CA3AF; }
.form-control:focus {
  border-color: #0A66C2;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.12);
}
textarea.form-control { line-height: 1.55; min-height: 90px; }

/* ─── POST WIZARD MODAL ─── */
.post-wizard-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #FAFBFC;
}
.wizard-step { display: flex; flex-direction: column; }

/* Step indicator */
.wiz-step-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 80px;
}
.wizard-step-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #E5E7EB;
  border: 2px solid transparent;
  flex-shrink: 0;
  margin-bottom: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.wizard-step-dot.active {
  background: #0A66C2;
  border-color: rgba(10,102,194,0.2);
  box-shadow: 0 0 0 3px rgba(10,102,194,0.12);
}
.wizard-step-dot.done { background: #0A66C2; }
.wiz-step-label {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  transition: color 0.15s;
}
.wiz-step-wrap:has(.wizard-step-dot.active) .wiz-step-label,
.wiz-step-wrap:has(.wizard-step-dot.done)   .wiz-step-label { color: #0A66C2; }
.wiz-step-line {
  flex: 1;
  height: 2px;
  background: #E5E7EB;
  margin-top: 4px;
  border-radius: 2px;
  min-width: 30px;
}

/* Source picker cards */
.source-card {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
  color: #6B7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
}
.source-card svg { color: #9CA3AF; transition: color 0.15s; }
.source-card:hover {
  border-color: #C7D2E0;
  box-shadow: 0 4px 14px rgba(15,30,60,0.05);
  transform: translateY(-1px);
}
.source-card.active {
  border-color: #0A66C2;
  background: #F3F8FD;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.12);
  color: #0A66C2;
}
.source-card.active svg { color: #0A66C2; }
.source-card:focus-visible {
  border-color: #0A66C2;
  box-shadow: 0 0 0 3px rgba(10,102,194,0.25);
}

/* Writer textarea */
.post-textarea {
  flex: 1;
  min-height: 240px;
  resize: none;
  padding: 16px 18px !important;
  border-radius: 12px !important;
  font-size: 14.5px !important;
  line-height: 1.65 !important;
  background: #FFFFFF;
}

/* Char count badge */
.char-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #F3F4F6;
  color: #6B7280;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}

/* Editor layout (step 3) */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  padding: 20px;
  flex: 1;
  min-height: 0;
}
.editor-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #E5E7EB;
}
.editor-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 2px;
}
.sidebar-section {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 14px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

/* AI tool buttons */
.ai-tool-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  text-align: left;
}
.ai-tool-btn svg { color: #6B7280; flex-shrink: 0; }
.ai-tool-btn:hover {
  background: #F3F8FD;
  border-color: #C3DCF4;
  color: #0A66C2;
}
.ai-tool-btn:hover svg { color: #0A66C2; }
.ai-tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Image drop zone */
.image-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 1.5px dashed #D1D5DB;
  border-radius: 10px;
  font-size: 13px;
  color: #6B7280;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #FAFBFC;
}
.image-drop-zone:hover, .image-drop-zone.drag-over {
  border-color: #0A66C2;
  background: #F3F8FD;
  color: #0A66C2;
}

/* Role model filter chips */
.rm-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  user-select: none;
}
.rm-chip-label:hover { border-color: #C3DCF4; }
.rm-chip-label:has(input:checked) {
  background: #EAF2FB;
  border-color: #0A66C2;
  color: #0A66C2;
  font-weight: 600;
}

/* Post preview card (step 4) */
.post-preview-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15,30,60,0.03);
}
.preview-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: #111827;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Spinner */
.spin-icon { animation: spin-icon-rot 0.9s linear infinite; }
@keyframes spin-icon-rot {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .spin-icon { animation: none; }
}

.ref-gen-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-start;
}

.ref-gen-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90px;
}

.ref-gen-pick__ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ref-gen-pick__ring:hover {
  border-color: var(--gray-400);
}

.ref-gen-pick__ring--on {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(10, 102, 194, 0.25);
}

.ref-gen-pick__img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ref-gen-pick__name {
  font-size: 10px;
  line-height: 1.25;
  color: var(--gray-600);
  text-align: center;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.ref-gen-pick__remove {
  position: absolute;
  top: -4px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--gray-800);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0.9;
  z-index: 1;
}

.ref-gen-pick__remove:hover {
  opacity: 1;
}

.ref-web-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

.ref-web-pick__ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0 auto;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ref-web-pick--on .ref-web-pick__ring {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(10, 102, 194, 0.25);
}

.ref-web-pick__img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.ref-web-pick__cap {
  font-size: 9px;
  line-height: 1.2;
  color: var(--gray-500);
  margin-top: 3px;
  text-align: center;
  max-height: 30px;
  overflow: hidden;
  word-break: break-word;
}

.ref-web-pick__hint {
  font-size: 10px;
  color: var(--gray-500);
}

@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { order: 2; }
}
