:root {
    --fp-navy: #0c2430;
    --fp-navy-2: #102f3d;
    --fp-navy-3: #173d4d;
    --fp-accent: #28758a;
    --fp-accent-dark: #1f6477;
    --fp-accent-soft: #eaf3f5;
    --fp-bg: #f3f5f6;
    --fp-panel: #ffffff;
    --fp-text: #17252d;
    --fp-muted: #70808a;
    --fp-border: #dfe5e8;
    --fp-success: #2c7a5a;
    --fp-danger: #a64a4a;
    --fp-sidebar-width: 268px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--fp-text); background: var(--fp-bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.btn { border-radius: 4px; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--fp-accent); --bs-btn-border-color: var(--fp-accent); --bs-btn-hover-bg: var(--fp-accent-dark); --bs-btn-hover-border-color: var(--fp-accent-dark); }
.btn-outline-primary { --bs-btn-color: var(--fp-accent-dark); --bs-btn-border-color: #98bac4; --bs-btn-hover-bg: var(--fp-accent); --bs-btn-hover-border-color: var(--fp-accent); }
.form-control { border-radius: 4px; border-color: #ccd6da; min-height: 44px; }
.form-control:focus { border-color: #6b9ba9; box-shadow: 0 0 0 .2rem rgba(40,117,138,.10); }
.form-label { font-weight: 650; font-size: .9rem; }
.alert { border-radius: 4px; border-width: 1px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--fp-sidebar-width); background: var(--fp-navy); color: #dbe7eb; display: flex; flex-direction: column; z-index: 1040; border-right: 1px solid rgba(255,255,255,.04); }
.brand-wrap { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; gap: 12px; align-items: center; color: white; }
.brand-mark, .mobile-auth-logo span, .auth-logo span { width: 36px; height: 36px; display: inline-grid; place-items: center; background: #fff; color: var(--fp-navy); font-weight: 900; font-size: 1.15rem; border-radius: 3px; }
.brand strong { display: block; font-size: 1.03rem; letter-spacing: .01em; }
.brand small { display: block; color: #8da5af; font-size: .72rem; margin-top: 1px; }
.sidebar-close { border: 0; background: transparent; color: white; font-size: 1.1rem; }
.tenant-chip { margin: 18px 18px 6px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); padding: 9px 11px; display: flex; gap: 9px; align-items: center; font-size: .83rem; }
.tenant-dot { width: 7px; height: 7px; border-radius: 50%; background: #70c59f; box-shadow: 0 0 0 3px rgba(112,197,159,.11); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 24px; scrollbar-width: thin; scrollbar-color: #31505d transparent; }
.nav-section { color: #708d99; font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; padding: 18px 10px 7px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; color: #c6d7dd; text-decoration: none; border-left: 3px solid transparent; font-size: .9rem; transition: .12s ease; }
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { color: #fff; background: #153746; border-left-color: #6fb2c3; }
.nav-item.disabled { opacity: .54; pointer-events: none; }
.nav-badge { margin-left: auto; text-transform: uppercase; letter-spacing: .07em; font-size: .58rem; color: #91aab4; }
.sidebar-footer { min-height: 72px; border-top: 1px solid rgba(255,255,255,.08); padding: 12px 16px; display: flex; align-items: center; gap: 8px; }
.user-mini { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; background: #1d4656; border: 1px solid rgba(255,255,255,.10); font-weight: 800; }
.user-meta { min-width: 0; display: flex; flex-direction: column; }
.user-meta strong { color: white; font-size: .8rem; }
.user-meta small { color: #78939e; font-size: .68rem; }
.logout-btn { border: 0; background: transparent; color: #89a4af; padding: 8px; }
.logout-btn:hover { color: white; }

.app-main { min-height: 100vh; margin-left: var(--fp-sidebar-width); }
.topbar { min-height: 82px; background: #fff; border-bottom: 1px solid var(--fp-border); display: flex; align-items: center; gap: 16px; padding: 14px 30px; position: sticky; top: 0; z-index: 1020; }
.topbar h1 { font-size: 1.12rem; font-weight: 760; margin: 0 0 3px; }
.topbar p { font-size: .77rem; color: var(--fp-muted); }
.menu-toggle { border: 1px solid var(--fp-border); background: #fff; width: 40px; height: 40px; font-size: 1.2rem; }
.version-pill { display: inline-flex; padding: 5px 9px; background: #f4f7f8; border: 1px solid var(--fp-border); color: #5f7079; font-size: .72rem; font-weight: 700; }
.content-wrap { padding: 30px; max-width: 1680px; margin: 0 auto; }
.page-intro { margin-bottom: 24px; }
.page-intro h2 { font-size: clamp(1.45rem, 2vw, 1.9rem); font-weight: 760; margin: 3px 0 6px; }
.page-intro p { color: var(--fp-muted); margin: 0; max-width: 800px; }
.section-kicker { display: inline-block; color: var(--fp-accent-dark); font-size: .68rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }

.status-strip { min-height: 68px; background: #fff; border: 1px solid var(--fp-border); border-left: 4px solid var(--fp-accent); padding: 13px 16px; display: flex; gap: 13px; align-items: center; }
.status-strip-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--fp-accent-soft); color: var(--fp-accent-dark); font-size: 1.1rem; }
.status-strip strong, .status-strip span { display: block; }
.status-strip > div:nth-child(2) span { font-size: .8rem; color: var(--fp-muted); margin-top: 2px; }
.status-dot-label { display: flex !important; flex-direction: row; align-items: center; gap: 7px; color: var(--fp-muted); font-size: .78rem; font-weight: 750; }
.status-dot-label i { width: 7px; height: 7px; border-radius: 50%; background: #a6b1b7; }
.status-connected i { background: var(--fp-success); }
.status-error i { background: var(--fp-danger); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 150px; background: #fff; border: 1px solid var(--fp-border); border-top: 3px solid #91aeb8; padding: 18px; position: relative; }
.metric-card.muted { background: linear-gradient(180deg, #fff, #fafbfb); }
.metric-icon { position: absolute; right: 16px; top: 16px; width: 34px; height: 34px; display: grid; place-items: center; color: #6e8d98; background: #eff4f5; }
.metric-label { display: block; color: #657780; font-weight: 680; font-size: .79rem; max-width: 70%; }
.metric-card strong { display: block; font-size: 2rem; margin-top: 20px; line-height: 1; }
.metric-card small { color: #97a3a8; font-size: .72rem; }
.panel { background: #fff; border: 1px solid var(--fp-border); padding: 22px; }
.panel-table { padding: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h3 { font-size: 1.08rem; font-weight: 760; margin: 3px 0 0; }
.badge-soft-success, .badge-soft-neutral { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; background: #eaf5ef; color: #317455; border: 1px solid #cfe7d9; font-size: .7rem; font-weight: 750; }
.badge-soft-neutral { background: #f2f5f6; color: #5f7079; border-color: #dfe5e8; }
.setup-list { border-top: 1px solid var(--fp-border); }
.setup-row { display: flex; gap: 13px; padding: 14px 3px; border-bottom: 1px solid #edf0f1; color: #9aa5aa; }
.setup-row > i { margin-top: 2px; }
.setup-row div { display: flex; flex-direction: column; }
.setup-row strong { color: #607079; font-size: .88rem; }
.setup-row span { font-size: .76rem; color: #95a0a5; }
.setup-row.done > i, .setup-row.done strong { color: var(--fp-success); }
.setup-row.current > i, .setup-row.current strong { color: var(--fp-accent-dark); }
.empty-action { min-height: 270px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border: 1px dashed #cbd5d9; padding: 24px; background: #fafbfb; }
.empty-action > i { font-size: 1.7rem; color: var(--fp-accent); margin-bottom: 13px; }
.empty-action h4 { font-size: 1rem; font-weight: 760; }
.empty-action p { color: var(--fp-muted); font-size: .84rem; max-width: 420px; }
.status-inline { display: inline-flex; padding: 4px 7px; background: #f0f3f4; color: #697a82; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-inline.success { background: #e7f4ed; color: var(--fp-success); }
.status-inline.danger { background: #f9eaea; color: var(--fp-danger); }
.connection-meta, .empty-hint { margin-top: 18px; color: var(--fp-muted); font-size: .78rem; }
.table { --bs-table-bg: transparent; }
.table thead th { background: #f6f8f9; color: #6e7d85; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--fp-border); padding: 13px 16px; white-space: nowrap; }
.table tbody td { padding: 14px 16px; border-color: #edf0f1; font-size: .83rem; }
.table tbody tr:hover { background: #fbfcfc; }

.auth-body { background: #e9edef; }
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 34px; }
.auth-panel { width: min(1120px, 100%); min-height: 650px; background: #fff; display: grid; grid-template-columns: 1.04fr .96fr; box-shadow: 0 24px 70px rgba(14,37,48,.12); }
.auth-brand-panel { position: relative; overflow: hidden; background: var(--fp-navy); color: white; padding: 70px 64px; display: flex; align-items: center; }
.auth-brand-content { position: relative; z-index: 2; max-width: 500px; }
.auth-logo { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 780; margin-bottom: 64px; }
.auth-eyebrow { color: #8eb3c0; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: .68rem; }
.auth-brand-panel h1 { font-size: clamp(2.15rem, 4vw, 3.45rem); line-height: 1.06; letter-spacing: -.04em; font-weight: 760; margin: 14px 0 22px; }
.auth-copy { color: #adc0c8; max-width: 480px; line-height: 1.7; }
.auth-points { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 34px; color: #d0dde2; font-size: .78rem; }
.auth-points i { color: #73c39f; margin-right: 6px; }
.auth-grid { position: absolute; inset: 0; opacity: .08; background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px); background-size: 42px 42px; transform: perspective(500px) rotateX(8deg) scale(1.1); }
.auth-form-panel { padding: 70px; display: grid; place-items: center; }
.auth-form-wrap { width: min(390px, 100%); }
.auth-form-wrap h2 { font-size: 1.8rem; font-weight: 780; margin: 4px 0 7px; }
.auth-note { margin-top: 28px; text-align: center; color: #9aa6ab; font-size: .7rem; }
.mobile-auth-logo { display: flex; align-items: center; gap: 10px; font-weight: 760; margin-bottom: 34px; }

.sidebar-backdrop { display: none; }

@media (max-width: 1199.98px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 16px 0 40px rgba(6,25,33,.2); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1030; background: rgba(10,28,36,.42); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .app-main { margin-left: 0; }
    .auth-stage { padding: 0; }
    .auth-panel { min-height: 100vh; grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { padding: 42px 24px; }
}

@media (max-width: 767.98px) {
    .content-wrap { padding: 20px 16px 34px; }
    .topbar { min-height: 68px; padding: 10px 16px; }
    .topbar p { display: none; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 130px; }
    .status-strip { align-items: flex-start; flex-wrap: wrap; }
    .status-dot-label { margin-left: 51px !important; }
    .panel { padding: 18px; }
}

/* v0.2 - Artikel & Synchronisation */
.metric-card.compact { min-height: 132px; }
.metric-card.compact strong { margin-top: 14px; font-size: 1.72rem; }
.metric-card .metric-date { font-size: 1.65rem; }

.table-toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 16px; border-bottom: 1px solid var(--fp-border); background: #fff; }
.toolbar-search { position: relative; flex: 1 1 360px; min-width: 250px; }
.toolbar-search > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #829198; z-index: 2; }
.toolbar-search .form-control { padding-left: 38px; }
.toolbar-field { flex: 0 0 160px; }
.toolbar-field label { display: block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #71818a; margin-bottom: 5px; }
.toolbar-field .form-select { min-height: 44px; border-radius: 4px; border-color: #ccd6da; font-size: .84rem; }
.btn-reset { color: #71818a; text-decoration: none; font-size: .8rem; white-space: nowrap; }
.btn-reset:hover { color: var(--fp-accent-dark); }
.table-meta { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid #edf0f1; color: #849198; font-size: .72rem; }
.article-main-cell { min-width: 260px; }
.article-main-cell strong { display: block; color: #22333b; font-size: .84rem; }
.article-main-cell span { display: block; color: #71818a; font-size: .76rem; margin-top: 2px; max-width: 420px; }
.table-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .72rem; color: #60727b; }
.vpe-cell { min-width: 220px; max-width: 360px; color: #667780; }
.vpe-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; margin-right: 7px; padding: 0 6px; background: var(--fp-accent-soft); color: var(--fp-accent-dark); font-weight: 800; font-size: .68rem; }
.status-inline.warning { background: #fff4dc; color: #8a6921; }
.table-empty { padding: 36px 18px; text-align: center; color: #8a989e; }
.table-pagination { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--fp-border); color: #73838b; font-size: .78rem; }
.pagination-actions { display: flex; gap: 7px; }

.sync-actions { border-top: 1px solid var(--fp-border); }
.sync-action-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 18px 2px; border-bottom: 1px solid #edf0f1; }
.sync-action-row > div { min-width: 0; }
.sync-action-row strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.sync-action-row span { display: block; color: var(--fp-muted); font-size: .78rem; line-height: 1.55; max-width: 690px; }
.cli-hint { margin-top: 18px; border: 1px solid #d8e1e4; background: #f7f9fa; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; }
.cli-hint > i { color: var(--fp-accent-dark); margin-top: 2px; }
.cli-hint strong { display: block; font-size: .76rem; margin-bottom: 4px; }
.cli-hint code { display: block; color: #51656e; font-size: .72rem; white-space: normal; word-break: break-all; }
.sync-kv { margin: 0; border-top: 1px solid var(--fp-border); }
.sync-kv > div { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 11px 2px; border-bottom: 1px solid #edf0f1; }
.sync-kv dt { color: #77878f; font-size: .77rem; font-weight: 600; }
.sync-kv dd { margin: 0; color: #263840; font-size: .8rem; font-weight: 720; text-align: right; }
.sync-message { margin-top: 14px; padding: 11px 12px; border-left: 3px solid #c2a65f; background: #fff9ea; color: #72613b; font-size: .76rem; }
.panel-table-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 16px 14px; border-bottom: 1px solid var(--fp-border); }
.panel-table-heading h3 { font-size: 1rem; font-weight: 760; margin: 3px 0 0; }
.sync-error-message { min-width: 320px; max-width: 760px; white-space: normal; color: #7b4545; }
.compact-empty { min-height: 220px; }
.dashboard-sync-state { border-top: 1px solid var(--fp-border); padding-top: 18px; }
.dashboard-sync-number { font-size: 2.35rem; font-weight: 790; line-height: 1; letter-spacing: -.03em; }
.dashboard-sync-state > span { display: block; color: var(--fp-muted); font-size: .76rem; margin-top: 5px; }
.dashboard-sync-state dl { margin: 18px 0; border-top: 1px solid #edf0f1; }
.dashboard-sync-state dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #edf0f1; }
.dashboard-sync-state dt { font-size: .74rem; color: #7b8a91; font-weight: 600; }
.dashboard-sync-state dd { margin: 0; font-size: .74rem; color: #34464f; font-weight: 700; text-align: right; }

@media (max-width: 991.98px) {
    .table-toolbar { flex-wrap: wrap; }
    .toolbar-search { flex-basis: 100%; }
    .toolbar-field { flex: 1 1 180px; }
}

@media (max-width: 767.98px) {
    .table-toolbar { align-items: stretch; }
    .toolbar-field { flex-basis: 100%; }
    .table-toolbar .btn { width: 100%; }
    .sync-action-row { grid-template-columns: 1fr; }
    .sync-action-row form, .sync-action-row .btn { width: 100%; }
    .panel-table-heading { padding: 16px; }
}
