/* ============================================================
   Onboarding Sistēma — Galvenais CSS
   Balstīts uz UI stila vadlīnijām
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --blue:       #004A8E;
  --blue-light: #e8f0fe;
  --accent:     #1e40af;
  --dark:       #111827;
  --mid:        #374151;
  --soft:       #6b7280;
  --border:     #e5e7eb;
  --bg:         #f3f4f6;
  --white:      #fff;
  --green:      #16a34a;
  --red:        #dc2626;
  --yellow:     #d97706;
  --purple:     #7c3aed;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}

/* ── Admin layout ── */
.layout-admin {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--dark);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo span {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo small {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.sidebar-section {
  padding: 8px 20px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: all .15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,.08);
  border-left-color: var(--blue);
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  opacity: .7;
  flex-shrink: 0;
}

.sidebar-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  font-size: 13px;
  color: var(--mid);
}

.content {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
}

/* ── Kartes ── */
.card {
  background: var(--white);
  border-radius: 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.card-body { padding: 22px; }

/* ── Tabulas ── */
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); }
th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--soft);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* ── Statistikas kartiņas ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: 0;
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card .label {
  font-size: 11px;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}

.stat-card .sub { font-size: 12px; color: var(--soft); }

/* ── Pogas ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-outline { background: var(--white); color: var(--mid); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: #fee2e2; color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: var(--green); }
.btn-success:hover { background: #bbf7d0; }
.btn-warning { background: #fef3c7; color: var(--yellow); }
.btn-warning:hover { background: #fde68a; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-draft   { background: #f3f4f6; color: #6b7280; }
.badge-sent    { background: #dbeafe; color: #1d4ed8; }
.badge-paid    { background: #dcfce7; color: #15803d; }
.badge-overdue { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* ── Formas ── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
}

input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border .15s, box-shadow .15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 74, 142, .08);
}

input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--red);
}

.invalid-feedback {
  font-size: 12px;
  color: var(--red);
  margin-top: 3px;
}

textarea { resize: vertical; min-height: 70px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 0;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Lappušošana ── */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.page-btn {
  padding: 6px 12px;
  border-radius: 0;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--mid);
  text-decoration: none;
}
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-btn:hover:not(.active) { background: var(--bg); }

/* ── Modāls ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 0;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p  { font-size: 14px; color: var(--soft); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Onboarding progress ── */
.progress-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 0; right: 0;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--soft);
  transition: all .2s;
}

.progress-step.completed .step-circle {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.progress-step.active .step-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--soft);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.progress-step.active .step-label { color: var(--blue); }
.progress-step.completed .step-label { color: var(--green); }

