/*
 * Kunduz Real Estate — executive layer on evapp-modern.css (dossier-precios pattern)
 * Fintech-grade surfaces, ink CTAs, trust bar, premium listing cards
 */

:root {
  --k-brand: #1e3d5c;
  --k-brand-mid: #2d5a87;
  --k-accent: #c9a66b;
  --k-accent-soft: rgb(201 166 107 / 0.18);
  --k-chrome-bg: var(--r-ink);
}

body.k-page {
  font-family: var(--r-font);
  background: var(--r-surface-subtle);
  color: var(--r-ink);
}

.k-container {
  width: min(100% - 2rem, 1140px);
  margin-inline: auto;
}

/* —— Nav — matches footer chrome —— */
.k-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--k-chrome-bg);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  transition: background 0.3s, box-shadow 0.3s;
  isolation: isolate;
}

/* evapp-modern.css targets #mainNav for Bootstrap sites — keep Kunduz nav self-contained */
#mainNav.k-nav {
  background: var(--k-chrome-bg) !important;
  border-bottom: 1px solid rgb(255 255 255 / 0.08) !important;
  border-radius: 0 !important;
}

#mainNav.k-nav.is-scrolled {
  background: var(--k-chrome-bg) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.22);
}

#mainNav.k-nav .k-nav__inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  /* Keep .k-container width + horizontal inset — width:100% was pinning the logo to the viewport edge */
  width: min(100% - 2rem, 1140px) !important;
  max-width: 1140px;
  margin-inline: auto !important;
  min-height: 5.25rem;
  gap: 1rem;
}

.k-nav.is-scrolled {
  background: var(--k-chrome-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.22);
}

.k-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 5.25rem;
  gap: 1rem;
}

.k-nav__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  color: #fff;
  isolation: isolate;
}

.k-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: auto;
}

/* Castor mark — transparent PNG, no blend mode */
.k-logo--mark,
.k-logo--footer {
  mix-blend-mode: normal;
}

/* Legacy black-bg PNG lockups */
.k-logo--lockup {
  mix-blend-mode: lighten;
}

.k-logo--lockup {
  height: clamp(2.35rem, 5.5vw, 3rem);
  max-width: min(220px, 58vw);
}

/* Castor mark — sized like property portal header icons (Idealista/Fotocasa ~48–72px) */
.k-logo--mark {
  width: clamp(3.25rem, 7vw, 4.5rem);
  height: clamp(3.25rem, 7vw, 4.5rem);
  max-width: none;
}

/* Header lockup — castor emblem + KUNDUZ wordmark (transparent PNG) */
.k-logo--nav-lockup {
  height: clamp(2.5rem, 6vw, 3.35rem);
  width: auto;
  max-width: min(240px, 62vw);
  mix-blend-mode: normal;
}

.k-logo--footer {
  width: clamp(2rem, 4vw, 2.5rem);
  height: clamp(2rem, 4vw, 2.5rem);
  max-width: none;
  margin: 0;
}

.k-logo--login {
  display: block;
  width: clamp(5rem, 14vw, 6.5rem);
  height: clamp(5rem, 14vw, 6.5rem);
  max-width: none;
  margin: 0 auto 1.25rem;
}

.k-nav__links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.15rem;
}

@media (min-width: 992px) {
  .k-nav__links { display: flex; align-items: center; }
}

.k-nav__links a {
  color: rgb(255 255 255 / 0.72);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.k-nav__links a:hover,
.k-nav__links a[aria-current="page"] {
  color: #fff;
  background: rgb(255 255 255 / 0.1);
}

.k-btn--nav-ghost {
  background: rgb(255 255 255 / 0.08) !important;
  color: rgb(255 255 255 / 0.88) !important;
  border: 1px solid rgb(255 255 255 / 0.18) !important;
  box-shadow: none;
  font-size: 0.8125rem;
  padding: 0.55rem 1rem;
}

.k-btn--nav-ghost:hover {
  background: rgb(255 255 255 / 0.14) !important;
  color: #fff !important;
  transform: none;
}

.k-nav__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.k-lang-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.06);
}

