

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --accent: #6366f1;
  --accent-600: #5b5ef0;
  --accent-700: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.35);

  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-hover: #f1f3f9;
  --sidebar-bg: #ffffff;
  --border: #e7e9f0;
  --border-strong: #d7dae6;

  --text: #1c2333;
  --text-muted: #5b6478;
  --text-faint: #8a91a3;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 4px 16px -4px rgba(16, 24, 40, 0.10), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.18);
  --shadow-pop: 0 12px 32px -8px rgba(16, 24, 40, 0.20);

  --green: #16a34a;   --green-soft: rgba(22,163,74,.12);
  --amber: #d97706;   --amber-soft: rgba(217,119,6,.14);
  --red: #dc2626;     --red-soft: rgba(220,38,38,.12);
  --blue: #2563eb;    --blue-soft: rgba(37,99,235,.12);
  --violet:#7c3aed;   --violet-soft: rgba(124,58,237,.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

[data-theme="dark"] {
  --bg: #0b0e16;
  --bg-elevated: #12151f;
  --surface: #151926;
  --surface-2: #1a1f2e;
  --surface-hover: #1f2434;
  --sidebar-bg: #0e111a;
  --border: #232838;
  --border-strong: #2d3346;

  --text: #e8eaf2;
  --text-muted: #9aa3b8;
  --text-faint: #6b7488;

  --accent: #818cf8;
  --accent-600: #6f7bf7;
  --accent-700: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --accent-glow: rgba(129, 140, 248, 0.35);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 8px 24px -6px rgba(0,0,0,.5);
  --shadow-lg: 0 28px 56px -16px rgba(0,0,0,.65);
  --shadow-pop: 0 16px 40px -10px rgba(0,0,0,.6);

  --green-soft: rgba(34,197,94,.16);
  --amber-soft: rgba(245,158,11,.18);
  --red-soft: rgba(248,113,113,.16);
  --blue-soft: rgba(96,165,250,.16);
  --violet-soft: rgba(167,139,250,.18);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-glow); }
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
input, select, textarea { font-family: inherit; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(1200px 600px at 15% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--violet-soft), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 38px 36px;
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 26px;
}
.auth-logo {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 8px 20px -6px var(--accent-glow);
}
.auth-brand .name { font-size: 17px; font-weight: 700; }
.auth-brand .sub { font-size: 12.5px; color: var(--text-muted); }
.auth-card h1 { font-size: 23px; margin-bottom: 6px; }
.auth-card .lede { color: var(--text-muted); margin: 0 0 26px; font-size: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px;
  transition: transform .08s, box-shadow .15s, background .15s, border-color .15s, color .15s;
  white-space: nowrap; user-select: none; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-600), var(--accent-700));
  color: #fff; box-shadow: 0 4px 14px -4px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { box-shadow: 0 6px 20px -4px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--text-faint); }
.btn-subtle { background: var(--surface-hover); color: var(--text); }
.btn-subtle:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon { padding: 9px; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

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

.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar-head { padding: 18px 18px 14px; display: flex; align-items: center; gap: 11px; }
.sidebar-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}
.sidebar-brand .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sidebar-brand .plan { font-size: 11.5px; color: var(--text-faint); text-transform: capitalize; }

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px; color: var(--text-muted);
  font-weight: 550; font-size: 13.5px; margin-bottom: 2px;
  transition: background .14s, color .14s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-item.active svg { opacity: 1; }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--surface-hover); color: var(--text-muted); padding: 1px 8px; border-radius: 20px; font-weight: 700; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.app-download { margin-bottom: 10px; }
