/* ═══════════════════════════════════════════════════════════════════════════
   Markthelfer – Global Stylesheet
   Colors: Primary #2E75B6 | OK #27AE60 | Warn #E74C3C
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #2E75B6;
  --primary-d: #235e92;
  --primary-l: #e8f1fb;
  --ok: #27AE60;
  --ok-l: #e9f7ef;
  --warn: #E74C3C;
  --warn-l: #fdecea;
  --yellow: #f39c12;
  --yellow-l: #fff8e1;
  --bg: #f0f4f8;
  --sidebar-bg: #1a2744;
  --sidebar-w: 240px;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #718096;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .08);
  --transition: .18s ease;
  --bottom-nav: 56px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #cbd5e0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .02em;
}

.sidebar-brand .icon {
  font-size: 1.5rem;
}

.sidebar-section {
  padding: .5rem 1rem .25rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #4a6080;
  margin-top: .5rem;
}

.sidebar-nav {
  flex: 1;
  padding: .5rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  color: #a0aec0;
  font-size: .9rem;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(46, 117, 182, .3);
  color: #fff;
  border-left: 3px solid var(--primary);
}

.nav-item .nav-icon {
  font-size: 1.05rem;
  min-width: 20px;
  text-align: center;
}

.nav-item .nav-label {
  flex: 1;
}

/* Locked module */
.nav-item.locked {
  opacity: .45;
  cursor: default;
}

.nav-item.locked:hover {
  background: none;
  color: #a0aec0;
}

.nav-item.locked::after {
  content: '🔒';
  font-size: .75rem;
  margin-left: auto;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: .8rem;
  color: #4a6080;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top header ────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .875rem;
}

.topbar-user a {
  color: var(--warn);
  font-size: .8rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem;
}

/* ── Page content ──────────────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.page-sub {
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: .1rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--primary-l);
}

.stat-icon.green {
  background: var(--ok-l);
}

.stat-icon.red {
  background: var(--warn-l);
}

.stat-icon.yellow {
  background: var(--yellow-l);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.data-table th {
  background: #f7fafc;
  font-weight: 600;
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.data-table th:hover {
  background: #edf2f7;
}

.data-table th .sort-icon {
  margin-left: .25rem;
  opacity: .4;
}

.data-table th.sort-asc .sort-icon::after {
  content: ' ↑';
  opacity: 1;
}

.data-table th.sort-desc .sort-icon::after {
  content: ' ↓';
  opacity: 1;
}

.data-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f7fafc;
}

.data-table .actions {
  display: flex;
  gap: .5rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  min-height: 44px;
  /* Touch target */
  text-decoration: none;
}

.btn:hover {
  opacity: .88;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-ok {
  background: var(--ok);
  color: #fff;
}

.btn-danger {
  background: var(--warn);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary {
  background: #edf2f7;
  color: var(--text);
}

.btn-sm {
  padding: .35rem .75rem;
  font-size: .8rem;
  min-height: 36px;
}

.btn-icon {
  padding: .5rem;
  border-radius: 8px;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: #4a5568;
}

.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 117, 182, .15);
}

.form-control.is-invalid {
  border-color: var(--warn);
}

.form-text {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-l);
  color: var(--primary);
}

.badge-ok {
  background: var(--ok-l);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-l);
  color: var(--warn);
}

.badge-err {
  background: #FED7D7;
  color: #C53030;
}

.badge-yellow {
  background: var(--yellow-l);
  color: var(--yellow);
}

.badge-gray {
  background: #edf2f7;
  color: var(--text-muted);
}

/* ── Alerts / Flash ────────────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.alert-success {
  background: var(--ok-l);
  border-left: 4px solid var(--ok);
  color: #1a5c38;
}

.alert-error {
  background: var(--warn-l);
  border-left: 4px solid var(--warn);
  color: #7b1c1c;
}

.alert-info {
  background: var(--primary-l);
  border-left: 4px solid var(--primary);
  color: #1a3a60;
}

.alert-warning {
  background: var(--yellow-l);
  border-left: 4px solid var(--yellow);
  color: #7d4e00;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: center;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  transition: background var(--transition);
  text-decoration: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.pagination a:hover {
  background: var(--primary-l);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .disabled {
  opacity: .4;
  cursor: default;
  pointer-events: none;
}

/* ── Table search bar ──────────────────────────────────────────────────────── */
.table-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.table-search {
  flex: 1;
  min-width: 200px;
  padding: .55rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .875rem;
}

.table-search:focus {
  outline: none;
  border-color: var(--primary);
}

