/* ================================================================
   TRACKFLOW — style.css  v1.3
   Font: Inter (Google Fonts) — clean, readable, no eye strain
   Theme: Deep navy dark + soft light
   ================================================================ */

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

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --bg:        #0f1623;
  --bg2:       #131d2e;
  --surface:   #172033;
  --surface2:  #1c2840;
  --surface3:  #213050;
  --surface4:  #263660;

  --border:    rgba(255,255,255,0.06);
  --border2:   rgba(255,255,255,0.10);
  --border3:   rgba(255,255,255,0.16);

  --blue:      #4f8ef7;
  --blue-dim:  rgba(79,142,247,0.12);
  --blue-glow: 0 0 28px rgba(79,142,247,0.15);

  --green:     #34d399;
  --green-dim: rgba(52,211,153,0.1);

  --red:       #f87171;
  --red-dim:   rgba(248,113,113,0.1);

  --amber:     #fbbf24;
  --amber-dim: rgba(251,191,36,0.1);

  --violet:    #a78bfa;

  /* TEXT — carefully chosen for zero eye strain */
  --text:      #e2e8f0;   /* primary — soft white, not harsh */
  --text2:     #94a3b8;   /* secondary — readable slate */
  --text3:     #64748b;   /* tertiary — labels, hints */
  --text4:     #3d526b;   /* muted — placeholders */

  --input-bg:  #1c2840;
  --card-bg:   #172033;
  --sidebar-bg:#131d2e;
  --topbar-bg: rgba(15,22,35,0.92);

  --sidebar-w: 220px;
  --header-h:  58px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-sm: 7px;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:        #f1f5f9;
  --bg2:       #e8eef6;
  --surface:   #ffffff;
  --surface2:  #f8fafc;
  --surface3:  #f1f5f9;
  --surface4:  #e2e8f0;

  --border:    rgba(15,23,42,0.07);
  --border2:   rgba(15,23,42,0.12);
  --border3:   rgba(15,23,42,0.20);

  --blue:      #2563eb;
  --blue-dim:  rgba(37,99,235,0.08);
  --green:     #059669;
  --green-dim: rgba(5,150,105,0.08);
  --red:       #dc2626;
  --red-dim:   rgba(220,38,38,0.08);
  --amber:     #d97706;
  --amber-dim: rgba(217,119,6,0.08);

  --text:      #0f172a;
  --text2:     #334155;
  --text3:     #64748b;
  --text4:     #94a3b8;

  --input-bg:  #ffffff;
  --card-bg:   #ffffff;
  --sidebar-bg:#ffffff;
  --topbar-bg: rgba(241,245,249,0.94);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
}

/* scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

/* ── APP SHELL ── */
.app-shell { display: flex; min-height: 100vh; }
.main-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform 0.28s ease, background 0.25s;
}

.sidebar-brand {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}

.brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #4f8ef7, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(79,142,247,0.35);
}

.brand-name { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }
.brand-sub  { font-size: 10px; color: var(--text3); margin-top: 1px; }

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

.nav-section {
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text4); padding: 10px 8px 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text3); font-size: 13.5px;
  font-weight: 450; margin-bottom: 1px;
  transition: all 0.12s; border: 1px solid transparent;
  user-select: none; text-decoration: none;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--blue-dim); color: var(--blue); border-color: rgba(79,142,247,0.15); font-weight: 500; }

.nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--blue); color: #fff; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }

.sidebar-bottom { padding: 10px 8px; border-top: 1px solid var(--border); }

.upgrade-btn {
  width: 100%; padding: 9px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f8ef7, #2563eb);
  color: #fff; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; margin-bottom: 6px;
  transition: filter 0.15s, transform 0.15s;
  box-shadow: 0 3px 12px rgba(79,142,247,0.3);
}
.upgrade-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }

.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text3); cursor: pointer;
  transition: all 0.12s; margin-bottom: 1px;
}
.sidebar-link:hover { background: var(--surface2); color: var(--text); }

.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; margin-top: 4px; transition: border-color 0.12s;
}
.sidebar-user:hover { border-color: var(--border2); }

.user-av {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--blue); display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600;
  color: #fff; flex-shrink: 0; overflow: hidden;
}
.user-av img { width: 100%; height: 100%; object-fit: cover; }
.user-av-name  { font-size: 12.5px; font-weight: 500; color: var(--text); }
.user-av-email { font-size: 10.5px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }

