/* ==========================================================================
   Skytteklubben – member administration
   Scandinavian look: warm paper, pine green, quiet lines, lots of air.
   Breakpoints:  phone < 700px  ·  tablet 700–1099px  ·  desktop ≥ 1100px
   ========================================================================== */

:root {
  --paper:      #F6F4F0;
  --surface:    #FFFFFF;
  --sand:       #EEEAE3;
  --line:       #E3DED5;
  --line-strong:#CFC8BC;
  --ink:        #1E2326;
  --ink-soft:   #4A5157;
  --muted:      #7A8086;
  --pine:       #2F4A3E;
  --pine-dark:  #233931;
  --pine-soft:  #E4EBE6;
  --fjord:      #3E5A6E;
  --fjord-soft: #E3EAF0;
  --ochre:      #9A6420;
  --ochre-soft: #F6ECDD;
  --lingon:     #A2392B;
  --lingon-soft:#F7E4E0;

  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 2px rgba(30, 35, 38, .04), 0 2px 8px rgba(30, 35, 38, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Inter, Arial, sans-serif;

  --sidebar-w: 248px;
  --tabbar-h:  64px;
  --gutter:    16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 16px; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
.link { color: var(--pine); text-decoration: underline; text-decoration-color: rgba(47, 74, 62, .3); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--pine); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.icon  { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; border-radius: 6px; }

/* ---------- Frame -------------------------------------------------------- */
.app { min-height: 100vh; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--pine); color: #fff;
}
.brand-mark .icon { width: 20px; height: 20px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sand); color: var(--ink); }
.nav-item.is-active { background: var(--pine-soft); color: var(--pine-dark); }

.sidebar { display: none; }
.topbar  { display: none; }
.tabbar  { display: none; }

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px var(--gutter) 40px;
}

/* ---------- Page head ---------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 24px;
}
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .02em; margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; margin-left: -6px; padding-right: 8px;
  color: var(--pine); font-weight: 500;
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink-soft); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-dark); border-color: var(--pine-dark); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--lingon); }
.btn-danger:hover { border-color: var(--lingon); background: var(--lingon-soft); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn.btn-danger:hover { background: var(--lingon-soft); color: var(--lingon); }

/* ---------- Cards, lists, facts ----------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }

.list { list-style: none; margin: 0 -8px; padding: 0; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px;
  border-radius: var(--radius-sm);
}
a.list-row:hover { background: var(--paper); }
.list li + li { border-top: 1px solid var(--line); }
.list-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.list-main strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row > .icon { color: var(--line-strong); }
.list-row form { margin: 0; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--sand); color: var(--ink-soft);
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; background: var(--pine-soft); color: var(--pine-dark); }

.facts { margin: 0; display: grid; }
.facts > div { display: grid; grid-template-columns: 42% 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.empty { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 8px 0; }
.empty .icon { color: var(--pine); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state p + p { margin-top: 4px; }
.meta { margin-top: 8px; text-align: center; }
.notes { white-space: normal; color: var(--ink-soft); }

/* ---------- Stats -------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.stat:hover { border-color: var(--line-strong); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat:first-child { background: var(--pine); border-color: var(--pine); color: #fff; }
.stat:first-child .stat-label { color: rgba(255, 255, 255, .75); }

/* ---------- Badges ------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--sand); color: var(--ink-soft);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge-active   { background: var(--pine-soft);  color: var(--pine-dark); }
.badge-pending  { background: var(--fjord-soft); color: var(--fjord); }
.badge-paused   { background: var(--ochre-soft); color: var(--ochre); }
.badge-resigned { background: var(--sand);       color: var(--muted); }
.badge-excluded { background: var(--lingon-soft);color: var(--lingon); }
.badge-warn     { background: var(--ochre-soft); color: var(--ochre); }
.badge-danger   { background: var(--lingon-soft);color: var(--lingon); }

.permit { font-variant-numeric: tabular-nums; }
.permit-soon    { color: var(--ochre); font-weight: 500; }
.permit-expired { color: var(--lingon); font-weight: 500; }

/* ---------- Alerts ------------------------------------------------------- */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--fjord-soft); color: var(--fjord);
}
.alert .icon { width: 18px; height: 18px; }
.alert-success { background: var(--pine-soft);   color: var(--pine-dark); }
.alert-warn    { background: var(--ochre-soft);  color: var(--ochre); }
.alert-error   { background: var(--lingon-soft); color: var(--lingon); }

/* ---------- Filters ------------------------------------------------------ */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.filters .search { grid-column: 1 / -1; }
.search { position: relative; display: block; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ---------- Form controls ------------------------------------------------ */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;              /* 16px stops iOS from zooming in on focus */
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="date"] { display: block; }
.search input[type="search"] { padding-left: 44px; }
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237A8086' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px rgba(47, 74, 62, .14); }
::placeholder { color: #A3A7AB; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 500; color: var(--ink-soft); padding: 0; }
.field-error { color: var(--lingon); font-size: 13px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--lingon); }

.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.member-form .card > * + * { margin-top: 16px; }
.member-form .card-head { margin-bottom: 0; }
.stack { display: grid; gap: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.chip input:checked + span { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--fjord); outline-offset: 2px; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: var(--line-strong); transition: background .2s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch input:checked + .switch-track { background: var(--pine); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--fjord); outline-offset: 2px; }

.form-actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; gap: 8px;
  margin: 8px calc(var(--gutter) * -1) 0; padding: 12px var(--gutter);
  background: rgba(246, 244, 240, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.add-admin { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.add-admin summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--pine); font-weight: 500; cursor: pointer; list-style: none;
}
.add-admin summary::-webkit-details-marker { display: none; }
.add-admin[open] summary { margin-bottom: 12px; }

/* ---------- Profile ------------------------------------------------------ */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.profile-title h1 { font-size: 24px; }
.profile-title p { margin: 4px 0 8px; }
.profile-head .actions { grid-column: 1 / -1; }
.profile-head .actions > * { flex: 1; }
.profile-head .actions .btn { width: 100%; }

/* ---------- Member table (cards on phone) ------------------------------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: #FBFAF8;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; transition: background .12s; }
.table tbody tr[data-href]:hover { background: #FBFAF8; }
.cell-member { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.td-nowrap { white-space: nowrap; }
.table th { white-space: nowrap; }
.row-link { font-weight: 500; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ---------- Login -------------------------------------------------------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--gutter); }
.login { width: 100%; max-width: 400px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 36px 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; margin-top: 18px; }
.login-card > p { margin: 4px 0 24px; }
.login-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--pine); color: #fff; }
.login-mark .icon { width: 30px; height: 30px; }

/* ==========================================================================
   Phone  (< 700px)  – top brand bar + bottom tab bar, cards instead of table
   ========================================================================== */