/* ── Public forma ── */
.public-wrap {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.public-header {
  background: var(--dark);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-header .logo {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.public-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
}

.public-form-card {
  background: var(--white);
  border-radius: 0;
  width: 100%;
  max-width: 640px;
  overflow: hidden;
}

.public-form-header {
  background: var(--blue);
  padding: 32px;
  color: #fff;
}

.public-form-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.public-form-header p {
  font-size: 14px;
  opacity: .8;
}

.public-form-body { padding: 32px; }

/* ── Client portal ── */
.client-layout {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.client-nav {
  background: var(--dark);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.client-nav .logo {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.client-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.client-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 16px;
  width: 100%;
}

.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-card.active { border-color: var(--blue); }
.step-card.locked { opacity: .5; }

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
}

.step-icon.done    { background: #dcfce7; color: var(--green); }
.step-icon.current { background: var(--blue); color: #fff; }
.step-icon.pending { background: var(--bg); color: var(--soft); }

.step-info { flex: 1; }
.step-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.step-info p  { font-size: 13px; color: var(--soft); }

/* ── Checkbox ── */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  cursor: pointer;
}

/* ── Utils ── */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-soft { color: var(--soft); }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 24px; }

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   Papildinājumi — tāme, dokumenti, lietotāji
   ============================================================ */

/* Universāli: nekādu noapaļojumu (izņemot apļus) */
input, select, textarea, button, .btn, .card, .modal,
.alert, .badge, .stat-card, .step-card, .public-form-card,
.page-btn, .box { border-radius: 0; }

/* ── Sekciju etiķete ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--soft);
  margin-bottom: 14px;
}

/* ── Papildu bloks formā (uzņēmuma rekvizīti) ── */
.conditional-block {
  grid-column: 1 / -1;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  background: #fafbfc;
  padding: 16px;
  margin-top: 4px;
}

.conditional-block[hidden] { display: none; }

.conditional-block .block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--blue);
  margin-bottom: 12px;
}

/* ── Tāmes tabula ── */
.estimate-table { width: 100%; border-collapse: collapse; }
.estimate-table th {
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 9px 12px;
  text-align: left;
  border-bottom: none;
}
.estimate-table td {
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.estimate-table tbody tr:nth-child(even) { background: #f7f9fb; }
.estimate-table tbody tr:hover { background: var(--blue-light); }
.estimate-table .num { text-align: right; white-space: nowrap; }
.estimate-table .pos-name { font-weight: 600; }
.estimate-table .pos-desc { font-size: 12px; color: var(--soft); margin-top: 2px; }
.estimate-table tr.total-row td {
  background: var(--blue-light);
  border-top: 2px solid var(--blue);
  border-bottom: none;
  font-weight: 700;
}
.estimate-table tr.sub-row td:first-child { padding-left: 28px; }

/* ── Tāmes redaktors (admin) ── */
.estimate-rows { width: 100%; border-collapse: collapse; }
.estimate-rows th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--soft);
  font-weight: 700;
  padding: 6px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.estimate-rows td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.estimate-rows input, .estimate-rows textarea { font-size: 12px; padding: 7px 9px; }
.estimate-rows .calc {
  font-size: 12px;
  color: var(--mid);
  text-align: right;
  padding-top: 9px;
  white-space: nowrap;
}
.estimate-rows .calc strong { color: var(--dark); }
.row-drag { cursor: move; color: var(--soft); user-select: none; padding-top: 9px; }
.row-del {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--red);
  cursor: pointer;
  width: 28px;
  height: 32px;
  font-size: 15px;
  line-height: 1;
}
.row-del:hover { background: #fee2e2; }

.mini-input { width: 100%; }
.pct-warn { color: var(--red); font-weight: 600; }
.pct-ok   { color: var(--green); font-weight: 600; }

/* ── Kopsavilkuma kaste ── */
.summary-box {
  border: 1px solid var(--border);
  background: var(--white);
}
.summary-box .row {
  display: flex;
  justify-content: space-between;
  padding: 9px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.summary-box .row:last-child { border-bottom: none; }
.summary-box .row.grand {
  background: var(--blue-light);
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--blue);
}
.summary-box .row .lbl { color: var(--mid); }
.summary-box .row .val { font-variant-numeric: tabular-nums; }

/* ── Dokumentu rindas ── */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--white);
  margin-bottom: 8px;
}
.doc-ico {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}
.doc-row.contract .doc-ico { background: var(--blue-light); color: var(--blue); }
.doc-meta { flex: 1; min-width: 0; }
.doc-meta .nm { font-size: 13px; font-weight: 600; }
.doc-meta .sub { font-size: 11px; color: var(--soft); margin-top: 2px; }

/* ── Toolbar ── */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .spacer { flex: 1; }

