/* ═══════════════════════════════════════════════════════════════════════════
   Brochure Manager – Frontend Admin & WP Backend CSS
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Primary brand colour — overridden via wp_head by the colour setting */
    --bm-c-primary:       #ddc9a3;
    --bm-c-primary-text:  #2d3748;   /* auto-flipped to #fff for dark primaries */

    --bm-c-accent:   #c0392b;
    --bm-c-green:    #27ae60;
    --bm-c-yellow:   #e67e22;
    --bm-c-grey:     #95a5a6;
    --bm-c-bg:       #faf9f7;
    --bm-c-surface:  #ffffff;
    --bm-c-border:   #e8e2d8;
    --bm-c-text:     #2d3748;
    --bm-c-muted:    #718096;

    --bm-radius-sm:  6px;
    --bm-radius:     10px;
    --bm-radius-lg:  14px;

    --bm-shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --bm-shadow:     0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
    --bm-shadow-md:  0 8px 24px rgba(0,0,0,.12);

    --bm-font:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

.bm-admin-wrap {
    font-family: var(--bm-font);
    color: var(--bm-c-text);
    background: var(--bm-c-bg);
    min-height: 100vh;
    padding: 0 0 60px;
}

/* ── Top Bar ──────────────────────────────────────────────────────────────── */

.bm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--bm-c-primary);
    color: var(--bm-c-primary-text);
    margin-bottom: 28px;
    border-bottom: 2px solid rgba(0,0,0,.08);
}

.bm-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--bm-c-primary-text);
}

.bm-topbar-brand svg { opacity: .8; }

.bm-topbar-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bm-c-primary-text);
    opacity: .7;
    font-size: 13px;
    text-decoration: none;
    transition: opacity .15s;
}
.bm-topbar-logout:hover { opacity: 1; }

.bm-back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bm-c-primary-text);
    opacity: .85;
    text-decoration: none;
    font-size: 14px;
    transition: opacity .15s;
}
.bm-back-link:hover { opacity: 1; }

/* ── Notices ──────────────────────────────────────────────────────────────── */

.bm-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--bm-radius);
    margin: 0 28px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.bm-notice-icon {
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.bm-notice-success {
    background: #eafaf1;
    color: #1a6b3a;
    border: 1px solid #a9dfbf;
}

.bm-notice-error {
    background: #fdf2f2;
    color: #922b21;
    border: 1px solid #f1948a;
}

/* ── Stats Row ────────────────────────────────────────────────────────────── */

.bm-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 28px;
    margin-bottom: 32px;
}

.bm-stat-tile {
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow-sm);
    padding: 20px 24px;
    border-top: 3px solid var(--bm-c-primary);
    border: 1px solid var(--bm-c-border);
    border-top: 3px solid var(--bm-c-primary);
}

.bm-stat-tile--green { border-top-color: var(--bm-c-green); }
.bm-stat-tile--grey  { border-top-color: var(--bm-c-grey); }

.bm-stat-tile-num {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: var(--bm-c-text);
}

.bm-stat-tile-lbl {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--bm-c-muted);
    margin-top: 6px;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.bm-section {
    padding: 0 28px;
    margin-bottom: 36px;
}

.bm-section-header {
    margin-bottom: 16px;
}

.bm-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--bm-c-text);
    margin: 0;
    padding: 0;
    border: none;
}

/* ── CTA Card ─────────────────────────────────────────────────────────────── */

.bm-cta-card {
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--bm-c-border);
}

.bm-cta-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #eef2f8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--bm-c-primary);
}

.bm-cta-text {
    flex: 1;
}

.bm-cta-text strong {
    display: block;
    font-size: 15px;
    color: var(--bm-c-text);
    margin-bottom: 4px;
}

.bm-cta-text p {
    margin: 0;
    font-size: 13px;
    color: var(--bm-c-muted);
}

/* ── Brochure Grid / Cards ────────────────────────────────────────────────── */

.bm-brochure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.bm-brochure-card {
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow);
    border: 1px solid var(--bm-c-border);
    padding: 20px 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow .2s;
}

.bm-brochure-card:hover { box-shadow: var(--bm-shadow-md); }

