/* Lead Today — subset of the house-style tokens for this app's pages.
   Full source: git@github.com:Lead-Today/huisstijl-leadtoday.git */

/* ───── Isidora Sans (huisstijl-lettertype) ───── */
@font-face {
  font-family: "Isidora Sans";
  src: url("fonts/IsidoraSans-Medium.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Isidora Sans";
  src: url("fonts/IsidoraSans-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Isidora Sans";
  src: url("fonts/IsidoraSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --lt-ink: #101820;
  --lt-blue: #0093B2;
  --lt-blue-dark: #007A94;
  --lt-blue-bg: #E0F4F9;
  --lt-orange: #FC4C02;
  --lt-orange-dark: #D93F00;
  --lt-bg: #F8FAFC;
  --lt-bg-soft: #F1F5F9;
  --lt-surface: #FFFFFF;
  --lt-border: #E2E8F0;
  --lt-text: #101820;
  --lt-text-muted: #64748B;
  --lt-success: #16A34A;
  --lt-success-bg: #DCFCE7;
  --lt-error: #DC2626;
  --lt-error-bg: #FEE2E2;
  --font-sans: "Isidora Sans", Arial, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-card: 0 1px 4px rgba(16, 24, 32, 0.05), 0 4px 16px rgba(16, 24, 32, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--lt-bg);
  color: var(--lt-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px;
}

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

.brand img { height: 40px; width: auto; }

.card {
  background: var(--lt-surface);
  border: 1px solid var(--lt-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--lt-ink);
}

h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 24px 0 8px;
}

p { color: var(--lt-text-muted); margin: 0 0 16px; }

.btn {
  display: inline-block;
  background: var(--lt-orange);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  border-radius: var(--r-lg);
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.btn:hover { background: var(--lt-orange-dark); }

.btn-secondary { background: var(--lt-blue); }
.btn-secondary:hover { background: var(--lt-blue-dark); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 6px 14px;
  border-radius: 999px;
}
.status.ok { background: var(--lt-success-bg); color: var(--lt-success); }
.status.off { background: var(--lt-error-bg); color: var(--lt-error); }

.dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }

.alert {
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.9375rem;
}
.alert.ok { background: var(--lt-success-bg); color: var(--lt-success); }
.alert.err { background: var(--lt-error-bg); color: var(--lt-error); }

code {
  background: var(--lt-blue-bg);
  color: var(--lt-blue-dark);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.875em;
}

.muted { color: var(--lt-text-muted); font-size: 0.875rem; }

/* Form fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; }
.field input {
  width: 100%; font-family: inherit; font-size: 0.9375rem;
  padding: 12px 14px; border: 1px solid var(--lt-border);
  border-radius: var(--r-md); background: var(--lt-bg);
}
.field input:focus { outline: none; border-color: var(--lt-blue); background: #fff; }

/* Tables */
.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--lt-border); font-size: 0.9375rem;
}
.table th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--lt-text-subtle); font-weight: 600;
}
.table tr:last-child td { border-bottom: none; }
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--lt-ink); }
.table th .sort-ind { font-size: 0.85em; }

/* Clickable rows (whole row navigates), in house style */
.row-link { cursor: pointer; transition: background var(--t-base, 0.15s) ease; }
.row-link:hover { background: var(--lt-blue-bg); }
.row-link td a { color: var(--lt-ink); text-decoration: none; font-weight: 600; }
.row-link:hover td a { color: var(--lt-blue-dark); }

/* Button variants */
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; border-radius: 10px; }
.btn-danger { background: var(--lt-error); }
.btn-danger:hover { background: #b91c1c; }

/* Section divider */
hr.sep { border: none; border-top: 1px solid var(--lt-border); margin: 28px 0; }

/* Pipeline (kanban) */
.pipeline { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.pipe-col {
  flex: 0 0 250px; min-width: 250px;
  background: var(--lt-bg-soft); border: 1px solid var(--lt-border);
  border-radius: var(--r-lg); padding: 12px;
}
.pipe-col h3 { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--lt-ink); }
.pipe-col .col-sub { font-size: 0.8125rem; color: var(--lt-text-muted); margin: 2px 0 10px; }
.pipe-card {
  background: #fff; border: 1px solid var(--lt-border); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm, 0 1px 2px rgba(16,24,32,.05));
}
.pipe-card a { color: var(--lt-ink); font-weight: 600; text-decoration: none; font-size: 0.875rem; }
.pipe-card a:hover { color: var(--lt-blue-dark); }
.pipe-card .opp { font-size: 0.8125rem; color: var(--lt-text-muted); margin: 2px 0; }
.pipe-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 0.8125rem; }
.pipe-card .meta .amount { font-weight: 600; color: var(--lt-ink); }

