/* =========================================================
   Brīnumpalīgs — kopīgais stils visām lietotnes lapām.
   Tumšā tēma, kas saskan ar landing page (zelts uz tumši zila).
   Lapas atšķir body klase: .p-form / .p-login / .p-queue / .p-lead
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Hanken+Grotesk:wght@400..700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  /* Pamats (no landing page paletes) */
  --bg: #0e1024;
  --bg-grad-1: #191c42;
  --bg-grad-2: #211f3f;
  --surface: #171a38;
  --surface-2: #1e2247;
  --surface-3: #262a55;
  --ink: #ecedfb;
  --ink-soft: #c3c4e6;
  --ink-faint: #9698c6;
  --line: #2a2e57;
  --line-strong: #3c4178;

  /* Akcenti */
  --gold: #f6c56b;
  --gold-ink: #f8d08a;
  --gold-deep: #e5a93f;
  --gold-soft: rgba(246, 197, 107, 0.13);
  --brand: #8c8df2;
  --brand-soft: rgba(140, 141, 242, 0.13);

  /* Stāvokļi */
  --ok: #7fe0c0;
  --ok-soft: #163328;
  --ok-line: #2c5c45;
  --err: #ff8a82;
  --err-soft: #3a1f29;
  --err-line: #6b3340;

  /* Statusu krāsu kods (rinda + pieteikums) */
  --st-new: #b3a6ff;
  --st-new-soft: #21244a;
  --st-new-line: #3c4178;
  --st-draft: #f8d08a;
  --st-draft-soft: #36300f;
  --st-draft-line: #6b561f;
  --st-ok: #7fe0c0;
  --st-ok-soft: #163328;
  --st-ok-line: #2c5c45;
  --st-rej: #b7b1cc;
  --st-rej-soft: #25274a;
  --st-rej-line: #3f3f63;
  --st-blue: #7cc4ff;
  --st-blue-soft: #13283f;
  --st-blue-line: #2a4d6e;
  --st-fail: #ff8a82;
  --st-fail-soft: #3a1f29;
  --st-fail-line: #6b3340;

  /* Forma / izmēri */
  --radius: 20px;
  --radius-sm: 13px;
  --radius-xs: 9px;
  --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
  --shadow-soft: 0 10px 30px -16px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --speed: 0.5s;

  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-head: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(1100px 620px at 14% -10%, var(--bg-grad-1), transparent 58%),
    radial-gradient(900px 540px at 100% 0%, var(--bg-grad-2), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   Kopīgie komponenti
   ========================================================= */

/* Zīmols */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}

.brand__mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__name {
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.brand__tag {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* Iziet poga (admin) */
.logout {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.logout:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: var(--surface-2);
}

/* Augšjosla (admin) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 4vw, 32px);
  animation: rise var(--speed) var(--ease) both;
}

/* Statusa nozīmīte */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-2);
  vertical-align: middle;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge--new { color: var(--st-new); background: var(--st-new-soft); border-color: var(--st-new-line); }
.badge--draft_ready { color: var(--st-draft); background: var(--st-draft-soft); border-color: var(--st-draft-line); }
.badge--approved { color: var(--st-ok); background: var(--st-ok-soft); border-color: var(--st-ok-line); }
.badge--rejected { color: var(--st-rej); background: var(--st-rej-soft); border-color: var(--st-rej-line); }
.badge--contacted { color: var(--st-blue); background: var(--st-blue-soft); border-color: var(--st-blue-line); }
.badge--draft_failed { color: var(--st-fail); background: var(--st-fail-soft); border-color: var(--st-fail-line); }

/* Pakalpojuma nozīmīte (service_label) — neitrāla, bez statusa punkta */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-2);
  vertical-align: middle;
}

/* Stāvokļi: tukšs / ielāde / kļūda */
.state {
  text-align: center;
  padding: clamp(36px, 8vw, 64px) 20px;
  color: var(--ink-faint);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.state h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.state p {
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.state p:last-child {
  margin-bottom: 0;
}

.state--error {
  border-style: solid;
  border-color: var(--err-line);
  background: var(--err-soft);
  color: var(--err);
}

.state--error h2 {
  color: var(--err);
}

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.2s var(--ease) infinite;
}

/* Animācijas */
@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rot {
  to { transform: rotate(360deg); }
}

/* =========================================================
   Publiskā anketa (.p-form)  —  public/index.html
   ========================================================= */
body.p-form {
  display: flex;
  flex-direction: column;
}

.p-form .page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 5vw, 24px) 56px;
  flex: 1;
}