/* ── TOPBAR ── */
.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0;
  background: var(--topbar-bg); backdrop-filter: blur(10px); z-index: 40;
  transition: background 0.25s;
}

.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 7px 12px; width: 280px;
  transition: border-color 0.15s;
}
.topbar-search:focus-within { border-color: var(--blue); }
.topbar-search input {
  background: none; border: none; outline: none;
  font-size: 13px; color: var(--text); font-family: inherit; width: 100%;
}
.topbar-search input::placeholder { color: var(--text4); }

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

.topbar-icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text3); font-size: 14px; transition: all 0.12s;
}
.topbar-icon-btn:hover { color: var(--text); border-color: var(--border2); }

.quick-create-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--blue); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: filter 0.15s;
}
.quick-create-btn:hover { filter: brightness(1.08); }

.topbar-av {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600;
  color: #fff; cursor: pointer; overflow: hidden; font-family: inherit;
}
.topbar-av img { width: 100%; height: 100%; object-fit: cover; }

/* dropdown */
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius); min-width: 168px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: none; z-index: 100;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; font-size: 13px; color: var(--text2);
  cursor: pointer; transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}
.dd-item:last-child { border-bottom: none; }
.dd-item:hover { background: var(--surface2); color: var(--text); }
.dd-item.danger { color: var(--red); }

/* live pill */
.live-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-dim); border: 1px solid rgba(52,211,153,0.2);
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; color: var(--green); font-weight: 500;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: livepulse 2s infinite;
}
@keyframes livepulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ── PAGE STRUCTURE ── */
.page-wrap { padding: 24px; }

.page-header { margin-bottom: 22px; }
.breadcrumb { font-size: 12px; color: var(--text3); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.breadcrumb span { cursor: pointer; }
.breadcrumb span:hover { color: var(--text2); }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; margin-bottom: 4px; }
.page-desc  { font-size: 13.5px; color: var(--text3); line-height: 1.5; }
.page-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── CARDS ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s, background 0.25s;
}
.card-pad { padding: 20px; }
.card:hover { border-color: var(--border2); }

.card-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 16px;
}
.card-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.card-meta  { font-size: 11.5px; color: var(--text3); }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }

.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden; transition: all 0.15s;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.stat-card:nth-child(1)::after { background: var(--blue); }
.stat-card:nth-child(2)::after { background: var(--green); }
.stat-card:nth-child(3)::after { background: var(--red); }
.stat-card:nth-child(4)::after { background: var(--amber); }
.stat-card:hover { border-color: var(--border2); transform: translateY(-1px); }

.stat-icon  { font-size: 20px; margin-bottom: 12px; }
.stat-label { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; line-height: 1; margin-bottom: 6px; }
.stat-sub   { font-size: 11.5px; color: var(--text3); }
.stat-sub .up { color: var(--green); }

/* ── CHARTS ── */
.charts-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.charts-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
canvas { max-height: 230px; }

/* ── FORMS ── */
.form-group { margin-bottom: 15px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.form-hint  { font-size: 11.5px; color: var(--text3); margin-top: 4px; line-height: 1.4; }

.form-input, .form-select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit; font-size: 13.5px;
  color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
.form-input::placeholder { color: var(--text4); }
.form-input:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.1);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; cursor: pointer;
}
.form-select option { background: var(--surface); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all 0.15s;
  font-size: 13px; padding: 9px 16px; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 10px rgba(79,142,247,0.25); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost   { background: var(--surface2); color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface3); color: var(--text); }
.btn-danger  { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.15); }
.btn-sm   { padding: 5px 10px; font-size: 12px; }
.btn-lg   { padding: 11px 20px; font-size: 14px; font-weight: 600; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 6px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 500; color: var(--text3); border-bottom: 1px solid var(--border); white-space: nowrap; letter-spacing: 0.3px; }
td { padding: 12px 14px; font-size: 13px; color: var(--text2); border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--surface2); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 500; }
.badge-blue   { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(79,142,247,0.2); }
.badge-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }
.badge-amber  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }
.badge-gray   { background: var(--surface3);  color: var(--text2); border: 1px solid var(--border2); }
.badge-red    { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }

