/* Wicflow Cold Dialer — design system.

   Direction: a working sales tool, not a dashboard. Density over decoration,
   dividers over cards, one primary action per view. Borders and type carry the
   structure; shadows are reserved for things that genuinely float.

   Legacy aliases (--card/--ink/--muted/--line/--radius) are kept at the bottom
   of :root because existing rules and inline styles reference them. */

/* Self-hosted fonts — no third-party connection, same as wicflow.com. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/dmsans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/dmsans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrumentserif-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrumentserif-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Wicflow brand — warm paper, ink, one brass accent (wicflow.com base.css) */
  --bg:            #f7f7f5;
  --surface:       #ffffff;
  --surface-2:     #fbfbf9;
  --surface-3:     #eeeee9;
  --border:        #e6e6e1;
  --border-strong: #d2d2cb;
  --text:          #111113;
  --text-2:        #4f5763;
  --text-3:        #8b8f96;

  /* Accent role is INK: primary actions are ink pills, as on wicflow.com.
     Brass is the single highlight and never carries small text. */
  --accent:        #111113;
  --accent-hover:  #2a2a2c;
  --accent-ink:    #f7f7f5;   /* text on an accent fill */
  --accent-weak:   #eeeee9;
  --accent-line:   #c9c9c2;
  --brass:         #a1772f;   /* darkened for text use, >=3:1 on white */
  --brass-bright:  #b88a3e;   /* marks, underlines, fills */
  --brass-weak:    #f3ead9;

  --ok:            #2e6e4e;  --ok-weak:   #e8efe8;
  --warn:          #9c6b1f;  --warn-weak: #f5edda;
  --bad:           #a83a2f;  --bad-weak:  #f7e9e6;
  --call:          #1f6b47;  /* call button fill, white text */
  --call-end:      #a83a2f;

  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --r-sm: 3px; --r: 5px; --r-lg: 8px; --r-full: 999px;

  --shadow:    0 1px 3px rgba(17,17,19,.04);
  --shadow-lg: 0 10px 24px -6px rgba(17,17,19,.13), 0 2px 6px -2px rgba(17,17,19,.05);
  --ring: 0 0 0 3px color-mix(in srgb, var(--text) 18%, transparent);

  --row: 38px;                /* table row height */

  /* legacy aliases — existing rules and inline styles depend on these */
  --card: var(--surface); --ink: var(--text); --muted: var(--text-2);
  --line: var(--border); --radius: var(--r);
}


/* Single-theme by design: wicflow.com is light-only, and the dialer now
   matches it in every OS theme. The palette above is the complete set. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.012em; margin: 0; font-weight: 600; }
a { color: var(--accent); }
svg { display: block; }
.num, .mono { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1320px; }
.row { display: flex; gap: 8px; align-items: center; }
.spacer, .grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- header ---------- */
header.bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 52px; flex: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
header.bar h1 { font-size: 14px; font-weight: 600; }
header.bar a {
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 5px 8px; border-radius: var(--r-sm);
}
header.bar a:hover { color: var(--text); background: var(--surface-3); }

/* ---------- surfaces ----------
   A section, not a floating card. Panels that need separating get a hairline,
   not a shadow and 20px of radius. */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 10px;
}
.note {
  font-size: 13px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-left: 2px solid var(--warn);
  padding: 10px 12px; border-radius: var(--r); margin-bottom: 10px;
  line-height: 1.45;
}
.note b { color: var(--text); font-weight: 600; }

/* ---------- badges ----------
   Restrained: a tag states a fact, it does not shout. */
