:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2128;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --info: #58a6ff;
  --sidebar-width: 240px;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.brand-icon { font-size: 22px; }

.sidebar-nav {
  padding: 8px 8px;
  flex: 1;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section + .nav-section {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  margin-top: 4px;
}

.nav-section-label {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  user-select: none;
}

.nav-section-label-link {
  display: block;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s;
  cursor: pointer;
}
.nav-section-label-link:hover { color: var(--accent); text-decoration: none; }
.nav-section-label-link.active { color: var(--accent); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: rgba(88,166,255,0.12); color: var(--accent); font-weight: 500; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-muted); }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text); font-weight: 500; }

/* ── "Возникли вопросы?" help dropdown ────────── */
.help-dropdown { position: relative; display: inline-flex; }
.btn-help-docs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-help-docs:hover,
.help-dropdown.open .btn-help-docs {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(88,166,255,0.06);
  text-decoration: none;
}
.btn-help-icon { width: 14px; height: 14px; flex-shrink: 0; }
.btn-help-chevron {
  width: 10px; height: 6px; flex-shrink: 0; margin-left: 1px;
  transition: transform 0.2s;
}
.help-dropdown.open .btn-help-chevron { transform: rotate(180deg); }

/* dropdown menu */
.help-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  overflow: hidden;
  z-index: 200;
  animation: helpDropIn 0.15s ease;
}
.help-dropdown.open .help-dropdown-menu { display: block; }
@keyframes helpDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.help-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.help-dropdown-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.help-dropdown-item:hover { background: rgba(88,166,255,0.07); text-decoration: none; }
.help-dropdown-item-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(88,166,255,0.1);
  color: var(--accent);
}
.help-dropdown-item-icon svg { width: 16px; height: 16px; }
.help-dropdown-item-text { display: flex; flex-direction: column; gap: 2px; }
.help-dropdown-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.help-dropdown-item-sub { font-size: 11px; color: var(--text-muted); }
@media (max-width: 640px) { .btn-help-label, .btn-help-chevron { display: none; } }