.app-download-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); font-weight: 700; padding: 0 2px 6px; }
.app-download-btns { display: flex; gap: 8px; }
.app-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-size: 12.5px; font-weight: 600; transition: background .14s, border-color .14s;
}
.app-btn:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }
.app-btn svg { width: 16px; height: 16px; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px;
  transition: background .14s;
}
.user-chip:hover { background: var(--surface-hover); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}
.user-chip .who { min-width: 0; }
.user-chip .who .n { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who .e { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 16.5px; font-weight: 700; }
.topbar .page-sub { font-size: 12.5px; color: var(--text-muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  display: grid; place-items: center; transition: all .14s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }

.content { padding: 28px; flex: 1; max-width: 1320px; width: 100%; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }

.page-header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; }
.page-header p { color: var(--text-muted); margin: 4px 0 0; }
.page-header .spacer { flex: 1; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 18px 16px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat .stat-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat .stat-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent);
}
.stat .stat-ico svg { width: 19px; height: 19px; }
.stat .stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.stat .stat-value { font-size: 27px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.stat .stat-delta { font-size: 12px; margin-top: 6px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.stat .stat-delta.up { color: var(--green); }
.stat .stat-delta.down { color: var(--red); }
.stat .stat-delta.flat { color: var(--text-faint); }
.stat .spark { position: absolute; right: 14px; bottom: 12px; opacity: .5; }
.ico-green { background: var(--green-soft) !important; color: var(--green) !important; }
.ico-amber { background: var(--amber-soft) !important; color: var(--amber) !important; }
.ico-red   { background: var(--red-soft) !important; color: var(--red) !important; }
.ico-blue  { background: var(--blue-soft) !important; color: var(--blue) !important; }
.ico-violet{ background: var(--violet-soft) !important; color: var(--violet) !important; }

.ai-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 22px 28px;
  color: #fff;
  /* Themed banner: follows the workspace accent (brand) colour. */
  background: linear-gradient(120deg,
    var(--accent-700) 0%,
    var(--accent) 55%,
    var(--accent-600) 100%);
  box-shadow: 0 18px 48px -16px color-mix(in srgb, var(--accent) 55%, transparent);
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.ai-hero .hero-main { position: relative; flex: 1 1 340px; min-width: 0; }
.ai-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 90% -40%, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}
.ai-hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; opacity: .9; background: rgba(255,255,255,.16); padding: 4px 11px; border-radius: 20px; margin-bottom: 14px; }
.ai-hero h2 { font-size: 25px; margin-bottom: 8px; position: relative; }
.ai-hero p { opacity: .92; margin: 0; max-width: 60ch; position: relative; font-size: 14.5px; }
.ai-hero .hero-cta { margin-top: 0; display: flex; gap: 10px; position: relative; flex-wrap: wrap; flex: none; }
.ai-hero .btn-glass { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(4px); }
.ai-hero .btn-glass:hover { background: rgba(255,255,255,.26); }
.ai-hero .btn-white { background: #fff; color: var(--accent-700); }

.priorities { display: flex; flex-direction: column; gap: 2px; }
.priority {
  display: flex; align-items: flex-start; gap: 13px; padding: 13px 8px;
  border-bottom: 1px solid var(--border);
}
.priority:last-child { border-bottom: none; }
.priority .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.priority .dot.high { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.priority .dot.medium { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.priority .dot.low { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.priority .ptext { font-size: 13.5px; flex: 1; }
.priority .sev { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 20px; }
.sev.high { background: var(--red-soft); color: var(--red); }
.sev.medium { background: var(--amber-soft); color: var(--amber); }
.sev.low { background: var(--green-soft); color: var(--green); }

.ai-rec {
  margin-top: 14px; padding: 13px 15px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
}
.ai-rec svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 20px;
  background: var(--surface-hover); color: var(--text-muted); line-height: 1.5;
}
.badge .pip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-hot { background: var(--red-soft); color: var(--red); }
.badge-warm { background: var(--amber-soft); color: var(--amber); }
.badge-cold { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-live { background: var(--green-soft); color: var(--green); }
.badge-preview { background: var(--amber-soft); color: var(--amber); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); font-weight: 700; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .lead-name { font-weight: 650; color: var(--text); }
table.data .muted { color: var(--text-muted); }
.cell-actions { text-align: right; white-space: nowrap; }

/* Invoice line-item editor: tighter cells + no number spinners so narrow
   Qty / GST fields actually show their values. */
#inv-items tbody td { padding: 8px 6px; }
#inv-items tbody td:first-child { padding-left: 4px; }
#inv-items .input { padding: 9px 10px; }
#inv-items input[type=number] {
  padding: 9px 6px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
#inv-items input[type=number]::-webkit-outer-spin-button,
#inv-items input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.row-id { font-variant-numeric: tabular-nums; color: var(--text-faint); font-size: 12.5px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  position: relative; flex: 1; max-width: 360px; min-width: 200px;
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); }
.search input { padding-left: 38px; }
.chip-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--surface);
  transition: all .14s;
}
.chip:hover { border-color: var(--text-faint); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.empty { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty .empty-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-hover); display: grid; place-items: center; margin: 0 auto 16px; }
.empty .empty-ico svg { width: 26px; height: 26px; color: var(--text-faint); }
.empty h3 { margin-bottom: 6px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,14,22,.5); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 7vh 20px 20px;
  opacity: 0; transition: opacity .2s;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(10px) scale(.98); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.modal-overlay.open .modal { transform: none; }
