:root {
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #111111;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --active-bg: #f1f1f1;
  --blue: #0b5fa5;
  --blue-hover: #084a82;
  --red: #e3171f;
  --disabled: #dcdcdc;
  --radius: 22px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Izkārtojums ---------- */
.layout {
  display: grid;
  grid-template-columns: 382px 1fr;
  min-height: 100vh;
}

/* ---------- Navigācija ---------- */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 42px 40px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.logo { display: block; margin: 0 0 34px 8px; text-decoration: none; color: var(--text); }
.logo img { max-width: 284px; height: auto; display: block; }
.logo-text { font-size: 14px; line-height: 1.3; text-transform: uppercase; color: #333; }

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
}
.search:focus-within { border-color: var(--blue); }
.search svg { width: 20px; height: 20px; fill: none; stroke: #555; stroke-width: 1.8; flex: none; }
.search input {
  border: 0; outline: 0; width: 100%;
  font: inherit; font-size: 13px; background: transparent;
}
.search input::placeholder { color: #c4c4c4; }

.sections {
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.nav-item {
  display: flex; align-items: center; gap: 16px;
  width: 100%; height: 50px; padding: 0 9px;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 18px; text-align: left; cursor: pointer;
}
.nav-item svg { width: 30px; height: 30px; color: #3f4650; flex: none; }
.nav-item:hover { background: #f7f7f7; }
.nav-item.active { background: var(--active-bg); font-weight: 600; }

.audiences {
  display: flex; flex-direction: column; gap: 3px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.audience {
  display: flex; align-items: center; gap: 26px;
  width: 100%; height: 52px; padding: 0 18px;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 18px; text-align: left; cursor: pointer;
}
.audience::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: var(--dot); flex: none;
}
.audience:hover { background: #f7f7f7; }
.audience.active { background: var(--active-bg); font-weight: 600; }

/* ---------- Galvene ---------- */
.main { min-width: 0; }

.topbar {
  height: 95px;
  display: flex; align-items: center;
  padding: 0 42px;
  background-color: var(--white);
  background-repeat: no-repeat;
  background-position: right top;
  background-size: auto 100%;
  border-bottom: 1px solid var(--line);
}
.breadcrumb { margin: 0; font-size: 20px; font-weight: 500; }
.breadcrumb span { color: var(--muted); font-weight: 400; }

/* ---------- Saraksta kartīte ---------- */
.content { padding: 46px 42px 42px; }

.card {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  background: var(--white);
  padding: 18px 36px 16px;
}
.card-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.total { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.total b { color: var(--text); font-weight: 700; }

.table { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) 1fr 1fr 150px;
  align-items: center;
  gap: 16px;
  padding: 0 36px;
}

.row-head {
  height: 76px;
  background: #f7f7f7;
  color: var(--muted);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.c-center { text-align: center; }
.c-right { text-align: right; }

.rows {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rows .row {
  min-height: 83px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.rows .row:last-child { border-bottom: 0; }

.ev-title { font-weight: 600; margin: 0; }
.ev-type { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.ev-aud { text-align: center; color: var(--aud); }
.ev-date { text-align: center; }
.ev-date.soon { color: var(--red); font-weight: 700; }
.ev-action { text-align: right; }

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 16px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}
.btn:hover { background: var(--blue-hover); }
.btn.disabled {
  background: var(--disabled); color: #f4f4f4;
  box-shadow: none; pointer-events: none;
}

.empty {
  padding: 60px 36px;
  text-align: center;
  color: var(--muted);
}
.empty b { color: var(--text); }

/* ---------- Lapošana ---------- */
.pagination {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 6px;
  padding: 20px 36px 22px;
  font-size: 14px;
  min-height: 78px;
}
.pagination button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 8px; border-radius: 6px; color: #444;
}
.pagination .num.active { font-weight: 700; color: var(--text); }
.pagination .num:hover:not(.active) { background: #ececec; }
.pagination .step {
  background: var(--white); border: 1px solid var(--line);
  padding: 7px 8px; margin: 0 14px;
}
.pagination .step:disabled { color: #b5b5b5; cursor: default; }
.pagination .gap { padding: 0 4px; color: #777; }

/* ---------- Mazāki ekrāni ---------- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 300px 1fr; }
  .sidebar { padding: 32px 24px; }
  .content { padding: 32px 24px; }
  .row { grid-template-columns: 1.6fr 1fr 1fr 130px; padding: 0 24px; }
  .card-head { padding: 18px 24px; }
}

@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .audiences, .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .admin-nav .nav-item { width: auto; height: 42px; font-size: 15px; gap: 8px; }
  .audience { width: auto; height: 40px; gap: 10px; padding: 0 12px; font-size: 15px; }
  .topbar { height: 72px; padding: 0 24px; }
  .breadcrumb { font-size: 16px; }

  .row-head { display: none; }
  .rows .row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 16px 20px;
  }
  .ev-title { grid-column: 1 / -1; }
  .ev-aud, .ev-date { text-align: left; font-size: 14px; }
  .ev-action { grid-column: 2; grid-row: 2 / span 2; }
  .pagination { justify-content: center; flex-wrap: wrap; }
  .pagination .step { margin: 0 6px; }
}

/* =====================================================================
   ADMINISTRĒŠANAS VIDE
   ===================================================================== */

/* ---------- Pogas ---------- */
.btn:disabled { background: var(--disabled); color: #f4f4f4; box-shadow: none; cursor: default; }
.btn-red { background: #b30d0d; }
.btn-red:hover { background: #8f0a0a; }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-outline:hover { background: #f3f3f3; }
.btn-block { display: block; width: 100%; height: 46px; border-radius: 8px; font-size: 16px; font-weight: 600; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: #555; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: #f0f0f0; color: var(--text); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: #fde8e8; }

/* ---------- Sānjosla ---------- */
.admin-nav {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 0;
}
.admin-nav .nav-item svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.user-box {
  margin-top: auto;
  padding-top: 28px;
  display: flex; align-items: center; gap: 10px;
  font-size: 16px;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e4e4e4; flex: none; }
.login-link {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: none; padding: 0; cursor: pointer; font-size: 16px;
}
.login-link:hover span:last-child { text-decoration: underline; }
.logout {
  margin-left: auto; border: 0; background: none; padding: 4px;
  color: var(--muted); font-size: 15px; cursor: pointer;
}
.logout:hover { color: var(--text); }

/* ---------- Saraksts ---------- */
.card-head.has-action { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.mode-hint { margin: 4px 0 0; font-size: 13px; color: var(--blue); }

.table.is-admin .row { grid-template-columns: minmax(260px, 1.7fr) 1fr 1fr 80px; }
.table.is-admin.has-check .row { grid-template-columns: 28px minmax(240px, 1.7fr) 1fr 1fr 80px; }

.chk { display: inline-flex; cursor: pointer; }
.chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; }

.rows .row.is-selected { background: #f2f7fc; }
.rows .row.is-past .ev-title,
.rows .row.is-past .ev-date { color: var(--muted); }
.rows .row.is-flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #e2eefa; } to { background: transparent; } }

.title-link {
  border: 0; background: none; padding: 0; text-align: left;
  font: inherit; font-weight: 600; color: inherit; cursor: pointer;
}
.title-link:hover { color: var(--blue); text-decoration: underline; }

/* ---------- Trīs punktu izvēlne ---------- */
.menu {
  position: fixed; z-index: 50;
  min-width: 230px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.menu-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; padding: 11px 12px;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 15px; text-align: left; cursor: pointer;
}
.menu-item svg { width: 20px; height: 20px; color: #444; flex: none; }
.menu-item:hover, .menu-item:focus-visible { background: #f3f3f3; outline: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--red); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* ---------- Uznirstošie logi ---------- */
.modal {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 36px;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal::backdrop {
  background: rgba(60, 60, 60, .35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-body { padding: 24px 36px 34px; }

.login { display: flex; flex-direction: column; }
.login-logo { display: flex; justify-content: center; margin-bottom: 6px; }
.login-logo img, .login-logo svg { width: 68px; height: 68px; }
.login-kicker { margin: 0; text-align: center; font-size: 13px; }
.login h2 { margin: 0 0 30px; text-align: center; font-size: 17px; font-weight: 700; }
.login .field-label { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.login .input, .login .input-wrap { margin-bottom: 22px; }
.login .input-wrap .input { margin-bottom: 0; }
.login .btn-block { margin-top: 30px; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 50px; }
.eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: #222; cursor: pointer;
}
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.remember { display: flex; align-items: center; gap: 8px; margin-top: -8px; font-size: 13px; cursor: pointer; width: fit-content; }
.remember input {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; margin: 0;
  display: grid; place-items: center;
  border: 1px solid #b5b5b5; border-radius: 50%; cursor: pointer;
}
.remember input:checked { border-color: var(--blue); }
.remember input:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

.form-error { margin: 12px 0 0; color: var(--red); font-size: 13px; font-weight: 500; }

.confirm { text-align: center; }
.modal-icon {
  width: 58px; height: 58px; margin: 6px auto 14px;
  display: grid; place-items: center;
  border-radius: 50%; background: #fde8e8; color: var(--red);
}
.modal-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm h2 { margin: 0 0 8px; font-size: 18px; }
.confirm p { margin: 0 0 26px; color: #555; font-size: 14px; line-height: 1.55; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; height: 44px; border-radius: 8px; font-size: 15px; }

/* ---------- Forma ---------- */
.form-card {
  max-width: 1135px;
  margin: 0 auto;
  padding: 36px 36px 48px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.form-title { margin: 0 0 30px; font-size: 16px; font-weight: 400; color: var(--muted); }
.field { margin-bottom: 28px; }
.field-label { display: block; margin-bottom: 10px; font-size: 16px; }
.field-label small { color: var(--muted); font-size: 13px; }

.input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--text);
  font: inherit; font-size: 14px;
}
.input::placeholder { color: #c4c4c4; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 95, 165, .12); }
.input[aria-invalid="true"] { border-color: var(--red); }
select.input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
select.input:invalid { color: #c4c4c4; }
select.input option { color: var(--text); }

.field-error { margin: 6px 0 0; color: var(--red); font-size: 13px; }

.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 54px; }

.check-line { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }

.form-actions { display: flex; gap: 12px; margin-top: 44px; }
.form-actions .btn { min-width: 104px; padding: 8px 18px; font-size: 14px; }

/* Teksta redaktors */
.editor { border: 1px solid var(--line); border-radius: 8px; }
.editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 95, 165, .12); }
.toolbar {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 14px;
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}
.tool {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent;
  color: #333; font-size: 15px; cursor: pointer;
}
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: #ececec; }
.tool[aria-pressed="true"] { background: #e3ebf5; color: var(--blue); }
.editor-area {
  min-height: 300px; padding: 16px;
  font-size: 15px; line-height: 1.6;
  outline: none;
  overflow-wrap: anywhere;
}
.editor-area.is-empty::before { content: attr(data-placeholder); color: #c4c4c4; pointer-events: none; }
.editor-area img { max-width: 100%; height: auto; }
.editor-area h3 { margin: .6em 0 .3em; font-size: 19px; }
.editor-area a { color: var(--blue); }

.emoji-pop {
  position: absolute; top: calc(100% + 4px); z-index: 5;
  display: grid; grid-template-columns: repeat(8, 36px); gap: 2px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.emoji-pop button { width: 36px; height: 36px; border: 0; border-radius: 6px; background: none; font-size: 20px; cursor: pointer; }
.emoji-pop button:hover { background: #f0f0f0; }

/* ---------- Paziņojums ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  border-radius: 10px;
  background: #22303c; color: #fff;
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .rows .row.is-flash { animation: none; }
  .toast { transition: none; }
}

@media (max-width: 860px) {
  .field-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px 32px; }
  .table.is-admin .rows .row { grid-template-columns: 1fr auto; }
  .table.is-admin.has-check .rows .row { grid-template-columns: auto 1fr auto; }
  .has-check .ev-check { grid-column: 1; grid-row: 1 / span 3; }
  .has-check .ev-title, .has-check .ev-aud, .has-check .ev-date { grid-column: 2; }
  .table.is-admin .ev-action { grid-column: -2; grid-row: 1 / span 3; }
  .user-box { padding-top: 18px; }
}

/* ---------- Lietotāja izvēlne un iestatījumi ---------- */
.avatar { background-color: #e4e4e4; background-size: cover; background-position: center; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 6px 8px 6px 6px; margin: 0 -6px;
  border: 0; border-radius: 30px; background: transparent;
  font-size: 16px; text-align: left; cursor: pointer;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: #f3f3f3; }
.user-btn .user-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.avatar-edit { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.avatar-actions .btn { padding: 8px 16px; font-size: 14px; }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.settings-sub { margin: 10px 0 0; font-size: 18px; font-weight: 600; }
.settings-sub + .field-hint { margin-bottom: 20px; }

/* Dzēšanas režīmā visa rinda atzīmē ierakstu */
.has-check .rows .row { cursor: pointer; user-select: none; -webkit-user-select: none; }
.has-check .rows .row:hover:not(.is-selected) { background: #fafafa; }
.chk { padding: 6px; margin: -6px; }

/* ---------- Kalendārs ---------- */
.date-wrap { position: relative; }
.date-trigger {
  display: flex; align-items: center; gap: 10px;
  text-align: left; cursor: pointer;
}
.date-trigger span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-trigger .placeholder { color: #c4c4c4; }
.date-trigger svg { width: 18px; height: 18px; flex: none; color: #555; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-trigger[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 95, 165, .12); }

.check-box-line { height: 50px; }

.calendar {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  width: min(336px, calc(100vw - 40px));
  padding: 16px 16px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .16);
}

.calendar.uz-augsu { top: auto; bottom: calc(100% + 8px); }

.kal-galva { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kal-menesis { font-size: 15px; font-weight: 600; }
.kal-nav {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #333; cursor: pointer;
}
.kal-nav:hover { background: #f0f0f0; }
.kal-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.kal-rinda { display: grid; grid-template-columns: repeat(7, 1fr); }
.kal-nedela span { padding: 6px 0; text-align: center; font-size: 12px; color: var(--muted); }
.kal-nedela abbr { text-decoration: none; }

.kal-suna { display: flex; justify-content: center; padding: 2px 0; }
.kal-diena {
  width: 40px; height: 40px; max-width: 100%;
  border: 0; border-radius: 50%; background: transparent;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.kal-diena:hover { background: #f0f0f0; }
.kal-diena.pagajis { color: #c8c8c8; cursor: not-allowed; }
.kal-diena.pagajis:hover { background: transparent; }
.cits-menesis .kal-diena { color: #cfcfcf; }
.kal-diena.sodien { color: var(--blue); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--blue); }
.kal-diena:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Perioda josla */
.kal-suna.ir-diapazona { background: #e7f0f9; }
.kal-suna.ar-joslu.ir-sakums { background: linear-gradient(to right, transparent 50%, #e7f0f9 50%); }
.kal-suna.ar-joslu.ir-beigas { background: linear-gradient(to left, transparent 50%, #e7f0f9 50%); }
.kal-suna.ir-diapazona .kal-diena:hover { background: #d3e3f3; }
.kal-suna.ir-sakums .kal-diena,
.kal-suna.ir-beigas .kal-diena { background: var(--blue); color: #fff; font-weight: 600; box-shadow: none; }
/* Kamēr izvēlas beigu datumu, priekšskatījums ir gaišāks */
.calendar.ir-prieksskats .kal-suna.ir-diapazona { background: #f1f6fb; }
.calendar.ir-prieksskats .kal-suna.ar-joslu.ir-sakums { background: linear-gradient(to right, transparent 50%, #f1f6fb 50%); }
.calendar.ir-prieksskats .kal-suna.ar-joslu.ir-beigas { background: linear-gradient(to left, transparent 50%, #f1f6fb 50%); }
.calendar.ir-prieksskats .kal-diena[aria-selected="false"] { background: transparent; }
.calendar.ir-prieksskats .ar-joslu .kal-diena[aria-selected="false"] { background: #cfe0f1; color: var(--text); }

.kal-kaja { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.kal-statuss { margin: 0 0 12px; min-height: 20px; font-size: 13px; line-height: 1.45; color: #555; }
.kal-pogas { display: flex; align-items: center; gap: 8px; }
.kal-atstarpe { flex: 1; }
.kal-pogas .btn { padding: 7px 14px; font-size: 13px; border-radius: 6px; }
.kal-teksta-poga {
  border: 0; background: none; padding: 6px 4px;
  color: var(--blue); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.kal-teksta-poga:hover { text-decoration: underline; }

/* =====================================================================
   BANERIS, LOGO UN PRIEKŠSKATĪJUMS
   ===================================================================== */
.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;
}

.baneris img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.baneris-vieta {
  height: 180px;
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, #f3f3f3 0 14px, #ececec 14px 28px);
  border-bottom: 1px solid var(--line);
  color: #8a8a8a; font-size: 14px; letter-spacing: .02em;
}

.logo-vieta {
  display: grid; place-items: center;
  width: 284px; max-width: 100%; height: 64px;
  border: 1.5px dashed #cfcfcf; border-radius: 10px;
  color: #a5a5a5; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}

/* Klikšķināmas rindas */
.rows .row.is-clickable { cursor: pointer; }
.rows .row.is-clickable:hover { background: #fafafa; }
.title-link { font-size: inherit; line-height: inherit; }

/* Priekšskatījuma logs */
.modal-wide { width: min(600px, calc(100% - 32px)); }
.preview { position: relative; padding: 34px 40px 34px; }
.p-aizvert {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #f3f3f3; color: #333; cursor: pointer;
}
.p-aizvert:hover { background: #e8e8e8; }
.p-aizvert svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.p-birkas { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; padding-right: 44px; }
.p-birka {
  padding: 4px 12px; border-radius: 20px;
  background: #f1f1f1; color: #555;
  font-size: 12px; font-weight: 500;
}
.p-auditorija { color: var(--aud); background: color-mix(in srgb, var(--aud) 10%, white); }

.preview h2:focus { outline: none; }
.preview h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.3; padding-right: 20px; }
.p-datums {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 20px; font-size: 15px; font-weight: 500; color: #333;
}
.p-datums svg { width: 18px; height: 18px; flex: none; color: var(--blue); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.p-apraksts {
  max-height: 45vh; overflow-y: auto;
  padding: 18px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 15px; line-height: 1.6; color: #333;
  overflow-wrap: anywhere;
}
.p-apraksts > :first-child { margin-top: 0; }
.p-apraksts > :last-child { margin-bottom: 0; }
.p-apraksts img { max-width: 100%; height: auto; border-radius: 8px; }
.p-apraksts h3 { font-size: 17px; margin: 1em 0 .4em; }
.p-apraksts a { color: var(--blue); }
.p-tukss { color: var(--muted); font-style: italic; }

.p-darbibas { display: flex; gap: 12px; margin-top: 24px; }
.p-darbibas .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 26px; border-radius: 8px; font-size: 15px;
}

@media (max-width: 860px) {
  .baneris-vieta { height: 110px; font-size: 12px; text-align: center; padding: 0 16px; }
  .preview { padding: 28px 22px; }
  .p-darbibas .btn { flex: 1; padding: 0 12px; }
}

/* ---------- Kursi no mājaslapas un brīdinājumi ---------- */
.arejs-zime { display: inline-grid; place-items: center; width: 36px; height: 36px; color: #b0b0b0; cursor: help; }
.arejs-zime svg { width: 18px; height: 18px; }
.admin-bridinajums {
  margin: 0 0 20px; padding: 14px 18px;
  border-radius: 12px; background: #fff6e0; color: #6b4c00;
  font-size: 14px; line-height: 1.5;
}
.admin-bridinajums small { color: #8a6d1f; }

/* ---------- Pieteikšanās forma ---------- */
.pieteikums { position: relative; padding: 34px 40px; }
.pt-kicker { text-align: left; margin-bottom: 4px; color: var(--muted); }
.pieteikums h2 { margin: 0 0 10px; padding-right: 40px; font-size: 21px; line-height: 1.3; }
.pieteikums h2:focus { outline: none; }
.pt-lauki {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.pt-lauks { margin-bottom: 14px; }
.pt-plats { grid-column: 1 / -1; }
.pieteikums .field-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.pieteikums .input { height: 46px; }
.pieteikums .field-error { margin-top: 4px; }
.pt-obl { color: var(--red); }
.pt-piezime { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pt-piezime a { color: var(--blue); }
.pieteikums .form-error { margin: 4px 0 6px; }
.pt-slazds { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pt-paldies { text-align: center; padding: 44px 40px 36px; }
.pt-paldies p { margin: 0 0 6px; color: #444; line-height: 1.55; }
.pt-paldies .p-darbibas { justify-content: center; }
.pt-ikona {
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%; background: #e6f4ea; color: #1e7b3c;
}
.pt-ikona svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) {
  .pieteikums { padding: 28px 22px; }
  .pt-lauki { grid-template-columns: 1fr; }
}

/* ---------- Importēšana no Excel ---------- */
.imp-karte { max-width: 1300px; }
.imp-zona {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 20px;
  border: 2px dashed #cfd8e3; border-radius: 16px; background: #fafcff;
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.imp-zona:hover, .imp-zona.velk, .imp-zona:focus-within { border-color: var(--blue); background: #f2f7fc; }
.imp-zona svg { width: 44px; height: 44px; color: var(--blue); fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.imp-zona-virsr { font-size: 16px; font-weight: 500; }
.imp-zona-virsr u { color: var(--blue); }
.imp-zona-apr { font-size: 13px; color: var(--muted); }
.imp-padoms { margin-top: 22px; padding: 16px 18px; border-radius: 12px; background: #f7f7f7; font-size: 14px; line-height: 1.55; color: #444; }
.imp-padoms p { margin: 6px 0 0; }
.imp-ielade { padding: 40px 0; text-align: center; color: var(--muted); }

.imp-fails { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; font-size: 14px; }
.imp-fails .btn { padding: 7px 14px; font-size: 13px; margin-left: auto; }
.imp-lapa { display: flex; align-items: center; gap: 8px; }
.imp-lapa .input { height: 36px; width: auto; }

.imp-kolonnas { margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; }
.imp-kolonnas summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.imp-kolonnas summary span { font-weight: 400; color: var(--muted); }
.imp-kolonnu-rezgis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; padding: 4px 16px 16px; }
.imp-kol { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.imp-kol .input { height: 38px; font-size: 13px; }

.imp-kopsavilkums { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.imp-ok, .imp-prob { padding: 5px 12px; border-radius: 20px; }
.imp-ok { background: #e6f4ea; color: #1e5b2f; }
.imp-prob { background: #fde8e8; color: #8f0a0a; }

.imp-tabula-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 60vh; overflow-y: auto; }
.imp-tabula { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-tabula th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px; background: #f7f7f7; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
}
.imp-tabula td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.imp-tabula tr:last-child td { border-bottom: 0; }
.imp-tabula input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); }
.imp-nr { color: var(--muted); }
.imp-nos { font-weight: 600; min-width: 240px; }
.imp-dat { white-space: nowrap; }
.imp-mazs { height: 34px; font-size: 13px; min-width: 130px; padding: 0 30px 0 8px; background-position: right 8px center; }
.imp-minets { border-color: #e8b53a; background-color: #fffaf0; }
.imp-sarkans { color: var(--red); font-weight: 500; }
.imp-zals { color: #1e7b3c; font-weight: 500; }
.imp-tabula tr.ir-problema td { background: #fffafa; }
.imp-tabula tr.ir-problema .imp-nos, .imp-tabula tr.izslegta td { color: #a0a0a0; }
.imp-tabula tr.ir-problema select, .imp-tabula tr.izslegta select { opacity: .55; }

.imp-rezultats { text-align: center; padding: 20px 0; }
.imp-rezultats h2 { margin: 0 0 12px; font-size: 20px; }
.imp-rezultats h2:focus { outline: none; }
.imp-rezultats .form-actions { justify-content: center; }
.imp-kludas { display: inline-block; margin: 0; padding: 12px 18px 12px 34px; text-align: left; font-size: 14px; line-height: 1.6; background: #fff6e0; border-radius: 10px; }
.imp-kurss { padding: 5px 12px; border-radius: 20px; background: #eef0f3; color: #555; }
.imp-pelek { color: #8a8a8a; font-weight: 500; }
.imp-tabula tr.ir-kurss td { background: #f7f8f9; color: #9a9a9a; }
.imp-tabula tr.ir-kurss .imp-nos { color: #9a9a9a; }
.imp-piet { white-space: nowrap; }
.imp-piet a { color: var(--blue); }

/* ---------- Poga un skats "Notikumi šodien" ---------- */
.btn-sodien {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 14px; border-radius: 8px; white-space: nowrap;
}
.btn-sodien svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-sodien.active { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.sod-telpa { color: var(--text); }
.sod-punkts { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--dot); vertical-align: middle; }
.rows .row.sod-rinda.notiek { background: #f2f9f4; }
.sod-tagad {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: #e6f4ea; color: #1e7b3c; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.sod-tagad::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fa155; }
@media (max-width: 860px) {
  .card-head.has-action { flex-wrap: wrap; }
}