/* ── MINI BARS ── */
.mini-bar-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.mini-bar-row:last-child { border-bottom: none; }
.mini-bar-label { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.mini-bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mini-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mini-bar-track { width: 72px; height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; }
.mini-bar-fill  { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.mini-bar-val   { font-size: 12px; font-weight: 600; color: var(--text); min-width: 22px; text-align: right; }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,0.2); opacity: 0; transform: translateY(6px); transition: all 0.22s ease; min-width: 200px; pointer-events: auto; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-color: rgba(52,211,153,0.3); }
.toast.toast-error   { border-color: rgba(248,113,113,0.3); }
.toast.toast-info    { border-color: rgba(79,142,247,0.3); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); width: 100%; max-width: 480px; padding: 24px; transform: scale(0.97); transition: transform 0.22s ease; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title  { font-size: 17px; font-weight: 600; color: var(--text); }
.modal-close  { width: 26px; height: 26px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); font-size: 13px; transition: all 0.12s; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── EMPTY STATE ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 20px; text-align: center; }
.empty-icon  { font-size: 30px; opacity: 0.4; margin-bottom: 10px; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text3); margin-bottom: 5px; }
.empty-desc  { font-size: 12.5px; color: var(--text4); max-width: 240px; line-height: 1.5; }

/* ── SPINNER ── */
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.55s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BUILDER ── */
.builder-layout  { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.platform-pills  { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.platform-pill   { padding: 4px 11px; border-radius: 20px; font-size: 12px; cursor: pointer; border: 1px solid var(--border2); background: var(--surface2); color: var(--text3); transition: all 0.12s; }
.platform-pill:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.link-output { background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 12px; font-size: 12.5px; color: var(--text3); word-break: break-all; line-height: 1.7; min-height: 50px; }
.link-output.has-link { color: var(--blue); border-color: rgba(79,142,247,0.25); }
.utm-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.utm-tag  { background: var(--surface3); border: 1px solid var(--border2); border-radius: 5px; padding: 2px 8px; font-size: 11px; color: var(--text3); }
.utm-tag strong { color: var(--blue); font-weight: 500; }

.how-step { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.how-step:last-child { margin-bottom: 0; }
.step-num { background: var(--blue-dim); border-radius: 5px; padding: 3px 7px; font-size: 10.5px; color: var(--blue); font-weight: 600; flex-shrink: 0; }
.step-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── CLICK LOG ── */
.cl-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.cl-filter-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 7px 12px;
  font-size: 13px; color: var(--text2); cursor: pointer;
  transition: all 0.12s; white-space: nowrap;
}
.cl-filter-pill select { background: none; border: none; outline: none; color: var(--text2); font-size: 13px; font-family: inherit; cursor: pointer; padding: 0; }
.cl-filter-pill select option { background: var(--surface); }
.cl-filter-pill:focus-within { border-color: var(--blue); color: var(--text); }

.dev-type-btns { display: flex; gap: 3px; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 4px; }
.dev-btn { width: 28px; height: 28px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; transition: all 0.12s; color: var(--text4); }
.dev-btn:hover, .dev-btn.active { background: var(--surface3); color: var(--text2); }

.cl-clear { padding: 7px 12px; border-radius: var(--radius-sm); background: var(--surface2); border: 1px solid var(--border2); font-size: 13px; color: var(--text3); cursor: pointer; margin-left: auto; transition: all 0.12s; font-family: inherit; }
.cl-clear:hover { color: var(--text); border-color: var(--border3); }

/* Click log table rows — generous spacing like the design */
.cl-table { width: 100%; border-collapse: collapse; }
.cl-table th { padding: 10px 16px; font-size: 11px; font-weight: 500; color: var(--text3); text-align: left; border-bottom: 1px solid var(--border); background: var(--surface2); letter-spacing: 0.3px; white-space: nowrap; }
.cl-table td { padding: 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cl-table tr:last-child td { border-bottom: none; }
.cl-table tbody tr { transition: background 0.1s; }
.cl-table tbody tr:hover td { background: rgba(79,142,247,0.04); }

.cl-td { padding: 15px 16px; }

/* time column */
.cl-time { font-size: 14px; font-weight: 600; color: var(--text); }
.cl-date { font-size: 11px; color: var(--text3); margin-top: 2px; }

/* source column */
.cl-src { display: flex; align-items: center; gap: 9px; padding: 15px 16px; }
.cl-src-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.cl-src-name { font-size: 13.5px; font-weight: 500; }

/* geo column */
.cl-flag { font-size: 18px; line-height: 1; margin-bottom: 2px; }
.cl-city { font-size: 13.5px; font-weight: 500; color: var(--text); }
.cl-country { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* device column */
.cl-dev { display: flex; align-items: center; gap: 8px; padding: 15px 16px; }
.cl-dev-icon { width: 26px; height: 26px; border-radius: 6px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cl-dev-browser { font-size: 13px; color: var(--text2); }
.cl-dev-os { font-size: 11px; color: var(--text3); margin-top: 1px; }

/* short link column */
.cl-shortlink { font-size: 12.5px; color: var(--blue); cursor: pointer; font-family: 'Courier New', monospace; padding: 15px 16px; display: block; }
.cl-shortlink:hover { text-decoration: underline; }

/* type badge */
.type-live { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.2); border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 500; }
.type-sim  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); border-radius: 5px; padding: 2px 7px; font-size: 11px; font-weight: 500; }

/* campaign pill in click log */
.cl-campaign { display: inline-block; background: var(--surface3); border: 1px solid var(--border2); border-radius: 5px; padding: 3px 9px; font-size: 12px; color: var(--text2); }

/* pagination */
.cl-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); }
.cl-showing { font-size: 12.5px; color: var(--text3); }
.cl-showing strong { color: var(--text); font-weight: 600; }
.pg-btns { display: flex; gap: 3px; }
.pg-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface2); color: var(--text3); font-size: 12.5px; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.pg-btn:hover { color: var(--text); border-color: var(--border3); }
.pg-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.pg-btn.nav { padding: 0 8px; width: auto; }
.pg-dots { color: var(--text4); font-size: 12px; display: flex; align-items: center; padding: 0 2px; }