.upgrade-banner {
  background: linear-gradient(135deg, #1a2744 0%, #2E75B6 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 500px;
  margin: 3rem auto;
}

.upgrade-banner h2 {
  font-size: 1.4rem;
  margin-bottom: .5rem;
}

.upgrade-banner p {
  opacity: .85;
  margin-bottom: 1.25rem;
  font-size: .95rem;
}

.upgrade-price {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
}

.upgrade-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.upgrade-banner .btn {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

/* ── License expiry warning banner ──────────────────────────────────────────── */
.expiry-banner {
  background: var(--yellow-l);
  border-left: 4px solid var(--yellow);
  border-radius: 0;
  padding: .6rem 1.25rem;
  font-size: .85rem;
  margin-bottom: 0;
}

.expiry-banner-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.expiry-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.expiry-text {
  flex: 1;
  color: #7d4e00;
  line-height: 1.4;
}

.expiry-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #a07000;
  line-height: 1;
  padding: .1rem .3rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.expiry-close:hover {
  background: rgba(0, 0, 0, .06);
}

/* ── Status colors ─────────────────────────────────────────────────────────── */
.status-geplant {
  color: var(--primary);
}

.status-bestaetigt {
  color: var(--ok);
}

.status-abgesagt {
  color: var(--warn);
}

.status-abgeschlossen {
  color: var(--text-muted);
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
  transform: scale(.96);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.mt-1 {
  margin-top: .5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: .5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: .875rem;
}

.fw-bold {
  font-weight: 700;
}

.d-flex {
  display: flex;
}

.gap-1 {
  gap: .5rem;
}

.gap-2 {
  gap: 1rem;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.w-100 {
  width: 100%;
}

/* ── Bottom Nav (Mobile) ────────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border-top: 1px solid rgba(255, 255, 255, .1);
  z-index: 200;
  height: var(--bottom-nav);
}

.bottom-nav-items {
  display: flex;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #718096;
  font-size: .6rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  transition: color var(--transition);
}

.bottom-nav-item .bn-icon {
  font-size: 1.2rem;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item:hover {
  color: #fff;
  text-decoration: none;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
    padding-bottom: var(--bottom-nav);
  }

  .menu-toggle {
    display: block;
  }

  .bottom-nav {
    display: block;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 199;
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .page-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Login page ─────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2744 0%, #2E75B6 100%);
  padding: 1rem;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .2);
}

.login-logo {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: .5rem;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .25rem;
}

.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 1.75rem;
}

/* ── Dark Mode ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1117;
  --card: #1a1d27;
  --border: #2d3148;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --primary-l: #1a2744;
  --ok-l: #0d2b1a;
  --warn-l: #2d1010;
  --yellow-l: #2a2000;
  --shadow: 0 2px 12px rgba(0, 0, 0, .4);
  --sidebar-bg: #0d1020;
}

[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .card {
  background: var(--card);
  border-color: var(--border);
}

[data-theme="dark"] .topbar {
  background: var(--card);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .form-control {
  background: #252840;
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .data-table thead th {
  background: #1f2235;
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: #1f2235;
}

[data-theme="dark"] .btn-ghost {
  color: var(--text-muted);
}

[data-theme="dark"] .alert {
  border-color: var(--border);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #252840;
  border-color: var(--border);
  color: var(--text);
}

/* ── Compact table view ────────────────────────────────────────────────────── */
.table-wrap.compact .data-table td,
.table-wrap.compact .data-table th {
  padding: .3rem .6rem;
  font-size: .8rem;
}

.table-wrap.compact .data-table td img {
  width: 22px !important;
  height: 22px !important;
}

/* ── Toast notifications ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.1rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  border-left: 4px solid var(--primary);
  font-size: .9rem;
  pointer-events: auto;
  max-width: 360px;
  animation: toastIn .3s cubic-bezier(.34, 1.3, .64, 1) both;
  transition: opacity .4s, transform .4s;
}

.toast.toast-success {
  border-color: var(--ok);
}

.toast.toast-error {
  border-color: var(--warn);
}

.toast.toast-warning {
  border-color: var(--yellow);
}

.toast.toast-out {
  opacity: 0;
  transform: translateX(1.5rem);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Dark Mode toggle button ───────────────────────────────────────────────── */
.topbar-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: .3rem .4rem;
  border-radius: 6px;
  transition: background var(--transition);
  line-height: 1;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Form-hint tooltips ─────────────────────────────────────────────────────── */
/* .form-hint spans are transformed to ⓘ icons by app.js automatically.        */

/* Hide the raw text when JS has run */
.form-hint {
  display: none;
}

/* Wrapper injected by JS next to the label */
.fh-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: .3rem;
}

/* The ⓘ icon button */
.fh-tip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  user-select: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.fh-tip__icon:hover,
.fh-tip__icon:focus-visible {
  background: var(--primary);
  color: #fff;
  outline: none;
}

/* The tooltip bubble */
.fh-tip__bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 280px;
  background: #2d3748;
  color: #f7fafc;
  font-size: .78rem;
  line-height: 1.5;
  padding: .5rem .75rem;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  z-index: 500;
  pointer-events: none;

  /* Arrow */
  &::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #2d3748;
  }
}

/* Show on hover (desktop) or .show class (touch) */
.fh-tip:hover .fh-tip__bubble,
.fh-tip:focus-within .fh-tip__bubble,
.fh-tip.show .fh-tip__bubble {
  display: block;
}

/* Dark mode adjustment */
[data-theme="dark"] .fh-tip__icon {
  background: rgba(255, 255, 255, .12);
  color: #a0aec0;
}

[data-theme="dark"] .fh-tip__icon:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Kebab / row-action menu ──────────────────────────────────────────────── */

.row-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* Hide the default disclosure triangle */
.kebab>summary {
  list-style: none;
}

.kebab>summary::-webkit-details-marker {
  display: none;
}

.kebab {
  position: relative;
  display: inline-block;
}

.kebab__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 170px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  z-index: 300;
  padding: .3rem;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.kebab__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
  cursor: pointer;
}

.kebab__item:hover {
  background: var(--primary-l);
  color: var(--primary);
}

.kebab__item--danger:hover {
  background: var(--warn-l);
  color: var(--warn);
}

/* button variant (for form submits) */
.kebab__item--btn {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font: inherit;
}

.kebab__divider {
  height: 1px;
  background: var(--border);
  margin: .25rem .5rem;
}

/* Dark mode */
[data-theme="dark"] .kebab__menu {
  background: #1e2a3a;
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

[data-theme="dark"] .kebab__item:hover {
  background: rgba(46, 117, 182, .25);
}