.bm-brochure-card--inactive {
    opacity: .75;
    border-style: dashed;
}

.bm-brochure-card-header {}

.bm-brochure-card-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.bm-brochure-card-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--bm-c-text);
    line-height: 1.3;
}

.bm-brochure-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bm-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--bm-c-muted);
}

.bm-meta-h1 {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-meta-page-title {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-meta-url {
    color: var(--bm-c-muted);
    text-decoration: none;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.bm-meta-url:hover { text-decoration: underline; }

/* ── Status Badges ────────────────────────────────────────────────────────── */

.bm-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.bm-badge-active   { background: #eafaf1; color: #1a6b3a; }
.bm-badge-inactive { background: #fdf2f2; color: #922b21; }

/* ── Tracking bars ────────────────────────────────────────────────────────── */

.bm-tracking-sources {
    background: var(--bm-c-bg);
    border-radius: var(--bm-radius-sm);
    padding: 12px 14px;
}

.bm-tracking-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bm-c-muted);
    margin-bottom: 8px;
}

.bm-tracking-bars { display: flex; flex-direction: column; gap: 6px; }

.bm-source-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px 20px;
    align-items: center;
    gap: 8px;
}

.bm-source-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--bm-c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bm-source-bar-wrap {
    background: #e2e8f0;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.bm-source-bar {
    height: 100%;
    background: var(--bm-c-primary);
    border-radius: 4px;
    transition: width .4s ease;
    min-width: 4px;
    opacity: .8;
}

.bm-source-count {
    font-size: 12px;
    color: var(--bm-c-muted);
    text-align: right;
}

.bm-source-del {
    font-size: 11px;
    color: #ccc;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s;
    text-align: center;
}
.bm-source-del:hover { color: var(--bm-c-accent); }

/* ── Card Actions ─────────────────────────────────────────────────────────── */

.bm-brochure-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--bm-c-border);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.bm-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius-lg);
    border: 2px dashed var(--bm-c-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.bm-empty-state p {
    color: var(--bm-c-muted);
    margin: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.bm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--bm-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--bm-font);
    text-decoration: none;
    line-height: 1.4;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
    outline: none;
}

.bm-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(30,58,95,.25);
}

.bm-button:active { transform: translateY(1px); }

/* ── Button variants — all use !important to beat theme selectors ── */

