:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1d2735;
  --muted: #66758a;
  --border: #d9e1ec;
  --primary: #B28F3F;
  --primary-hover: #977530;
  --primary-soft: #F6EBCF;
  --link: #8F6D29;
  --link-hover: #6F541F;
  --sidebar-active-bg: #F4E7C4;
  --sidebar-active-text: #6D531D;
  --table-hover: #FBF5E6;
  --hero-start: #35280E;
  --hero-mid: #6F5320;
  --hero-end: #B28F3F;
  --danger: #ba3a3a;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(24, 39, 75, 0.08);
  --font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; font-size: var(--font-size); color: var(--text); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
.auth-body { min-height: 100vh; background: linear-gradient(180deg, #edf2fb 0%, #f8fafc 100%); background-size: 100% 100%; background-position: center; background-repeat: no-repeat; }
.auth-body--has-background { background-attachment: fixed; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(540px, 100%); background: rgba(255,255,255,.96); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 28px; }
.auth-brand { display:flex; justify-content:center; margin-bottom: 18px; }
.auth-brand img { max-height: 72px; max-width: 240px; object-fit: contain; }
.app-header, .app-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border); }
.app-header { position: sticky; top: 0; z-index: 100; }
.app-footer { border-top: 1px solid var(--border); border-bottom: 0; position: sticky; bottom: 0; z-index: 90; margin-top: auto; }
.brand { font-weight: 700; }
.main-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.main-nav a { display:inline-flex; align-items:center; gap:8px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.main-nav a.is-active, .main-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.user-meta { display: flex; gap: 10px; align-items: center; }
.user-chip { display:inline-flex; align-items:center; gap:8px; color:var(--text); }
.user-chip small { display:block; }
.app-main { flex: 1; width: 100%; padding: 20px; max-width: 1400px; margin: 0 auto 32px; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 20px; }
.center-text { text-align: center; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.page-title { margin: 4px 0 0; font-size: 28px; }
.page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
textarea { min-height: 120px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; cursor: pointer; font-weight: 700; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:10px; border:1px solid var(--border); background:#fff; color:var(--text); }
.icon-btn:hover { background: var(--primary-soft); color:var(--primary); border-color: var(--primary); }
.icon-btn.is-primary { background: var(--primary); color:#fff; border-color:var(--primary); }
.icon-btn.is-primary:hover, .icon-btn.is-primary:focus-visible { background: var(--primary-hover); border-color: var(--primary-hover); color:#fff; }
.inline-links { display: flex; justify-content: space-between; gap: 12px; }
.alert { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); background: #f8fbff; margin-bottom: 16px; }
.alert-error { border-color: #f0c9c9; background: #fff5f5; color: #7b1e1e; }
.alert-info { border-color: #c9dcf9; background: #f3f8ff; }
.alert-warn { border-color: #f0d38a; background: #fffaf0; color: #7a5a00; }

.toast-stack { position: fixed; right: 20px; bottom: 88px; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.auth-toast-stack { top: auto; bottom: 20px; right: 20px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: inline-flex; align-items: center; gap: 10px; width: fit-content; max-width: min(560px, 100%); border-radius: 999px; padding: 10px 14px; border: 1px solid var(--border); background: #fff; box-shadow: var(--shadow); font-weight: 700; pointer-events: auto; transition: opacity .22s ease, transform .22s ease; }
.toast i { font-size: 14px; }
.toast-success { background: #e7f7ee; border-color: #b8e2c7; color: #18633c; }
.toast-warning { background: #fff4cc; border-color: #f2d582; color: #7a5a00; }
.toast-error { background: #fff0f0; border-color: #f0c9c9; color: #8b1e1e; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 13px; color: var(--muted); }
.table tbody tr:hover { background: var(--table-hover); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items:end; }
.toolbar-spread { display:flex; justify-content:space-between; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.filters-grid { display: grid; gap: 14px; grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) minmax(140px, 1fr) minmax(120px, 120px) auto; align-items: end; }
.filter-actions { display: flex; gap: 10px; align-items: end; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; color: var(--muted); }
.pagination { display: flex; gap: 6px; flex-wrap: wrap; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); background: #fff; }
.page-link.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.sort-link { display: inline-flex; gap: 6px; align-items: center; color: inherit; }
.sort-link.is-active { color: var(--primary); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; }
.badge-ok { background: #e7f7ee; color: #18633c; }
.badge-muted { background: #edf1f5; color: #526171; }
.badge-info { background: rgba(37,99,235,.12); color: #1d4ed8; border: 1px solid rgba(37,99,235,.18); }
.badge-warn { background: #fff4cc; color: #7a5a00; }
.small-text { font-size: 12px; }
.kpi-card { min-height: 120px; }
.kpi-label { color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; }
.align-start { align-items: start; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-card { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--border); border-radius:12px; padding:12px; background:#fff; }
.permission-card input { width:auto; margin-top:3px; }
.permission-card strong { display:block; }
.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-link { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: #fff; }
.tab-link.is-active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.log-tail { margin: 0; padding: 14px; border-radius: 12px; background: #0f1720; color: #dbe7ff; font-size: 12px; line-height: 1.45; overflow: auto; max-height: 300px; }
.modal-backdrop { position:fixed; inset:0; background:rgba(15,23,32,.55); display:flex; align-items:center; justify-content:center; padding:24px; z-index:200; }
.modal-card { width:min(860px, 100%); max-height:calc(100vh - 48px); overflow:auto; background:#fff; border-radius:18px; box-shadow:var(--shadow); border:1px solid var(--border); }
.modal-header, .modal-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 20px; border-bottom:1px solid var(--border); }
.modal-footer { border-top:1px solid var(--border); border-bottom:0; }
.modal-body { padding:20px; }
.table-actions { display:flex; gap:8px; }
.empty-text { color:var(--muted); padding:12px 0; }
@media (max-width: 1100px) {
  .four-col, .two-col, .permission-grid { grid-template-columns: 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .filter-actions { width: 100%; }
}
@media (max-width: 960px) {
  .app-header, .app-footer { flex-direction: column; align-items: flex-start; }
  .main-nav, .user-meta { width: 100%; flex-wrap: wrap; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}
.dashboard-grid { display:grid; gap:16px; }
.dashboard-grid--payments { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid--payments-secondary { grid-template-columns: 1.2fr .8fr; }
.stat-card strong { font-size: 24px; display:block; margin: 6px 0; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom: 12px; }
.section-head h2, .section-head h3 { margin:0; font-size:18px; }
.action-list { display:flex; flex-direction:column; gap:10px; }
.action-row { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; border:1px solid var(--border); border-radius: 12px; padding: 12px; }
.action-row.is-selected { border-color: var(--primary, #2563eb); box-shadow: 0 0 0 1px var(--primary, #2563eb) inset; }
.action-row-meta { display:flex; align-items:center; gap:8px; }
.suggestion-list { display:flex; flex-direction:column; gap:10px; }
.suggestion-card { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; border:1px solid var(--border); border-radius: 12px; padding: 12px; background: #fff; }
.suggestion-actions { display:flex; align-items:center; gap:8px; }
.badge-warning { background:#fff6e0; color:#8a5a00; }
.modal-backdrop-wide { padding: 20px; }
.modal-card-wide { width:min(1100px, 100%); }
@media (max-width: 1100px) {
  .dashboard-grid--payments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid--payments-secondary { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dashboard-grid--payments { grid-template-columns: 1fr; }
  .action-row, .suggestion-card { flex-direction:column; }
  .action-row-meta, .suggestion-actions { width:100%; justify-content:space-between; }
}

/* Release 062: Navigation refactor */
.app-shell-body { min-height: 100vh; background: var(--bg); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 16px; background: #fff; border-right: 1px solid var(--border); z-index: 120; transition: width .2s ease, padding .2s ease, transform .2s ease; overflow: hidden; }
.app-content-shell { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 100; padding: 14px 20px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); display:flex; justify-content:space-between; align-items:center; gap:16px; }
.app-footer { position: sticky; bottom: 0; z-index: 90; padding: 12px 20px; background: rgba(255,255,255,.96); border-top: 1px solid var(--border); display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:auto; }
.app-main { flex: 1; width: min(var(--app-content-width, 100%), 100%); padding: 20px; max-width: none; margin: 0 auto; }
.header-left, .header-actions { display:flex; align-items:center; gap:12px; }
.sidebar-brand-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.sidebar-brand { display:flex; align-items:center; gap:12px; color: var(--text); font-weight: 700; min-width: 0; }
.sidebar-brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
.sidebar-brand-text { white-space: nowrap; }
.sidebar-toggle { flex: 0 0 auto; }
.sidebar-nav { display:flex; flex-direction:column; gap:10px; min-height: 0; overflow-y:auto; overflow-x:visible; padding-right: 2px; }
.nav-section { border:1px solid var(--border); border-radius: 16px; background:#fcfdff; overflow: hidden; }
.nav-section.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--sidebar-active-bg) inset; }
.nav-section-toggle { width:100%; border:0; background:transparent; padding: 13px 14px; display:flex; justify-content:space-between; align-items:center; gap:12px; cursor:pointer; color: var(--text); font: inherit; }
.nav-section-toggle:hover { background: var(--primary-soft); }
.nav-section-toggle-main { display:flex; align-items:center; gap:10px; min-width:0; }
.nav-section-toggle-main > i, .nav-link > i { width: 18px; height: 18px; min-width: 18px; text-align: center; font-size: 15px; line-height: 18px; flex: 0 0 18px; }
.nav-section-label { font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-section-chevron { transition: transform .2s ease; color: var(--muted); }
.nav-section-items { display:none; padding: 0 10px 10px 10px; }
.nav-section.is-open .nav-section-items { display:flex; flex-direction:column; gap:6px; }
.nav-section.is-open .nav-section-chevron { transform: rotate(180deg); }
.nav-link { display:flex; align-items:center; gap:10px; border-radius: 12px; padding: 10px 12px; color: var(--text); }
.nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-link.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight:700; }
.nav-link-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-footer { margin-top:auto; padding-top: 4px; }
.user-meta-card { display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid var(--border); }
.user-chip { display:flex; align-items:center; gap:10px; min-width:0; flex:1 1 auto; }
.user-chip-texts { min-width:0; display:flex; flex-direction:column; }
.user-chip-texts strong, .user-chip-texts small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-mobile-toggle { display:none; position: relative; z-index: 140; }
@media (max-width: 1100px) { .header-left { width: 100%; } }
body.sidebar-collapsed .app-shell { grid-template-columns: 92px minmax(0, 1fr); }
body.sidebar-collapsed .app-sidebar { padding-inline: 12px; overflow: hidden; }
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-link-label,
body.sidebar-collapsed .user-chip-texts,
body.sidebar-collapsed .header-actions .btn span { display:none; }
body.sidebar-collapsed .sidebar-brand-row { justify-content:center; }
body.sidebar-collapsed .sidebar-toggle { display:none; }
body.sidebar-collapsed .nav-section { overflow: visible; width: 100%; min-width: 0; }
body.sidebar-collapsed .nav-section-toggle { justify-content:center; align-items:center; min-height: 46px; padding: 12px 0; }
body.sidebar-collapsed .nav-section-chevron { display:none; }
body.sidebar-collapsed .nav-section.is-open .nav-section-items { display:none; }
body.sidebar-collapsed .nav-section:hover .nav-section-items { display:flex; position:absolute; left: calc(100% + 10px); top: 0; min-width: 240px; max-width: min(320px, calc(100vw - 140px)); max-height: calc(100vh - 80px); overflow: auto; padding: 10px; background:#fff; border:1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); z-index: 220; }
body.sidebar-collapsed .nav-section { position:relative; }
body.sidebar-collapsed .nav-link { padding: 10px 12px; }
body.sidebar-collapsed .nav-section-toggle-main { justify-content:center; width:100%; gap:0; }
body.sidebar-collapsed .sidebar-nav { overflow-y:auto; overflow-x:visible; padding-right:0; scrollbar-width:none; }
body.sidebar-collapsed .sidebar-nav::-webkit-scrollbar { width:0; height:0; }
body.sidebar-collapsed .sidebar-footer { padding-top: 12px; }
body.sidebar-collapsed .user-meta-card { justify-content:center; }
body.sidebar-collapsed .user-chip { justify-content:center; flex:0 0 auto; }
body.sidebar-collapsed .user-meta-card .icon-btn { display:none; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); width: min(320px, calc(100vw - 24px)); box-shadow: var(--shadow); max-width: calc(100vw - 24px); overflow-y: auto; overflow-x: hidden; }
  .sidebar-mobile-toggle { display:inline-flex; flex: 0 0 auto; }
  body.sidebar-open { overflow: hidden; }
  .header-actions .btn { display:none; }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.sidebar-open::before { content:''; position:fixed; inset:0; background: rgba(15,23,32,.35); z-index: 110; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
  body.sidebar-collapsed .app-sidebar { width: min(320px, calc(100vw - 24px)); padding-inline: 16px; overflow-x:hidden; }
  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .nav-section-label,
  body.sidebar-collapsed .nav-link-label,
  body.sidebar-collapsed .user-chip-texts,
  body.sidebar-collapsed .header-actions .btn span { display: initial; }
  body.sidebar-collapsed .sidebar-toggle { display:inline-flex; }
  body.sidebar-collapsed .nav-section.is-open .nav-section-items,
  body.sidebar-collapsed .nav-section:hover .nav-section-items { display:flex; position:static; border:0; box-shadow:none; padding: 0 10px 10px 10px; }
  body.sidebar-collapsed .nav-section-chevron { display:inline-flex; }
  body.sidebar-collapsed .user-meta-card .icon-btn { display:inline-flex; }
}
@media (max-width: 720px) {
  .app-header, .app-footer { padding-inline: 14px; }
  .app-main { padding: 14px; }
}

.sidebar-brand-mark--image { background: transparent; padding: 0; overflow: hidden; }
.sidebar-brand-mark--image img { width: 100%; height: 100%; object-fit: contain; }
.header-brand--with-logo { display:inline-flex; align-items:center; gap:10px; }
.header-brand--with-logo img { height: 34px; width: auto; object-fit: contain; }
.settings-preview { display:flex; align-items:center; justify-content:center; min-height: 88px; padding: 12px; border:1px dashed var(--border); border-radius: 12px; background:#fafcff; }
.settings-preview img { max-width: 100%; max-height: 80px; object-fit: contain; }
.settings-preview--favicon { justify-content:flex-start; min-height: 72px; }
.settings-preview--favicon img { width: 32px; height: 32px; }
.settings-preview--wide { min-height: 180px; }
.settings-preview--wide img { max-height: 160px; border-radius: 10px; }
.settings-width-preview__shell { border:1px dashed var(--border); border-radius: 14px; padding: 14px; background:#fafcff; }
.settings-width-preview__content { min-height: 56px; display:flex; align-items:center; justify-content:center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight:700; }


.quick-tabs { display:flex; gap:10px; flex-wrap:wrap; }
.quick-tab { display:inline-flex; align-items:center; gap:8px; padding:10px 14px; border:1px solid var(--border); border-radius:12px; background:#fff; color:var(--text); font-weight:700; }
.quick-tab.is-active { background: var(--primary-soft); color: var(--primary); border-color: #c9dcf9; }
.info-list { display:grid; gap:10px; }
.info-row { display:flex; justify-content:space-between; gap:16px; padding:10px 0; border-bottom:1px solid var(--border); }
.info-row:last-child { border-bottom:0; }
.inline-kpis { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:12px; }
.inline-kpi { border:1px solid var(--border); border-radius:12px; padding:14px; background:#fff; }
.inline-kpi strong { display:block; font-size:22px; margin-top:4px; }
.summary-chip-row { display:flex; gap:10px; flex-wrap:wrap; }
.summary-chip { display:inline-flex; align-items:center; gap:8px; padding:9px 12px; border-radius:999px; background:#fff; border:1px solid var(--border); }
.table-actions { display:flex; gap:8px; flex-wrap:wrap; }
.section-subtitle { margin:0; color:var(--muted); font-size:13px; }
@media (max-width: 1100px) { .inline-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .inline-kpis { grid-template-columns: 1fr; } .info-row { flex-direction:column; gap:6px; } }

.badge-danger{background:rgba(185,28,28,.12);color:#991b1b;border:1px solid rgba(185,28,28,.2);}
.badge-row{display:flex;align-items:flex-start;gap:.5rem;padding:.35rem 0;}

/* Release 077: Sidebar/Header refactor */
.sidebar-head-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:4px; }
.sidebar-user-wrap { min-width:0; flex:1 1 auto; }
.sidebar-head-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.header-actions--branding { justify-content:flex-end; flex:1 1 auto; }
.header-brand-image { display:inline-flex; align-items:center; justify-content:flex-end; max-width:220px; }
.header-brand-image img { max-height:34px; width:auto; object-fit:contain; }
.brand { font-weight:700; font-size:18px; }
body.sidebar-collapsed .sidebar-user-wrap { display:none; }
body.sidebar-collapsed .sidebar-head-row { justify-content:center; }
body.sidebar-collapsed .sidebar-head-actions { width:100%; justify-content:center; }
body.sidebar-collapsed .sidebar-toggle { display:inline-flex; }
body.sidebar-collapsed .sidebar-head-actions .icon-btn { display:inline-flex; }
body.sidebar-collapsed .header-brand-image { max-width:44px; }
@media (max-width: 1100px) {
  .sidebar-head-row { padding-right:2px; }
  body.sidebar-collapsed .sidebar-user-wrap { display:block; }
  body.sidebar-collapsed .sidebar-head-row { justify-content:space-between; }
  body.sidebar-collapsed .sidebar-head-actions { width:auto; }
}
.archive-chip-row{display:flex;gap:10px;flex-wrap:wrap;}
.archive-chip{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--text);font-weight:700;}
.archive-chip.is-active{background:var(--primary-soft);color:var(--primary);border-color:#c9dcf9;}
.bulk-actions{display:flex;gap:8px;justify-content:flex-end;}
.row-check{display:inline-flex;align-items:center;justify-content:center;}
.row-check input{width:16px;height:16px;}


.quick-modal-tabs { gap: 10px; flex-wrap: wrap; }
.quick-modal-tab { min-width: 38px; }
.align-right { text-align: right; }
.num { display: inline-block; width: 100%; text-align: right; }
.table .align-right, .table th.align-right { text-align: right; }

.app-confirm-backdrop { position: fixed; inset: 0; background: rgba(15,23,32,.45); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1300; }
.app-confirm-dialog { width: min(460px, 100%); background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.app-confirm-head, .app-confirm-actions { padding: 18px 20px; }
.app-confirm-head { border-bottom: 1px solid var(--border); }
.app-confirm-head h3 { margin: 0 0 6px; font-size: 18px; }
.app-confirm-head p { margin: 0; color: var(--muted); line-height: 1.5; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.dashboard-hero { display:grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .9fr); gap:16px; }
.dashboard-hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-mid) 48%, var(--hero-end) 100%); color: #fff; }
.dashboard-hero-card .eyebrow, .dashboard-hero-card .muted { color: rgba(255,255,255,.82); }
.dashboard-hero-card::after { content: ''; position: absolute; inset: auto -120px -120px auto; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.10); }
.dashboard-hero-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; margin-top: 18px; }
.dashboard-hero-metric { position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 14px; background: rgba(255,255,255,.10); backdrop-filter: blur(4px); }
.dashboard-hero-metric span { display:block; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color: rgba(255,255,255,.8); }
.dashboard-hero-metric strong { display:block; margin-top:6px; font-size:24px; }
.dashboard-hero-side { display:grid; gap:16px; }
.dashboard-kpis { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:16px; }
.dashboard-kpi-card { display:flex; flex-direction:column; gap:8px; }
.dashboard-kpi-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.dashboard-kpi-top strong { font-size: 28px; line-height: 1.1; }
.dashboard-kpi-icon { width: 42px; height: 42px; border-radius: 12px; display:inline-flex; align-items:center; justify-content:center; background: var(--primary-soft); color: var(--primary); }
.dashboard-kpi-trend { font-weight: 700; }
.dashboard-panel { padding: 20px; }
.dashboard-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom: 14px; }
.dashboard-panel-head h2 { margin: 0 0 4px; font-size: 20px; }
.dashboard-panel-head p { margin: 0; color: var(--muted); }
.dashboard-chart-wrap { position: relative; min-height: 320px; }
.dashboard-chart-wrap.dashboard-chart-wrap--sm { min-height: 260px; }
.dashboard-insight-list { display:flex; flex-direction:column; gap:12px; }
.dashboard-insight-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.dashboard-insight-row strong { font-size: 18px; }
.dashboard-bar-list { display:flex; flex-direction:column; gap:14px; }
.dashboard-bar-row { display:grid; grid-template-columns: minmax(0, 1fr) auto; gap:8px 16px; align-items:center; }
.dashboard-bar-label { min-width: 0; }
.dashboard-bar-label strong, .dashboard-bar-label span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-bar-track { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: #edf2fb; overflow: hidden; }
.dashboard-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--hero-mid) 0%, var(--hero-end) 100%); }
.number-cell, .number-align { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1200px) { .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-hero { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .toast-stack { right: 12px; left: 12px; bottom: 76px; width: auto; } .toast { max-width: 100%; } .dashboard-kpis, .dashboard-hero-grid { grid-template-columns: 1fr; } .dashboard-panel-head, .dashboard-insight-row, .dashboard-bar-row { flex-direction: column; align-items: flex-start; } }

.settings-color-row{display:grid;grid-template-columns:64px 1fr;gap:10px;align-items:center;}
.settings-color-row input[type=color]{padding:4px;height:42px;min-width:0;border-radius:10px;}
.settings-theme-preview{border:1px solid var(--border);border-radius:14px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:12px;}
.settings-theme-preview__hero{border-radius:14px;padding:16px 18px;color:#fff;display:flex;flex-direction:column;gap:6px;}
.settings-theme-preview__row{display:flex;flex-wrap:wrap;gap:12px;align-items:center;}
.dashboard-cockpit{display:flex;flex-direction:column;gap:18px;}
.dashboard-story-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(340px,.85fr);gap:18px;}
.dashboard-cockpit-hero{position:relative;overflow:hidden;background:linear-gradient(135deg,var(--hero-start) 0%,var(--hero-mid) 48%,var(--hero-end) 100%);color:#fff;padding:28px;border-radius:22px;box-shadow:var(--shadow);}
.dashboard-cockpit-hero::after{content:'';position:absolute;inset:auto -90px -110px auto;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.08);}
.dashboard-cockpit-hero h2{margin:10px 0 8px;font-size:34px;line-height:1.08;max-width:700px;position:relative;z-index:1;}
.dashboard-cockpit-hero p{max-width:760px;color:rgba(255,255,255,.82);position:relative;z-index:1;}
.dashboard-story-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px;position:relative;z-index:1;}
.dashboard-story-metric{padding:14px;border-radius:16px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);backdrop-filter:blur(4px);}
.dashboard-story-metric span{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:rgba(255,255,255,.78);}
.dashboard-story-metric strong{display:block;margin-top:6px;font-size:26px;}
.dashboard-action-card{display:flex;flex-direction:column;gap:12px;padding:20px;border-radius:20px;background:var(--card);border:1px solid var(--border);box-shadow:var(--shadow);}
.dashboard-performance-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
.dashboard-performance-card{background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:18px;display:flex;flex-direction:column;gap:10px;}
.dashboard-performance-card strong{font-size:30px;line-height:1.05;}
.dashboard-performance-card .eyebrow{margin-bottom:2px;}
.dashboard-performance-card.is-alert strong,.dashboard-performance-card.is-alert .eyebrow{color:var(--danger);}
.dashboard-chart-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:18px;}
.dashboard-chart-card{background:var(--card);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);padding:20px;display:flex;flex-direction:column;gap:14px;}
.dashboard-chart-card h3{margin:0;font-size:22px;}
.dashboard-chart-card p{margin:0;color:var(--muted);}
.dashboard-chart-frame{position:relative;min-height:340px;}
.dashboard-chart-frame--sm{min-height:280px;}
.dashboard-split-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:18px;}
.dashboard-radar-list{display:flex;flex-direction:column;gap:12px;}
.dashboard-radar-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 16px;align-items:center;padding:14px;border:1px solid var(--border);border-radius:16px;background:linear-gradient(180deg,#fff 0%,#fcfbf7 100%);}
.dashboard-radar-row .muted{display:block;}
.dashboard-status-chip{display:inline-flex;align-items:center;gap:8px;border-radius:999px;padding:8px 12px;background:var(--primary-soft);color:var(--sidebar-active-text);font-weight:700;}
.dashboard-progress{display:flex;flex-direction:column;gap:10px;}
.dashboard-progress-row{display:grid;grid-template-columns:150px minmax(0,1fr) auto;gap:12px;align-items:center;}
.dashboard-progress-track{height:12px;background:#efe6d4;border-radius:999px;overflow:hidden;}
.dashboard-progress-fill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--hero-mid) 0%,var(--hero-end) 100%);}
@media (max-width: 1280px){.dashboard-performance-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.dashboard-chart-grid,.dashboard-story-grid,.dashboard-split-grid{grid-template-columns:1fr;}}
@media (max-width: 720px){.dashboard-story-metrics,.dashboard-performance-grid{grid-template-columns:1fr;}.dashboard-cockpit-hero h2{font-size:28px;}.dashboard-progress-row{grid-template-columns:1fr;}}


.card-highlight,
.modal-header-highlight {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg,var(--hero-start) 0%,var(--hero-mid) 48%,var(--hero-end) 100%);
  color: #fff;
}
.card-highlight::after,
.modal-header-highlight::after {
  content: '';
  position: absolute;
  inset: auto -72px -92px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.card-highlight > *,
.modal-header-highlight > * {
  position: relative;
  z-index: 1;
}
.card-highlight--controls {
  border: 0;
  box-shadow: var(--shadow);
}
.card-highlight--controls label,
.card-highlight--controls .muted,
.card-highlight--controls .small-text,
.card-highlight--controls .field label {
  color: rgba(255,255,255,.88);
}
.card-highlight--controls .icon-btn,
.modal-header-highlight .icon-btn {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.24);
  color: #fff;
}
.card-highlight--controls .icon-btn:hover,
.card-highlight--controls .icon-btn:focus-visible,
.modal-header-highlight .icon-btn:hover,
.modal-header-highlight .icon-btn:focus-visible {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.34);
  color: #fff;
}
.card-highlight--controls input,
.card-highlight--controls select,
.card-highlight--controls textarea {
  background: rgba(255,255,255,.98);
  border-color: rgba(255,255,255,.22);
}
.card-highlight--controls input::placeholder,
.card-highlight--controls textarea::placeholder {
  color: #768194;
}
.modal-header-highlight {
  border-bottom: 0;
  padding: 18px 22px;
}
.modal-header-highlight h2,
.modal-header-highlight .small-text,
.modal-header-highlight .muted {
  color: #fff;
}
.modal-header-highlight .small-text.muted,
.modal-header-highlight .muted {
  color: rgba(255,255,255,.82);
}

.document-template-grid {
  align-items: start;
}

.modal-card-xl {
  max-width: 1280px;
}

.document-editor-layout {
  align-items: start;
}

.wysiwyg-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.wysiwyg-editor {
  min-height: 260px;
  border: 1px solid #d6d6d6;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  overflow: auto;
}

.wysiwyg-editor:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.placeholder-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.placeholder-chip {
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--primary-soft);
  color: var(--link);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

.placeholder-chip:hover {
  background: var(--sidebar-active-bg);
}

.doc-preview-shell {
  min-height: 220px;
  border: 1px solid #e2e2e2;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  overflow: auto;
}

.doc-preview-shell h1,
.doc-preview-shell h2,
.doc-preview-shell h3 {
  margin-top: 0;
}

.doc-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.doc-preview-table th,
.doc-preview-table td {
  border: 1px solid #d8d8d8;
  padding: 8px 10px;
  text-align: left;
}

.doc-preview-table .is-number {
  text-align: right;
  white-space: nowrap;
}

.doc-placeholder-missing {
  color: #9f7b25;
  font-style: italic;
}

[data-structured-fields][hidden], [data-free-fields][hidden] { display: none !important; }

@media (max-width: 1100px) {
  .app-header { gap: 10px; }
  .brand { font-size: 16px; }
  .header-actions--branding { justify-content: flex-end; min-width: 0; }
  .header-brand-image { max-width: 120px; }
}

.report-builder-grid{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px;}
.report-builder-card{flex:0 0 280px;max-width:280px;padding:14px;}
.checkbox-row{display:flex;align-items:center;gap:8px;}
.checkbox-row input{width:16px;height:16px;flex:0 0 16px;}
.table-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.table-sort-link{display:inline-flex;align-items:center;gap:8px;color:inherit;font-weight:600;}
.table-sort-link i{font-size:12px;color:var(--muted);}
.table-sort-link.is-active{color:var(--primary);}
.table-sort-link.is-active i{color:var(--primary);}
@media (max-width: 720px){.report-builder-card{flex:1 1 100%;max-width:none;}.app-header{padding-left:14px;}.header-left{width:auto;min-width:0;}.sidebar-mobile-toggle{display:inline-flex !important;}}

.token-row { display:flex; flex-wrap:wrap; gap:12px; }
.token-card { display:flex; align-items:center; gap:12px; padding:10px 14px; border:1px solid var(--border); border-radius:14px; background:#fff; }
.report-switches { display:flex; flex-wrap:wrap; gap:14px 18px; }
.filters-grid-wide { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }


.select-search,
.combo-input {
  width: 100%;
  padding: 9px 42px 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.select-search:focus,
.combo-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(178, 143, 63, 0.16);
}
.combo-field { position: relative; }
.combo-field::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 39px;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.8rem;
}
.combo-select-native { display: none; }
.combo-clear {
  position: absolute;
  right: 34px;
  top: 34px;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.combo-clear:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.combo-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12); max-height: 260px; overflow: auto; padding: 6px; }
.combo-option { width: 100%; border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: inherit; }
.combo-option:hover,
.combo-option.is-active,
.combo-option.is-selected { background: rgba(178, 143, 63, 0.12); }
.combo-option.is-empty { color: var(--muted); cursor: default; }
.field .small-text {
  font-size: 12px;
}


.report-feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px;align-items:start;}
.report-feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:12px;align-items:start;}
.report-feature-card,.report-column-card{padding:14px;min-width:0;overflow:hidden;}
.report-feature-card .filters-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;align-items:start;}
.report-feature-card .field,.report-column-card .checkbox-row{min-width:0;}
.report-feature-card select,.report-feature-card input{max-width:100%;}
.report-column-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:start;}
.report-toggle summary{display:flex;align-items:center;justify-content:space-between;gap:16px;cursor:pointer;list-style:none;}
.report-toggle summary::-webkit-details-marker{display:none;}
.report-toggle summary span{display:flex;flex-direction:column;gap:2px;}
.report-toggle summary small{font-size:12px;}
.report-toggle-meta{display:inline-flex !important;flex-direction:row !important;align-items:center;gap:8px;color:var(--muted);font-size:13px;white-space:nowrap;}
.report-toggle[open] .report-toggle-meta i{transform:rotate(180deg);}
@media (max-width: 720px){.report-feature-grid,.report-column-grid{grid-template-columns:1fr;}.report-toggle summary{align-items:flex-start;}.report-toggle-meta{white-space:normal;}}


.filters-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.filters-grid .field {
  flex: 0 0 auto;
  min-width: 0;
}
.filters-grid--standard .field:not(.filter-field-search):not(.filter-field-sm):not(.filter-field-lg) {
  width: 200px;
  max-width: 100%;
}
.filters-grid--standard .field.filter-field-search + .field:not(.filter-field-search):not(.filter-field-sm):not(.filter-field-lg) {
  width: 200px;
}
.filter-field-search {
  width: 400px;
  max-width: 100%;
}
.filter-field-sm {
  width: 200px;
  max-width: 100%;
}
.filter-field-lg {
  width: 400px;
  max-width: 100%;
}
.filter-field-search input,
.filter-field-search select,
.filter-field-sm input,
.filter-field-sm select,
.filter-field-lg input,
.filter-field-lg select {
  width: 100%;
}
.filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.table-footer--standard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.table-footer__info {
  justify-self: start;
}
.table-footer__per-page {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
}
.table-footer__per-page-label {
  color: var(--muted);
  font-size: 13px;
}
.table-footer__per-page-links,
.table-footer__pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.table-footer__pagination {
  justify-self: end;
}
@media (max-width: 900px) {
  .filters-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .filter-field-search,
  .filter-field-sm,
  .filter-field-lg,
  .filter-actions {
    width: 100%;
  }
  .table-footer--standard {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .table-footer__per-page,
  .table-footer__pagination {
    justify-self: start;
  }
}

.modal-card-md {
  max-width: 860px;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.modal-inline-actions {
  display: flex;
  justify-content: flex-end;
}

.quick-section-modal .card {
  box-shadow: none;
}

.inline-kpi strong.number-align, .stat-card strong.number-align, .dashboard-story-metric strong.number-align { display:block; text-align:right; font-variant-numeric: tabular-nums; }

/* Release 316: kontextbezogene Hilfe */
.context-help-floating { display:none; }
.context-help-modal[hidden] { display:none !important; }
.context-help-content { padding:18px 22px 6px; }
.help-topic { border:1px solid var(--border); border-radius:14px; padding:12px 14px; background:#fff; }
.help-topic p { margin:6px 0 0; }
