:root {
  --bg: #eff4f8;
  --ink: #163046;
  --brand: #0f766e;
  --brand-2: #f59e0b;
  --card: #ffffff;
  --muted: #5f7182;
  --line: #d9e2ea;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Alegreya Sans', 'Trebuchet MS', 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 25% 8%, #d9f3ef 0%, var(--bg) 42%);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1300px; margin: 0 auto; padding: 1rem; }
.row { display: flex; justify-content: space-between; align-items: center; }
.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.topbar nav a { margin-left: 1rem; color: var(--muted); }
.brand { font-size: 1.4rem; font-weight: 700; color: var(--brand); }
.topbar .superadmin-switch {
  margin: .5rem auto 0;
  max-width: 1300px;
  padding: 0 1rem .6rem;
  display: flex;
  justify-content: flex-end;
}
.topbar .superadmin-switch label {
  font-size: .85rem;
}

.hero { padding: 2rem; border-radius: 18px; background: linear-gradient(120deg, #e6f8f5, #fef5dd); margin: 1rem 0; }
.hero.compact { padding: 1.2rem; }
.hero-main {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr);
  gap: 1.2rem;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.75), rgba(255,255,255,0) 45%),
    linear-gradient(120deg, #e4f7f5, #fdf1d2 65%);
}
.hero-content h1 {
  font-size: clamp(2.2rem, 2.6vw, 3.2rem);
  line-height: 1.05;
  margin: .2rem 0 .6rem;
  font-family: 'Alegreya', 'Georgia', serif;
}
.hero-lead { font-size: 1.1rem; color: #2b3b4d; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(15, 118, 110, .12);
  color: #0f4f4a;
  border: 1px solid rgba(15, 118, 110, .25);
  padding: .25rem .7rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }
.hero-cta .btn { min-width: 150px; }
.hero-points {
  margin-top: 1.2rem;
  display: grid;
  gap: .55rem;
  padding: .9rem 1rem;
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(15, 23, 42, .08);
}
.hero-points > div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: .8rem;
  align-items: baseline;
}
.hero-points strong { font-size: .95rem; color: #0f4f4a; }
.hero-points span { color: #334155; }
.harbor-hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}
.harbor-hero-media {
  display: flex;
  justify-content: flex-end;
}
.harbor-hero-img {
  width: 100%;
  max-width: 320px;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}
.harbor-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 260px;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .5rem;
}
.harbor-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .10);
}
.webcam-links { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 900px) {
  .harbor-hero { grid-template-columns: 1fr; }
  .harbor-hero-media { justify-content: flex-start; }
  .harbor-hero-img { max-width: 100%; }
}
.role-cta {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
  align-items: center;
  gap: 1rem;
}
.role-cta-actions {
  display: flex;
  gap: .8rem;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
@media (max-width: 900px) {
  .role-cta { grid-template-columns: 1fr; }
  .role-cta-actions { justify-content: flex-start; flex-wrap: wrap; }
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--brand);
  color: var(--brand);
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .6rem;
  margin-top: 1.2rem;
}
.metric { font-size: 1.3rem; font-weight: 700; display: block; }
.metric-label { font-size: .85rem; color: var(--muted); }
.hero-visual {
  display: grid;
  gap: .8rem;
}
.hero-visual.modern { align-content: start; }
.hero-showcase {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}
.hero-showcase h3 { margin: .1rem 0 .4rem; font-family: 'Alegreya', 'Georgia', serif; }
.hero-showcase p { margin: 0 0 .6rem 0; color: #334155; }
.hero-card {
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  padding: 1rem;
}
.hero-card.alt { background: rgba(255,255,255,.75); }
.hero-mini-map {
  margin-top: .8rem;
  height: 110px;
  border-radius: 10px;
  background: linear-gradient(180deg, #cfe8fb, #eaf4ff);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(53, 90, 120, .2);
}
.mini-pier {
  position: absolute;
  left: 10%;
  top: 15%;
  width: 70%;
  height: 16px;
  background: linear-gradient(180deg, #b28e6b, #8e6f53);
  border-radius: 8px;
}
.mini-berths {
  position: absolute;
  left: 18%;
  top: 42%;
  width: 10px;
  height: 50px;
  background: #2f9d4e;
  box-shadow: 18px 0 0 #2f9d4e, 36px 0 0 #bf8c19, 54px 0 0 #666666;
  border-radius: 4px;
}
.steps { position: relative; }
.step-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem;
}
.step-list li {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  padding: .85rem .95rem;
  display: grid;
  gap: .25rem;
}
.step-list li strong { font-size: 1rem; }
.step-list li span { color: #475569; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.sales-split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1rem;
  margin: 1rem 0;
  align-items: stretch;
}
.sales-split.reverse {
  grid-template-columns: .85fr 1.15fr;
}
.media-placeholder {
  border: 1px dashed #9fb7cf;
  background: linear-gradient(180deg, #f7fbff, #eef5fc);
  min-height: 200px;
  display: grid;
  align-content: center;
  justify-items: start;
}
.callout {
  border: 1px solid #bcd4ea;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .sales-split, .sales-split.reverse { grid-template-columns: 1fr; }
  .hero-points > div { grid-template-columns: 1fr; gap: .15rem; }
}
.card.feature {
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
}
.muted { color: var(--muted); }
.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: .4rem 0 1rem;
}
.subnav .left { display: flex; align-items: center; gap: .6rem; }
.subnav .crumb { color: var(--muted); font-weight: 600; }
.subnav .btn.small { padding: .35rem .6rem; }
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .8rem;
}
.wizard-steps .step {
  border-radius: 999px;
  border: 1px solid #bfd0e1;
  background: #eef5fc;
  padding: .25rem .7rem;
  font-size: .85rem;
  color: #35506b;
}
.wizard-steps .step.active {
  background: rgba(15, 118, 110, .15);
  border-color: rgba(15, 118, 110, .35);
  color: #0f4f4a;
  font-weight: 700;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .8rem;
  border: 1px solid rgba(15, 23, 42, .12);
}
.pill.subtle {
  background: #f3f8fd;
  color: #31506b;
  border-color: #c8d9ea;
}
.pill.ok { background: rgba(47,157,78,.12); color: #1b6a34; border-color: rgba(47,157,78,.25); }
.pill.bad { background: rgba(174,47,47,.10); color: #8a1e1e; border-color: rgba(174,47,47,.25); }

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.editor-grid { grid-template-columns: minmax(700px, 1fr) 350px; align-items: start; }
.role-cards { align-items: stretch; }
.role-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
}
.role-card p:last-child { margin-top: auto; }
.harbor-search {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.harbor-filters { position: sticky; top: 1rem; align-self: start; }
.harbor-results {
  display: grid;
  gap: 1rem;
}
.harbor-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.harbor-card:hover { box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12); }
.harbor-photo {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #b7d3ea, #e9f2f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d4055;
  font-size: .85rem;
  font-weight: 600;
}
.harbor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.harbor-body h3 { margin: 0 0 .2rem 0; }
.harbor-link { text-decoration: none; }
.harbor-link:hover { text-decoration: underline; }
.harbor-location { margin: 0 0 .6rem 0; color: #475569; }
.harbor-title { display: grid; gap: .15rem; }

@media (max-width: 900px) {
  .harbor-search { grid-template-columns: 1fr; }
  .harbor-card { grid-template-columns: 1fr; }
  .harbor-photo { height: 200px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  background: var(--brand);
  color: white;
  border: 1px solid rgba(8, 51, 47, 0.20);
  border-radius: 8px;
  padding: .55rem .9rem;
  min-height: 40px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.btn:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.btn.secondary {
  background: var(--brand-2);
  color: #1b2430;
  border-color: rgba(138, 90, 8, 0.22);
}
.btn.small {
  padding: .35rem .55rem;
  font-size: .86rem;
  min-height: 34px;
}
.btn.large { padding: .8rem 1.2rem; font-size: 1rem; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.inline-expander summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--brand);
  font-weight: 600;
}
.inline-expander summary::-webkit-details-marker { display: none; }
.inline-expander .plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--brand);
  line-height: 1;
}
.owner-add-boat { margin-top: .8rem; }

.form-grid { display: grid; gap: .7rem; }
.form-grid.narrow { max-width: 420px; }
.form-grid.filters { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: grid; gap: .25rem; font-size: .95rem; }
input, select, textarea {
  border: 1px solid #cad8e6;
  border-radius: 8px;
  padding: .55rem;
}

.flash {
  margin: 1rem 0;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}
.flash.error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}
.flash.success {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.table-wrap {
  overflow-x: hidden;
  overflow-y: visible;
}
th, td {
  padding: .45rem .5rem;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
th { white-space: normal; }
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: .7rem;
}
.action-left { flex: 1; }

.map-wrap { overflow: auto; }
.map-frame { overflow: auto; border: 1px solid #c5d8ea; border-radius: 12px; background: #e4f1fb; }
.map {
  position: relative;
  border: 2px solid #96b3cc;
  border-radius: 12px;
  overflow: hidden;
}
.map-scene {
  background:
    linear-gradient(180deg, rgba(210,231,247,.25), rgba(136,178,208,.15)),
    repeating-linear-gradient(90deg, #d9ecfb, #d9ecfb 24px, #d1e6f7 25px);
}
.map-water-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.24), rgba(255,255,255,0) 40%);
  pointer-events: none;
  z-index: 1;
}

.map-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-layer-elements { z-index: 10; }
.map-layer-berths { z-index: 20; }
.map-layer .editable-item { pointer-events: auto; }
.map-layer-elements .map-element { box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.map-layer-berths .berth { box-shadow: 0 1px 2px rgba(7, 23, 41, .24); }
.map-layer-berths::before {
  content: "Båtplasser";
  position: absolute;
  left: 10px;
  top: 8px;
  padding: 2px 6px;
  font-size: .68rem;
  letter-spacing: .02em;
  color: #274760;
  background: rgba(255,255,255,.6);
  border-radius: 6px;
  border: 1px solid rgba(39, 71, 96, .18);
  pointer-events: none;
  z-index: 0;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .7rem;
}
.map-toolbar input { min-width: 180px; }
.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.toolbar-inline {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
}

.btn.active-tool {
  background: #0b4f4a;
  color: #fff;
}

.map-element,
.berth {
  position: absolute;
  border-radius: 7px;
  user-select: none;
}

.map-element {
  border: 1px solid rgba(10, 31, 51, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #13263a;
  font-size: .78rem;
  font-weight: 600;
}
.map-element .map-el-label {
  pointer-events: none;
  padding: 2px 5px;
  background: rgba(255,255,255,.55);
  border-radius: 6px;
}
.map-element.type-pier { background: linear-gradient(180deg, #b28e6b, #8e6f53); color: #fff; }
.map-element.type-floating_dock { background: linear-gradient(180deg, #8f6f4d, #71543a); color: #fff; }
.map-element.type-service { background: linear-gradient(180deg, #f5cd79, #d8a64c); }
.map-element.type-building { background: linear-gradient(180deg, #c8d2db, #9bacb8); }

.berth {
  color: white;
  border: 1px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .74rem;
  font-weight: 700;
  min-width: 12px;
  min-height: 12px;
}
.berth > span { pointer-events: none; }
.berth.owner-berth {
  outline: 3px solid #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .35);
}
.berth .owner-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 2px 5px;
  font-size: .62rem;
  background: rgba(15, 23, 42, .85);
  color: #fff;
  border-radius: 4px;
  pointer-events: none;
}

.editable-item { cursor: move; }
.editable-item.active {
  outline: 2px solid #111827;
  z-index: 40;
}
.editable-item.collision {
  outline: 2px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(239,68,68,.25);
}
.resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #0f172a;
  border-radius: 50%;
  cursor: nwse-resize;
}
.delete-handle {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #1f2937;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  line-height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 45;
}
.delete-handle:hover {
  background: #fee2e2;
  border-color: #991b1b;
  color: #991b1b;
}

.draw-preview {
  opacity: .5;
  border: 2px dashed #0f172a !important;
  z-index: 50;
}
.draw-preview.collision {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, .28) !important;
}
.draw-preview .draw-preview-label {
  position: absolute;
  left: 4px;
  top: 4px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  font-size: .7rem;
  padding: 2px 4px;
  border-radius: 4px;
  pointer-events: none;
}

.inline-form {
  display: flex;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form .btn,
.inline-form select,
.inline-form input {
  margin: 0;
}
.settings-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.admin-shell .settings-side,
.admin-shell .settings-main .card {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: #13324e;
  border: 1px solid #d4e2ef;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
.admin-shell .settings-side {
  position: sticky;
  top: 1rem;
  border-radius: 18px;
  padding: .9rem;
  display: grid;
  gap: .35rem;
}
.admin-shell .settings-side h3 {
  margin: .2rem 0 .5rem;
  color: #0f2e47;
}
.admin-shell .settings-side a {
  border: 1px solid #d5e3f0;
  border-radius: 12px;
  padding: .58rem .75rem;
  color: #335673;
  background: #f4f9ff;
  font-weight: 600;
}
.admin-shell .settings-side a.active {
  background: #0f7e7a;
  border-color: #0f7e7a;
  color: #fff;
  font-weight: 700;
}
.admin-shell .settings-side .settings-link-inline {
  border-left: 4px solid #98c7df;
}
.admin-shell .settings-side .settings-link-route {
  background: #fff7e6;
  border-color: #f3cf89;
  border-left: 4px solid #e6ab3e;
}
.admin-shell .settings-side .settings-link-route span {
  float: right;
  opacity: .8;
}
.admin-shell .settings-main .card h1,
.admin-shell .settings-main .card h2,
.admin-shell .settings-main .card h3,
.admin-shell .settings-main .card p,
.admin-shell .settings-main .card th,
.admin-shell .settings-main .card td,
.admin-shell .settings-main .card label,
.admin-shell .settings-main .card .muted {
  color: #21425f;
}
.admin-shell .settings-main table tr td,
.admin-shell .settings-main table tr th {
  border-bottom-color: #d7e5f1;
}
.admin-shell .settings-main input,
.admin-shell .settings-main select,
.admin-shell .settings-main textarea {
  background: #fff;
  border-color: #c7d8e6;
  color: #1f3347;
}
.tenant-toolbar {
  margin: .5rem 0 .75rem;
}
.tenant-toolbar input[type="search"] {
  min-width: 290px;
}
.tenant-table-box {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
}
.admin-email-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .55rem;
  margin-left: .4rem;
  white-space: normal;
  width: 100%;
  margin-bottom: .2rem;
}
.admin-email-row code {
  max-width: 100%;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tenant-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: wrap;
  white-space: normal;
  width: 100%;
}
.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(8, 51, 47, 0.20);
  background: var(--brand);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}
.action-icon:hover { box-shadow: 0 8px 16px rgba(15, 23, 42, 0.24); }
.action-icon .cute-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.action-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  pointer-events: none;
}
.plus-icon {
  background: var(--brand-2);
  color: #1b2430;
  border-color: rgba(138, 90, 8, 0.22);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
}
.danger-icon {
  background: #c63b3b;
  border-color: #a32f2f;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}
.ok-icon {
  background: #2b8a57;
  border-color: #35a067;
  color: #f2fbf5;
}
.no-icon {
  background: #b83232;
  border-color: #d64a4a;
  color: #fff;
}
/* Fallback: if older text buttons appear in tenant actions, make them icon-only. */
.tenant-actions .btn.small {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 9px;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tenant-actions .btn.small::before {
  font-size: 1rem;
  line-height: 1;
}
.tenant-actions .btn.small[href*="/admin?tenant_slug"]::before { content: "⚓"; }
.tenant-actions .btn.small[href*="/admin/onboarding"]::before { content: "✨"; }
.tenant-actions .btn.small[href*="/admin/map"]::before { content: "🗺"; }
.tenant-actions .btn.small[href*="/superadmin/csv-import"]::before { content: "📄"; }
.confirm-inline {
  position: relative;
  display: inline-flex;
}
.confirm-inline > summary {
  list-style: none;
}
.confirm-inline > summary::-webkit-details-marker { display: none; }
.confirm-actions {
  position: absolute;
  top: 38px;
  right: 0;
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  z-index: 25;
}
.sa-hero {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 1rem;
}
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.sa-kpi {
  border: 1px solid #d6e4f0;
  border-radius: 12px;
  padding: .7rem .75rem;
  background: #f4f9ff;
}
.sa-kpi .label {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #52738e;
  margin-bottom: .2rem;
}
.sa-kpi strong {
  font-size: 1.7rem;
  line-height: 1.1;
}
.sa-kpi .metric {
  display: flex;
  align-items: baseline;
  gap: .68rem;
}
.sa-kpi small {
  color: #567894;
  font-size: 1rem;
  letter-spacing: .015em;
}
.actions-right {
  text-align: right;
}
.tenant-admin-table .actions-right {
  min-width: 210px;
}
.lead-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
  width: 100%;
}
.lead-actions .inline-form {
  justify-content: flex-end;
}
.list-stack {
  display: grid;
  gap: .7rem;
}
.list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: start;
  border: 1px solid #d8e5f1;
  border-radius: 14px;
  padding: .75rem .85rem;
  background: #fdfefe;
}
.list-card.alt {
  background: #f7fbff;
  border-color: #cfe0ef;
}
.list-card h4 {
  margin: 0 0 .5rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}
.list-main { min-width: 0; }
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .45rem .8rem;
}
.list-grid > div {
  display: grid;
  gap: .1rem;
  min-width: 0;
}
.list-grid .wide {
  grid-column: 1 / -1;
}
.list-grid .k {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #597894;
}
.list-grid .v {
  color: #16354f;
  overflow-wrap: anywhere;
}
.list-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 170px;
}
.tenant-stack .list-actions {
  min-width: 240px;
}
.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;
}

.size-readout {
  background: #eef7ff;
  border: 1px solid #cae3ff;
  border-radius: 8px;
  padding: .55rem;
  font-size: .9rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #d1dde8;
  border-radius: 999px;
  padding: .2rem .6rem;
  background: #f8fbff;
  font-size: .85rem;
}
.chip input { margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: #e6f1fb;
  border: 1px solid #c7dcf3;
  font-size: .78rem;
  color: #1f3b58;
}
.warn {
  color: #991b1b;
  font-weight: 700;
}
.site-footer {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.75);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.footer-grid p { margin: .35rem 0 0; color: var(--muted); }
.footer-links {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .grid.editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-main { grid-template-columns: 1fr; }
  .topbar .row { flex-wrap: wrap; gap: .6rem; }
  .topbar nav { display: flex; flex-wrap: wrap; gap: .4rem .8rem; width: 100%; }
  .topbar nav a { margin-left: 0; }
  .container { padding: .8rem; }
  .card { padding: .85rem; }
  .hero-cta .btn { min-width: 0; width: 100%; }
  .harbor-search { grid-template-columns: 1fr; }
  .harbor-filters { position: static; max-height: none; }
  .action-row { flex-wrap: wrap; justify-content: flex-start; }
  .subnav { flex-wrap: wrap; }
  .subnav .left { width: 100%; justify-content: space-between; }
  .map-toolbar input { min-width: 120px; }
  .wizard-steps .step { font-size: .8rem; }
  .footer-grid { flex-direction: column; }
  .btn-row { width: 100%; }
  .btn-row .btn { width: 100%; }
  .settings-shell { grid-template-columns: 1fr; }
  .admin-shell .settings-side { position: static; }
  .tenant-toolbar input[type="search"] { min-width: 0; width: 100%; }
  .tenant-table-box { max-height: 360px; }
  .sa-hero { grid-template-columns: 1fr; }
  .list-card { grid-template-columns: 1fr; }
  .list-actions,
  .tenant-stack .list-actions { min-width: 0; width: 100%; justify-content: flex-start; }
}