.pill, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; padding: 2px 7px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
  line-height: 1.5;
}
.pill { font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.pill.live  { background: var(--ok-weak);  color: var(--ok);   border-color: transparent; }
.pill.demo  { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.tag.p1 { background: var(--bad-weak);  color: var(--bad);  border-color: transparent; font-weight: 600; }
.tag.p2 { background: var(--warn-weak); color: var(--warn); border-color: transparent; font-weight: 600; }
.tag.mobile { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.tag.landline, .tag.foreign, .tag.service {
  background: var(--warn-weak); color: var(--warn); border-color: transparent;
}

/* ---------- lead card ---------- */
.lead-name {
  font-family: var(--font-display); font-size: 25px; font-weight: 400;
  letter-spacing: -.01em; margin-bottom: 1px;
}
.lead-co { color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; }
.phone { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.ctx {
  border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px;
  font-size: 13px; color: var(--text-2);
}
.ctx div { margin-bottom: 2px; }
.ctx b { color: var(--text); font-weight: 500; }

/* ---------- controls ----------
   One primary per view. Everything else is quiet until hovered. */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 30px; padding: 0 13px; border-radius: var(--r-full);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.call-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 40px; font: inherit; font-size: 14px; font-weight: 600;
  background: var(--call); color: #fff; border: 0; border-radius: var(--r-full);
  cursor: pointer; text-decoration: none;
  transition: filter .1s;
}
.call-btn:hover { filter: brightness(1.07); }
.call-btn:active { filter: brightness(.95); }
.call-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.call-btn.hangup { background: var(--call-end); }
.call-btn[disabled] { background: var(--text-3); cursor: not-allowed; }

label {
  display: block; font-size: 12px; font-weight: 500; color: var(--text-2);
  margin: 12px 0 4px;
}
textarea, input[type=text], input[type=password], input[type=tel],
input[type=datetime-local], select {
  width: 100%; height: 32px; padding: 0 10px; border-radius: var(--r);
  font: inherit; font-size: 13.5px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .1s, box-shadow .1s;
}
select { padding-right: 6px; }
textarea { height: auto; min-height: 68px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ---------- disposition grid ---------- */
.dispo { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.dispo button {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px; font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  border-radius: var(--r); text-align: left;
  transition: background .1s, border-color .1s;
}
.dispo button:hover { border-color: var(--accent); background: var(--accent-weak); }
.dispo button:focus-visible { outline: none; box-shadow: var(--ring); }
.dispo button.wide { grid-column: 1 / -1; }
.dispo button .k {
  display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none;
  border: 1px solid var(--border); border-radius: 2px;
  font-size: 9.5px; font-weight: 600; color: var(--text-3);
}
.dispo button svg { flex: none; color: var(--text-3); }
.dispo button:hover svg { color: var(--accent); }

/* ---------- tables ----------
   Dense by intent: the operator scans many rows, so rows are 38px and the
   header is a quiet strip rather than a coloured band. */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; height: 30px; padding: 0 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { height: var(--row); padding: 0 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }

/* ---------- misc ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 1px;
         background: var(--border); border: 1px solid var(--border);
         border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 12px 14px; }
.stat .n {
  font-family: var(--font-display); font-size: 26px; font-weight: 400;
  letter-spacing: -.01em; line-height: 1.1;
}
.stat .l { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty h2 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 13.5px; color: var(--text-3); }
.progress { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 9px 16px;
  border-radius: var(--r); font-size: 13px; font-weight: 500; z-index: 100;
  box-shadow: var(--shadow-lg);
}
#langBtn {
  height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
}
#langBtn:hover { color: var(--text); background: var(--surface-3); }
#langBtn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- drop zone ---------- */
.dz {
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  padding: 26px 20px; text-align: center; color: var(--text-2); cursor: pointer;
  background: var(--surface-2);
  transition: border-color .1s, background .1s;
}
.dz:hover { border-color: var(--accent); background: var(--accent-weak); }
.dz:focus-visible { outline: none; box-shadow: var(--ring); }
.dz svg { margin: 0 auto 8px; color: var(--text-3); }
.dz .t { font-size: 13.5px; font-weight: 500; color: var(--text); }
.dz .s { font-size: 12.5px; margin-top: 2px; }
.dz .s a { cursor: pointer; font-weight: 500; }
.dz.over { border-color: var(--accent); border-style: solid; background: var(--accent-weak); }
.dz.over svg { color: var(--accent); }
.dz.bad { border-color: var(--bad); color: var(--bad); }
#dropveil {
  position: fixed; inset: 10px; z-index: 90; display: none;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border: 1.5px dashed var(--accent); border-radius: var(--r-lg);
  align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--accent);
}
#dropveil.on { display: flex; }

/* progress bar, reused on the admin enrichment card */
.bar { height: 4px; border-radius: var(--r-full); background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brass-bright); transition: width .25s ease; }

/* meeting fields, revealed when a kartoitus is booked */
.meetbox { border-left: 2px solid var(--ok); padding-left: 10px; margin-top: 8px; }
.meetbox label:first-child { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* niche breakdown chips in the import preview */
.nichelist { display: flex; flex-wrap: wrap; gap: 5px; }
.nichelist .tag b { font-weight: 600; color: var(--text); margin-left: 2px; }