@media (max-width: 699px) {
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 20;
    padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) 8px;
    background: rgba(246, 244, 240, .92);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topnav { display: none; }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar .nav-item {
    flex-direction: column; justify-content: center; gap: 2px;
    min-height: 50px; padding: 0; font-size: 11px; background: none;
  }
  .tabbar .nav-item .icon { width: 24px; height: 24px; }
  .tabbar .nav-item.is-active { color: var(--pine); background: none; }

  .main { padding-top: 12px; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); }
  h1 { font-size: 26px; }
  .page-head { margin-top: 4px; }
  .page-head .actions .btn-primary span { display: none; }
  .page-head .actions .btn { padding: 0 14px; }
  .page-head .actions .btn-primary { width: 44px; padding: 0; }

  .form-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .form-actions .btn { flex: 1; }

  /* table rows become cards */
  .table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tbody tr {
    position: relative;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
    padding: 14px 16px; margin-bottom: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .table td { padding: 0; border: 0; font-size: 14px; }
  .table td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
  }
  .table td.td-member { grid-column: 1 / -1; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
  .table .cell-member { min-width: 0; }
  .table td.hide-md { display: none; }
  .row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
  .table td a.link { position: relative; z-index: 1; }
}

/* ==========================================================================
   Tablet / iPad  (700px – 1099px)  – top bar with inline navigation
   ========================================================================== */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .main { padding-top: 28px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
  .filters { grid-template-columns: 2fr repeat(4, minmax(0, 1fr)); }
  .filters .search { grid-column: auto; }
  .profile-head { grid-template-columns: auto 1fr auto; padding: 24px; }
  .profile-head .actions { grid-column: auto; }
  .profile-head .actions > *, .profile-head .actions .btn { flex: none; width: auto; }
  .card { padding: 24px; }
  .form-actions { margin: 8px 0 0; padding: 14px 0; border-top: 1px solid var(--line); background: rgba(246, 244, 240, .92); }
  .login-card { padding: 44px 40px; }
}

@media (min-width: 700px) and (max-width: 1099px) {
  .topbar {
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 20;
    padding: calc(env(safe-area-inset-top) + 10px) var(--gutter) 10px;
    background: rgba(246, 244, 240, .92);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topnav { display: flex; gap: 4px; margin-left: auto; }
  .topnav .nav-item { gap: 8px; padding: 0 14px; border-radius: 999px; }
  .topnav .nav-item .icon { width: 18px; height: 18px; }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  .filters-2 { grid-template-columns: 1fr 200px; }
  .filters-2 .search { grid-column: auto; }
  .table .hide-md { display: none; }
}
@media (min-width: 1100px) and (max-width: 1299px) {
  .table .hide-lg { display: none; }
}
@media (min-width: 700px) and (max-width: 959px) {
  .topbar .brand-name { display: none; }
  .topnav { gap: 0; }
  .topnav .nav-item { padding: 0 11px; }
}
@media (min-width: 700px) and (max-width: 779px) {
  .topnav .nav-item span { display: none; }
  .topnav .nav-item { width: 44px; justify-content: center; padding: 0; }
}

/* ==========================================================================
   Desktop  (≥ 1100px, e.g. 1200px screen) – fixed sidebar
   ========================================================================== */
@media (min-width: 1100px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 28px;
    position: sticky; top: 0; height: 100vh;
    padding: 24px 16px;
    background: #FBFAF8; border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 0 8px; }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 4px; }
  .who { display: flex; align-items: center; gap: 10px; padding: 0 12px 8px; font-size: 14px; color: var(--ink-soft); }
  .main { padding: 36px 40px 48px; max-width: 1040px; margin: 0; min-width: 0; }
  .filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .filters .search { grid-column: 1 / -1; }
  .filters-2 { grid-template-columns: 1fr 220px; }
  .filters-2 .search { grid-column: auto; }
}


/* ==========================================================================
   Calendar
   ========================================================================== */
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-sm .icon { width: 16px; height: 16px; }

.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg .btn { border-color: transparent; }
.date-jump { display: flex; gap: 8px; flex-wrap: wrap; }
.date-jump input[type="date"], .date-jump select { min-height: 40px; padding: 6px 12px; width: auto; }
.date-jump select { padding-right: 36px; }

.range-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-link {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font-size: 14px; color: var(--ink-soft);
}
.chip-link:hover { border-color: var(--pine); color: var(--pine); }

.cal { padding: 0 !important; overflow: hidden; }
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-grid {
  display: grid;
  grid-template-columns: 56px repeat(var(--cols), minmax(150px, 1fr));
  min-width: calc(56px + var(--cols) * 150px);
  padding-bottom: 12px;
}
.cal-week { grid-template-columns: 56px repeat(7, minmax(112px, 1fr)); min-width: calc(56px + 7 * 112px); }

.cal-corner, .cal-times { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cal-corner { border-bottom: 1px solid var(--line); }
.cal-head {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  padding: 12px 12px 10px;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #FBFAF8; font-size: 12px; color: var(--muted);
}
.cal-head strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.cal-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-head:hover strong { color: var(--pine); }
.cal-head.is-today { background: var(--pine-soft); }
.cal-head.is-today strong { color: var(--pine-dark); }

.cal-times, .cal-col { position: relative; height: var(--h); margin-top: 10px; }
.cal-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col {
  border-left: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) / 2), #F2EFE9 calc(var(--hour) / 2), #F2EFE9 calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px), transparent var(--hour));
  cursor: copy;
}
.cal-col.is-past { background-color: #FBFAF8; cursor: default; }
.cal-col.is-past .bk { opacity: .6; }
.cal-closed {
  position: absolute; left: 0; right: 0; z-index: 1;
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, #F1EEE8 0, #F1EEE8 6px, #F8F6F2 6px, #F8F6F2 12px);
  cursor: not-allowed;
}
.cal-closed span { font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .8); padding: 2px 8px; border-radius: 999px; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--lingon); z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--lingon); }
.cal-col ~ .cal-col .cal-now::before { display: none; }