.k-lang-option {
  margin: 0;
  border: none;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.65rem;
  line-height: 1.2;
  cursor: pointer;
  color: rgb(255 255 255 / 0.72);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.k-lang-option:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.1);
}

.k-lang-option--active {
  color: #fff !important;
  background: rgb(255 255 255 / 0.18) !important;
  cursor: default;
}

.k-lang-option:focus {
  outline: none;
}

.k-lang-option:focus-visible {
  outline: 2px solid var(--k-accent);
  outline-offset: 1px;
  z-index: 1;
}

/* —— Buttons (evapp ink + brand) —— */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.k-btn:hover { transform: translateY(-1px); }

.k-btn--ink {
  background: var(--r-ink) !important;
  color: #fff !important;
  box-shadow: var(--r-shadow-sm);
}

.k-btn--ink:hover {
  background: #1f2937 !important;
  box-shadow: var(--r-shadow-md);
}

.k-btn--primary {
  background: var(--k-brand) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgb(30 61 92 / 0.28);
}

.k-btn--primary:hover {
  background: var(--k-brand-mid) !important;
}

.k-btn--outline {
  background: var(--r-surface) !important;
  color: var(--r-ink) !important;
  border: 1px solid var(--r-line-strong) !important;
  box-shadow: var(--r-shadow-sm);
}

.k-btn--outline:hover {
  background: var(--r-surface-band) !important;
}

.k-btn--ghost {
  background: transparent;
  color: rgb(255 255 255 / 0.82);
  border: 1px solid transparent;
}

.k-btn--ghost:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

.k-page .k-btn--ghost {
  color: var(--r-ink-soft);
}

.k-page .k-btn--ghost:hover {
  background: rgb(10 13 18 / 0.05);
  color: var(--r-ink);
}

.k-nav .k-btn--ghost {
  color: rgb(255 255 255 / 0.82);
}

.k-nav .k-btn--ghost:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

/* —— Masthead / hero (dossier-masthead) —— */
.k-masthead {
  padding-top: clamp(7rem, 13vw, 9rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  background: linear-gradient(180deg, var(--r-surface-band) 0%, var(--r-surface) 62%);
  position: relative;
  overflow: hidden;
}

.k-masthead::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  background: radial-gradient(circle, rgb(45 90 135 / 0.08) 0%, transparent 68%);
  pointer-events: none;
}

.k-masthead__grid {
  display: grid;
  gap: 2rem;
  align-items: start;
  position: relative;
}

@media (min-width: 900px) {
  .k-masthead__grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: center;
  }
}

.k-masthead__eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--k-brand-mid);
  background: rgb(45 90 135 / 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.k-masthead h1 {
  font-family: var(--r-display);
  font-size: clamp(2.125rem, 5.5vw, 3.125rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--r-ink);
  margin: 0 0 1rem;
}

.k-masthead__lead {
  color: var(--r-ink-soft);
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 34rem;
  margin: 0 0 1.5rem;
}

.k-masthead__brand-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.k-masthead__aside {
  display: none;
}

@media (min-width: 900px) {
  .k-masthead__aside {
    display: block;
    border-radius: var(--r-radius-xl);
    overflow: hidden;
    border: 1px solid var(--r-line);
    box-shadow: var(--r-shadow-lg);
    aspect-ratio: 4/5;
    max-height: 420px;
    background: var(--r-surface-band) center/cover no-repeat;
  }
}

/* Hub hero variant */
.k-masthead--hub {
  padding-bottom: clamp(3rem, 6vw, 4rem);
}

.k-masthead--hub .k-masthead__grid {
  grid-template-columns: 1fr;
}

/* —— Search (elevated card) —— */
.k-search-card {
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius-lg);
  box-shadow: var(--r-shadow-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.k-search-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--r-muted);
  margin: 0 0 0.75rem 0.25rem;
}