.p-form .brand {
  margin-bottom: clamp(20px, 4vw, 34px);
}

.p-form .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.p-form .card__head {
  padding: clamp(22px, 5vw, 32px) clamp(20px, 5vw, 34px) 0;
}

.p-form .intro {
  margin: 0 0 clamp(18px, 4vw, 26px);
}

.p-form .intro h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  line-height: 1.15;
}

.p-form .intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* Soļu indikators */
.p-form .steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 4vw, 28px);
}

.p-form .steps__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-form .steps__bar {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}

.p-form .steps__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transition: width var(--speed) var(--ease);
}

.p-form .steps__item.is-done .steps__bar::after,
.p-form .steps__item.is-active .steps__bar::after {
  width: 100%;
}

.p-form .steps__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  transition: color 0.3s ease;
}

.p-form .steps__item.is-active .steps__label,
.p-form .steps__item.is-done .steps__label {
  color: var(--gold-ink);
}

@media (max-width: 460px) {
  .p-form .steps__label { display: none; }
}

/* Soļa saturs */
.p-form .card__body {
  padding: 0 clamp(20px, 5vw, 34px);
  position: relative;
}

.p-form .step {
  display: none;
  animation: stepIn var(--speed) var(--ease);
}

.p-form .step.is-active {
  display: block;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.p-form .step__title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.p-form .step__hint {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Lauki */
.p-form .field {
  margin-bottom: 18px;
}

.p-form .field:last-child {
  margin-bottom: 0;
}

.p-form .field > label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 7px;
}

.p-form .field .opt {
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.p-form .field__help {
  margin: -3px 0 9px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.p-form input[type="text"],
.p-form input[type="email"],
.p-form input[type="tel"],
.p-form input[type="number"],
.p-form select,
.p-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.p-form textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.p-form input::placeholder,
.p-form textarea::placeholder {
  color: var(--ink-faint);
}

.p-form input:focus,
.p-form select:focus,
.p-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(246, 197, 107, 0.18);
  background: var(--surface);
}

.p-form .field.has-error input,
.p-form .field.has-error select,
.p-form .field.has-error textarea {
  border-color: var(--err);
  box-shadow: 0 0 0 4px var(--err-soft);
}

.p-form .field__error {
  display: none;
  margin-top: 7px;
  font-size: 0.82rem;
  color: var(--err);
  font-weight: 500;
}

.p-form .field.has-error .field__error {
  display: block;
}

.p-form .row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 460px) {
  .p-form .row { grid-template-columns: 1fr; }
}

.p-form .row--three {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 560px) {
  .p-form .row--three { grid-template-columns: 1fr; }
}

/* Biežuma pilles */
.p-form .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.p-form .pill {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  min-width: 96px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease;
}

.p-form .pill:hover {
  color: var(--ink);
  border-color: var(--gold-deep);
}

.p-form .pill:active {
  transform: translateY(1px) scale(0.99);
}

.p-form .pill.is-active {
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 55%, var(--gold-deep));
  border-color: transparent;
  color: #241a05;
  box-shadow: 0 10px 24px -14px rgba(246, 197, 107, 0.55);
}

/* Dzīvais teikumu skaitītājs */
.p-form .field__count {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}

.p-form .field__count.is-ok {
  color: var(--ok);
}

.p-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239698c6' stroke-width='2.4' 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 14px center;
  padding-right: 38px;
}

/* Ietaupījuma aprēķins */
.p-form .calc {
  margin-top: 22px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--gold-soft), transparent 140%);
  padding: 18px 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.p-form .calc.is-empty {
  opacity: 0.55;
}

.p-form .calc__lead {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.p-form .calc__big {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--gold-ink);
}

