/* Quillon Ops — кастом поверх Tailwind CDN */

:root {
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --muted: #64748b;
}

body { -webkit-font-smoothing: antialiased; }

/* --- nav --- */
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background: #f1f5f9; color: var(--ink); }
.nav-link.active { background: var(--brand); color: #fff; }

/* --- inputs / selects --- */
.input-field {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-field::placeholder { color: #94a3b8; }
.input-field:hover { border-color: #94a3b8; }
.input-field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
textarea.input-field { height: auto; padding: 8px 12px; line-height: 1.4; }

/* native <select> → убираем дефолтную стрелку ОС, рисуем свой chevron */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
select.input-field:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* date-пикеры */
input[type="date"].input-field { cursor: pointer; }
input[type="date"].input-field::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .55; transition: opacity .15s ease;
}
input[type="date"].input-field:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* --- buttons --- */
.btn-primary {
  height: 40px;
  padding: 0 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 2px 8px rgba(29, 78, 216, .28); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .5; cursor: default; }

.btn-secondary {
  height: 40px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }

/* --- badges --- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: lowercase;
  letter-spacing: .01em;
}
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red   { background: #fee2e2; color: #991b1b; }

/* --- воронка сделок (дашборд): name | bar | count | amount --- */
.funnel-row {
  display: grid;
  grid-template-columns: 190px 1fr 80px 120px;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}
/* воронка аналитики (лиды/сделки): name | bar | count */
.fbar {
  display: grid;
  grid-template-columns: 200px 1fr 96px;
  gap: 14px;
  align-items: center;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}
.funnel-bar {
  height: 10px;
  border-radius: 5px;
  background: #eef2ff;
  position: relative;
  overflow: hidden;
}
.funnel-bar > span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #1d4ed8, #60a5fa);
  border-radius: inherit;
  transition: width .4s ease;
}

/* --- дельта-чипы сравнения периодов --- */
.delta {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.summary-card .value .delta { margin-left: 8px; }
.delta-up   { color: #166534; background: #dcfce7; }
.delta-down { color: #991b1b; background: #fee2e2; }
.delta-flat { color: #64748b; background: #f1f5f9; }

/* --- summary / KPI cards --- */
.summary-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.summary-card:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .08); border-color: var(--border-strong); }
.summary-card h4 {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 6px;
}
.summary-card .value { font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.summary-card .sub { font-size: .75rem; color: var(--muted); margin-top: 5px; }

/* --- spinner --- */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- хронология клиента (timeline) --- */
.tl { border-left: 2px solid var(--border); padding-left: 16px; margin-left: 4px; }
.tl-item { position: relative; padding: 6px 0; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 9px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px #fff;
}
.tl-dot.tl-lead { background: #3b82f6; }
.tl-dot.tl-deal { background: #16a34a; }
.tl-body { min-width: 0; }