.k-search {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .k-search {
    grid-template-columns: 1.4fr 1fr 1fr auto;
    align-items: stretch;
  }
}

.k-search input,
.k-search select {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--r-line);
  border-radius: 12px;
  font-size: 0.9375rem;
  font-family: var(--r-font);
  background: var(--r-surface-subtle);
  color: var(--r-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.k-search input:focus,
.k-search select:focus {
  outline: none;
  border-color: var(--k-brand-mid);
  box-shadow: 0 0 0 3px rgb(45 90 135 / 0.12);
  background: var(--r-surface);
}

.k-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.k-chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--r-line);
  background: var(--r-surface);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--r-ink-soft);
  transition: all 0.2s;
  box-shadow: var(--r-shadow-sm);
}

.k-chip.is-active,
.k-chip:hover {
  border-color: var(--k-brand-mid);
  color: var(--k-brand);
  background: rgb(45 90 135 / 0.08);
}

/* Trust — uses evapp-trust from evapp-modern */
.k-trust .evapp-trust-icon {
  color: var(--k-brand-mid);
}

/* —— Sections —— */
.k-section {
  padding: clamp(3.5rem, 7vw, 5rem) 0;
  background: var(--r-surface);
}

.k-section--band {
  background: var(--r-surface-band);
}

.k-section__header {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
}

.k-section__header--left {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.k-section__eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--r-muted);
  margin-bottom: 0.5rem;
}

.k-section__header h2 {
  font-family: var(--r-display);
  font-size: clamp(1.875rem, 4vw, 2.375rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--r-ink);
  margin: 0 0 0.75rem;
}

.k-section__sub {
  color: var(--r-muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  margin: 0;
}

/* —— Country cards (hub) —— */
.k-countries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.k-country-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius-lg);
  overflow: hidden;
  box-shadow: var(--r-shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.2s;
}

.k-country-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--r-shadow-lg);
  border-color: rgb(45 90 135 / 0.25);
}

.k-country-card__img {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
}

.k-country-card__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgb(10 13 18 / 0.55) 100%);
}

.k-country-card__body {
  padding: 1.35rem 1.5rem 1.5rem;
  position: relative;
}

.k-country-card h2 {
  font-family: var(--r-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.k-country-card p {
  margin: 0;
  color: var(--r-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.k-country-card__cta {
  display: inline-flex;
  margin-top: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--k-brand-mid);
}

/* —— Feature cards (how it works) —— */
.k-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.k-feature-card {
  padding: 1.75rem;
  border-radius: var(--r-radius);
  border: 1px solid var(--r-line);
  background: var(--r-surface);
  box-shadow: var(--r-shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  height: 100%;
}

.k-feature-card:hover {
  box-shadow: var(--r-shadow-md);
  border-color: var(--r-line-strong);
}

.k-feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgb(45 90 135 / 0.12), var(--k-accent-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--k-brand-mid);
}

.k-feature-card h3 {
  font-family: var(--r-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  color: var(--r-ink);
}

.k-feature-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--r-muted);
  line-height: 1.55;
}

/* —— Listing grid (dossier-price-card style) —— */
.k-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.k-listing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius);
  overflow: hidden;
  box-shadow: var(--r-shadow-sm);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.k-listing-card:hover {
  box-shadow: var(--r-shadow-md);
  border-color: var(--r-line-strong);
  transform: translateY(-3px);
}

.k-listing-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.k-listing-card__media {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--r-surface-band);
  overflow: hidden;
}

.k-listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.k-listing-card__media--detail {
  border-radius: var(--r-radius-lg);
  margin-bottom: 1.25rem;
}

.k-listing-card__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgb(10 13 18 / 0.15));
  pointer-events: none;
}