/* Chart hover tooltip */
.chart-tip {
  position: absolute; pointer-events: none; opacity: 0;
  transform: translate(-50%, -135%);
  background: var(--lt-ink); color: #fff;
  font-size: 0.75rem; font-weight: 600; font-family: var(--font-sans);
  padding: 5px 9px; border-radius: 6px; white-space: nowrap; z-index: 10;
  transition: opacity 0.1s ease;
}
.bar { transition: opacity 0.1s ease; cursor: default; }
.bar:hover { opacity: 0.8; }

/* Stat tiles (revenue figures) */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 28px; }
.stat {
  background: var(--lt-surface);
  border: 1px solid var(--lt-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  min-width: 220px;
}
.stat .label {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--lt-text-subtle); font-weight: 600; margin-bottom: 6px;
}
.stat .value { font-size: 1.75rem; font-weight: 700; color: var(--lt-ink); line-height: 1.2; }
.stat .sub { font-size: 0.8125rem; color: var(--lt-text-muted); margin-top: 6px; }
.stat.accent { border-color: var(--lt-blue); }
.stat.accent .value { color: var(--lt-blue-dark); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lt-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: color var(--t-base, 0.15s) ease;
}
.back-link:hover { color: var(--lt-blue-dark); }
.back-link .arrow { transition: transform var(--t-base, 0.15s) ease; }
.back-link:hover .arrow { transform: translateX(-3px); }

/* ───── App shell with left sidebar ───── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0; background: #fff;
  border-right: 1px solid var(--lt-border);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 8px;
}
.sidebar .logo { padding: 8px 12px 20px; }
.sidebar .logo img { height: 30px; width: auto; }

.yearswitch {
  padding: 0 12px 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--lt-border);
}
.yearswitch-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--lt-text-muted); margin-bottom: 6px;
}
.yearstep {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; padding: 4px;
  border: 1px solid var(--lt-border); border-radius: var(--r-md);
  background: var(--lt-bg);
}
.yearstep .ystep {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: var(--r-sm, 8px);
  color: var(--lt-blue-dark); text-decoration: none;
  font-size: 1.1rem; line-height: 1; font-weight: 700;
  transition: background var(--t-base, 0.15s) ease;
}
.yearstep .ystep:hover { background: var(--lt-blue-bg); }
.yearstep .ystep.disabled {
  color: var(--lt-border); cursor: default; pointer-events: none;
}
.yearstep .yval {
  font-size: 1.0625rem; font-weight: 700; color: var(--lt-ink);
  letter-spacing: 0.01em;
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--lt-ink); text-decoration: none;
  font-weight: 600; font-size: 0.9375rem;
  transition: background var(--t-base, 0.15s) ease;
}
.nav a:hover { background: var(--lt-bg-soft); }
.nav a.active { background: var(--lt-blue-bg); color: var(--lt-blue-dark); }
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar .foot {
  border-top: 1px solid var(--lt-border);
  padding: 14px 12px 0; font-size: 0.875rem; color: var(--lt-text-muted);
}
.sidebar .foot a { color: var(--lt-blue-dark); }

.main { flex: 1; min-width: 0; padding: 40px; }
.main > h1 { margin-top: 0; }

/* ───── Tabs (segmented control, house style) ───── */
.tabs {
  display: inline-flex;
  gap: 4px;
  margin: 4px 0 20px;
  padding: 4px;
  background: var(--lt-bg-soft);
  border: 1px solid var(--lt-border);
  border-radius: var(--r-pill);
}
.tabs a, .tabs button {
  padding: 7px 16px;
  border: none;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--lt-text-muted);
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-base, 0.15s) ease, color var(--t-base, 0.15s) ease;
}
.tabs a:hover, .tabs button:hover { color: var(--lt-ink); }
.tabs a.active, .tabs button.active {
  background: var(--lt-blue);
  color: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 32, 0.05));
}

/* Toolbar: search + bulk action on one aligned row */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.toolbar .search { margin: 0; flex: 1 1 260px; max-width: 360px; }
.toolbar .btn { margin-left: auto; }

/* Search input on list pages */
.search {
  width: 100%; max-width: 320px; font-family: inherit; font-size: 0.9375rem;
  padding: 10px 14px; border: 1px solid var(--lt-border);
  border-radius: var(--r-md); background: #fff; margin-bottom: 16px;
}
.search:focus { outline: none; border-color: var(--lt-blue); }

/* Status pill in tables */
.pill {
  display: inline-block; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: 0.75rem; font-weight: 600; background: var(--lt-bg-soft); color: var(--lt-text-muted);
}
.pill.c { background: var(--lt-success-bg); color: var(--lt-success); }
.pill.p { background: var(--lt-blue-bg); color: var(--lt-blue-dark); }
.pill.s { background: var(--lt-orange-light, #FEF0E8); color: var(--lt-orange-dark); }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
    padding: 12px 16px; gap: 12px;
  }
  .sidebar .logo { padding: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .yearswitch {
    padding: 0; margin: 0; border: none;
    display: flex; align-items: center; gap: 8px;
  }
  .yearswitch-label { margin: 0; }
  .sidebar .foot { border: none; padding: 0; margin-left: auto; }
  .main { padding: 24px 16px; }
}