.p-form .calc__big span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.p-form .calc__days {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.p-form .calc__days b {
  color: var(--gold-ink);
}

.p-form .calc__sub {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.p-form .calc__sub b {
  color: var(--ink);
}

.p-form .calc__cost {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.p-form .calc__cost b {
  color: var(--ink);
}

.p-form .calc__note {
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* Apakša / pogas */
.p-form .card__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(18px, 4vw, 26px) clamp(20px, 5vw, 34px);
  margin-top: clamp(20px, 4vw, 28px);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.p-form .btn {
  font: inherit;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s ease, box-shadow 0.2s ease,
    color 0.2s ease, border-color 0.2s ease;
}

.p-form .btn:active {
  transform: translateY(1px) scale(0.99);
}

.p-form .btn--primary {
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 55%, var(--gold-deep));
  color: #241a05;
  box-shadow: 0 12px 28px -14px rgba(246, 197, 107, 0.55);
  margin-left: auto;
}

.p-form .btn--primary:hover {
  box-shadow: 0 16px 34px -14px rgba(246, 197, 107, 0.7);
  filter: brightness(1.03);
}

.p-form .btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}

.p-form .btn--ghost:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.p-form .btn[hidden] {
  display: none;
}

.p-form .btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* Spinner (tumšs uz zelta) */
.p-form .spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid rgba(36, 26, 5, 0.35);
  border-top-color: #241a05;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}

/* Iznākuma ekrāni */
.p-form .result {
  display: none;
  text-align: center;
  padding: clamp(34px, 8vw, 56px) clamp(22px, 6vw, 40px);
  animation: stepIn 0.5s var(--ease);
}

.p-form .result.is-active {
  display: block;
}

.p-form .result__icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}

.p-form .result__icon svg {
  width: 34px;
  height: 34px;
}

.p-form .result--ok .result__icon {
  background: rgba(127, 224, 192, 0.14);
  color: var(--ok);
}

.p-form .result--err .result__icon {
  background: var(--err-soft);
  color: var(--err);
}

.p-form .result h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 5vw, 1.7rem);
}

.p-form .result p {
  margin: 0 auto;
  max-width: 38ch;
  color: var(--ink-soft);
}

.p-form .result__actions {
  margin-top: 26px;
}

/* Atbildes laika solījums (4. solis) */
.p-form .sla {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--gold-soft);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.p-form .sla svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--gold-ink);
}

.p-form .sla b {
  color: var(--ink);
}

/* «Kas notiek tālāk» soļi pateicības ekrānā */
.p-form .next-steps {
  list-style: none;
  margin: 26px auto 0;
  padding: 0;
  max-width: 42ch;
  text-align: left;
  display: grid;
  gap: 14px;
}

.p-form .next-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.p-form .next-steps__num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #241a05;
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 55%, var(--gold-deep));
}

.p-form .result__contact {
  margin-top: 24px;
  font-size: 0.9rem;
}

.p-form .result__contact a,
.p-form .result__links a,
.p-form .result--err a {
  color: var(--gold-ink);
  font-weight: 600;
  text-decoration: none;
}

.p-form .result__contact a:hover,
.p-form .result__links a:hover,
.p-form .result--err a:hover {
  text-decoration: underline;
}

.p-form .result__links {
  margin-top: 18px;
  font-size: 0.92rem;
}

.p-form .check svg circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: draw 0.6s var(--ease) 0.1s forwards;
}

.p-form .check svg path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: draw 0.4s var(--ease) 0.5s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.p-form .foot-note {
  text-align: center;
  margin-top: 22px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* =========================================================
   Pieslēgšanās (.p-login)  —  admin/login.html
   ========================================================= */
body.p-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 48px) clamp(16px, 5vw, 24px);
}

.p-login .wrap {
  width: 100%;
  max-width: 400px;
  animation: rise var(--speed) var(--ease) both;
}

.p-login .brand {
  justify-content: center;
  margin-bottom: clamp(20px, 4vw, 28px);
}

.p-login .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(26px, 6vw, 36px);
  position: relative;
  overflow: hidden;
}

.p-login .card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

.p-login .card__head {
  margin-bottom: 22px;
}

.p-login .card__head h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.p-login .card__head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.p-login .alert {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--err-soft);
  border: 1px solid var(--err-line);
  color: var(--err);
  font-size: 0.88rem;
  font-weight: 500;
}

.p-login .alert svg {
  width: 18px;
  height: 18px;
  flex: none;
}

body.p-login.is-error .alert {
  display: flex;
  animation: shake 0.5s var(--ease);
}

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