/* Primary (brand gold) */
.bm-button.bm-button-primary,
a.bm-button.bm-button-primary {
    background:   var(--bm-c-primary, #ddc9a3) !important;
    color:        var(--bm-c-primary-text, #2d3748) !important;
    border-color: var(--bm-c-primary, #ddc9a3) !important;
}
.bm-button.bm-button-primary:hover,
a.bm-button.bm-button-primary:hover {
    filter: brightness(.88) saturate(1.1) !important;
}

/* Success (green) */
.bm-button.bm-button-success,
a.bm-button.bm-button-success {
    background:   #27ae60 !important;
    color:        #fff    !important;
    border-color: #27ae60 !important;
}
.bm-button.bm-button-success:hover,
a.bm-button.bm-button-success:hover {
    background:   #219a52 !important;
    border-color: #219a52 !important;
    color:        #fff    !important;
}

/* Danger */
.bm-button.bm-button-danger,
a.bm-button.bm-button-danger {
    background:   #c0392b !important;
    color:        #fff    !important;
    border-color: #c0392b !important;
}
.bm-button.bm-button-danger:hover,
a.bm-button.bm-button-danger:hover {
    background: #a93226 !important; border-color: #a93226 !important;
}

/* Warning */
.bm-button.bm-button-warning,
a.bm-button.bm-button-warning {
    background:   #e67e22 !important;
    color:        #fff    !important;
    border-color: #e67e22 !important;
}
.bm-button.bm-button-warning:hover,
a.bm-button.bm-button-warning:hover {
    background: #d68910 !important; border-color: #d68910 !important;
}

/* Outline */
.bm-button.bm-button-outline,
a.bm-button.bm-button-outline {
    background:   transparent !important;
    color:        var(--bm-c-primary, #ddc9a3) !important;
    border-color: var(--bm-c-primary, #ddc9a3) !important;
}
.bm-button.bm-button-outline:hover,
a.bm-button.bm-button-outline:hover {
    background:   var(--bm-c-primary, #ddc9a3) !important;
    border-color: var(--bm-c-primary, #ddc9a3) !important;
    color:        var(--bm-c-primary-text, #2d3748) !important;
    filter: brightness(.88) !important;
}

/* Ghost */
.bm-button.bm-button-ghost,
a.bm-button.bm-button-ghost {
    background:   transparent                  !important;
    color:        var(--bm-c-muted, #718096)   !important;
    border-color: var(--bm-c-border, #e8e2d8)  !important;
}
.bm-button.bm-button-ghost:hover,
a.bm-button.bm-button-ghost:hover {
    background:   var(--bm-c-bg, #faf9f7)  !important;
    color:        var(--bm-c-text, #2d3748) !important;
    border-color: #ccc                      !important;
}

.bm-button-sm  { padding: 5px 12px; font-size: 12px; }
.bm-button-lg  { padding: 12px 24px; font-size: 15px; }
.bm-button-full { width: 100%; }

/* ── Login ────────────────────────────────────────────────────────────────── */

.bm-login-wrap {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    background: var(--bm-c-bg);
    min-height: 100vh;
    align-items: center;
}

.bm-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow-md);
    padding: 40px 36px;
    text-align: center;
}

.bm-login-logo {
    width: 72px;
    height: 72px;
    background: #eef2f8;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.bm-login-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--bm-c-text);
    margin: 0 0 6px;
}

.bm-login-sub {
    font-size: 14px;
    color: var(--bm-c-muted);
    margin: 0 0 24px;
}

.bm-login-form { text-align: left; }

/* ── Form layout ──────────────────────────────────────────────────────────── */

.bm-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    margin-bottom: 28px;
}

.bm-page-heading h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--bm-c-text);
    margin: 0 0 2px;
}

.bm-page-heading-sub {
    font-size: 13px;
    color: var(--bm-c-muted);
    margin: 0;
}

.bm-page-link {
    font-size: 13px;
    color: var(--bm-c-primary);
    text-decoration: none;
}
.bm-page-link:hover { text-decoration: underline; }

.bm-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
    padding: 0 28px;
}

.bm-form-section {
    background: var(--bm-c-surface);
    border-radius: var(--bm-radius-lg);
    box-shadow: var(--bm-shadow-sm);
    border: 1px solid var(--bm-c-border);
    padding: 24px 26px;
    margin-bottom: 20px;
}

.bm-sidebar-section {
    position: static !important;
    margin-bottom: 0;
}

.bm-form-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--bm-c-border);
}

.bm-form-section-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bm-c-primary);
    color: var(--bm-c-primary-text);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bm-form-section-head h3 {
    margin: 0;
    padding-top: 0 !important;
    font-size: 15px;
    font-weight: 700;
    color: var(--bm-c-text);
}

/* ── Fields ───────────────────────────────────────────────────────────────── */

.bm-field {
    margin-bottom: 22px;
}

.bm-field:last-child { margin-bottom: 0; }

.bm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--bm-c-text);
    margin-bottom: 7px;
}

.bm-label-required::after {
    content: ' *';
    color: var(--bm-c-accent);
}

.bm-label-optional {
    font-weight: 400;
    font-size: 11px;
    color: var(--bm-c-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-left: 6px;
}

/* ── Header image preview block ── */
.bm-header-img-set {
    border: 1px solid var(--bm-c-border);
    border-radius: var(--bm-radius);
    overflow: hidden;
    background: #fafafa;
}

.bm-header-img-preview {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
}

.bm-header-img-preview img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.bm-header-img-actions {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--bm-c-border);
    background: #fff;
}

.bm-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bm-c-border);
    border-radius: var(--bm-radius-sm);
    font-size: 14px;
    font-family: var(--bm-font);
    color: var(--bm-c-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
    line-height: 1.5;
}