.k-listing-card__body {
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.k-listing-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.k-listing-card__price {
  font-family: var(--r-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--r-ink);
  line-height: 1.1;
  white-space: nowrap;
}

.k-listing-card h3 {
  font-family: var(--r-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  line-height: 1.35;
}

.k-listing-card__meta {
  font-size: 0.8125rem;
  color: var(--r-muted);
  margin-top: auto;
  padding-top: 0.5rem;
}

.k-badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: rgb(45 90 135 / 0.1);
  color: var(--k-brand-mid);
  flex-shrink: 0;
}

.k-badge--investment {
  background: var(--k-accent-soft);
  color: #5c4520;
}

/* Legacy grid alias */
.k-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.k-grid.k-listings-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* —— Footer (dossier dark) —— */
.k-footer {
  background: var(--k-chrome-bg);
  color: #9ca3af;
  padding: clamp(1.25rem, 2.5vw, 1.75rem) 0 1rem;
  border-radius: var(--r-radius-lg) var(--r-radius-lg) 0 0;
  margin-top: 0;
}

.k-footer a {
  color: #d1d5db;
  text-decoration: none;
}

.k-footer a:hover { color: #fff; }

.k-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.k-footer__grid--local {
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .k-footer__grid,
  .k-footer__grid--local {
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
  }

  .k-footer__col--brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 479px) {
  .k-footer__grid,
  .k-footer__grid--local {
    grid-template-columns: 1fr;
  }
}

.k-footer__col--brand {
  max-width: 20rem;
}

.k-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.k-footer__brand-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.k-footer__brand-link--solo {
  display: inline-block;
  line-height: 0;
  margin-bottom: 0.35rem;
}

.k-footer__col--mark-only .k-logo--footer {
  width: clamp(2.5rem, 5vw, 3rem);
  height: clamp(2.5rem, 5vw, 3rem);
}

.k-footer__col--mark-only .k-footer__tagline {
  margin-top: 0.35rem;
}

.k-footer__col--mark-only .k-footer__contact {
  margin-top: 0.35rem;
}

.k-footer__brand-text {
  min-width: 0;
}

.k-footer__brand-name {
  margin: 0;
  font-family: var(--r-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.k-footer__brand-name span {
  color: var(--k-accent);
  font-weight: 500;
}

.k-footer__tagline {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #9ca3af;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.k-footer__contact {
  margin: 0.15rem 0 0;
  font-size: 0.8125rem;
}

.k-footer__heading {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.k-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.k-footer__links a {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.k-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 0.85rem;
}

.k-footer__copy {
  margin: 0;
  font-size: 0.8125rem;
}

.k-footer__legal {
  margin: 0;
  font-size: 0.75rem;
  color: #6b7280;
  max-width: 32rem;
  text-align: right;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .k-footer__legal {
    text-align: left;
  }
}

/* Legacy footer aliases (older pages) */
.k-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.k-footer__brand {
  margin: 0;
  font-family: var(--r-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
}

.k-footer__brand span {
  color: var(--k-accent);
  font-weight: 500;
}

/* —— Detail page panel —— */
.k-detail-panel {
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius-lg);
  box-shadow: var(--r-shadow-md);
  padding: clamp(1.5rem, 4vw, 2rem);
  overflow: hidden;
}

.k-detail-panel img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--r-radius);
  margin-bottom: 1.25rem;
}

/* —— Admin —— */
.k-admin {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px 1fr;
}

@media (max-width: 900px) {
  .k-admin { grid-template-columns: 1fr; }
  .k-admin__sidebar { display: none; }
}

.k-admin__sidebar {
  background: var(--r-ink);
  color: #e8eaed;
  padding: 1.75rem 1.25rem;
  border-right: 1px solid rgb(255 255 255 / 0.06);
}

.k-admin__brand {
  margin: 0 0 1.75rem;
  padding: 0 0.9rem;
  font-family: var(--r-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.3;
}

.k-admin__brand span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--k-accent);
  margin-top: 0.15rem;
}

.k-admin__sidebar a {
  display: block;
  color: #9ca3af;
  text-decoration: none;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  transition: background 0.2s, color 0.2s;
}

.k-admin__sidebar a:hover,
.k-admin__sidebar a.is-active {
  background: rgb(255 255 255 / 0.08);
  color: #fff;
}

.k-admin__nav-label {
  margin: 1rem 0 0.35rem;
  padding: 0 0.9rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.35);
}

.k-admin__nav-label:first-of-type {
  margin-top: 0;
}

.k-admin__logout {
  margin-top: 1.5rem !important;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  padding-top: 1rem !important;
}

.k-admin__title {
  margin: 0 0 1rem;
  font-family: var(--r-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.k-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.k-type-tab {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--r-line);
  border-radius: 999px;
  background: var(--r-surface);
  font-family: var(--r-font);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.k-type-tab:hover {
  border-color: var(--k-brand-mid);
}

.k-type-tab.is-active {
  background: var(--k-brand);
  border-color: var(--k-brand);
  color: #fff;
}

.k-form__sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.k-form__section {
  border: 1px solid var(--r-line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem 0.5rem;
  margin: 0 0 1.25rem;
  background: var(--r-surface-subtle);
}

.k-form__section legend {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--k-brand-mid);
  padding: 0 0.35rem;
}

.k-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0 1rem;
}

.k-form__grid > div {
  min-width: 0;
}

.k-form__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.k-form__check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

.k-form__check input {
  width: auto;
  margin: 0;
}

.k-form__hint {
  font-size: 0.8125rem;
  color: var(--k-muted);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.k-form__hint code {
  font-size: 0.75rem;
  background: rgb(0 0 0 / 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.k-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.k-table__actions {
  white-space: nowrap;
}

.k-table__actions .k-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.k-admin__main {
  padding: 2rem clamp(1.25rem, 4vw, 2.5rem);
  background: var(--r-surface-subtle);
}

.k-panel {
  background: var(--r-surface);
  border: 1px solid var(--r-line);
  border-radius: var(--r-radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--r-shadow-sm);
}

.k-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--r-ink);
}

.k-form input,
.k-form select,
.k-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--r-line);
  border-radius: 12px;
  font-family: var(--r-font);
  margin-bottom: 1rem;
  background: var(--r-surface-subtle);
}

.k-form input:focus,
.k-form select:focus,
.k-form textarea:focus {
  outline: none;
  border-color: var(--k-brand-mid);
  box-shadow: 0 0 0 3px rgb(45 90 135 / 0.1);
  background: var(--r-surface);
}

.k-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.k-table th,
.k-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--r-line);
}