/* ── Drukas skats ── */
@media print {
  .sidebar, .topbar, .no-print, .client-nav { display: none !important; }
  body { background: #fff; }
  .content, .client-content { padding: 0; }
  .card { border: none; }
  .estimate-table th { background: #1F4E79 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .estimate-table tr.total-row td,
  .summary-box .row.grand { background: #EAF0F6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 768px) {
  .estimate-rows, .estimate-rows tbody, .estimate-rows tr, .estimate-rows td { display: block; width: 100%; }
  .estimate-rows thead { display: none; }
  .estimate-rows tr { border-bottom: 2px solid var(--border); padding: 8px 0; }
}

/* ============================================================
   Zīmols (logo) un konfigurējamais lapas fons
   ============================================================ */

/* ── Logo ── */
.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
  max-width: 100%;
}

.brand-logo img {
  display: block;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo--center { justify-content: center; }

.brand-logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.3px;
}

.brand-logo--on-dark .brand-logo-text { color: #fff; }

/* Logo virs publiskajām formām */
.public-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.public-stack {
  width: 100%;
  max-width: 640px;
}

.public-stack .public-form-card { max-width: none; }

/* Sidebar logo */
.sidebar-logo .brand-logo { margin-bottom: 6px; }

/* ── Konfigurējamais fons ── */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.page-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.page-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Publiskais saturs vienmēr virs fona slāņiem */
.public-wrap {
  position: relative;
  z-index: 2;
  background: transparent;
}

/* Telefonos video netiek atskaņots — paliek posteris no page-bg fona */
@media (max-width: 640px) {
  .page-bg-video { display: none; }
}

/* Kustību samazināšana — cieņa pret sistēmas iestatījumu */
@media (prefers-reduced-motion: reduce) {
  .page-bg-video { display: none; }
}

/* Uz attēla/video fona kartei vajag nedaudz "pacēluma" */
.page-bg--image ~ .public-wrap .public-form-card,
.page-bg--video ~ .public-wrap .public-form-card,
.page-bg--image ~ .page-bg-overlay ~ .public-wrap .public-form-card,
.page-bg--video ~ .page-bg-overlay ~ .public-wrap .public-form-card {
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.page-bg--image ~ .public-wrap .card,
.page-bg--video ~ .public-wrap .card,
.page-bg--image ~ .page-bg-overlay ~ .public-wrap .card,
.page-bg--video ~ .page-bg-overlay ~ .public-wrap .card {
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

/* ── Teksta saite formas apakšā (vietā, kur agrāk bija poga headerī) ── */
.form-footer-link {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--soft);
}

.form-footer-link a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.form-footer-link a:hover { text-decoration: underline; }

/* ── Iestatījumu lapa ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.upload-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--mid);
}

.upload-field input[type="file"] {
  width: 100%;
  font-size: 12px;
  padding: 8px;
  border: 1px dashed var(--border);
  background: #fff;
  cursor: pointer;
}

.upload-preview {
  height: 90px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.upload-preview img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.upload-preview--light { background: #fff; }
.upload-preview--dark  { background: var(--dark); }

.upload-preview--wide {
  height: 130px;
  background: var(--bg);
  padding: 0;
}

.upload-preview--wide img { max-height: 100%; width: 100%; object-fit: cover; }

.upload-empty {
  font-size: 12px;
  color: var(--soft);
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--soft);
  margin-top: 6px;
  line-height: 1.5;
}

.color-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-field input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.color-field input[type="text"] { flex: 1; }

.bg-type-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bg-type-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.bg-type-option input { margin: 0; }

.bg-type-option.is-selected {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

/* ── Etiķete ar palīgsaiti (piem., "Aizmirsāt paroli?") ── */
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.label-row label { margin-bottom: 6px; }

.label-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.label-link:hover { text-decoration: underline; }

/* Kartes iekšienē kājenes saitei nevajag divkāršu atkāpi */
.card-body > .form-footer-link { margin-top: 20px; }

/* ── Šaurāks publiskās formas variants (pieslēgšanās, parole, verifikācija) ── */
.public-stack--narrow { max-width: 450px; }

.public-stack--narrow .public-form-header { padding: 26px 32px; }
.public-stack--narrow .public-form-header h1 { font-size: 20px; }
.public-stack--narrow .public-form-body { padding: 28px 32px; }

@media (max-width: 480px) {
  .public-form-header { padding: 24px 20px; }
  .public-form-body   { padding: 24px 20px; }
}

/* ── Konta fakti klienta kartiņā ── */
.account-facts { display: grid; gap: 10px; }

.account-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.account-facts dt {
  font-size: 12px;
  color: var(--soft);
  flex-shrink: 0;
}

.account-facts dd {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  margin: 0;
}

/* Atslēgtas pogas nedrīkst izskatīties spiežamas */
.btn:disabled,
.btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Klientu portāls — sānjosla, projekti, sadaļas
   ============================================================ */

/* ── Sānjoslas papildinājumi ── */
.sidebar-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
  padding: 1px 7px;
  border-radius: 10px;
}

.sidebar-badge {
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  flex-shrink: 0;
}

.sidebar-project {
  padding: 12px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 6px;
}

.sidebar-project label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .7px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  margin-bottom: 6px;
}

.sidebar-project select {
  width: 100%;
  font-size: 12px;
  padding: 7px 9px;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
  cursor: pointer;
}

.sidebar-project select option { color: #111827; }

/* ── Projektu saraksts ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.project-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.project-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(17,24,39,.07);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.project-card-type {
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 10px;
}

.project-card-desc {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 14px;
}

.project-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.project-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  overflow: hidden;
}

.project-progress-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.project-progress-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
  min-width: 32px;
  text-align: right;
}

.project-card-meta {
  font-size: 11px;
  color: var(--soft);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ── Darbība, kas gaida klientu ── */
.todo-card {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  padding: 18px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.todo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 3px;
}

.todo-text {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
}

/* ── Soļu rinda pārskatā ── */
.step-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
}

.step-row:last-child { border-bottom: none; }

/* ── Faktu saraksts ── */
.fact-list { display: grid; gap: 10px; }

.fact-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.fact-list > div:last-child { border-bottom: none; padding-bottom: 0; }

.fact-list dt {
  font-size: 12px;
  color: var(--soft);
  flex-shrink: 0;
}

.fact-list dd {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  margin: 0;
  word-break: break-word;
}

/* ── Tukšs stāvoklis ── */
.empty-state {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 48px 32px;
  text-align: center;
}

.empty-icon { font-size: 36px; margin-bottom: 14px; }

.empty-state h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--soft);
  line-height: 1.7;
  max-width: 420px;
  margin: 0 auto 20px;
}