.bm-input:focus {
    outline: none;
    border-color: var(--bm-c-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}

textarea.bm-input { resize: vertical; min-height: 80px; }

.bm-field-hint {
    font-size: 12px;
    color: var(--bm-c-muted);
    margin: 6px 0 0;
    line-height: 1.5;
}

.bm-field-hint code {
    background: #f0f4f8;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    word-break: break-all;
}

/* ── SEO Counter ──────────────────────────────────────────────────────────── */

.bm-char-counter {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-char-bar-wrap {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.bm-char-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width .2s ease, background .2s ease;
    background: var(--bm-c-grey);
}

.bm-fill-ok   { background: var(--bm-c-green) !important; }
.bm-fill-warn { background: var(--bm-c-yellow) !important; }
.bm-fill-bad  { background: var(--bm-c-accent) !important; }

.bm-char-text {
    font-size: 12px;
    color: var(--bm-c-muted);
    white-space: nowrap;
}

.bm-char-num {
    font-weight: 700;
    color: var(--bm-c-text);
}

/* ── Dropzone ─────────────────────────────────────────────────────────────── */

.bm-dropzone {
    border: 2px dashed var(--bm-c-border);
    border-radius: var(--bm-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: var(--bm-c-bg);
    position: relative;
}

.bm-dropzone--over {
    border-color: var(--bm-c-primary);
    background: #eef2f8;
}

.bm-dropzone--loading { opacity: .8; }

.bm-dropzone-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: -1; /* behind elements but the button triggers it programmatically */
}

.bm-dropzone-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bm-dropzone-idle p {
    font-size: 14px;
    color: var(--bm-c-muted);
    margin: 0;
}

.bm-dropzone-or {
    font-size: 12px;
    color: #bbb;
}

.bm-dropzone-current {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--bm-c-text);
}

.bm-current-file {
    font-weight: 600;
    color: var(--bm-c-primary);
    text-decoration: none;
}
.bm-current-file:hover { text-decoration: underline; }

.bm-current-replace {
    font-size: 12px;
    color: var(--bm-c-muted);
}

/* Image dropzone preview */
.bm-dropzone-image .bm-dropzone-preview {
    width: 100%;
    max-height: 160px;
    overflow: hidden;
    border-radius: var(--bm-radius-sm);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-dropzone-image .bm-dropzone-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Upload progress */
.bm-dropzone-status {
    width: 100%;
    font-size: 13px;
    text-align: center;
    display: none;
}

.bm-status-success { color: var(--bm-c-green); }
.bm-status-error   { color: var(--bm-c-accent); }

.bm-upload-progress {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.bm-upload-progress-bar {
    height: 100%;
    background: var(--bm-c-primary);
    border-radius: 2px;
    width: 0;
    transition: width .2s linear;
}

/* ── Radio group (status) ─────────────────────────────────────────────────── */

.bm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bm-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: var(--bm-radius-sm);
    border: 1px solid var(--bm-c-border);
    transition: border-color .15s, background .15s;
}

.bm-radio-option:has(input:checked) {
    border-color: var(--bm-c-primary);
    background: #eef2f8;
}

.bm-radio-option input { margin: 0; flex-shrink: 0; }

.bm-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--bm-c-text);
}

.bm-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bm-radio-dot--green { background: var(--bm-c-green); }
.bm-radio-dot--grey  { background: var(--bm-c-grey); }

/* ── Sidebar actions ──────────────────────────────────────────────────────── */

.bm-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* Submit button loading state */
.bm-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bmSpin .7s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes bmSpin { to { transform: rotate(360deg); } }

.bm-spin {
    animation: bmSpin .8s linear infinite;
    display: inline-block;
}

/* Upload pending indicator */
.bm-upload-pending {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--bm-c-muted);
    padding: 8px 0 0;
    justify-content: center;
}

/* ── Success actions bar ──────────────────────────────────────────────────── */

.bm-success-actions {
    margin: 0 28px 20px;
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    border-radius: var(--bm-radius);
    padding: 14px 20px;
}

.bm-success-actions-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.bm-success-checkmark {
    font-size: 20px;
    color: var(--bm-c-green);
    flex-shrink: 0;
}