/* bottom stat cards */
.cl-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 14px; }
.cl-stat { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; }
.cl-stat-lbl { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.cl-stat-val { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; margin-bottom: 4px; }
.cl-stat-sub { font-size: 12px; color: var(--text3); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 8px; }
.spark-b { width: 7px; border-radius: 2px; background: var(--blue); opacity: 0.45; }
.speed-ring { position: relative; width: 42px; height: 42px; }
.speed-ring svg { transform: rotate(-90deg); }
.speed-ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: var(--green); }

/* ── SETTINGS ── */
.settings-wrap { max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.av-upload { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.av-circle { width: 66px; height: 66px; border-radius: 14px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff; overflow: hidden; cursor: pointer; border: 2px solid var(--border2); transition: opacity 0.12s; }
.av-circle:hover { opacity: 0.85; }
.av-circle img { width: 100%; height: 100%; object-fit: cover; }

/* ── MOBILE ── */
.mobile-menu-btn { display: none; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; cursor: pointer; color: var(--text2); font-size: 15px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 49; }
.sidebar-overlay.open { display: block; }

/* link table */
.link-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.link-dest  { font-size: 11.5px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.src-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.table-actions { display: flex; gap: 5px; align-items: center; }

/* link analytics expand */
.link-analytics-row { background: var(--surface2); padding: 16px 20px; border-top: 1px solid var(--border); }
.la-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.la-item { text-align: center; }
.la-val { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.la-lbl { font-size: 10.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }
.la-clicks-list { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.la-click-row { display: flex; gap: 10px; padding: 5px 0; font-size: 12px; color: var(--text3); border-bottom: 1px solid var(--border); align-items: center; }
.la-click-row:last-child { border-bottom: none; }

@media(max-width:1100px){
  .stats-grid{grid-template-columns:repeat(2,1fr);}
  .charts-grid-2{grid-template-columns:1fr;}
  .charts-grid-3{grid-template-columns:1fr 1fr;}
  .cl-stats-row{grid-template-columns:1fr 1fr;}
}
@media(max-width:768px){
  :root{--sidebar-w:0px;}
  .sidebar{transform:translateX(-220px);width:220px;}
  .sidebar.open{transform:translateX(0);}
  .main-content{margin-left:0;}
  .page-wrap{padding:16px;}
  .stats-grid{grid-template-columns:1fr 1fr;}
  .charts-grid-3{grid-template-columns:1fr;}
  .builder-layout{grid-template-columns:1fr;}
  .mobile-menu-btn{display:block;}
  .topbar-search{width:160px;}
  .cl-stats-row{grid-template-columns:1fr;}
  .la-grid{grid-template-columns:repeat(2,1fr);}
}