/* ── Mobilā sānjosla ── */
@media (max-width: 860px) {
  .layout-admin { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: column;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }

  .sidebar-nav .sidebar-section { width: 100%; }

  .sidebar-link { flex: 1 1 auto; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0 !important; }
}

/* ── Projektu cilnes admin klienta kartiņā ── */
.project-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.project-tabs-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
  color: var(--soft);
  margin-right: 4px;
}

.project-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--mid);
  text-decoration: none;
}

.project-tab:hover { border-color: var(--blue); color: var(--blue); }

.project-tab.active {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

/* ── Lēmuma izvēle (apstiprināt / noraidīt) ── */
.decision-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.decision-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
}

.decision-option:hover { border-color: var(--blue); }

.decision-option input { margin-top: 3px; flex-shrink: 0; }

.decision-option strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.decision-option small {
  font-size: 12px;
  color: var(--soft);
  line-height: 1.5;
}

.decision-option:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-light);
}

/* ── Piedāvājuma rindiņa klienta kartiņā ── */
.offer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.offer-row:last-child { border-bottom: none; }

.offer-meta { min-width: 0; }

.offer-meta .nm {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  display: block;
}

.offer-meta .nm:hover { color: var(--blue); }

.offer-meta .sub {
  font-size: 11px;
  color: var(--soft);
  margin-top: 2px;
  line-height: 1.5;
}