.bm-success-actions-inner strong {
    font-size: 14px;
    color: #1a6b3a;
    flex: 1;
}

.bm-success-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Slug field ───────────────────────────────────────────────────────────── */

.bm-slug-field-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--bm-c-border);
    border-radius: var(--bm-radius-sm);
    overflow: hidden;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.bm-slug-field-wrap:focus-within {
    border-color: var(--bm-c-primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

.bm-slug-prefix {
    padding: 10px 10px 10px 14px;
    font-size: 13px;
    color: var(--bm-c-muted);
    background: var(--bm-c-bg);
    border-right: 1px solid var(--bm-c-border);
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.bm-slug-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
    min-width: 0;
    font-family: monospace;
    font-size: 14px;
    padding: 10px 6px !important;
}

.bm-slug-suffix {
    padding: 10px 14px 10px 6px;
    font-size: 13px;
    color: var(--bm-c-muted);
    background: var(--bm-c-bg);
    border-left: 1px solid var(--bm-c-border);
}

.bm-slug-status {
    margin-top: 6px;
    font-size: 12px;
    min-height: 18px;
}

.bm-slug-status--ok .bm-slug-preview-text {
    color: var(--bm-c-muted);
}

.bm-slug-status--ok .bm-slug-preview-text strong {
    color: var(--bm-c-text);
    font-weight: 600;
}

.bm-slug-status--error {
    color: var(--bm-c-accent);
    font-weight: 600;
}

.bm-field-hint--warn {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 6px 10px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

/* ── Google Snippet Preview ───────────────────────────────────────────────── */

.bm-snippet-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bm-c-muted);
    margin-bottom: 10px;
}

.bm-snippet-box {
    border: 1px solid #dfe1e5 !important;
    border-radius: var(--bm-radius) !important;
    padding: 18px 20px !important;
    background: #fff !important;
    max-width: 600px;
    font-family: arial, sans-serif !important;
    position: relative;
    box-shadow: 0 1px 6px rgba(32,33,36,.1);
}

.bm-snippet-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
    border-radius: var(--bm-radius) var(--bm-radius) 0 0;
}

.bm-snippet-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.bm-snippet-text { flex: 1; min-width: 0; }

.bm-snippet-thumb-wrap {
    flex-shrink: 0;
    width: 92px;
    height: 92px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8eaed;
}

.bm-snippet-thumb {
    width: 92px !important;
    height: 92px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Favicon + site name + breadcrumb row */
.bm-snippet-site-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
}