/* ── Profile topbar button ──────────────────────────────── */
.profile-topbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}
.profile-topbar-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.profile-topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(88,166,255,0.2);
  border: 1px solid rgba(88,166,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  pointer-events: none;
}
.profile-topbar-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.profile-topbar-role {
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Profile modal ──────────────────────────────────────── */
.profile-modal-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(88,166,255,0.2);
  border: 2px solid rgba(88,166,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.profile-modal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.profile-modal-login {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.profile-modal-role-badge { margin-top: 5px; }

.profile-modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.profile-modal-tab {
  flex: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.profile-modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.profile-modal-tab:hover { color: var(--text); }

.profile-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* Profile msg (inline feedback) */
.profile-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.profile-msg-success { background: rgba(63,185,80,0.13); color: var(--success); }
.profile-msg-error   { background: rgba(248,81,73,0.13);  color: var(--danger); }

@media (max-width: 480px) {
  .profile-topbar-name, .profile-topbar-role { display: none; }
  .profile-topbar-btn { padding: 4px; }
}

.content { padding: 24px; flex: 1; }

/* ── Section banner (collapsible page description) ─── */
.section-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.section-banner:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

.section-banner-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.section-banner-header:hover { background: var(--surface-2); }

.section-banner-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.section-banner-titles {
  flex: 1;
}
.section-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-banner-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}
.section-banner-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.section-banner-header:hover .section-banner-toggle {
  background: rgba(88,166,255,0.12);
  color: var(--accent);
  border-color: rgba(88,166,255,0.3);
}
.section-banner.is-collapsed .section-banner-toggle { color: var(--text-muted); }

.section-banner-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.28s ease;
}
.section-banner.is-collapsed .section-banner-body {
  grid-template-rows: 0fr;
}
.section-banner-body-inner {
  overflow: hidden;
}
.section-banner-content {
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.section-banner-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

@media (max-width: 600px) {
  .section-banner-header { padding: 12px 14px; }
  .section-banner-content { padding: 0 14px 14px; }
  .section-banner-title { font-size: 14px; }
  .section-banner-toggle { padding: 4px 10px; font-size: 11px; }
}

/* ── Flash messages ──────────────────────── */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin: 0;
  font-size: 14px;
  border-left: 4px solid;
}
.flash-success { background: rgba(63,185,80,0.1); border-color: var(--success); color: var(--success); }
.flash-error   { background: rgba(248,81,73,0.1);  border-color: var(--danger);  color: var(--danger);  }
.flash-warning { background: rgba(210,153,34,0.1); border-color: var(--warning); color: var(--warning); }
.flash-info    { background: rgba(88,166,255,0.1); border-color: var(--info);    color: var(--info);    }
.flash-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; padding: 0 4px; }

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; text-align: left; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

.form-card { max-width: 800px; }

/* ── Tables ──────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--surface-2); }
.text-center { text-align: center; }

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 180px; }
.col-4 { flex: 0 0 calc(33.33% - 11px); }
.col-6 { flex: 0 0 calc(50% - 8px); }
.col-8 { flex: 0 0 calc(66.67% - 11px); }

.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.required { color: var(--danger); }

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.checkbox-wrap input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: 0.85; }
.btn-primary   { background: var(--accent);   color: #0d1117; border-color: var(--accent); }
.btn-danger    { background: var(--danger);   color: #fff;    border-color: var(--danger); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-warning   { background: var(--warning);  color: #0d1117; border-color: var(--warning); }
.btn-info      { background: var(--info);     color: #0d1117; border-color: var(--info); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 10px; }

/* ── Star / Favourite button ─────────────── */
.btn-icon-star {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-icon-star:hover {
  color: #e3b341;
  border-color: #e3b341;
  background: rgba(227,179,65,0.08);
  opacity: 1;
}
.btn-icon-star.is-favorite {
  color: #e3b341;
  border-color: #e3b341;
  background: rgba(227,179,65,0.12);
}

/* ── Badges ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-danger  { background: rgba(248,81,73,0.15); color: var(--danger); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--warning); }
.badge-info    { background: rgba(88,166,255,0.15); color: var(--info); }
.badge-perm    { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); margin: 2px 2px; }

/* Status badges */
.badge-status-active      { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-status-in_repair   { background: rgba(210,153,34,0.15); color: var(--warning); }
.badge-status-written_off { background: rgba(248,81,73,0.15); color: var(--danger); }
.badge-status-transferred { background: rgba(88,166,255,0.15); color: var(--info); }

/* Condition badges */
.badge-condition-excellent { background: rgba(63,185,80,0.15); color: var(--success); }
.badge-condition-good      { background: rgba(88,166,255,0.15); color: var(--info); }
.badge-condition-fair      { background: rgba(210,153,34,0.15); color: var(--warning); }
.badge-condition-poor      { background: rgba(248,81,73,0.15); color: var(--danger); }

/* ── Audit (stocktaking) badges ──────────── */
.badge-audit-draft       { background: rgba(139,148,158,0.15); color: var(--text-muted); }
.badge-audit-in_progress { background: rgba(88,166,255,0.15);  color: var(--info); }
.badge-audit-completed   { background: rgba(63,185,80,0.15);   color: var(--success); }
.badge-audit-cancelled   { background: rgba(248,81,73,0.15);   color: var(--danger); }

.badge-audit-item-pending     { background: rgba(139,148,158,0.15); color: var(--text-muted); }
.badge-audit-item-found       { background: rgba(63,185,80,0.15);   color: var(--success); }
.badge-audit-item-not_found   { background: rgba(248,81,73,0.15);   color: var(--danger); }
.badge-audit-item-discrepancy { background: rgba(210,153,34,0.15);  color: var(--warning); }

/* ── Item request badges ─────────────────── */
.badge-req-pending   { background: rgba(210,153,34,0.15);  color: var(--warning); }
.badge-req-approved  { background: rgba(63,185,80,0.15);   color: var(--success); }
.badge-req-rejected  { background: rgba(248,81,73,0.15);   color: var(--danger); }
.badge-req-cancelled { background: rgba(139,148,158,0.15); color: var(--text-muted); }
.badge-req-completed { background: rgba(88,166,255,0.15);  color: var(--info); }

/* ── Audit table row highlights ──────────── */
.row-success td { background: rgba(63,185,80,0.04); }
.row-warning td { background: rgba(210,153,34,0.06); }
.row-danger  td { background: rgba(248,81,73,0.06); }

/* ── Page header ─────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title-text { font-size: 20px; font-weight: 700; color: var(--text); }

/* ── Toolbar / search ────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.search-input { max-width: 220px; }
.filter-select { width: auto; min-width: 120px; max-width: 180px; flex: 0 1 auto; }
.toolbar-actions { display: flex; gap: 8px; }

/* ── Styled scrollbar ────────────────────── */
.card-body.p-0 {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.card-body.p-0::-webkit-scrollbar { height: 6px; }
.card-body.p-0::-webkit-scrollbar-track { background: transparent; }
.card-body.p-0::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.card-body.p-0::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Sidebar scrollbar ───────────────────── */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Bulk action bar ────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(88,166,255,0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.bulk-count { font-weight: 600; font-size: 14px; color: var(--accent); white-space: nowrap; }

/* ── Sidebar footer ─────────────────────── */
.sidebar-footer {
  padding: 8px 8px 12px;
  border-top: 1px solid var(--border);
}

/* ── Pagination ──────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}
.page-info { color: var(--text-muted); font-size: 13px; }

/* ── Stats grid ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  border-top: 3px solid var(--border);
}
.stat-active  { border-top-color: var(--success); }
.stat-warning { border-top-color: var(--warning); }
.stat-danger  { border-top-color: var(--danger); }
.stat-info    { border-top-color: var(--info); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard charts grid (legacy kept for reference) ───────────────── */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.dashboard-charts-grid .card,
.dashboard-half-row .card {
  margin-bottom: 0;
}

.dashboard-half-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Dashboard widget grid ───────────────── */
.dashboard-widget-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.dashboard-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-widget {
  min-width: 0;
}

.dashboard-widget .card {
  margin-bottom: 0;
}

.dashboard-widget.widget-full {
  grid-column: span 2;
}

.dashboard-widget.widget-hidden {
  display: none;
}

.dashboard-widget.widget-dragging {
  opacity: 0.35;
}

.dashboard-widget.widget-drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ── Drag handle ─────────────────────────── */
.drag-handle {
  cursor: grab;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.45;
  user-select: none;
  flex-shrink: 0;
  margin-right: 6px;
  transition: opacity 0.15s;
  padding: 2px;
}

.drag-handle:hover {
  opacity: 1;
  color: var(--text);
}

.drag-handle:active {
  cursor: grabbing;
}

/* ── Widget settings modal items ─────────── */
.widget-settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.widget-settings-item:last-child {
  border-bottom: none;
}

.widget-settings-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.widget-settings-label {
  font-size: 14px;
  color: var(--text);
}

/* ── Summary KPI widget ──────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}

.kpi-card.kpi-info  { border-left-color: var(--info); }
.kpi-card.kpi-success { border-left-color: var(--success); }
.kpi-card.kpi-warning { border-left-color: var(--warning); }
.kpi-card.kpi-danger  { border-left-color: var(--danger); }

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Category breakdown widget ───────────── */
.cat-breakdown-list {
  list-style: none;
  padding: 12px 0;
}

.cat-breakdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}

.cat-breakdown-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-breakdown-bar-wrap {
  width: 80px;
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.cat-breakdown-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.cat-breakdown-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Activity feed widget ────────────────── */
.activity-list {
  list-style: none;
  padding: 4px 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  margin-top: 1px;
}

.activity-icon.act-created { background: color-mix(in srgb, var(--success) 15%, transparent); }
.activity-icon.act-updated { background: color-mix(in srgb, var(--info) 15%, transparent); }

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

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

/* Audit progress block (in-progress audits on dashboard) */
.audit-progress-block {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.audit-progress-block:last-of-type {
  border-bottom: none;
}
.audit-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.audit-progress-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.audit-progress-title:hover { text-decoration: underline; }
.audit-progress-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 8px;
}
.audit-progress-bar-wrap {
  width: 100%;
  background: var(--border);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.audit-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width .3s ease;
}
.audit-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

/* Donut chart */
.donut-card-body {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.donut-wrap {
  position: relative;
  flex-shrink: 0;
}
.donut-svg {
  width: 120px;
  height: 120px;
  display: block;
}
.donut-center-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.donut-total {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.donut-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.donut-legend {
  list-style: none;
  flex: 1;
  min-width: 0;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-label {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.donut-legend-val {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Horizontal bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 36px;
  align-items: center;
  gap: 10px;
}
.bar-label {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: var(--surface-2);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.bar-fill-accent { background: var(--accent); }
.bar-fill-info   { background: var(--info); opacity: 0.8; }
.bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
}

/* ── Detail page ─────────────────────────── */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.detail-header h2 { font-size: 22px; font-weight: 700; }
.inv-number { font-size: 13px; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); }
.detail-actions { display: flex; gap: 8px; align-items: center; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: start;
}
.detail-grid-left { display: flex; flex-direction: column; gap: 12px; }
.card-qr { align-self: start; }

.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.detail-list dt { color: var(--text-muted); font-weight: 500; }
.detail-list dd { color: var(--text); }

.contact-info-list { list-style: none; margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.contact-info-list li { margin: 2px 0; }

.contact-fields-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }

.notes-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.notes-section h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.detail-custom-fields { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.detail-section-title { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }

/* ── Public link box ─────────────────────────────── */
.public-link-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.public-link-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--info);
  margin-bottom: 8px;
}
.public-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.public-link-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: text;
}

.barcode-section { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.barcode-img { max-width: 100%; background: #fff; padding: 12px; border-radius: 6px; }
.barcode-number { font-family: monospace; color: var(--text-muted); font-size: 13px; }

/* ── History ─────────────────────────────── */
.change-list { list-style: none; font-size: 12px; }
.change-list li { margin: 2px 0; }
.old-val { color: var(--danger); text-decoration: line-through; }
.new-val { color: var(--success); }

/* ── Permissions ─────────────────────────── */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.permission-item input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.perm-label { font-size: 13px; color: var(--text); }

/* ── Inline form ─────────────────────────── */
.inline-form { display: inline; }

/* ── Dropdown ────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 140px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  font-size: 13px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--surface-2); color: var(--accent); }

/* ── Column picker ───────────────────────── */
.col-picker-wrap { position: relative; }
.col-picker-menu {
  min-width: 220px;
  padding: 0;
  overflow: hidden;
}
.col-picker-header {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.col-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 0.12s;
}
.col-picker-item:hover { background: var(--surface-2); }
.col-picker-label { flex: 1; }

/* Toggle switch */
.col-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 12px;
}
.col-toggle input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.col-toggle-track {
  display: block;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}
.col-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s, background 0.2s;
}
.col-toggle input[type=checkbox]:checked + .col-toggle-track {
  background: rgba(88,166,255,0.35);
}
.col-toggle input[type=checkbox]:checked + .col-toggle-track::after {
  transform: translateX(14px);
  background: var(--accent);
}

/* ── Utility ─────────────────────────────── */
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 20px; }
.p-4 { padding: 16px; }

/* ── Login page ──────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--text); }
.login-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 14px; }
.login-form .form-group { margin-bottom: 20px; }

code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-muted); }

/* ── Item photo ──────────────────────────── */
.item-photo-wrap {
  text-align: center;
  margin-bottom: 16px;
}
.item-photo {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
}
.item-photo-thumb {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
}
.photo-preview {
  margin-bottom: 12px;
}

/* ── Barcode settings ────────────────────── */
.qr-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.qr-actions > .btn {
  width: 100%;
  justify-content: center;
}
.barcode-settings {
  width: 100%;
}
.barcode-settings summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
  width: 100%;
}
.barcode-settings summary::-webkit-details-marker { display: none; }
.barcode-settings-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;
}
.form-control-sm {
  font-size: 13px;
  padding: 4px 8px;
  height: auto;
}
.barcode-settings-body .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.barcode-settings-body .form-row label {
  font-size: 12px;
  color: var(--text-muted);
}
.form-range {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── QR image ────────────────────────────── */
.qr-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  image-rendering: pixelated;
}

/* ── Mobile nav ──────────────────────────── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 8px;
  line-height: 1;
}
.topbar-left {
  display: flex;
  align-items: center;
}
.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  padding: 0 4px;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ── Responsive breakpoints ──────────────── */
@media (max-width: 1100px) {
  .dashboard-half-row { grid-template-columns: 1fr; }
  .dashboard-widgets { grid-template-columns: 1fr; }
  .dashboard-widget.widget-full { grid-column: span 1; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: inline-flex; }
  .sidebar-close-btn { display: inline-flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .content { padding: 16px; }

  /* Detail page stacks to single column */
  .detail-grid { grid-template-columns: 1fr; }
  .dashboard-charts-grid { grid-template-columns: 1fr; }
  .dashboard-half-row { grid-template-columns: 1fr; }
  .dashboard-widgets { grid-template-columns: 1fr; }
  .dashboard-widget.widget-full { grid-column: span 1; }

  /* Detail header wraps nicely */
  .detail-header { flex-direction: column; align-items: flex-start; }
  .detail-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Tables: horizontal scroll */
  .card-body.p-0 { overflow-x: auto; }
  .table { min-width: 600px; }

  /* Toolbar stacks vertically */
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-form { flex-direction: column; }
  .search-form .form-control,
  .search-form .filter-select,
  .search-form select.form-control { max-width: 100%; width: 100%; }
  .toolbar-actions { flex-wrap: wrap; }

  /* Topbar user info: hide role badge on very small screens */
  .topbar-user .badge { display: none; }
  .user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Form rows stack */
  .form-row { flex-direction: column; gap: 0; }
  .col-4, .col-6, .col-8 { flex: 1 1 100%; }
}

@media (max-width: 480px) {
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { color: var(--text-muted); margin-top: 10px; margin-bottom: 2px; }
  .detail-list dd { margin-bottom: 4px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Light theme ─────────────────────────── */
body.light-theme {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --text: #1f2328;
  --text-muted: #57606a;
  --success: #1a7f37;
  --warning: #9a6700;
  --danger: #cf222e;
  --info: #0969da;
}

body.light-theme .nav-item.active {
  background: rgba(9,105,218,0.1);
  color: var(--accent);
}

body.light-theme .sidebar-overlay {
  background: rgba(0,0,0,0.4);
}

/* ── Onboarding Tour ─────────────────────── */
.tour-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  transition: opacity 0.3s ease;
}
.tour-backdrop.tour-active { display: block; animation: tourFadeIn 0.3s ease; }

.tour-spotlight {
  display: none;
  position: fixed;
  z-index: 915;
  border-radius: 8px;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 8px rgba(88,166,255,0.25);
  animation: tourPulse 2s infinite;
  pointer-events: none;
  transition: top 0.35s cubic-bezier(0.4,0,0.2,1),
              left 0.35s cubic-bezier(0.4,0,0.2,1),
              width 0.35s cubic-bezier(0.4,0,0.2,1),
              height 0.35s cubic-bezier(0.4,0,0.2,1);
}
.tour-spotlight.tour-active { display: block; }

@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent), 0 0 0 8px rgba(88,166,255,0.25); }
  50%       { box-shadow: 0 0 0 4px var(--accent), 0 0 0 14px rgba(88,166,255,0.12); }
}

@keyframes tourFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes tourSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.tour-card {
  display: none;
  position: fixed;
  z-index: 920;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(88,166,255,0.15);
  overflow: hidden;
  transition: top 0.35s cubic-bezier(0.4,0,0.2,1),
              left 0.35s cubic-bezier(0.4,0,0.2,1);
}
.tour-card.tour-active {
  display: block;
  animation: tourSlideIn 0.35s cubic-bezier(0.4,0,0.2,1);
}

/* Arrow pointer */
.tour-card::before {
  content: '';
  position: absolute;
  top: 28px;
  left: -10px;
  border: 10px solid transparent;
  border-right-color: var(--border);
  border-left: none;
  pointer-events: none;
  transition: top 0.35s cubic-bezier(0.4,0,0.2,1);
}
.tour-card::after {
  content: '';
  position: absolute;
  top: 29px;
  left: -8px;
  border: 9px solid transparent;
  border-right-color: var(--surface);
  border-left: none;
  pointer-events: none;
  transition: top 0.35s cubic-bezier(0.4,0,0.2,1);
}
/* Arrow pointing right (when card is to the left of target) */
.tour-card.arrow-right::before {
  left: auto;
  right: -10px;
  border-right-color: transparent;
  border-left: 10px solid var(--border);
}
.tour-card.arrow-right::after {
  left: auto;
  right: -8px;
  border-right-color: transparent;
  border-left: 9px solid var(--surface);
}
/* No arrow (welcome step) */
.tour-card.arrow-none::before,
.tour-card.arrow-none::after { display: none; }

.tour-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}

.tour-step-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(88,166,255,0.12);
  padding: 3px 10px;
  border-radius: 20px;
}