.p-login .field {
  margin-bottom: 16px;
}

.p-login .field > label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 7px;
}

.p-login input[type="text"],
.p-login input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.p-login input::placeholder {
  color: var(--ink-faint);
}

.p-login input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(246, 197, 107, 0.18);
  background: var(--surface);
}

body.p-login.is-error input {
  border-color: var(--err-line);
}

.p-login .btn {
  width: 100%;
  font: inherit;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  color: #241a05;
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 12px 28px -14px rgba(246, 197, 107, 0.55);
  transition: transform 0.15s var(--ease), box-shadow 0.2s ease, filter 0.2s ease;
  margin-top: 6px;
}

.p-login .btn:hover {
  box-shadow: 0 16px 34px -14px rgba(246, 197, 107, 0.7);
  filter: brightness(1.04);
}

.p-login .btn:active {
  transform: translateY(1px) scale(0.99);
}

.p-login .btn:disabled {
  opacity: 0.7;
  cursor: progress;
}

.p-login .spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(36, 26, 5, 0.35);
  border-top-color: #241a05;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}

.p-login .foot-note {
  text-align: center;
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* =========================================================
   Pieteikumu rinda (.p-queue)  —  admin/queue.html
   ========================================================= */
.p-queue .shell {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 5vw, 28px) 64px;
}

.p-queue .head {
  margin-bottom: 20px;
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.04s;
}

.p-queue .head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
}

.p-queue .head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Filtri */
.p-queue .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.08s;
}

.p-queue .chip {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease,
    transform 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.p-queue .chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.p-queue .chip:active {
  transform: scale(0.97);
}

.p-queue .chip[aria-pressed="true"] {
  color: #241a05;
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 60%, var(--gold-deep));
  border-color: transparent;
  box-shadow: 0 10px 24px -14px rgba(246, 197, 107, 0.55);
}

.p-queue .chip__count {
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.8;
}

/* Rinda */
.p-queue .queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p-queue .lead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 18px;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s var(--ease), border-color 0.2s ease, box-shadow 0.2s ease,
    background 0.2s ease;
  animation: rise 0.45s var(--ease) both;
}

.p-queue .lead:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: 0 22px 44px -26px rgba(0, 0, 0, 0.85);
}

.p-queue .lead:active {
  transform: translateY(0);
}

.p-queue .lead__main {
  min-width: 0;
}

.p-queue .lead__name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-queue .lead__company {
  color: var(--ink-soft);
  font-weight: 500;
}

.p-queue .lead__meta {
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.p-queue .lead__meta b {
  color: var(--ink-soft);
  font-weight: 600;
}

.p-queue .lead__side {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
}

.p-queue .lead__id {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.p-queue .skeleton {
  height: 76px;
}

@media (max-width: 540px) {
  .p-queue .lead { grid-template-columns: 1fr; }
  .p-queue .lead__side { justify-content: space-between; }
}

/* =========================================================
   Viens pieteikums (.p-lead)  —  admin/lead.html
   ========================================================= */
.p-lead .shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 5vw, 28px) 80px;
}

.p-lead .topbar {
  margin-bottom: clamp(18px, 3vw, 26px);
}

/* Atpakaļ saite */
.p-lead .back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s ease, gap 0.2s var(--ease);
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.03s;
}

.p-lead .back:hover {
  color: var(--ink);
  gap: 10px;
}

.p-lead .back svg {
  width: 16px;
  height: 16px;
}

/* Lapas galva */
.p-lead .head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.06s;
}

.p-lead .head__title {
  min-width: 0;
}

.p-lead .head__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
}

.p-lead .head__meta {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.p-lead .head__meta b {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Darbību josla */
.p-lead .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.p-lead .btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  transition: transform 0.15s var(--ease), border-color 0.2s ease, background 0.2s ease,
    color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.p-lead .btn:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

.p-lead .btn:active {
  transform: scale(0.97);
}

.p-lead .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.p-lead .btn--primary {
  color: #241a05;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-ink), var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 12px 26px -16px rgba(246, 197, 107, 0.6);
}

.p-lead .btn--primary:hover {
  background: linear-gradient(135deg, var(--gold-ink), var(--gold-ink) 60%, var(--gold));
  border-color: transparent;
}

.p-lead .btn--ok {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-soft);
}

.p-lead .btn--ok:hover {
  color: #d6ffee;
  border-color: var(--ok);
  background: var(--ok-soft);
}

.p-lead .btn--danger {
  color: var(--err);
  border-color: var(--err-line);
  background: var(--err-soft);
}

.p-lead .btn--danger:hover {
  color: #ffd6d2;
  border-color: var(--err);
  background: var(--err-soft);
}

.p-lead .btn .spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: rot 0.7s linear infinite;
  display: none;
}