.k-table th {
  font-weight: 600;
  color: var(--r-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.k-alert {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.k-alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.k-alert--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }

.k-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #152a3f 0%, var(--k-brand) 55%, #0f1f2e 100%);
  padding: 2rem 0;
}

.k-login__box {
  width: min(100% - 2rem, 420px);
  background: rgb(10 20 32 / 0.55);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--r-radius-lg);
  padding: 2.25rem;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.35);
}

.k-login__box h1 {
  color: #fff;
}

.k-login__box > p {
  color: rgb(255 255 255 / 0.65) !important;
}

.k-login__box .k-form label {
  color: rgb(255 255 255 / 0.85);
}

.k-login__box .k-form input {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.12);
  color: #fff;
}

.k-login__box .k-form input:focus {
  background: rgb(255 255 255 / 0.1);
  border-color: var(--k-accent);
}

.k-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--r-muted);
  font-size: 1rem;
  background: var(--r-surface-band);
  border-radius: var(--r-radius);
  border: 1px dashed var(--r-line);
}

/* Hero aliases (templates may still use k-hero) */
.k-hero {
  padding-top: clamp(7rem, 13vw, 9rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  background: linear-gradient(180deg, var(--r-surface-band) 0%, var(--r-surface) 62%);
  position: relative;
  overflow: hidden;
}

.k-hero h1 {
  font-family: var(--r-display);
  font-size: clamp(2.125rem, 5.5vw, 3.125rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 0 0 1rem;
}

.k-hero__brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.k-hero__lead {
  color: var(--r-ink-soft);
  font-size: 1.125rem;
  line-height: 1.65;
  max-width: 34rem;
  margin: 0 0 1.5rem;
}