.tour-skip-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.tour-skip-btn:hover { color: var(--text); background: var(--surface-2); }

.tour-card-body { padding: 16px 20px 12px; }

.tour-icon {
  font-size: 36px;
  margin-bottom: 10px;
  line-height: 1;
  display: block;
}

.tour-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.tour-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.tour-card-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.tour-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tour-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.tour-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.tour-actions { display: flex; gap: 8px; align-items: center; }

.tour-btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tour-btn-secondary:hover { background: var(--border); color: var(--text); }

.tour-btn-primary {
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 7px;
}


/* ── Item Comments ──────────────────────────────────────────────────────── */
.comment-thread { display: flex; flex-direction: column; gap: 12px; }

.comment-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.comment-date {
  font-size: 12px;
}

.comment-delete-form { margin-left: auto; }

.btn-comment-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.btn-comment-delete:hover { color: var(--danger); background: rgba(248,81,73,0.1); }

.comment-text {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-form { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }

.comment-input { width: 100%; resize: vertical; min-height: 60px; }

/* ── Attachments ─────────────────────────── */
.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.attachment-icon { font-size: 20px; flex-shrink: 0; }

.attachment-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.attachment-name {
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-name:hover { text-decoration: underline; }

.attachment-meta { font-size: 12px; }

.attachment-form .form-row { flex-wrap: wrap; }

/* ── Empty-value dash ─────────────────────── */
.empty-val { font-size: 0.75em; color: var(--text-muted); opacity: 0.55; }

/* ── Calendar ────────────────────────────── */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-nav-btn {
  font-size: 18px;
  line-height: 1;
  padding: 4px 12px;
}

.cal-month-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  min-width: 180px;
  text-align: center;
}

.cal-grid-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-header-cell {
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.cal-header-cell.cal-weekend { color: var(--danger); }

.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 110px;
  padding: 6px 8px;
  vertical-align: top;
  background: var(--surface);
  transition: background 0.1s;
}

.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell--empty { background: var(--bg); }

.cal-cell--weekend { background: rgba(248,81,73,0.03); }

.cal-cell--today { background: rgba(88,166,255,0.06); }

.cal-day-number {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.4;
}

.cal-day-today {
  color: var(--accent);
  font-weight: 700;
}

.cal-booking {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(88,166,255,0.13);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 11px;
  color: var(--accent);
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}

.cal-booking:hover {
  background: rgba(88,166,255,0.22);
  border-color: rgba(88,166,255,0.55);
}

.cal-booking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.cal-booking-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Modal ───────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(540px, 96vw);
  max-height: 90vh;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ── Booking detail view ─────────────────── */
.booking-detail { display: flex; flex-direction: column; gap: 12px; }

.booking-detail-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.booking-detail-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 120px;
  flex-shrink: 0;
  padding-top: 1px;
}