.p-lead .btn.is-busy .spin {
  display: inline-block;
}

/* Divkolonu izkārtojums */
.p-lead .grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(16px, 2.4vw, 26px);
  align-items: start;
}

.p-lead .col__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

/* Anketa (kreisā puse) */
.p-lead .brief {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 26px);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 20px;
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.1s;
}

.p-lead .brief__group + .brief__group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.p-lead .brief__group h3 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.p-lead .field {
  margin: 0 0 14px;
}

.p-lead .field:last-child {
  margin-bottom: 0;
}

.p-lead .field__k {
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-bottom: 2px;
}

.p-lead .field__v {
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.p-lead .field__v a {
  color: var(--gold);
  text-decoration: none;
}

.p-lead .field__v a:hover {
  text-decoration: underline;
}

/* Skaitļu režģis */
.p-lead .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.p-lead .stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 11px 13px;
}

.p-lead .stat__n {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.p-lead .stat__n.is-gold {
  color: var(--gold-ink);
}

.p-lead .stat__l {
  font-size: 0.74rem;
  color: var(--ink-faint);
  margin-top: 1px;
}

/* Piedāvājums (labā puse) */
.p-lead .proposal {
  animation: rise var(--speed) var(--ease) both;
  animation-delay: 0.14s;
}

.p-lead .prop__head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.2vw, 22px);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
}

.p-lead .cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p-lead .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.2vw, 22px);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.p-lead .card.is-recommended {
  border-color: var(--gold-deep);
  box-shadow: 0 18px 40px -26px rgba(246, 197, 107, 0.45);
}

.p-lead .card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.p-lead .tier-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
  padding: 5px 11px;
  border-radius: 999px;
}

/* Ieteicams pārslēgs */
.p-lead .rec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  user-select: none;
}

.p-lead .rec input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.p-lead .rec__sw {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex: none;
}

.p-lead .rec__sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: transform 0.2s var(--ease), background 0.2s ease;
}

.p-lead .rec input:checked + .rec__sw {
  background: linear-gradient(135deg, var(--gold-ink), var(--gold-deep));
  border-color: transparent;
}

.p-lead .rec input:checked + .rec__sw::after {
  transform: translateX(16px);
  background: #241a05;
}

.p-lead .rec.is-on {
  color: var(--gold-ink);
}

/* Rediģējamie lauki */
.p-lead .edit {
  margin-bottom: 12px;
}

.p-lead .edit:last-child {
  margin-bottom: 0;
}

.p-lead .edit__k {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}

.p-lead .inp,
.p-lead .ta {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.p-lead .inp:hover,
.p-lead .ta:hover {
  border-color: var(--line-strong);
}

.p-lead .inp:focus,
.p-lead .ta:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(246, 197, 107, 0.18);
}

.p-lead .inp--title {
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.p-lead .inp--name {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.p-lead .ta {
  line-height: 1.5;
  min-height: 64px;
}

.p-lead .ta--steps {
  min-height: 96px;
}

.p-lead .hint {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 4px;
}

.p-lead .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.p-lead .skeleton {
  border-radius: var(--radius);
}

/* Paziņojuma uzliesmojums (toast) */
.p-lead .toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  z-index: 50;
  max-width: calc(100vw - 32px);
}

.p-lead .toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.p-lead .toast--ok { border-color: var(--ok-line); color: var(--ok); }
.p-lead .toast--err { border-color: var(--err-line); color: var(--err); }

@media (max-width: 880px) {
  .p-lead .grid { grid-template-columns: 1fr; }
  .p-lead .brief { position: static; }
}

@media (max-width: 540px) {
  .p-lead .two { grid-template-columns: 1fr; }
  .p-lead .actions { width: 100%; }
  .p-lead .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* =========================================================
   Pieejamība: mazāka kustība
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