.bm-snippet-favicon {
    flex-shrink: 0;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: #e8eaed !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

.bm-snippet-favicon img {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

.bm-snippet-favicon-letter {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #444 !important;
    line-height: 1 !important;
}

.bm-snippet-site-info {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0;
}

.bm-snippet-site-name {
    font-size: 13px !important;
    color: #202124 !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-snippet-breadcrumb {
    font-size: 12px !important;
    color: #4d5156 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bm-snippet-chevron {
    font-size: 11px !important;
    color: #4d5156 !important;
}

.bm-snippet-title {
    font-size: 19px !important;
    color: #1a0dab !important;
    line-height: 1.3 !important;
    margin: 0 0 3px !important;
    cursor: default;
    word-break: break-word;
}

.bm-snippet-desc {
    font-size: 13px !important;
    color: #4d5156 !important;
    line-height: 1.58 !important;
    margin: 0 !important;
    word-break: break-word;
}

.bm-snippet-placeholder {
    color: #bbb !important;
    font-style: italic;
}

/* ── Statistics page ─────────────────────────────────────────────────────── */

.bm-section-desc {
    font-size: 13px;
    color: var(--bm-c-muted);
    margin: 4px 0 0;
}

.bm-stat-tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.bm-stat-tile-link:hover { color: var(--bm-c-primary); }

.bm-empty-hint {
    font-size: 13px;
    color: var(--bm-c-muted);
    margin-top: 8px;
}
.bm-empty-hint code { font-size: 12px; }

.bm-stats-table-wrap {
    overflow-x: auto;
    border-radius: var(--bm-radius);
    border: 1px solid var(--bm-c-border);
}

.bm-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bm-stats-table thead th {
    background: var(--bm-c-bg);
    color: var(--bm-c-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--bm-c-border);
    white-space: nowrap;
}

.bm-stats-table tbody tr {
    border-bottom: 1px solid var(--bm-c-border);
    transition: background .12s;
}
.bm-stats-table tbody tr:last-child { border-bottom: none; }
.bm-stats-table tbody tr:hover { background: var(--bm-c-bg); }

.bm-stats-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.bm-stats-source-name {
    font-weight: 600;
    color: var(--bm-c-text);
    font-family: monospace;
    font-size: 13px;
    background: #f0ebe3;
    padding: 2px 7px;
    border-radius: 4px;
}

.bm-stats-count { font-variant-numeric: tabular-nums; }

.bm-stats-bar-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.bm-stats-bar-wrap {
    flex: 1;
    height: 8px;
    background: #e8e2d8;
    border-radius: 99px;
    overflow: hidden;
}

.bm-stats-bar-fill {
    height: 100%;
    background: var(--bm-c-primary, #ddc9a3);
    border-radius: 99px;
    transition: width .4s ease;
}

.bm-stats-pct {
    font-size: 12px;
    color: var(--bm-c-muted);
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bm-stats-date { font-size: 12px; color: var(--bm-c-muted); white-space: nowrap; }

.bm-stats-url-link {
    font-size: 12px;
    color: var(--bm-c-primary);
    text-decoration: none;
    font-family: monospace;
}
.bm-stats-url-link:hover { text-decoration: underline; }

.bm-stats-actions { text-align: right; }

.bm-stats-total-row {
    background: var(--bm-c-bg);
    border-top: 2px solid var(--bm-c-border) !important;
}
.bm-stats-total-row td { padding: 12px 16px; }

.bm-stats-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--bm-c-muted);
    padding: 10px 14px;
    background: var(--bm-c-bg);
    border-radius: var(--bm-radius-sm);
    border: 1px solid var(--bm-c-border);
}
.bm-stats-hint code { font-size: 12px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .bm-form-layout {
        grid-template-columns: 1fr;
    }
    .bm-sidebar-section {
        position: static;
        order: -1;
    }
    .bm-brochure-grid {
        grid-template-columns: 1fr;
    }
    .bm-stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .bm-topbar { padding: 12px 16px; }
    .bm-section { padding: 0 16px; }
    .bm-form-layout { padding: 0 16px; }
    .bm-page-heading { padding: 0 16px; }
    .bm-notice { margin: 0 16px 16px; }
    .bm-success-actions { margin: 0 16px 16px; }
    .bm-stats-row { padding: 0 16px; grid-template-columns: 1fr; }
    .bm-cta-card { flex-direction: column; text-align: center; }
}

/* ── Help video widget ──────────────────────────────────────────────────── */
.bm-help-video-card {
    background: #fff;
    border: 1px solid var(--bm-c-border, #e8e3d9);
    border-radius: var(--bm-radius);
    overflow: hidden;
}

.bm-help-video-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background: var(--bm-c-primary, #ddc9a3);
    color: var(--bm-c-primary-text, #2d3748);
    font-weight: 600;
    font-size: 13px;
}

.bm-help-video-header svg {
    flex-shrink: 0;
    opacity: .85;
}

.bm-help-video-newtab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: inherit;
    opacity: .75;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid currentColor;
    transition: opacity .15s;
    white-space: nowrap;
}
.bm-help-video-newtab:hover { opacity: 1; text-decoration: none; color: inherit; }

.bm-help-video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
}

.bm-help-video-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bm-help-video-hint {
    margin: 0;
    padding: 8px 14px 10px;
    font-size: 12px;
    color: var(--bm-c-muted, #888);
    line-height: 1.4;
}

/* Dashboard variant — compact, max-width so it doesn't fill the full content width */
.bm-help-video-card--dashboard {
    max-width: 400px !important;
}

/* Sidebar variant (edit form — neue Broschüre) */
.bm-form-sidebar .bm-help-video-card {
    margin-top: 16px;
}
.bm-form-sidebar .bm-help-video-hint {
    display: none;
}