/* When a form wraps the body + footer, it must flex so .modal-body can scroll. */
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-head h3 { font-size: 17px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }

.copilot-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; box-shadow: 0 14px 34px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.2);
  display: grid; place-items: center; transition: transform .18s, box-shadow .18s;
}
.copilot-fab:hover { transform: translateY(-2px) scale(1.04); }
.copilot-fab svg { width: 24px; height: 24px; }

.copilot-panel {
  position: fixed; top: 0; right: 0; height: 100vh; width: 400px; max-width: 92vw; z-index: 70;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.copilot-panel.open { transform: none; }
.copilot-head {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.copilot-head .cp-logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,var(--accent),var(--violet)); color:#fff; display: grid; place-items: center; }
.copilot-head .cp-logo svg { width: 18px; height: 18px; }
.copilot-head .t { font-weight: 700; font-size: 14.5px; }
.copilot-head .s { font-size: 11.5px; color: var(--text-muted); }
.copilot-head .close { margin-left: auto; }

.copilot-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.cp-msg { display: flex; gap: 10px; max-width: 92%; }
.cp-msg .cp-av { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.cp-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.cp-msg.user .cp-av { background: var(--surface-hover); color: var(--text-muted); }
.cp-msg.bot .cp-av { background: linear-gradient(135deg,var(--accent),var(--violet)); color: #fff; }
.cp-bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.cp-msg.user .cp-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cp-msg.bot .cp-bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cp-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.cp-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: blink 1.2s infinite; }
.cp-typing span:nth-child(2){ animation-delay:.2s } .cp-typing span:nth-child(3){ animation-delay:.4s }
@keyframes blink { 0%,60%,100%{opacity:.25; transform:translateY(0)} 30%{opacity:1; transform:translateY(-3px)} }
.copilot-suggest { padding: 0 18px 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.copilot-suggest button { font-size: 12px; padding: 6px 11px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); }
.copilot-suggest button:hover { border-color: var(--accent); color: var(--accent); }
.copilot-foot { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; gap: 9px; align-items: flex-end; }
.copilot-foot textarea { flex: 1; resize: none; max-height: 120px; min-height: 42px; }

.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kan-col { flex: none; width: 290px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kan-col-head { padding: 13px 15px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.kan-col-head .k-dot { width: 9px; height: 9px; border-radius: 50%; }
.kan-col-head .k-title { font-weight: 700; font-size: 13px; }
.kan-col-head .k-count { margin-left: auto; font-size: 11.5px; background: var(--surface-hover); color: var(--text-muted); padding: 1px 9px; border-radius: 20px; font-weight: 700; }
.kan-list { padding: 11px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; }
.kan-list.drag-over { background: var(--accent-soft); border-radius: 12px; }
.kan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .14s, transform .14s, border-color .14s;
}
.kan-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.kan-card.dragging { opacity: .5; }
.kan-card .kc-name { font-weight: 650; font-size: 13.5px; margin-bottom: 5px; }
.kan-card .kc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-muted); font-size: 12px; }
.kan-card .kc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.kan-card .kc-amount { font-weight: 700; font-size: 13px; }

.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.detail-row { display: flex; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .dl { width: 130px; flex: none; color: var(--text-muted); font-weight: 600; }
.detail-row .dv { flex: 1; font-weight: 550; }

.timeline { position: relative; padding-left: 8px; }
.tl-item { position: relative; padding: 0 0 20px 26px; }
.tl-item::before { content:""; position: absolute; left: 5px; top: 4px; bottom: -4px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-item .tl-dot { position: absolute; left: 0; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); }
.tl-item .tl-title { font-weight: 650; font-size: 13.5px; }
.tl-item .tl-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.tl-item .tl-body { font-size: 13px; color: var(--text-muted); margin-top: 5px; }

.score-gauge { display: flex; align-items: center; gap: 16px; }
.gauge-ring {
  width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center;
  position: relative;
}
.gauge-ring .gv { font-size: 24px; font-weight: 800; }
.gauge-ring .gl { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.score-meta { flex: 1; font-size: 13px; }
.score-meta .row { display: flex; justify-content: space-between; padding: 4px 0; }
.score-meta .row .l { color: var(--text-muted); }
.score-reasons { margin: 12px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
.score-reasons li { display: flex; gap: 8px; padding: 5px 0; color: var(--text-muted); }
.score-reasons li svg { width: 15px; height: 15px; color: var(--accent); flex: none; margin-top: 2px; }

.ai-draft { margin-top: 14px; }
.ai-draft .draft-out { margin-top: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; white-space: pre-wrap; line-height: 1.55; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1 / .92; border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  display: flex; flex-direction: column; background: var(--surface-2); position: relative; min-height: 64px;
}
.cal-day.empty-day { background: transparent; border-color: transparent; }
.cal-day .d-num { font-size: 12.5px; font-weight: 650; color: var(--text-muted); }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-day .d-tag { margin-top: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; align-self: flex-start; }
.d-present { background: var(--green-soft); color: var(--green); }
.d-absent { background: var(--red-soft); color: var(--red); }
.d-leave { background: var(--amber-soft); color: var(--amber); }
.d-off { background: var(--surface-hover); color: var(--text-faint); }

.punch-card { text-align: center; }
.punch-clock { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.punch-date { color: var(--text-muted); margin-bottom: 18px; }
.geo-readout { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); display: flex; gap: 7px; align-items: center; justify-content: center; }
.geo-readout svg { width: 15px; height: 15px; color: var(--accent); }

.setting-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row .si { flex: 1; }
.setting-row .si .st { font-weight: 650; font-size: 14px; }
.setting-row .si .sd { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 30px; transition: background .18s; cursor: pointer; }
.switch .track::before { content:""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(19px); }

.token-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.token-row:last-child { border-bottom: none; }
.token-row code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }

.toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px;
  box-shadow: var(--shadow-pop); font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 9px;
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1) both;
}
.toast.ok { background: var(--green); color: #fff; }
.toast.err { background: var(--red); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.alert { padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-info { background: var(--blue-soft); color: var(--blue); }
.alert-success { background: var(--green-soft); color: var(--green); }

.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 18px; } .mb-3 { margin-bottom: 12px; }
.muted { color: var(--text-muted); } .faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; } .text-lg { font-size: 16px; }
.fw-700 { font-weight: 700; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.tab-spacer { flex: 1; }

@media (max-width: 1024px) {
  .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; display: none; }
  .sidebar-backdrop.show { display: block; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
  .page-header h1 { font-size: 21px; }
}

.usage-bar { height: 9px; border-radius: 20px; background: var(--surface-hover); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent-600), var(--accent-700)); transition: width .3s; }
.usage-bar span.full { background: linear-gradient(90deg, var(--amber), var(--red)); }

.plan-card { transition: transform .16s, box-shadow .16s, border-color .16s; }
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plan-price { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 2px; }

.code-block {
  margin: 0; padding: 13px 14px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border); font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px; line-height: 1.5; color: var(--text); overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

.wa-thread { display: flex; flex-direction: column; gap: 12px; max-height: 56vh; overflow-y: auto; }
.wa-msg { max-width: 76%; }
.wa-msg.out { align-self: flex-end; text-align: right; }
.wa-msg.in { align-self: flex-start; }
.wa-bubble { display: inline-block; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; text-align: left; }
.wa-msg.out .wa-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.wa-msg.in .wa-bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.wa-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; }