.booking-detail-value {
  color: var(--text);
  font-size: 14px;
}

.mb-4 { margin-bottom: 16px; }
.page-header { display: flex; align-items: center; gap: 12px; }



/* ── Booking bar chart widget ────────────── */
.booking-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 0 4px;
}

.booking-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.booking-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--border);
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  min-height: 8px;
}

.booking-bar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  min-height: 4px;
}

.booking-bar-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.booking-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
}

/* ── Mini-calendar widget ─────────────────── */
.mini-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.mini-cal-head.mini-cal-weekend {
  color: var(--accent);
}

.mini-cal-cell {
  position: relative;
  text-align: center;
  padding: 4px 2px;
  border-radius: 4px;
  font-size: 12px;
  min-height: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
}

.mini-cal-cell.mini-cal-empty {
  background: none;
}

.mini-cal-cell.mini-cal-today .mini-cal-day {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

.mini-cal-cell.mini-cal-weekend {
  color: var(--accent);
}

.mini-cal-cell.mini-cal-has-bookings {
  background: var(--accent-bg, rgba(99,102,241,0.08));
  cursor: default;
}

.mini-cal-day {
  font-size: 12px;
  line-height: 20px;
}

.mini-cal-dot-count {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 4px;
  line-height: 14px;
  min-width: 14px;
  text-align: center;
}

.mini-cal-legend {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-cal-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  overflow: hidden;
}

.mini-cal-legend-date {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.mini-cal-legend-name {
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.mini-cal-legend-name:hover {
  text-decoration: underline;
  color: var(--accent);
}

.mini-cal-legend-resp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  flex-shrink: 0;
  font-size: 11px;
}

/* ── Reports ─────────────────────────────── */
.report-hub-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.report-stat-card {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
}

.report-stat-icon {
  font-size: 28px;
  line-height: 1;
}

.report-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.report-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.report-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.report-hub-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  cursor: pointer;
}

.report-hub-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-2px);
}