.bk {
  position: absolute; z-index: 2;
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 7px;
  border: 1px solid var(--surface); border-left: 3px solid var(--pine); border-radius: 7px;
  background: var(--pine-soft); color: var(--pine-dark);
  font-size: 12px; line-height: 1.25; overflow: hidden;
  cursor: pointer; transition: filter .15s, box-shadow .15s;
}
.bk:hover { filter: brightness(.97); box-shadow: 0 2px 8px rgba(30, 35, 38, .12); z-index: 5; }
.bk-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-title, .bk-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-title { font-weight: 500; }
.bk-meta { opacity: .8; }
.bk-club  { background: var(--fjord-soft); border-left-color: var(--fjord); color: var(--fjord); }
.bk-noro  { background: var(--ochre-soft); border-left-color: var(--ochre); color: #6B4515; }
.bk-mine  { background: var(--pine); border-left-color: var(--pine-dark); color: #fff; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 12px 2px 0; font-size: 13px; color: var(--ink-soft); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-booking { background: var(--pine-soft); border-left: 3px solid var(--pine); }
.lg-mine    { background: var(--pine); }
.lg-noro    { background: var(--ochre-soft); border-left: 3px solid var(--ochre); }
.lg-closed  { background: repeating-linear-gradient(135deg, #E6E1D8 0, #E6E1D8 3px, #F8F6F2 3px, #F8F6F2 6px); }

.range-info { padding: 16px 20px !important; }
.facts-inline { grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }
.facts-inline > div { display: flex; flex-direction: column; gap: 0; padding: 0; border: 0; }
.facts-inline dt { font-size: 12px; }
.facts-inline dd { font-weight: 500; }
.range-info p { margin-top: 10px; }

/* booking form */
.subhead { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 6px; }
.list-compact .list-row { min-height: 44px; padding: 6px 8px; }
.time-pill {
  flex: none; padding: 3px 10px; border-radius: 999px;
  background: var(--sand); color: var(--ink-soft); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.static-value { min-height: 46px; display: flex; align-items: center; padding: 0 14px; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); }
.date-tile {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 46px; height: 50px; border-radius: 10px; background: var(--pine-soft); color: var(--pine-dark); line-height: 1.1;
}
.date-tile strong { font-size: 18px; }
.date-tile span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.roles { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ranges */
.range-card .muted.small { margin-top: -6px; }
.range-card.is-inactive { opacity: .65; }
.range-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.range-stats strong { color: var(--ink); font-size: 15px; }
.facts-hours > div { grid-template-columns: 56px 1fr; padding: 6px 0; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.hours-grid { display: grid; gap: 8px; }
.hours-head, .hours-row { display: grid; grid-template-columns: 96px repeat(4, minmax(0, 1fr)); gap: 8px; align-items: center; }
.hours-head span { font-size: 12px; color: var(--muted); }
.hours-day { font-weight: 500; font-size: 14px; }
.hours-row input[type="time"] { min-height: 42px; padding: 6px 8px; }
.danger-zone { border-color: var(--lingon-soft); }
.danger-zone .card-head { margin-bottom: 4px; }
.danger-zone form { margin-top: 12px; }
.setting-link { display: flex; align-items: center; gap: 14px; }
.setting-link:hover { border-color: var(--line-strong); }
.setting-link > .icon { color: var(--muted); }

@media (max-width: 699px) {
  .cal-grid { grid-template-columns: 48px repeat(var(--cols), minmax(132px, 1fr)); min-width: calc(48px + var(--cols) * 132px); }
  .cal-week { grid-template-columns: 48px repeat(7, minmax(104px, 1fr)); min-width: calc(48px + 7 * 104px); }
  .cal-hour { right: 6px; }
  .cal { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); border-radius: 0; border-left: 0; border-right: 0; }
  .hours-head { display: none; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .hours-day { grid-column: 1 / -1; margin-top: 6px; }
  .roles { display: none; }
  .filters select[name="sort"] { grid-column: 1 / -1; }
}
@media (min-width: 700px) {
  .facts-inline { grid-template-columns: repeat(4, 1fr); }
  .grid-2-wide { grid-template-columns: 3fr 2fr; }
}


/* ==========================================================================
   Fees
   ========================================================================== */
.text-warn   { color: var(--ochre); }
.text-danger { color: var(--lingon); }
code { white-space: nowrap; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; background: var(--sand); padding: 2px 7px; border-radius: 6px; }

.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 44px; }
.input-suffix em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); pointer-events: none; }

.stat.stat-danger { border-color: #E9C4BD; background: var(--lingon-soft); color: var(--ink); }
.stat.stat-danger .stat-value { color: var(--lingon); }
.stat.stat-danger .stat-label { color: var(--lingon); }
.stats .stat .stat-value { overflow-wrap: anywhere; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }

/* arrears in the member list */
.row-arrears td:first-child { box-shadow: inset 3px 0 0 var(--lingon); }
.row-arrears { background: #FDF5F3; }
.table tbody tr.row-arrears[data-href]:hover { background: #FBEDEA; }
.arrears-tag {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  margin-top: 3px; padding: 2px 8px 2px 6px; border-radius: 999px;
  background: var(--lingon); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.arrears-tag .icon { width: 13px; height: 13px; }
.alert-link { text-decoration: none; }
.alert-link:hover span { text-decoration: underline; }
.is-inactive { opacity: .6; }
.td-check { width: 44px; }
.td-check input { width: 20px; height: 20px; accent-color: var(--pine); }
th input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--pine); }

.form-grid-3, .form-grid-4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 220px; }

/* member: my fees */
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 8px 2px 10px; }
.fee-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fee-summary > div { display: flex; flex-direction: column; gap: 2px; }
.fee-summary strong { font-size: 16px; }
.pay-card.is-overdue { border-color: #E9C4BD; box-shadow: inset 4px 0 0 var(--lingon), var(--shadow); }
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pay-amount { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.pay-ref { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pay-ref code { font-size: 16px; padding: 6px 12px; }
.pay-ways { display: grid; gap: 12px; margin: 18px 0 12px; }
.pay-way { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); border: 1px solid var(--line); }
.pay-way p { margin: 4px 0 0; color: var(--ink-soft); }
.btn-mobilepay { margin-top: 12px; background: #5A78FF; border-color: #5A78FF; color: #fff; }
.btn-mobilepay:hover { background: #4863E6; border-color: #4863E6; }

@media (max-width: 699px) {
  .fee-summary { grid-template-columns: 1fr 1fr; }
  .pay-ref { align-items: flex-start; }
  .row-arrears { background: none; }
  .table tbody tr.row-arrears { border-color: #E9C4BD; box-shadow: inset 4px 0 0 var(--lingon), var(--shadow); }
  .row-arrears td:first-child { box-shadow: none; }
  .td-check { position: absolute; right: 12px; top: 14px; }
}
@media (min-width: 700px) {
  .form-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .form-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .pay-ways { grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   Våbenregister
   ========================================================================== */
.top-actions { display: flex; align-items: center; gap: 2px; }
.icon-btn.is-active { background: var(--pine-soft); color: var(--pine-dark); }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat.is-selected { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine), var(--shadow); }

.thumb {
  flex: none; width: 52px; height: 40px; border-radius: 8px;
  object-fit: cover; background: var(--sand);
}
.thumb-empty { display: grid; place-items: center; color: var(--line-strong); }
.thumb-empty .icon { width: 20px; height: 20px; }

.weapon-head { display: grid; grid-template-columns: 1fr; gap: 20px; }
.weapon-photo img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--paper); border-radius: var(--radius-sm); }
.photo-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 180px; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px;
}
.photo-empty .icon { width: 36px; height: 36px; color: var(--line-strong); }
.weapon-title h1 { font-size: 26px; }
.weapon-title p.muted { margin: 4px 0 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.weapon-title .actions form { margin: 0; }

.weapon-form { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 16px; }
.weapon-form > .card { margin-bottom: 0; }
.photo-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; border-radius: var(--radius-sm); background: var(--paper); }
.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 100px; }

.caliber-list .list-row { gap: 10px; }
.caliber-form { flex: 1; flex-wrap: nowrap; }
.caliber-form input[type="text"] { min-height: 40px; padding: 6px 12px; min-width: 0; }

@media (min-width: 700px) {
  .weapon-head { grid-template-columns: minmax(260px, 2fr) 3fr; align-items: start; }
}
@media (min-width: 1100px) {
  .weapon-form { grid-template-columns: 3fr 2fr; align-items: start; }
  .photo-card { position: sticky; top: 24px; }
}
@media (max-width: 699px) {
  .stats-3 .stat-value { font-size: 24px; }
  .weapons-table .thumb { width: 44px; height: 36px; }
}

/* money amounts in stat tiles stay on one line */
.stat-money { white-space: nowrap; font-size: 22px; letter-spacing: -0.02em; }
@media (min-width: 700px) { .stat-money { font-size: 24px; } }
@media (min-width: 1100px) { .stat-money { font-size: 26px; } }

/* the member table card never gets inner padding */
.card.table-wrap { padding: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}


/* ==========================================================================
   SKV-registreringer
   ========================================================================== */
[hidden] { display: none !important; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.skv-form {
  flex: none; display: inline-grid; place-items: center;
  min-width: 52px; height: 30px; padding: 0 8px; border-radius: 8px;
  background: var(--fjord-soft); color: var(--fjord);
  font-size: 12.5px; font-weight: 600; letter-spacing: .03em; font-variant-numeric: tabular-nums;
}
.skv-list .list-row { align-items: center; }
.skv-list .list-main .small { white-space: normal; }
.skv-list .badge, .td-skv .badge { white-space: nowrap; }
.td-skv { min-width: 150px; }
.td-skv .skv-line { display: block; margin-top: 4px; line-height: 1.35; }
.field .switch { margin-top: 4px; }
.delete-row { display: flex; justify-content: flex-start; margin: 8px 0 24px; }

.stats-plain .stat:first-child { background: var(--surface); border-color: var(--line); color: inherit; }
.stats-plain .stat:first-child .stat-label { color: var(--muted); }
.stats-plain .stat.stat-danger:first-child { border-color: #E9C4BD; background: var(--lingon-soft); }
.stats-plain .stat.stat-danger:first-child .stat-label { color: var(--lingon); }
.stats-skv { grid-template-columns: repeat(2, 1fr); }
.stats-skv .stat { padding: 12px 14px; }
.stats-skv .stat-value { font-size: 24px; }
@media (min-width: 700px) { .stats-skv { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 699px) {
  .skv-list .list-row { flex-wrap: wrap; row-gap: 6px; }
  .skv-list .list-main { flex: 1 1 calc(100% - 76px); }
  .skv-list .list-row > .badge { margin-left: 64px; }
}
.sub-head { font-size: 15px; font-weight: 600; margin: 20px 0 2px; }
.btn-order-first { order: -1; }
.form-grid + .sub-head { padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 699px) {
  .form-actions:has(.btn-order-first:not([hidden])) { flex-wrap: wrap; }
  .form-actions .btn-order-first { flex-basis: 100%; }
}


/* ==========================================================================
   Kasse og lager
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.btn-lg { min-height: 52px; font-size: 16px; }
.narrow-card { max-width: 460px; }
.form-actions-inline { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.plain-list { margin: 4px 0 0; padding-left: 18px; }
.plain-list li { padding: 2px 0; }
.row-muted td { opacity: .55; }
.stock-ok { font-weight: 600; font-variant-numeric: tabular-nums; }
.qty { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty-in  { color: var(--pine); }
.qty-out { color: var(--lingon); }
.list-row.is-voided { opacity: .5; text-decoration: line-through; }
.sale-amount { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
.sale-amount small { font-weight: 400; font-size: 12px; color: var(--muted); }

/* Undermenu */
.subnav { display: flex; gap: 4px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter) 2px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.subnav a:hover { border-color: var(--line-strong); }
.subnav a.is-active { background: var(--pine); border-color: var(--pine); color: #fff; }

/* Kasseskærmen */
.pos { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.pos-tools { display: grid; gap: 10px; margin-bottom: 12px; }
.pos-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-groups::-webkit-scrollbar { display: none; }
.pos-group { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pos-group.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pos-item {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 112px; padding: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.pos-item:hover { border-color: var(--line-strong); }
.pos-item:active { transform: scale(.98); }
.pos-item.is-added { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.pos-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.pos-item-meta { font-size: 12px; color: var(--muted); }
.pos-item-price { margin-top: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-item-price small { display: block; font-weight: 400; font-size: 12px; color: var(--pine); }
.pos-item-stock { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.pos-item-stock.is-low { background: var(--ochre-soft); color: var(--ochre); }
.pos-item-stock.is-out { background: var(--lingon-soft); color: var(--lingon); }
.pos-item[hidden] { display: none; }

.pos-cart { display: grid; gap: 12px; margin-bottom: 0; }
.pos-cart .card-head { margin-bottom: 0; }
.pos-cart button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.cart-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cart-empty { padding: 14px 0; font-size: 14px; }
.cart-line { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "name name" "qty total"; gap: 4px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart-line-name { grid-area: name; }
.cart-qty { grid-area: qty; }
.cart-line-total { grid-area: total; }
.cart-line-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.cart-line-name small { display: block; color: var(--muted); font-weight: 400; }
.cart-qty { display: inline-flex; align-items: center; gap: 2px; }
.cart-qty button { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink); }
.cart-qty span { min-width: 26px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-line-total { min-width: 84px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 17px; }
.cart-total strong { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cart-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ochre-soft); color: var(--ochre); font-size: 13px; }
.cart-note .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.cart-note.is-error { background: var(--lingon-soft); color: var(--lingon); }
.pay-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pay-choices .chip span { width: 100%; justify-content: center; }
.cash-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.cash-row[hidden] { display: none; }
.change { display: flex; flex-direction: column; align-items: flex-end; min-width: 110px; padding-bottom: 8px; }
.change strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.change.is-short strong { color: var(--lingon); }

@media (min-width: 760px) {
  .pos { grid-template-columns: minmax(0, 1fr) 300px; }
  .pos-bar { display: none !important; }
  .pos-cart { position: sticky; top: 16px; }
}
@media (min-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 699px) {
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pos-item { min-height: 100px; padding: 10px; }
}

/* Kasseopgørelse */
.money-facts dd { text-align: right; font-variant-numeric: tabular-nums; }
.money-facts .sum dt, .money-facts .sum dd { font-weight: 600; color: var(--ink); }
.compact-table th, .compact-table td { padding: 8px 10px; }
.compact-table th:first-child, .compact-table td:first-child { padding-left: 0; }
.compact-table th:last-child, .compact-table td:last-child { padding-right: 0; }
.compact-table tfoot th, .compact-table tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; text-align: left; }
.compact-table tfoot .num { text-align: right; }
.receipt-table td, .receipt-table th { padding: 8px 10px; }
.move-form { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.move-form input[name="note"] { grid-column: 1 / -1; }
.denoms { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.denom { display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.denom > span { font-weight: 600; font-size: 14px; }
.denom input { min-height: 38px; min-width: 0; padding: 6px 10px; text-align: right; }
.denom output { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count-result { margin-top: 14px; }
@media (max-width: 699px) {
  .denoms { grid-template-columns: 1fr; }
}
@media (min-width: 960px) {
  .denoms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .move-form { grid-template-columns: 150px 130px 1fr 110px auto; }
  .move-form input[name="note"] { grid-column: auto; }
}

/* Lager */
.stock-form { display: grid; gap: 14px; }
.comp-row { display: grid; grid-template-columns: 1fr 96px; gap: 8px; margin-top: 8px; }
.count-input { width: 96px; min-height: 38px; padding: 6px 10px; text-align: right; }
.setup-rows { display: grid; gap: 8px; }
.setup-head, .setup-row { display: grid; gap: 8px; align-items: center; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 80px 64px 150px; }
.setup-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.setup-row.loc-row, .loc-head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 2fr) 64px 150px; }
.setup-row input, .setup-row select { min-height: 40px; }
.setup-actions { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.switch-sm { min-height: 40px; }
.add-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.add-row input[name="account_no"] { flex: 0 0 110px; min-width: 0; }
@media (max-width: 859px) {
  .setup-head { display: none; }
  .setup-row, .setup-row.loc-row { grid-template-columns: 1fr 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .setup-row > input[name="name"] { grid-column: 1 / -1; }
  .setup-row.loc-row > input[name="description"] { grid-column: 1 / -1; }
  .setup-actions { justify-content: flex-end; }
}

/* Rapport */
.report-filters { grid-template-columns: 1fr 1fr; align-items: end; }
.report-filters .quick-ranges { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (min-width: 700px) {
  .report-filters { grid-template-columns: 180px 180px 1fr; }
  .report-filters .quick-ranges { grid-column: auto; }
}
.export-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* Navigation med 6 punkter på iPad */
@media (min-width: 700px) and (max-width: 879px) {
  .topnav .nav-item span { display: none; }
  .topnav .nav-item { width: 44px; justify-content: center; padding: 0; }
}

/* Udskrift (bon, Z-rapport) */
@media print {
  .sidebar, .topbar, .tabbar, .no-print, .subnav, .back, .flash, .alert-success { display: none !important; }
  body { background: #fff; }
  .app, .main { display: block; margin: 0; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat:first-child { background: #fff; color: var(--ink); border-color: var(--line); }
  .stat:first-child .stat-label { color: var(--muted); }
}
.text-ok { color: var(--pine); font-weight: 600; }
.quick-cash { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.quick-cash .btn { flex: 1; min-width: 0; padding: 0 6px; }

input[type="number"] { -moz-appearance: textfield; }
.comp-row input, .setup-row input[type="number"] { min-width: 0; }
@media (max-width: 699px) {
  /* Små opgørelsestabeller forbliver tabeller på telefonen */
  .table.compact-table { display: table; }
  .compact-table thead { display: table-header-group; }
  .compact-table tbody { display: table-row-group; }
  .compact-table tbody tr { display: table-row; padding: 0; margin: 0; background: none; border: 0; box-shadow: none; }
  .compact-table td, .compact-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .stock-table .list-main .small { white-space: normal; }
}
@media (max-width: 699px) {
  .stats-inv { grid-template-columns: 1fr 1fr; }
  .stats-inv .stat:last-child { grid-column: 1 / -1; }
}

/* Kurv-bjælke på telefonen */
.pos-bar {
  position: fixed; left: 12px; right: 12px; z-index: 15;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 0 18px; border-radius: 999px;
  background: var(--pine); color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(30, 35, 38, .22);
}
.pos-bar[hidden] { display: none; }
@media (min-width: 900px) { .pos { grid-template-columns: minmax(0, 1fr) 340px; } }
.last-sale { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--pine-soft); color: var(--pine-dark); }
.last-sale .last-change { font-size: 17px; }
.last-sale .last-change strong { font-size: 20px; }
.last-sale .link { margin-left: auto; }
.board-list { display: grid; gap: 2px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-height: 360px; overflow-y: auto; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.check-row:hover { background: var(--paper); }
.check-row input { width: 18px; height: 18px; accent-color: var(--pine); flex: none; }

/* Transporttilladelser */
.tabs-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.form-grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.validity { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--pine-soft); color: var(--pine-dark); font-size: 14px; }
.tp-search { display: block; margin-bottom: 10px; }
.weapon-picks { display: grid; gap: 2px; max-height: 460px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.pick-head { margin: 10px 0 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.pick-row:hover { background: var(--paper); }
.pick-row input { width: 20px; height: 20px; accent-color: var(--pine); flex: none; }
.pick-row:has(input:checked) { background: var(--pine-soft); }
.pick-row[hidden], .pick-head[hidden] { display: none; }

/* Platform */
.platform-body { min-height: 100vh; }
.platform-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.platform-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.platform-nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink-soft); font-weight: 500; }
.platform-nav a:hover { background: var(--paper); }
.platform-main { max-width: 1100px; margin: 0 auto; padding: 24px var(--gutter) 60px; }
.platform-main .login { margin: 40px auto; }
.steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row form, .facts form { display: inline; margin: 0; }
.secret-card { border-color: var(--pine); }
code.secret { font-size: 18px; padding: 2px 8px; background: var(--pine-soft); border-radius: 6px; letter-spacing: .05em; }
.chip-link.mig { display: inline-block; margin: 2px 0; font-size: 12px; }

/* Våbenudlevering */
.scan-card { display: grid; gap: 10px; }
.scan-form { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-field { position: relative; flex: 1 1 180px; min-width: 0; }
.scan-field input { text-overflow: ellipsis; }
.scan-field .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; }
.scan-field input { min-height: 58px; padding-left: 50px; font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.scan-form .btn { min-height: 58px; }
.scan-video { width: 100%; max-height: 320px; border-radius: var(--radius-sm); background: #000; object-fit: cover; }
.action-card { border-width: 2px; }
.issue-card { border-color: var(--pine); }
.return-card { border-color: var(--ochre); }
.weapon-big { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.action-card .facts { margin: 12px 0 16px; }
.issue-list .issue-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 8px; flex-wrap: wrap; }
.issue-row.is-missing { background: var(--lingon-soft); border-radius: var(--radius-sm); }
.issue-row.is-old { background: var(--ochre-soft); border-radius: var(--radius-sm); }
.issue-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.issue-main strong { font-weight: 600; }
.issue-actions { display: flex; gap: 6px; align-items: center; }
.issue-actions form { margin: 0; }
.close-card { border-color: var(--line-strong); }
.missing-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .missing-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; align-items: center; } }
.log-filters { grid-template-columns: 1fr; align-items: end; }
.log-filters .day-jump { display: flex; gap: 6px; flex-wrap: wrap; }
.log-search { grid-template-columns: 1fr 1fr; align-items: end; }
.log-search .search { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .log-filters { grid-template-columns: 200px 1fr; }
  .log-search { grid-template-columns: minmax(0, 2fr) 170px 170px auto; }
  .log-search .search { grid-column: auto; }
}
.table tr.row-alert td { background: var(--lingon-soft); }
.day-card .facts { margin: 0; }
.weapon-state { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.weapon-state.is-in { background: var(--pine-soft); color: var(--pine-dark); }
.weapon-state.is-out { background: var(--lingon-soft); color: var(--lingon); }
@media print { .log-filters, .log-search { display: none !important; } }
.card-alert { border-color: #E9C4BD; background: #FFFBFA; }

/* ==========================================================================
   Kunder og markedsføring (platformen) – samme komponenter som våbenbogen
   ========================================================================== */
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-sub { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.badge-neutral { background: var(--sand); color: var(--ink-soft); }
.badge-sale { background: #fff; color: var(--ochre); box-shadow: inset 0 0 0 1px #D7B98E; }
.badge .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; }
.badge-contact { background: var(--lingon-soft); color: var(--lingon); }
.prio { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sand); color: var(--ink-soft); }
.prio-1 { background: var(--lingon-soft); color: var(--lingon); }
.prio-2 { background: var(--ochre-soft); color: var(--ochre); }
.nr { display: inline-grid; place-items: center; min-width: 48px; height: 40px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--sand); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; flex: none; }
.nr-tag { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sand); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }


/* Scan / søg */
.scan-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.scan-bar .scan-field { flex: 1; }
.scan-bar .scan-field input { min-height: 54px; font-size: 18px; font-weight: 500; letter-spacing: 0; }
.scan-bar .btn { min-height: 54px; }
.scan-video { margin-bottom: 12px; }

/* Filterchips som links */
.chip-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 16px; padding: 0 var(--gutter) 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); font-size: 14px; white-space: nowrap; }
.fchip:hover { border-color: var(--ink-soft); }
.fchip.is-active { background: var(--pine); border-color: var(--pine); color: #fff; }
.fchip .n { opacity: .7; font-variant-numeric: tabular-nums; }

/* Liste + våbenkort */
.book-split { display: grid; gap: 16px; }
.book-list { padding: 6px; margin: 0; }
.wrow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); }
.wrow + .wrow { border-top: 1px solid var(--line); }
.wrow:hover { background: var(--paper); }
.wrow.is-selected { background: var(--pine-soft); border-top-color: transparent; }
.wrow.is-selected + .wrow { border-top-color: transparent; }
.wrow.is-selected .nr { background: var(--pine); color: #fff; }
.wrow-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wrow-main strong { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow-main span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; max-width: 45%; }
.wrow-side small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.list-more { display: flex; justify-content: center; padding: 10px; }
.pane-empty { display: grid; place-items: center; text-align: center; min-height: 240px; color: var(--muted); }
.pane-empty .icon { width: 36px; height: 36px; color: var(--line-strong); margin: 0 auto 8px; }
.back-to-list { display: none; }

@media (max-width: 1099px) {
  .book-split.has-sel .book-list-wrap { display: none; }
  .book-split.has-sel .back-to-list { display: inline-flex; }
  .book-split:not(.has-sel) .book-pane { display: none; }
  .has-sel-hide { display: none; }
}
@media (min-width: 1100px) {
  .book-split { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); align-items: start; }
  .book-list-wrap { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .book-pane { position: sticky; top: 16px; }
}

/* Våbenkortet */
.wcard { padding: 22px 24px; }
.wcard-head { display: flex; gap: 18px; align-items: flex-start; }
.wcard-title { flex: 1; min-width: 0; }
.wcard-title .badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.wcard-title h2 { font-size: 22px; letter-spacing: -.01em; }
.wcard-title p { margin-top: 4px; color: var(--ink-soft); }
.where { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--fjord); }
.where .icon { width: 16px; height: 16px; }
.mini-label { flex: none; display: flex; gap: 8px; align-items: center; width: 168px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); }
.mini-label:hover { border-color: var(--ink-soft); }
.mini-label .qr svg { display: block; width: 60px; height: 60px; }
.mini-label .qr { width: 60px; height: 60px; flex: none; }
.mini-label strong { display: block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 20px; }
.mini-label span { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }
.wcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wcard-actions form { margin: 0; }
.status-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); align-items: center; }
.status-seg form { margin: 0; }
.status-seg .lbl { font-size: 13px; color: var(--muted); margin-right: 4px; }
.seg-btn { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.seg-btn:hover { border-color: var(--ink-soft); }
.seg-btn.is-on { background: var(--pine); border-color: var(--pine); color: #fff; cursor: default; }
.tabs { display: flex; gap: 22px; margin-top: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--pine-dark); border-bottom-color: var(--pine); }
.tabs-js .tab-panel[hidden] { display: none; }
.tab-panel { padding-top: 16px; }
.tab-panel > h3.panel-title { display: none; }
html:not(.js) .tabs { display: none; }
html:not(.js) .tab-panel > h3.panel-title { display: block; margin: 18px 0 8px; font-size: 16px; }
.sec { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.sec:first-child { margin-top: 0; }
.desc-box { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--paper); line-height: 1.5; white-space: pre-line; margin-bottom: 14px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: flex-end; }
.inline-actions form { margin: 0; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-actions input, .inline-actions select { min-height: 40px; width: auto; }
.inline-actions input.w-s { width: 90px; }
.inline-actions input.w-l { min-width: 220px; flex: 1; }
.hist-row { display: grid; grid-template-columns: 132px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hist-row:first-child { border-top: 0; }
.hist-row time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-row small { display: block; color: var(--muted); font-size: 12px; }
.out-box { padding: 20px; border-radius: var(--radius-sm); background: var(--paper); text-align: center; color: var(--ink-soft); }
.out-box p { margin-bottom: 12px; }
.new-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
@media (max-width: 699px) {
  .wcard { padding: 18px 16px; }
  .mini-label { display: none; }
  .hist-row { grid-template-columns: 1fr; gap: 2px; }
  .wcard-actions .btn { flex: 1 1 auto; }
}

/* Formularer */
.form-sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.form-sec-title .dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--pine); color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.form-sec-title h2 { font-size: 17px; }
.contact-pick { display: grid; gap: 12px; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.kind-chips .chip span { min-height: 36px; padding: 0 12px; font-size: 14px; }
.check-line { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--pine); flex: none; }
.sale-box { padding: 14px; border-radius: var(--radius-sm); background: var(--ochre-soft); }
.note-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fjord-soft); color: var(--fjord); font-size: 14px; line-height: 1.45; }
.note-box .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.form-grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.form-grid .span-all { grid-column: 1 / -1; }
.radio-cards { display: grid; gap: 8px; }
@media (min-width: 700px) { .radio-cards { grid-template-columns: 1fr 1fr; } }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card input { width: 20px; height: 20px; accent-color: var(--pine); margin-top: 2px; flex: none; }
.radio-card:has(input:checked) { border-color: var(--pine); background: var(--pine-soft); }
.radio-card small { display: block; color: var(--muted); }
[hidden] { display: none !important; }

/* Platform: kunder og markedsføring */
.platform-main { max-width: 1380px; }
.platform-nav a.is-active { background: var(--pine-soft); color: var(--pine-dark); }
.s-emne { background: var(--sand); color: var(--ink-soft); }
.s-kontaktet { background: var(--fjord-soft); color: var(--fjord); }
.s-demo { background: var(--ochre-soft); color: var(--ochre); }
.s-proeve { background: #fff; color: var(--ochre); box-shadow: inset 0 0 0 1px #D7B98E; }
.s-kunde { background: var(--pine-soft); color: var(--pine-dark); }
.s-nej { background: #F1EFEB; color: var(--muted); }
.s-ophort { background: var(--lingon-soft); color: var(--lingon); }
.next-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--paper); }
.next-box.is-due { background: var(--lingon-soft); }
.next-box form { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.next-box input { min-height: 40px; }
.status-seg .seg-btn { min-height: 34px; font-size: 13px; }
.due { color: var(--lingon); font-weight: 600; }
.act-form { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.act-form select, .act-form input { min-height: 40px; }
@media (max-width: 699px) { .next-box form, .act-form { grid-template-columns: 1fr; } }
.camp-steps { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--paper); margin-bottom: 16px; }
.camp-step { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.camp-step .dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 12px; font-weight: 600; }
.camp-step.is-on { color: var(--ink); font-weight: 600; }
.camp-step.is-on .dot { background: var(--pine); border-color: var(--pine); color: #fff; }
.camp-step.is-done .dot { background: var(--pine-soft); border-color: var(--pine-soft); color: var(--pine-dark); }
.merge-btn { padding: 3px 8px; border-radius: 6px; background: var(--fjord-soft); color: var(--fjord); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; border: 0; cursor: pointer; }
.mail-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.mail-preview .head { padding: 12px 16px; background: var(--paper); font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.mail-preview .body { padding: 16px 18px; white-space: pre-line; line-height: 1.55; }
.mail-preview .foot { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.progress { height: 10px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--pine); }
.ig-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ig-cal .wd { padding: 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--paper); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ig-day { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ig-day.blank { background: #FBFAF8; }
.ig-day .n { font-size: 12px; color: var(--muted); }
.ig-day.today .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--pine); color: #fff; font-weight: 600; }
.ig-chip { display: block; padding: 4px 7px; border-radius: 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-idea { background: var(--sand); color: var(--ink-soft); }
.ig-ready { background: var(--ochre-soft); color: var(--ochre); }
.ig-posted { background: var(--pine-soft); color: var(--pine-dark); }
.ig-image { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, var(--sand) 0 14px, var(--paper) 14px 28px); display: grid; place-items: center; overflow: hidden; color: var(--ink-soft); text-align: center; font-size: 14px; }
.ig-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 699px) { .ig-cal .wd { font-size: 10px; padding: 6px 2px; } .ig-day { min-height: 64px; padding: 3px; } .ig-chip { font-size: 10px; padding: 2px 4px; } }
.letter { width: 210mm; min-height: 297mm; box-sizing: border-box; padding: 20mm 20mm 20mm 20mm; margin: 16px auto; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.08); position: relative; font-size: 11pt; line-height: 1.5; color: #1E2326; break-after: page; }
.letter .sender { position: absolute; right: 20mm; top: 18mm; text-align: right; font-size: 9.5pt; white-space: pre-line; color: #4A5157; }
.letter .to { position: absolute; left: 22mm; top: 50mm; width: 85mm; white-space: pre-line; }
.letter .date { margin-top: 90mm; text-align: right; }
.letter .text { margin-top: 10mm; white-space: pre-line; }
@media print {
  .letter { margin: 0; box-shadow: none; }
  .letters-bar { display: none !important; }
}

/* CRM – detaljer og kontaktpersoner */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 8px; }
.contact-list { display: grid; gap: 0; }
.contact-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.contact-item:first-child { border-top: 0; padding-top: 0; }
.contact-item .who { display: grid; gap: 2px; min-width: 0; }
.contact-item .who a { word-break: break-all; }

/* Supportadgang fra platformen */
.support-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 16px; background: var(--ochre-soft); color: var(--ochre); border-bottom: 1px solid var(--ochre); font-size: 14px; }
.support-bar .icon { width: 16px; height: 16px; vertical-align: -3px; }
.support-bar form { margin: 0; }
.support-start { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.support-start input { min-height: 40px; }
@media (max-width: 699px) { .support-start { grid-template-columns: 1fr; } }

/* Kamera-scanner (stregkoder og QR) */
.scan-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: rgba(10, 12, 12, .92); color: #fff; }
.scan-box { position: relative; width: min(100%, 520px); aspect-ratio: 3 / 4; max-height: 70vh; border-radius: 16px; overflow: hidden; background: #000; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 8%; right: 8%; top: 32%; bottom: 32%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }
.scan-msg { margin: 0; text-align: center; font-size: 15px; max-width: 520px; }
.scan-overlay .btn { min-width: 160px; }
.cam-wrap { display: flex; gap: 6px; align-items: stretch; width: 100%; }
.cam-wrap > input { flex: 1 1 auto; min-width: 0; }
.cam-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm, 10px); background: var(--surface, #fff); color: var(--ink); cursor: pointer; }
.cam-btn:hover { border-color: var(--ink-soft); }
.search .cam-wrap { flex: 1 1 auto; }
.search .cam-btn { border: 0; width: 40px; background: transparent; }

/* Roller på medlemmet */
.role-list { display: grid; gap: 2px; margin: 8px 0; }
.role-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-radius: var(--radius-sm); cursor: pointer; }
.role-row:hover { background: var(--paper); }
.role-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pine); flex: none; }
.role-row span { display: grid; gap: 2px; }

/* Skydelog */
.shoot-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.shoot-status .icon { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.shoot-status div { display: grid; gap: 2px; }
.shoot-status span { font-size: 14px; }
.shoot-status.is-ok { background: var(--pine-soft); color: var(--pine-dark); border-color: transparent; }
.shoot-status.is-low { background: var(--ochre-soft); color: var(--ochre); border-color: transparent; }
.shoot-list { margin: 0; }
.shoot-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.shoot-row:first-child { border-top: 0; }
.shoot-row time { font-weight: 600; font-variant-numeric: tabular-nums; }
.shoot-main { display: grid; gap: 2px; min-width: 0; }
.shoot-row.is-void time, .shoot-row.is-void .shoot-main > :not(.text-danger) { text-decoration: line-through; color: var(--muted); }
.void-form { display: flex; gap: 6px; align-items: center; }
.void-form input { width: 140px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 13px; }
.attend-form { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; }
.attend-form input, .attend-form select { min-height: 44px; }
.shoot-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.shoot-banner > .icon { width: 26px; height: 26px; color: var(--pine); flex: none; }
.shoot-banner > span:not(.btn) { display: grid; gap: 1px; flex: 1; }
.shoot-banner small { color: var(--muted); }
.shoot-banner.is-done { background: var(--pine-soft); border-color: transparent; }
@media (max-width: 699px) {
  .shoot-row { grid-template-columns: 82px minmax(0, 1fr); }
  .shoot-row > form { grid-column: 1 / -1; }
  .attend-form { grid-template-columns: 1fr; }
}

/* Skydeleder: banekommandører på klubdagen */
.staff-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.staff-row > strong { min-width: 160px; }
.staff-row .check-line { min-height: 36px; font-size: 14px; }
.staff-actions { display: flex; gap: 6px; margin-left: auto; }
.staff-add select { min-height: 40px; min-width: 200px; }

/* Regnskab: kontoplan */
.acc-card { padding: 0; overflow: hidden; }
.acc-table { width: 100%; border-collapse: collapse; }
.acc-table th, .acc-table td { padding: 9px 14px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.acc-table thead th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--paper); }
.acc-table .acc-no { width: 90px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-table tr[data-href] { cursor: pointer; }
.acc-table tr[data-href]:hover td { background: var(--paper); }
.acc-table tr.acc-heading td { padding-top: 18px; font-weight: 700; font-size: 15px; border-top: 2px solid var(--line-strong); }
.acc-table tr.acc-sum td { font-weight: 600; font-style: italic; background: #FBFAF8; }
.acc-table tr.is-inactive td { color: var(--muted); }
.acc-table .row-link { color: inherit; text-decoration: none; }
@media (max-width: 699px) { .acc-table .hide-sm { display: none; } .acc-table .acc-no { width: 64px; } }

/* ---------- Regnskab: kassekladde, bilag og posteringer ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.acc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.acc-table .nowrap, .nowrap { white-space: nowrap; }
.acc-table tfoot td { font-weight: 600; border-top: 2px solid var(--line-strong); background: var(--paper); }
.acc-table tr.is-bad td { background: var(--lingon-soft); }
.acc-table tr.is-vat td { color: var(--ink-soft); font-size: 13.5px; }
.acc-table td .muted { font-size: 13px; }
.acc-table .badge { margin-left: 4px; font-size: 11px; padding: 1px 6px; }
.icon-link { display: inline-flex; padding: 4px; color: var(--muted); border-radius: 6px; }
.icon-link:hover { color: var(--ink); background: var(--sand); }
.clip { display: inline-flex; vertical-align: middle; color: var(--fjord); }
.clip .icon { width: 15px; height: 15px; }
.card-head.pad, .acc-card .pad { padding: 14px 14px 0; }
.jrn-form { margin-bottom: 16px; }
.jrn-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.jrn-grid .jrn-text { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .jrn-grid { grid-template-columns: 150px 90px minmax(180px, 2fr) 1fr 1fr 130px; align-items: start; }
  .jrn-grid .jrn-text { grid-column: auto; }
}
.jrn-file { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.jrn-file .btn { margin-left: auto; }
.jrn-post { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 24px; }
.jrn-post .field-error { flex-basis: 100%; display: flex; align-items: center; gap: 6px; }
.file-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.file-pick:hover, .file-pick:focus-within { border-color: var(--fjord); color: var(--ink); }
.file-pick input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick-big { display: flex; justify-content: center; min-height: 84px; font-size: 15px; font-weight: 500; }
.upload-status { min-height: 1em; }
.upload-status.is-error { color: var(--lingon); }
.vfiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vfile { display: flex; gap: 14px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.vfile.is-removed { background: var(--paper); color: var(--muted); }
.vfile-thumb { flex: none; width: 88px; height: 88px; border-radius: 6px; overflow: hidden; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.vfile-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vfile-type { font-weight: 700; font-size: 15px; color: var(--lingon); letter-spacing: .05em; }
.vfile-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vfile-meta strong { overflow-wrap: anywhere; }
.vfile-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vfile-actions form { margin: 0; }
.vfile-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.voucher-new { margin-bottom: 16px; }
.ledger-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ledger-filters input[type="text"] { width: 110px; }
.field-inline { display: inline-flex; align-items: center; gap: 6px; }
@media print { .jrn-form, .jrn-post, .vfile-upload, .ledger-filters { display: none !important; } }

/* ---------- Regnskab: saldobalance, resultatopgørelse og balance ---------- */
.rep-table tr.rep-virtual td { font-style: italic; color: var(--ink-soft); }
.rep-table tr[data-href] { cursor: pointer; }
.rep-table tr[data-href]:hover td { background: var(--paper); }
.rep-table tr.acc-sum td.num { border-top: 1px solid var(--line-strong); }
.rep-check { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 14px; }
.rep-check.ok { color: var(--pine-dark); }
.rep-check.bad { color: var(--lingon); font-weight: 600; }
.rep-period { display: inline-flex; }
.rep-period[open] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-period summary { cursor: pointer; color: var(--fjord); list-style: none; }
.rep-period summary::-webkit-details-marker { display: none; }
.rep-settings { margin-top: 20px; }
.rep-settings summary { cursor: pointer; font-weight: 600; }
.rep-year-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
@media print {
  .rep-table { font-size: 11pt; }
  .rep-table th, .rep-table td { padding: 4px 8px; }
  .acc-card { border: 0; }
  .page-head .eyebrow { display: block !important; }
}

/* ---------- Kassen -> kassekladden ---------- */
.pos-acc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.pos-acc > span { display: inline-flex; align-items: center; gap: 6px; }
.pos-acc form { margin: 0 0 0 auto; }
.acc-table td form { display: inline; margin: 0; }
.acc-table td .badge-pending[href] { text-decoration: none; }

/* ---------- Revision ---------- */
.audit-checks, .audit-rev, .audit-links { list-style: none; margin: 0; padding: 0; }
.audit-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.audit-checks li:first-child { border-top: 0; padding-top: 0; }
.audit-checks li .icon { flex: none; margin-top: 2px; }
.audit-checks li.is-ok .icon { color: var(--pine); }
.audit-checks li.is-warn .icon { color: var(--lingon); }
.audit-checks li.is-warn { color: var(--ink); font-weight: 500; }
.audit-rev li a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.audit-rev li:first-child a { border-top: 0; padding-top: 0; }
.audit-rev li a:hover span { text-decoration: underline; }
.audit-rev li.is-warn strong { color: var(--lingon); }
.audit-bar { height: 8px; border-radius: 99px; background: var(--sand); overflow: hidden; margin-top: 12px; }
.audit-bar span { display: block; height: 100%; background: var(--pine); }
.audit-links li { padding: 7px 0; border-top: 1px solid var(--line); }
.audit-links li:first-child { border-top: 0; padding-top: 0; }
.audit-note { white-space: normal; padding: 12px 14px; background: var(--paper); border-radius: var(--radius-sm); }
.review-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.review-log li { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--paper); border-left: 3px solid var(--line-strong); }
.review-log li.review-ok { border-left-color: var(--pine); }
.review-log li.review-question { border-left-color: var(--lingon); }
.review-log li.review-answer { border-left-color: var(--fjord); }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-form textarea { width: 100%; }

/* ---------- Moms ---------- */
.vat-facts .vat-total { font-weight: 700; border-top: 2px solid var(--line-strong); }
.vat-facts dd { text-align: right; font-variant-numeric: tabular-nums; }
.vat-ok { display: flex; align-items: center; gap: 6px; color: var(--pine-dark); font-size: 14px; margin: 0; }
.vat-report-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.acc-table tr.is-current td { background: var(--pine-soft); }
.audit-links form { display: inline; margin-left: 6px; }