.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid var(--border); }
.inv-from-name { font-size: 18px; font-weight: 800; }
.inv-title { font-size: 22px; font-weight: 800; letter-spacing: .12em; color: var(--accent); }
.inv-parties { display: flex; justify-content: space-between; gap: 24px; padding: 22px 0; flex-wrap: wrap; }
.inv-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 700; margin-bottom: 4px; display: block; }
.inv-meta-row { display: flex; justify-content: flex-end; gap: 18px; font-size: 13px; padding: 2px 0; }
.inv-meta-row .inv-label { margin: 0; align-self: center; }
.inv-totals { display: flex; justify-content: flex-end; margin-top: 18px; }
.inv-totals-box { width: 280px; max-width: 100%; }
.inv-totals-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.inv-totals-box .row .l { color: var(--text-muted); }
.inv-totals-box .row.grand { border-top: 2px solid var(--border); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 800; }
.inv-notes { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* --- Invoice templates --- */
.invoice-sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Simple black & white — strip all colour from the sheet. */
.invoice-sheet.tpl-bw { filter: grayscale(1); }
.invoice-sheet.tpl-bw .inv-title { color: #111; }

/* Three-column header: bill-from | bill-to (centre) | invoice + dates (right). */
.inv-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; padding-bottom: 22px; border-bottom: 2px solid var(--border); }
/* Bill-to sits in the middle column, but its text stays left-aligned. */
.inv-3col .inv-3col-center { text-align: left; }
.inv-3col .inv-3col-dates { margin-top: 12px; }
.inv-3col .inv-meta-row { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) { .inv-3col { grid-template-columns: 1fr; } }

/* Template picker in invoice settings */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tpl-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tpl-option:hover { border-color: var(--border-strong); }
.tpl-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tpl-option input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-name { font-size: 13px; font-weight: 650; text-align: center; }
.tpl-preview { width: 100%; height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.tpl-preview .bar { height: 6px; border-radius: 3px; background: #d7d9e0; }
.tpl-preview .bar.h { height: 10px; width: 55%; background: #9aa0ad; }
.tpl-preview-classic .bar.h { background: var(--accent); }
.tpl-preview-bw .bar.h { background: #333; }
.tpl-preview-bw .bar:not(.h) { background: #c9ccd3; }
.tpl-preview-threecol { flex-direction: row; align-items: stretch; gap: 6px; }
.tpl-preview-threecol .tcol { flex: 1; border-radius: 4px; background: #e2e4ea; }
.tpl-preview-threecol .tcol-mid { background: #cfd2da; }

@media print {
  .sidebar, .topbar, .copilot-fab, .copilot-panel, .no-print, .sidebar-backdrop { display: none !important; }
  body { background: #fff; }
  .app, .main, .content { display: block; max-width: none; margin: 0; padding: 0; }
  .content { padding: 0 !important; }
  .invoice-sheet { border: none !important; box-shadow: none !important; }
  .doc-sheet { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .table-wrap { border: none !important; }
}

.notif { position: relative; }
.notif-bell { position: relative; overflow: visible; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.notif-badge.hidden { display: none; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); z-index: 60; overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.notif-head .t { font-weight: 700; font-size: 14px; }
.notif-head .spacer { flex: 1; }
.notif-readall { background: transparent; border: none; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 22px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .14s; text-align: left; width: 100%; background: transparent; border-left: 0; border-right: 0; border-top: 0;
}
.notif-item:hover { background: var(--surface-hover); }
.notif-item.is-unread { background: var(--accent-soft); }
.notif-item.is-unread:hover { background: var(--accent-soft); }
.notif-item .it-title { font-weight: 650; font-size: 13px; }
.notif-item .it-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.notif-item .it-time { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--text-faint); }
.notif-dot-info { background: var(--blue); }
.notif-dot-success, .notif-dot-ok { background: var(--green); }
.notif-dot-warn { background: var(--amber); }
.notif-dot-error { background: var(--red); }
.notif-viewall { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 600; color: var(--accent); border-top: 1px solid var(--border); }
.notif-viewall:hover { background: var(--surface-hover); }

.notif-item-full { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.notif-item-full:last-child { border-bottom: none; }
.notif-item-full.is-unread { background: var(--accent-soft); }
.notif-item-full .notif-dot { margin-top: 6px; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 650; font-size: 14px; }
.notif-item-text { font-size: 13px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.notif-item-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.notif-item-meta a { color: var(--accent); font-weight: 600; }

.section-title { margin: 6px 0 14px; }
.section-title h2 { font-size: 16px; font-weight: 700; }
.section-title p { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

.notif-grid { grid-template-columns: 1fr; gap: 16px; }
.notif-event .card-head h3 { font-size: 14px; }
.notif-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-ch { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all .14s; }
.notif-ch:hover { border-color: var(--text-faint); color: var(--text); }
.notif-ch input { accent-color: var(--accent); }
.notif-editors { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.notif-editors > summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--accent); list-style: none; }
.notif-editors > summary::-webkit-details-marker { display: none; }
.notif-editors > summary::before { content: "＋ "; }
.notif-editors[open] > summary::before { content: "－ "; }
.notif-editors-body { margin-top: 14px; display: grid; gap: 16px; }
.notif-editor { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.notif-editor-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text-faint); margin-bottom: 10px; }
.notif-divider { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--text-faint); }
.notif-divider::before, .notif-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

svg { width: 18px; height: 18px; flex: none; }
.empty .empty-ico svg { width: 26px; height: 26px; }
.copilot-fab svg { width: 22px; height: 22px; }
.ai-hero .eyebrow svg { width: 14px; height: 14px; }
.card-head svg { width: 18px; height: 18px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.pager-count { font-size: 12.5px; color: var(--text-muted); }
.pager-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-links .is-disabled { opacity: .45; pointer-events: none; cursor: default; }
.pager-gap { padding: 0 4px; color: var(--text-faint); font-size: 13px; }

.tut-intro { align-items: center; }
.tut-section { margin-top: 26px; }
.tut-grid { margin-top: 4px; }
.tut-card { height: 100%; }
.tut-card .card-pad { display: flex; flex-direction: column; height: 100%; }
.tut-step-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tut-step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.tut-step-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); }
.tut-step-ico svg { width: 18px; height: 18px; }
.tut-step-title { font-size: 14.5px; font-weight: 700; }
.tut-step-text { font-size: 13px; line-height: 1.55; margin: 8px 0 14px; flex: 1; }
.tut-video-empty { display: flex; align-items: center; gap: 16px; }

.badge-red { background: var(--red-soft); color: var(--red); }
.task-overdue { color: var(--red); font-weight: 700; }
.task-today { color: var(--amber); font-weight: 700; }
tr.task-done .lead-name { text-decoration: line-through; color: var(--text-faint); }
.stat-link { display: block; height: 100%; text-decoration: none; color: inherit; transition: transform .12s; }
.stat-link:hover { transform: translateY(-2px); }
/* Cards fill their (equal-height) grid cell so every box in a row is the same height. */
.grid .stat { height: 100%; }
.import-steps { margin: 0 0 4px; padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--text); }
.import-steps li { margin-bottom: 4px; }

/* File dropzone (scan card / uploads) */
/* Outranks the generic `.field label { display:block }` rule (0,2,1 > 0,1,1). */
.field label.file-drop,
label.file-drop {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 22px 20px; margin: 0; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.file-drop:hover { border-color: var(--accent); background: var(--surface); }
.file-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.file-drop-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.file-drop-icon svg { width: 22px; height: 22px; }
.file-drop-main { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-word; }
.file-drop-hint { font-size: 12px; color: var(--text-faint); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--surface); }
.file-drop.has-file .file-drop-icon { background: var(--green-soft); color: var(--green); }
.file-drop.is-disabled { cursor: not-allowed; opacity: .6; }
.file-drop.is-disabled:hover { border-color: var(--border-strong); background: var(--surface-2); }
.lead-tasks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.lead-task { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.lead-task:last-child { border-bottom: none; padding-bottom: 0; }

.report-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.report-label { width: 110px; flex: none; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-track { flex: 1; height: 16px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.report-bar { height: 100%; border-radius: 8px; min-width: 2px; transition: width .25s ease; }
.report-val { width: 48px; flex: none; text-align: right; font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bar-blue { background: var(--blue); }
.bar-violet { background: var(--violet); }
.bar-amber { background: var(--amber); }
.bar-green { background: var(--green); }
.bar-red { background: var(--red); }

.report-columns { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.report-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.report-col-val { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.report-col-bar { width: 60%; max-width: 46px; background: var(--accent); border-radius: 8px 8px 0 0; transition: height .25s ease; }
.report-col-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; }

.cal-day-events { aspect-ratio: auto; min-height: 96px; align-items: stretch; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow: hidden; }
.cal-chip { display: block; font-size: 10.5px; font-weight: 650; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.chip-meeting { background: var(--violet-soft); color: var(--violet); }
.chip-task { background: var(--amber-soft); color: var(--amber); }
.chip-follow { background: var(--blue-soft); color: var(--blue); }
.chip-holiday { background: var(--green-soft); color: var(--green); }
.cal-day.is-holiday { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.cal-legend { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; margin-right: 2px; }

.doc-sheet { background: #fff; color: #111; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 48px; max-width: 820px; margin: 0 auto; }
.doc-text { font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; margin: 0; color: #111; }
