:root {
  --bg: #f4f6f8;
  --card: #fff;
  --text: #1a1a2e;
  --muted: #5c6370;
  --accent: #2563eb;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.staff-notice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1.5rem;
  background: #fff8e1;
  border-bottom: 1px solid #fcd34d;
  position: sticky;
  top: 3.25rem;
  z-index: 190;
}
.notice-chip {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}
.notice-chip:hover { background: rgba(0, 0, 0, 0.05); }
.notice-chip--warn { font-weight: 500; }
.staff-subnav {
  margin: 0;
  padding: 0.5rem 1.5rem 0.6rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 3.25rem;
  z-index: 180;
}
body:has(.staff-notice-bar) .staff-subnav {
  top: 6.1rem;
}
.topbar--anonymous { background: #f8fafc; }
.topbar a { color: var(--text); text-decoration: none; }
.topbar nav,
.topnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.brand { font-weight: 700; margin-right: 0.5rem; white-space: nowrap; }
.topnav-link {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.2;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.topnav-link:hover { background: #f1f5f9; }
.topnav-link.active,
.nav-dd.active > .topnav-link {
  color: var(--accent);
  font-weight: 600;
  background: #eff6ff;
}
.topnav .nav-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  flex: 0 0 16px;
  display: block;
  opacity: 0.92;
}
.nav-caret {
  width: 0.35rem;
  height: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.65;
  flex: 0 0 auto;
}
.nav-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.nav-dd-panel {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 12rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  z-index: 260;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.nav-dd-panel[hidden] { display: none !important; }
.nav-dd-panel a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
  line-height: 1.3;
}
.nav-dd-panel a:hover { background: #f1f5f9; }
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.topbar-email { font-size: 0.9rem; color: var(--muted); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.logout-form { margin: 0; display: flex; align-items: center; }
.logout-form button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  font-size: 0.9rem;
}
.logout-form button:hover { background: #f1f5f9; }
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.workspace-container { max-width: 1680px; }
.admin-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.admin-nav a {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}
.admin-nav a.active { background: #e8eef9; color: var(--accent); font-weight: 600; }
.alert-banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-banner.warn { background: #fff8e1; border: 1px solid #fcd34d; }
.alert-banner.ok { background: #ecfdf5; border: 1px solid #86efac; }
.alert-banner.error { background: #fef2f2; border: 1px solid #fca5a5; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  align-items: end;
}
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.card-header-row h2 { margin: 0; font-size: 1.1rem; }
.th-sort-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.th-sort-link:hover { text-decoration: underline; }
.th-sorted { background: #f5f8fc; }
.badge-count {
  background: #e2e8f0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
.workspace-filters { margin-bottom: 1rem; padding: 1rem 1.25rem; overflow: visible; }
.workspace-filters .search-field-primary,
.workspace-filters .live-search-wrap { overflow: visible; }
.live-search-hint { margin: 0.35rem 0 0; font-size: 0.8rem; }
.workspace-filters label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 500; }
.workspace-filters select,
.workspace-filters input[type="search"] {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}
.filter-hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.search-field { grid-column: span 2; }
.search-field-primary { grid-column: 1 / -1; }
.workspace-intro { margin: 0 0 1rem; font-size: 0.95rem; }
.module-nav { margin-bottom: 1rem; }
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 1rem 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.tab-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}
.tab-nav a.active { background: #e8eef9; color: var(--accent); font-weight: 600; }
.detail-dl { display: grid; grid-template-columns: 10rem 1fr; gap: 0.5rem 1rem; }
.detail-dl dt { color: var(--muted); font-weight: 500; }
.detail-dl .small { font-size: 0.8rem; margin-left: 0.35rem; }
.sync-meta { font-size: 0.85rem; margin-bottom: 0.75rem; }
.sync-log-card { margin-top: 1.5rem; padding: 1rem 1.25rem; }
.data-table.compact { font-size: 0.85rem; }
.note-list { list-style: none; padding: 0; }
.note-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.crm-info-fields { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.crm-info-field h3 { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; }
.ekonomi-view-tabs { flex-wrap: wrap; margin-bottom: 1rem; }
.ekonomi-seller-link { margin-left: auto; font-size: 0.85rem; }
.ekonomi-table .workflow-form select { max-width: 11rem; font-size: 0.85rem; }
.seller-row-form { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: center; }
.seller-row-form input[type="text"] { min-width: 12rem; flex: 1; }
.seller-comment-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.seller-comment-cell--inkasso {
  flex-direction: row;
}
.seller-contact-quick-form {
  margin: 0;
}
.seller-contact-quick-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.seller-contact-label-text {
  font-size: 0.85rem;
}
.icon-btn.seller-comment-edit-btn.has-comment {
  border-color: #3b82f6;
  background: #eff6ff;
}
.seller-comment-dialog-form .seller-comment-dialog-field {
  display: block;
  margin: 0.75rem 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}
.seller-comment-dialog-form textarea {
  display: block;
  width: 100%;
  min-height: 11rem;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}
.seller-comment-dialog-contacted {
  margin: 0.5rem 0 0;
}
.seller-comment-dialog-hint {
  margin: 0;
}
.ekonomi-table .col-seller-contact {
  min-width: 5.5rem;
  white-space: nowrap;
}
.ekonomi-table.seller-mode .col-sticky-note {
  min-width: 2.75rem;
  text-align: center;
}
.row-new-comment { background: #fffbeb; }
.badge-new { color: #d97706; font-weight: 700; margin-left: 0.25rem; }
.invoice-email-warn {
  color: #d97706;
  font-weight: 700;
  margin-left: 0.25rem;
  cursor: help;
}
.inkasso-date-form { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.inkasso-date-form input[type="date"] { font-size: 0.85rem; }
.inkasso-countdown {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.inkasso-countdown--ok { background: #ecfdf5; color: #047857; }
.inkasso-countdown--warn { background: #fffbeb; color: #b45309; }
.inkasso-countdown--urgent { background: #fef2f2; color: #b91c1c; }
.inkasso-countdown--overdue { background: #7f1d1d; color: #fff; }
.inkasso-countdown--muted { background: #f1f5f9; color: #64748b; }
.sms-cell { white-space: nowrap; }
.crm-info-text {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}
.cell-err { color: #b91c1c; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; }
.settings-actions-card { padding: 1.25rem; margin-bottom: 1.25rem; }
.settings-actions-card h2 { margin-top: 0; font-size: 1.1rem; }
.settings-action-block { margin-bottom: 1rem; }
.settings-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.settings-create-form { max-width: 28rem; }
.settings-next { margin-top: 1.5rem; }
.badge-demo {
  font-size: 0.75rem;
  background: #fef3c7;
  color: #92400e;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
}
.cell-actions { white-space: nowrap; }
.btn-danger-text { background: none; border: none; color: #b91c1c; cursor: pointer; text-decoration: underline; font-size: 0.9rem; }
.msg-ok { color: #166534; background: #ecfdf5; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.msg-warn { color: #92400e; background: #fffbeb; padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid #fde68a; }
.workspace-table-card { padding: 1rem 1.25rem; }
.table-scroll { overflow-x: auto; }
.ekonomi-table-scroll {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.ekonomi-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: visible;
}
.ekonomi-table.has-batch {
  --ek-left-status: 2.5rem;
  --ek-left-company: calc(2.5rem + 11.5rem);
}
.ekonomi-table.no-batch {
  --ek-left-status: 0;
  --ek-left-company: 11.5rem;
}
.ekonomi-table.seller-mode .col-sticky-status,
.ekonomi-table.seller-mode .col-sticky-company,
.ekonomi-table.seller-mode .col-sticky-note {
  position: static;
  left: auto;
  z-index: auto;
  box-shadow: none;
}
.ekonomi-table.seller-mode .col-sticky-company {
  min-width: 9rem;
  max-width: 16rem;
}
.ekonomi-table.seller-mode .col-invoice {
  min-width: 5.5rem;
  padding-left: 0.75rem;
}
.ekonomi-table.seller-mode .col-sticky-status {
  min-width: 8.5rem;
  white-space: nowrap;
}
.ekonomi-table .col-sticky-batch {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.ekonomi-table .col-sticky-status {
  position: sticky;
  left: var(--ek-left-status);
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.1);
}
.ekonomi-table .col-sticky-company {
  position: sticky;
  left: var(--ek-left-company);
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 6px -2px rgba(15, 23, 42, 0.1);
  min-width: 9rem;
  max-width: 13rem;
}
.ekonomi-table thead .col-sticky-batch,
.ekonomi-table thead .col-sticky-status,
.ekonomi-table thead .col-sticky-company {
  background: #f8fafc;
  z-index: 3;
}
.ekonomi-table .col-sticky-note {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -3px 0 8px -2px rgba(15, 23, 42, 0.12);
  min-width: 11rem;
  max-width: 15rem;
}
.ekonomi-table .col-actions {
  width: 4.25rem;
  min-width: 4.25rem;
  white-space: nowrap;
  text-align: center;
}
.ekonomi-table thead .col-sticky-note {
  background: #f8fafc;
  z-index: 3;
}
.ekonomi-table thead .col-seller-comment,
.ekonomi-table thead .col-actions {
  white-space: nowrap;
}
.ekonomi-table tr.customer-row:hover td.col-sticky-batch,
.ekonomi-table tr.customer-row:hover td.col-sticky-status,
.ekonomi-table tr.customer-row:hover td.col-sticky-company,
.ekonomi-table tr.customer-row:hover td.col-sticky-note,
.ekonomi-table tr.row-new-comment td.col-sticky-batch,
.ekonomi-table tr.row-new-comment td.col-sticky-status,
.ekonomi-table tr.row-new-comment td.col-sticky-company,
.ekonomi-table tr.row-new-comment td.col-sticky-note {
  background: #f0f6fc;
}
.ekonomi-table tr.row-new-comment td.col-sticky-batch,
.ekonomi-table tr.row-new-comment td.col-sticky-status,
.ekonomi-table tr.row-new-comment td.col-sticky-company,
.ekonomi-table tr.row-new-comment td.col-sticky-note {
  background: #fffbeb;
}
.ekonomi-table .col-club {
  max-width: 8.5rem;
  font-size: 0.85rem;
}
.ekonomi-table .col-club .muted {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ekonomi-table .col-salesperson {
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}
.ekonomi-table .col-invoice,
.ekonomi-table .col-amount {
  white-space: nowrap;
}
.ekonomi-table .col-seller-comment {
  width: 3.25rem;
  min-width: 3.25rem;
  max-width: 3.25rem;
  text-align: center;
  white-space: nowrap;
}
.ekonomi-table .col-seller-comment--new .icon-btn {
  border-color: #f59e0b;
  background: #fffbeb;
}
.ekonomi-table .ekonomi-actions-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}
.ekonomi-table .ekonomi-actions-cell .icon-btn {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}
.ekonomi-table .ekonomi-actions-cell .icon-btn.has-note {
  border-color: #93c5fd;
  background: #eff6ff;
}
.ekonomi-table .ekonomi-actions-cell .ekonomi-sms-form {
  display: inline;
  margin: 0;
}
.ekonomi-table .btn-link-compact {
  font-size: 0.8rem;
  padding: 0 0.15rem;
}
.ekonomi-table .inkasso-date-form input[type="date"] {
  max-width: 9.5rem;
}
.data-table { width: 100%; min-width: 640px; }

/* Körschema — förnyelsefärger (säljar-/staff-vy) */
.data-table tr.korschema-row-ok td {
  background: #e8f6ee;
}
.data-table tr.korschema-row-warn td {
  background: #fff0e0;
}
.korschema-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
  font-weight: 600;
}
.korschema-badge-ok {
  background: #c8ebd6;
  color: #14532d;
}
.korschema-badge-warn {
  background: #ffd8a8;
  color: #9a3412;
}
.korschema-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-left: 0.75rem;
  font-size: 0.9em;
}
.korschema-swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.2rem;
  vertical-align: -0.1rem;
  margin-right: 0.3rem;
}
.korschema-swatch-ok { background: #c8ebd6; border: 1px solid #86c9a0; }
.korschema-swatch-warn { background: #ffd8a8; border: 1px solid #f0b27a; }
.data-table .text-center { text-align: center; }
.korschema-logo-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.85em;
  font-weight: 600;
  background: #eef1f4;
  color: #334155;
}
.korschema-logo-ok {
  background: #c8ebd6;
  color: #14532d;
}
.korschema-logo-progress {
  background: #ffe8c4;
  color: #9a3412;
}
.korschema-logo-missing {
  background: #fde2e1;
  color: #9f1239;
}
.offer-responses-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.offer-responses-table {
  min-width: 0;
  table-layout: auto;
  font-size: 0.82rem;
}
.offer-responses-table th,
.offer-responses-table td {
  padding: 0.4rem 0.45rem;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}
.offer-responses-table form {
  margin: 0.15rem 0 0;
}
.offer-responses-table button {
  font-size: 0.78rem;
  padding: 0.2rem 0.45rem;
}
.empty-state { padding: 2rem 0; text-align: center; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.inline-form select { min-width: 14rem; padding: 0.35rem; }
.muted { color: var(--muted); }
.data-table tr.row-muted td { color: var(--muted); }
.stats { display: flex; gap: 1rem; margin: 1.5rem 0; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  min-width: 120px;
  text-align: center;
}
.stat .num { display: block; font-size: 1.75rem; font-weight: 700; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
}
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-size: 0.85rem; }
.next-steps { color: var(--muted); margin-top: 2rem; }
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 360px;
}
.login-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted, #64748b);
}
.login-card label { display: block; margin-top: 0.75rem; font-size: 0.9rem; }
.login-card input {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.login-card button {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.6rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.error { color: #b91c1c; }
.msg-error { color: #b91c1c; background: #fef2f2; padding: 0.75rem 1rem; border-radius: 8px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}
.card h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.detail-grid {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.detail-grid dt { color: var(--muted); margin: 0; }
.detail-grid dd { margin: 0; }
.small { font-size: 0.85rem; }
.card button {
  padding: 0.35rem 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.toolbar { margin: 0.75rem 0 1.25rem; }
.btn-primary {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
}
.btn-link { margin-left: 0.75rem; color: var(--muted); }
.company-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.company-form input,
.company-form textarea {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.company-form .hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.company-form .required { color: #b91c1c; }
.form-actions { margin-top: 1.25rem; }
.form-actions button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-bar select {
  display: block;
  margin-top: 0.35rem;
  padding: 0.4rem 0.5rem;
  min-width: 12rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.company-form select {
  display: block;
  width: 100%;
  max-width: 28rem;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.filter-bar .search-field { flex: 1; min-width: 14rem; }
.filter-bar .search-field input {
  display: block;
  width: 100%;
  max-width: 20rem;
  margin-top: 0.35rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.btn-filter {
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  height: fit-content;
}
.live-search-wrap { position: relative; }
.live-search-dropdown {
  position: absolute;
  z-index: 200;
  left: 0;
  right: 0;
  top: 100%;
  min-width: 100%;
  max-height: 20rem;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-top: 2px;
}
.live-search-dropdown--wide {
  min-width: min(44rem, calc(100vw - 2.5rem));
  max-width: 52rem;
  max-height: 26rem;
}
.live-search-dropdown.hidden { display: none; }
.live-search-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
}
/* Åsidosätt .card button (blå) för live-sök-träffar */
.workspace-filters.card .live-search-item {
  background: var(--card);
  color: var(--text);
  border-radius: 0;
  font-weight: normal;
  font-size: inherit;
}
.workspace-filters.card .live-search-item:hover {
  background: #eef4ff;
  color: var(--text);
}
.workspace-filters.card .live-search-item:focus-visible {
  background: #eef4ff;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.live-search-item:hover { background: #f0f4ff; }
.live-search-item-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-search-item-context {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-search-item-packages {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #334155;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.workspace-filters.card .live-search-item-title {
  color: var(--text);
  font-weight: 600;
}
.workspace-filters.card .live-search-item-context {
  color: var(--muted);
}
.workspace-filters.card .live-search-item-packages {
  color: #334155;
}
.live-search-item-meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.live-search-empty { padding: 0.75rem 0.9rem; color: var(--muted); font-size: 0.85rem; }
.cell-packages { max-width: 28rem; font-size: 0.85rem; line-height: 1.35; }
th.num, td.num { text-align: center; white-space: nowrap; }
.customer-row { cursor: pointer; }
.customer-row:hover { background: #f8fafc; }
a.customer-link {
  color: var(--accent, #1e3a5f);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
a.customer-link:hover { color: #0f2744; }
.btn-link.active { color: var(--accent, #1e3a5f); font-weight: 600; }
.kundsupport-presets { margin-bottom: 0.75rem; }
.row-highlight { background: #fff8e1 !important; }

/* Statusikoner — betalning + SimpleSign */
.status-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}
.status-icon {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
}
/* Betalning: grön=betald, orange=obetald, lila=krediterad, amber=påminnelse, röd=inkasso, grå=saknas */
.status-icon--green { background: #22c55e; }
.status-icon--unpaid { background: #f97316; }
.status-icon--credited { background: #7c3aed; }
.status-icon--to_credit {
  background: #ede9fe;
  border: 2px dashed #7c3aed;
}
.status-icon--yellow { background: #ca8a04; }
.status-icon--red { background: #ef4444; }
.status-icon--unknown { background: #cbd5e1; border: 1px solid #94a3b8; }
.topbar-dev-hint { font-size: 0.85rem; margin-right: 0.5rem; }
.status-icons-col,
.status-icons-cell {
  width: 3.5rem;
  white-space: nowrap;
}
.nav-badge {
  display: inline-block;
  min-width: 1.1rem;
  padding: 0.05rem 0.35rem;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background: #dc2626;
  border-radius: 999px;
  vertical-align: super;
}
.ekonomi-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}
.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.dashboard-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.dashboard-card-count {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.dashboard-card-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.dashboard-card-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.dashboard-card--warn .dashboard-card-count { color: #b45309; }
.dashboard-card--ok .dashboard-card-count { color: #15803d; }
.dashboard-card--muted .dashboard-card-count { color: #64748b; }
.filter-grid input[type="date"] {
  min-width: 10.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.batch-reminder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f0f9ff;
}
.batch-col {
  width: 2rem;
  text-align: center;
  vertical-align: middle;
}
.ekonomi-table .batch-reminder-cb {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.sms-dev-panel {
  margin-bottom: 1rem;
  border: 1px dashed #94a3b8;
  background: #f8fafc;
}
.sms-dev-form {
  margin-top: 0.5rem;
  align-items: end;
}
.status-icons-legend {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.status-icons-legend .legend-sep {
  color: var(--border);
  margin: 0 0.15rem;
}

.sync-status-panel {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
}
.sync-status-panel--ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.sync-status-panel--warn {
  border-color: #fcd34d;
  background: #fffbeb;
}
.sync-status-panel--err {
  border-color: #fca5a5;
  background: #fef2f2;
}
.sync-status-panel--running {
  border-color: #93c5fd;
  background: #eff6ff;
}
.sync-status-panel-main {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.sync-status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: #94a3b8;
}
.sync-status-panel--ok .sync-status-dot { background: #22c55e; }
.sync-status-panel--warn .sync-status-dot { background: #ca8a04; }
.sync-status-panel--err .sync-status-dot { background: #ef4444; }
.sync-status-panel--running .sync-status-dot { background: #3b82f6; }
.sync-status-headline {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}
.sync-status-detail {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
}
.sync-status-log {
  margin-top: 0.75rem;
}
.sync-status-log summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  user-select: none;
}
.sync-status-log table {
  margin-top: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  vertical-align: middle;
}
.icon-btn:hover { background: #f1f5f9; }
.icon-btn-glyph { font-size: 1rem; line-height: 1; }
.ekonomi-note-dialog-form textarea {
  width: 100%;
  min-height: 6rem;
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}
.ekonomi-note-dialog-form .hub-comment-dialog-footer {
  margin-top: 0.75rem;
}
.hub-comment-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  max-width: min(32rem, 92vw);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
}
.hub-comment-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.hub-comment-dialog-inner {
  padding: 1rem 1.25rem 1.25rem;
  margin: 0;
}
.hub-comment-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.hub-comment-dialog-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.hub-comment-dialog-body {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 50vh;
  overflow: auto;
  font-family: inherit;
  font-size: 0.9rem;
}
.dialog-close-btn {
  flex-shrink: 0;
  font-size: 1.1rem;
}
.hub-comment-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.25rem;
}
.hub-comment-mark-read-form {
  margin: 0;
}
.btn-filter-muted {
  background: #f1f5f9;
  color: var(--text);
}
.hub-invoice-comments { margin: 1rem 0; }
.hub-invoice-comments h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.hub-comment-block + .hub-comment-block { margin-top: 0.75rem; }
.hub-comment-meta { margin: 0 0 0.35rem; font-size: 0.85rem; }

/* —— Kalender —— */
.cal-page { max-width: none; width: 100%; }
.cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cal-header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.cal-nav-month {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cal-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cal-chips { display: flex; gap: 0.5rem; }
.cal-chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  font: inherit;
}
.cal-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.cal-type-filter select {
  margin-left: 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cal-legend {
  list-style: none;
  margin: -0.35rem 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}
.cal-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cal-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .cal-layout { grid-template-columns: 1fr; }
}
.cal-main.card { padding: 0.75rem; overflow: hidden; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}
.cal-day {
  min-width: 0;
  min-height: 6.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem;
  overflow: hidden;
  position: relative;
}
.cal-day--busy { cursor: pointer; }
.cal-day--expanded {
  z-index: 12;
  overflow: visible;
  min-height: auto;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}
.cal-day--expanded .cal-day-events {
  max-height: none;
  overflow-y: visible;
}
.cal-day--out { opacity: 0.45; }
.cal-day--today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
}
.cal-day-count {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  flex-shrink: 0;
}
.cal-day-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-height: 5.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.cal-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.15rem 0.25rem 0.15rem 0.2rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--pill) 22%, #fff);
  border-left: 3px solid var(--pill);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.cal-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pill) 35%, #fff);
}
.cal-pill-text {
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-more {
  font-size: 0.65rem;
  color: var(--accent);
  padding: 0.1rem 0.25rem;
  position: relative;
  cursor: pointer;
  font-weight: 600;
  border-radius: 4px;
  background: #e0f2fe;
}
.cal-more:hover { background: #bae6fd; }
.cal-tip-src { display: none !important; }
.cal-float-tip {
  position: fixed;
  z-index: 80;
  max-width: 20rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}
.cal-float-tip .cal-tip-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #93c5fd;
  margin-bottom: 0.2rem;
}
.cal-float-tip .cal-tip-title {
  font-weight: 650;
  margin-bottom: 0.25rem;
}
.cal-float-tip .cal-tip-row { color: #cbd5e1; }
.cal-float-tip .cal-tip-desc {
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid #334155;
  white-space: pre-wrap;
  color: #e2e8f0;
}
.cal-side { display: flex; flex-direction: column; gap: 1rem; }
.cal-upcoming h2,
.cal-create h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.cal-upcoming-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cal-upcoming-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.cal-upcoming-item--action {
  border-color: #fbbf24;
  background: #fffbeb;
}
.cal-upcoming-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.cal-type-badge {
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.cal-upcoming-title {
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cal-upcoming-sub { font-size: 0.8rem; margin-top: 0.15rem; }
.cal-progress {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #9a3412;
  font-weight: 500;
}
.cal-upcoming-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.cal-purge-demo {
  margin: 0 0 0.75rem;
}
.cal-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.cal-delete-form {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.cal-pill a.cal-pill-text {
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-pill a.cal-pill-text:hover {
  text-decoration: underline;
}
.cal-create-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.cal-create-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
.cal-create-form input,
.cal-create-form select,
.cal-create-form textarea {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.cal-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.cal-due-today h2 { display: flex; align-items: center; gap: 0.5rem; }
.cal-due-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.cal-upcoming-item--due {
  border-color: #f87171;
  background: #fef2f2;
}
.cal-due-reason {
  color: #b91c1c;
  font-weight: 600;
}

/* —— Partnerbevis admin —— */
.pb-admin { max-width: 72rem; }
.pb-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .pb-admin-layout { grid-template-columns: 1fr; }
}
.pb-section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.pb-section-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}
.pb-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
@media (max-width: 640px) {
  .pb-grid-2 { grid-template-columns: 1fr; }
}
.pb-grid-2 label,
.pb-section > label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}
.pb-grid-2 input,
.pb-grid-2 select,
.pb-grid-2 textarea,
.pb-section input[type="file"] {
  font-weight: 400;
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.pb-grid-2 .hint,
.pb-section .hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}
.pb-span-2 { grid-column: 1 / -1; }
.pb-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
  font-weight: 500 !important;
}
.pb-check input { width: auto; }
.pb-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .pb-colors { grid-template-columns: 1fr; }
}
.pb-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pb-color-row input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.pb-hex {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem !important;
}
.pb-logo-block {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pb-logo-thumb {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pb-logo-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pb-logo-empty {
  font-size: 0.75rem;
  color: var(--muted);
}
.pb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0.5rem 0 1.5rem;
  position: sticky;
  bottom: 0.75rem;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(6px);
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.btn-secondary {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: #fff;
  color: #0f172a !important;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.btn-secondary:hover { background: #f8fafc; }
.pb-preview-card { position: sticky; top: 1rem; }
.pb-mini {
  --pb-bg: #5C0A1A;
  --pb-accent: #C9A227;
  --pb-text: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  background: var(--pb-bg);
  aspect-ratio: 1.414 / 1;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}
.pb-mini-frame {
  margin: 6%;
  height: 88%;
  border: 1.5px solid var(--pb-accent);
  box-shadow: inset 0 0 0 1px var(--pb-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6% 5% 5%;
  text-align: center;
  color: var(--pb-text);
  box-sizing: border-box;
}
.pb-mini-logo {
  width: 18%;
  aspect-ratio: 1;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-mini-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pb-mini-logo-ph {
  font-size: 0.55rem;
  opacity: 0.55;
  border: 1px dashed var(--pb-accent);
  border-radius: 50%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-mini-club {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  opacity: 0.95;
}
.pb-mini-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pb-accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.pb-mini-member {
  font-size: 0.58rem;
  margin-bottom: 0.45rem;
  opacity: 0.92;
  line-height: 1.3;
}
.pb-mini-company {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.pb-mini-line {
  width: 28%;
  height: 1px;
  background: var(--pb-accent);
  margin: 0.15rem 0 0.4rem;
}
.pb-mini-body {
  font-size: 0.52rem;
  line-height: 1.35;
  opacity: 0.9;
  margin-bottom: auto;
  max-width: 92%;
}
.pb-mini-season {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
  color: var(--pb-text);
}
.pb-mini-thanks {
  font-size: 0.52rem;
  margin-top: 0.35rem;
  opacity: 0.9;
}
.flash-ok {
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.flash-err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.pb-admin .data-table .pb-swatch {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  vertical-align: middle;
  border: 1px solid #cbd5e1;
  margin-right: 0.35rem;
}

.pb-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.pb-row-actions .btn-secondary {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.pb-admin-layout {
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem);
}
.pb-suggest-wrap { position: relative; }
.pb-suggest-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.pb-suggest-chip {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.pb-suggest-chip:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.pb-pdf-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1.414 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.pb-pdf-canvas iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #1e293b;
}
.pb-pdf-status {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-size: 0.8rem;
  pointer-events: none;
}
.pb-pdf-status--err { background: rgba(127, 29, 29, 0.9); }
@media (max-width: 960px) {
  .pb-pdf-canvas { min-height: 16rem; }
}
