/* ============================================================
   base.css - Variables, reset, layout scaffolding
   ============================================================ */

/* ===== CSS VARIABLES & RESET ===== */
:root {
  --bg: #0f0f11;
  --bg-2: #16161a;
  --bg-3: #1e1e24;
  --bg-4: #252530;
  --border: #2a2a35;
  --border-light: #353545;
  --text: #e8e8f0;
  --text-2: #9898b0;
  --text-3: #6060780;
  --accent: #7ee8a2;
  --accent-dim: rgba(126, 232, 162, 0.12);
  --accent-2: #5bc4ff;
  --accent-2-dim: rgba(91, 196, 255, 0.1);
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.12);
  --amber: #ffc95c;
  --amber-dim: rgba(255, 201, 92, 0.12);
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
  --header-h: 64px;
  --filter-h: 56px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

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

html { scroll-behavior: smooth; overscroll-behavior: none; touch-action: manipulation; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ===== SUMMARY BAR ===== */
.summary-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(15, 15, 17);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.summary-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.summary-bar-inner::-webkit-scrollbar { display: none; }

.summary-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 8px;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

.brand-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}

.summary-stats {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: -8px;
  position: relative;
  z-index: 1;
}
.summary-stats::-webkit-scrollbar { display: none; }

.stat-chip {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background var(--transition);
}
.summary-stats .stat-chip:first-child {
  padding-left: 16px;
}
.stat-chip:hover { background: var(--bg-3); }
.stat-chip.stat-chip-clickable { cursor: pointer; }
.stat-chip.stat-chip-clickable:hover { background: var(--bg-3); box-shadow: 0 0 0 1px var(--border-light); }
.stat-chip.highlight {
  background: var(--accent-dim);
  border: 1px solid rgba(126, 232, 162, 0.2);
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  line-height: 1.2;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin-top: 1px;
}
.stat-value.negative { color: var(--red); }
.stat-value.commission-yellow { color: #ffc95c; }
.stat-chip.highlight .stat-value { color: var(--accent); }

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 8px;
}

.btn-add-client {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0f0f11;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-add-client:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-add-client:active { transform: translateY(0); }

/* ===== FILTER BAR ===== */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: rgb(22, 22, 26);
  border-bottom: 1px solid var(--border);
}

.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  max-width: 1600px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.filter-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-sep {
  color: var(--text-2);
  font-size: 12px;
}

.filter-input, .filter-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
}
.filter-input:focus, .filter-select:focus { border-color: var(--accent); }
.filter-input[type="date"] { font-family: var(--font-mono); font-size: 12px; }
.filter-quick-ranges { gap: 8px; }
.filter-quick-btns { display: flex; gap: 6px; }
.filter-select option:disabled { color: var(--text-2); opacity: 0.4; }
/* Force native <option> list to always use readable black-on-white regardless of page theme */
.filter-select option { background: #ffffff; color: #111111; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--accent);
  color: #0f0f11;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-light); }
.btn-ghost.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.2); }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-icon:hover { background: var(--bg-4); color: var(--text); border-color: var(--border-light); }
.btn-icon.danger:hover { background: var(--red-dim); color: var(--red); border-color: rgba(255,107,107,0.3); }
.btn-icon.primary:hover { background: var(--accent-dim); color: var(--accent); border-color: rgba(126,232,162,0.3); }
.btn-icon.has-note { color: var(--accent); border-color: rgba(126,232,162,0.35); }