.report-hub-card-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.report-hub-card-body {
  flex: 1;
}

.report-hub-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.report-hub-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.report-hub-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.report-tag {
  font-size: 11px;
  background: rgba(88,166,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 4px;
  padding: 2px 8px;
}

.report-hub-card-arrow {
  font-size: 18px;
  color: var(--text-muted);
  align-self: center;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.report-hub-card:hover .report-hub-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Filters card */
.report-filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.report-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.report-filters-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.report-filters-form .report-filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.report-filters-form .form-group {
  flex: 1 1 160px;
  margin-bottom: 0;
}

.report-filters-form .form-group--actions {
  flex: 0 0 auto;
}

/* Summary strip */
.report-summary-row {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.report-summary-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-summary-block--tags {
  flex-direction: column;
}

.report-summary-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.report-summary-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

.report-summary-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.report-summary-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mb-1 { margin-bottom: 4px; }

/* Toolbar */
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.report-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-toolbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.report-toolbar-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
}

.report-toolbar-right {
  display: flex;
  gap: 8px;
}

/* Print-only header — hidden on screen */
.print-header {
  display: none;
}

/* ── Multi-select dropdown (ms-*) ────────── */
.ms-root {
  position: relative;
  width: 100%;
}

.ms-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  min-height: 36px;
}

.ms-trigger:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.ms-trigger--open,
.ms-trigger--active {
  border-color: var(--accent);
}

.ms-trigger--active .ms-trigger-text {
  color: var(--accent);
  font-weight: 500;
}

.ms-trigger-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ms-chevron {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.ms-trigger--open .ms-chevron {
  transform: rotate(180deg);
}

.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 220px;
  max-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ms-search-row {
  padding: 10px 10px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ms-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.ms-search:focus {
  border-color: var(--accent);
}

.ms-selall-row {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ms-selall-btn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s;
}

.ms-selall-btn:hover {
  background: rgba(88, 166, 255, 0.1);
}

.ms-selall-btn--clear {
  color: var(--text-muted);
}

.ms-selall-btn--clear:hover {
  background: var(--surface-2);
  color: var(--text);
}

.ms-list {
  overflow-y: auto;
  max-height: 230px;
  padding: 6px 0;
  flex: 1;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.1s;
  user-select: none;
}

.ms-option:hover {
  background: var(--surface-2);
}

.ms-option input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Single-select searchable dropdown (ss-*) ── */
.ss-root {
  position: relative;
  width: 100%;
}

.ss-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  min-height: 36px;
}

.ss-trigger:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.ss-trigger--open,
.ss-trigger--active {
  border-color: var(--accent);
}

.ss-trigger-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ss-chevron {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.ss-trigger--open .ss-chevron {
  transform: rotate(180deg);
}

.ss-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ss-search-row {
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ss-search {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.ss-search:focus {
  border-color: var(--accent);
}

.ss-list {
  overflow-y: auto;
  max-height: 240px;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ss-list::-webkit-scrollbar { width: 5px; }
.ss-list::-webkit-scrollbar-track { background: transparent; }
.ss-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.ss-list::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.ss-option {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.1s;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-option:hover { background: var(--surface-2); }

.ss-option--clear {
  color: var(--text-muted);
  font-style: italic;
  border-bottom: 1px solid var(--border);
}

.ss-option--active {
  color: var(--accent);
  font-weight: 500;
}

/* ── Report Column Picker (rcp-*) ──────────── */
.rcp-wrap {
  position: relative;
  display: inline-block;
}

.rcp-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 400;
  padding: 4px 0;
}

.rcp-header {
  padding: 8px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.rcp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.1s;
  user-select: none;
  gap: 12px;
}

.rcp-item:hover {
  background: var(--surface-2);
}

.rcp-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
  order: 2;
}

.rcp-label {
  flex: 1;
}

/* ── Print styles ────────────────────────── */
@media print {
  /* Hide UI chrome */
  .sidebar,
  .topbar,
  .section-banner,
  .report-filters-card,
  .report-toolbar,
  .flash,
  .modal,
  .modal-backdrop,
  #tour-backdrop,
  #tour-spotlight,
  #tour-card {
    display: none !important;
  }

  /* Reset layout */
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  /* Show print header */
  .print-header {
    display: block !important;
    margin-bottom: 18pt;
    padding-bottom: 10pt;
    border-bottom: 2pt solid #111;
  }

  .print-header-logo {
    font-size: 16pt;
    font-weight: 700;
    margin-bottom: 6pt;
  }

  .print-header-meta {
    font-size: 9pt;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 12pt;
  }

  /* Summary */
  .report-summary-row {
    display: flex !important;
    background: none !important;
    border: 1pt solid #ccc !important;
    border-radius: 4pt !important;
    padding: 8pt 12pt !important;
    margin-bottom: 14pt !important;
    color: #111 !important;
  }

  .report-summary-num { color: #111 !important; }
  .report-summary-lbl { color: #555 !important; }
  .report-summary-divider { background: #ccc !important; }

  /* Table */
  .card {
    border: 1pt solid #ccc !important;
    border-radius: 4pt !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 9pt !important;
  }

  .table th {
    background: #f0f0f0 !important;
    color: #111 !important;
    border: 1pt solid #ccc !important;
    padding: 5pt 8pt !important;
    text-align: left !important;
  }

  .table td {
    border: 1pt solid #ddd !important;
    padding: 4pt 8pt !important;
    color: #111 !important;
  }

  .table tbody tr:nth-child(even) td {
    background: #fafafa !important;
  }

  .badge {
    border: 1pt solid #ccc !important;
    background: none !important;
    color: #111 !important;
    padding: 1pt 4pt !important;
    border-radius: 3pt !important;
    font-size: 8pt !important;
  }

  code {
    background: none !important;
    color: #111 !important;
    font-size: 9pt !important;
  }

  .text-muted { color: #555 !important; }

  a { color: #111 !important; text-decoration: none !important; }

  /* Page setup */
  @page {
    margin: 18mm 15mm;
    size: A4 landscape;
  }
}
