:root {
    --bm-bg: #f4f7f5;
    --bm-surface: #ffffff;
    --bm-surface-soft: #f8faf9;
    --bm-border: #e3e9e5;
    --bm-text: #17211b;
    --bm-muted: #6b776f;
    --bm-primary: #17633a;
    --bm-primary-dark: #0f4b2b;
    --bm-primary-soft: #e9f5ee;
    --bm-blue: #275da8;
    --bm-blue-soft: #edf3fb;
    --bm-amber: #9a5a00;
    --bm-amber-soft: #fff5df;
    --bm-danger: #b42318;
    --bm-danger-soft: #fff0ee;
    --bm-sidebar: #10291c;
    --bm-sidebar-muted: #9fb3a7;
    --bm-radius: 18px;
    --bm-shadow: 0 10px 28px rgba(24, 49, 34, .08);
}

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

a { color: var(--bm-primary); }
a:hover { color: var(--bm-primary-dark); }

.bm-app { min-height: 100vh; }
.bm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    padding: 24px 18px;
    background: var(--bm-sidebar);
    color: #fff;
    z-index: 1030;
    display: none;
    flex-direction: column;
}
.bm-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.bm-brand:hover { color: #fff; }
.bm-brand-mark {
    width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.12);
    font-size: 1.15rem;
}
.bm-brand-title { font-weight: 800; letter-spacing: -.02em; }
.bm-brand-subtitle { color: var(--bm-sidebar-muted); font-size: .76rem; }
.bm-nav-label { margin: 28px 10px 8px; color: #779080; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.bm-nav { display: grid; gap: 4px; }
.bm-nav a {
    display: flex; align-items: center; gap: 11px;
    min-height: 44px; padding: 10px 12px;
    color: #d7e5dc; text-decoration: none; border-radius: 12px;
    font-weight: 650;
}
.bm-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.bm-nav a.active { background: #fff; color: var(--bm-primary-dark); box-shadow: 0 7px 18px rgba(0,0,0,.15); }
.bm-nav .sub { padding-left: 42px; font-size: .9rem; color: #bdd0c3; }
.bm-sidebar-footer { margin-top: auto; padding-top: 20px; }
.bm-user-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px; }

.bm-main { min-height: 100vh; }
.bm-topbar {
    height: 72px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--bm-border);
    position: sticky; top: 0; z-index: 1020; backdrop-filter: blur(12px);
}
.bm-topbar-title { font-weight: 800; letter-spacing: -.02em; }
.bm-content { padding: 24px 18px 40px; }

.bm-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:22px; }
.bm-eyebrow { color: var(--bm-primary); font-size: .74rem; font-weight: 850; letter-spacing: .10em; text-transform: uppercase; margin-bottom: 5px; }
.bm-page-title { font-size: clamp(1.6rem, 2vw, 2.15rem); font-weight: 850; letter-spacing: -.035em; margin: 0 0 5px; }
.bm-page-subtitle { color: var(--bm-muted); margin: 0; max-width: 760px; }

.bm-card { background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); box-shadow: var(--bm-shadow); }
.bm-card-body { padding: 20px; }
.bm-card-title { font-weight: 800; letter-spacing: -.02em; margin: 0; }
.bm-card-muted { color: var(--bm-muted); }

.bm-metric { min-height: 120px; padding: 18px; display:flex; flex-direction:column; justify-content:space-between; }
.bm-metric-icon { width: 40px; height: 40px; border-radius: 12px; display:grid; place-items:center; background: var(--bm-primary-soft); color: var(--bm-primary); font-size:1.05rem; }
.bm-metric-label { color: var(--bm-muted); font-size:.78rem; font-weight:700; }
.bm-metric-value { font-size: 1.65rem; line-height: 1.1; font-weight: 850; letter-spacing: -.03em; }

.bm-status { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; font-size:.72rem; font-weight:850; letter-spacing:.04em; }
.bm-status-open { color:#136b3b; background:#e6f6ec; }
.bm-status-closed { color:#275da8; background:#eaf1fb; }
.bm-status-apurated { color:#17633a; background:#dff1e6; }
.bm-status-pending { color:#8a5700; background:#fff2d4; }
.bm-status-danger { color:#a12b21; background:#ffebe8; }

.bm-extraction-card { position:relative; overflow:hidden; }
.bm-extraction-card::before { content:""; position:absolute; inset:0 auto 0 0; width:4px; background:var(--bm-primary); opacity:.85; }
.bm-extraction-meta { display:flex; gap:14px; flex-wrap:wrap; color:var(--bm-muted); font-size:.82rem; }
.bm-mini-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; }
.bm-mini-stat { padding:12px; background:var(--bm-surface-soft); border:1px solid var(--bm-border); border-radius:13px; }
.bm-mini-stat span { display:block; color:var(--bm-muted); font-size:.7rem; font-weight:700; margin-bottom:2px; }
.bm-mini-stat strong { font-size:1rem; }

.btn { border-radius: 11px; font-weight: 750; padding: .62rem .9rem; }
.btn-sm { padding: .45rem .7rem; border-radius: 9px; }
.btn-success { background: var(--bm-primary); border-color: var(--bm-primary); }
.btn-success:hover, .btn-success:focus { background: var(--bm-primary-dark); border-color: var(--bm-primary-dark); }
.btn-outline-success { color: var(--bm-primary); border-color: #8fbea3; }
.btn-outline-success:hover { background: var(--bm-primary); border-color: var(--bm-primary); }
.btn-primary { background: var(--bm-blue); border-color: var(--bm-blue); }

.bm-segmented { display:inline-flex; padding:4px; gap:4px; background:#e9efeb; border-radius:13px; }
.bm-segmented a { padding:7px 12px; border-radius:10px; text-decoration:none; color:var(--bm-muted); font-size:.83rem; font-weight:800; }
.bm-segmented a.active { background:#fff; color:var(--bm-primary-dark); box-shadow:0 2px 8px rgba(30,55,41,.10); }

.table { --bs-table-bg: transparent; margin-bottom:0; }
.table thead th { color:var(--bm-muted); font-size:.71rem; letter-spacing:.05em; text-transform:uppercase; border-bottom-color:var(--bm-border); font-weight:800; }
.table td, .table th { vertical-align: middle; border-color: #edf1ee; padding: .8rem .7rem; }
.number-input { max-width: 155px; font-weight:800; letter-spacing:.08em; border-radius:10px; }
.form-control, .form-select { border-radius: 11px; border-color: #d7dfda; min-height: 44px; }
.form-control:focus, .form-select:focus { border-color:#76ad8c; box-shadow:0 0 0 .2rem rgba(23,99,58,.12); }
.form-label { font-weight:700; color:#3f4a43; }

.alert { border:0; border-radius:14px; }
.alert-success { background:#e8f5ed; color:#145f37; }
.alert-danger { background:#fff0ee; color:#9b2c23; }
.alert-info { background:#edf5fb; color:#245c86; }

.bm-empty { text-align:center; padding:48px 24px; }
.bm-empty-icon { width:54px; height:54px; border-radius:16px; background:var(--bm-primary-soft); color:var(--bm-primary); display:grid; place-items:center; margin:0 auto 14px; font-size:1.3rem; }

.bm-login-shell { min-height:100vh; display:grid; grid-template-columns: 1fr; }
.bm-login-brand { display:none; background:var(--bm-sidebar); color:#fff; padding:56px; }
.bm-login-brand-inner { max-width:560px; margin:auto; }
.bm-login-panel { display:flex; align-items:center; justify-content:center; padding:28px 18px; background:var(--bm-bg); }
.bm-login-box { width:min(430px, 100%); }
.bm-login-logo { width:54px; height:54px; border-radius:17px; background:var(--bm-primary); color:#fff; display:grid; place-items:center; font-size:1.35rem; margin-bottom:18px; }

.bm-step { display:flex; gap:12px; align-items:flex-start; padding:12px 0; }
.bm-step-number { flex:0 0 auto; width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:var(--bm-primary-soft); color:var(--bm-primary); font-weight:850; font-size:.78rem; }
.bm-progress-track { height:8px; border-radius:999px; background:#e8eeea; overflow:hidden; }
.bm-progress-bar { height:100%; background:var(--bm-primary); border-radius:999px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 4; background: rgba(244,247,245,.94); backdrop-filter: blur(8px); padding: 12px 0; }

pre.bm-console { background:#102118; color:#dce9e0; border-radius:14px; padding:16px; white-space:pre-wrap; max-height:420px; overflow:auto; }

@media (min-width: 992px) {
    .bm-sidebar { display:flex; }
    .bm-main { margin-left:270px; }
    .bm-topbar { padding:0 30px; }
    .bm-content { padding:30px 30px 48px; }
    .bm-login-shell { grid-template-columns: minmax(420px, 46%) 1fr; }
    .bm-login-brand { display:flex; }
}

@media (max-width: 767.98px) {
    .bm-page-head { flex-direction:column; }
    .bm-mini-grid { grid-template-columns:1fr; }
    .bm-content { padding-top:18px; }
}

/* ===== Gerenciamento BichoMania ===== */
.bm-metric-link { text-decoration:none; color:inherit; display:block; height:100%; }
.bm-metric-link .bm-card { transition: transform .16s ease, box-shadow .16s ease; }
.bm-metric-link:hover .bm-card { transform: translateY(-2px); box-shadow:0 14px 34px rgba(26,72,45,.13); }
.bm-icon-warning { background:#fff4df !important; color:#c96a00 !important; }
.bm-badge { display:inline-flex; align-items:center; border-radius:999px; padding:.34rem .62rem; font-size:.68rem; line-height:1; font-weight:850; white-space:nowrap; }
.bm-badge-success { background:#e4f5ea; color:#156437; }
.bm-badge-danger { background:#ffebe8; color:#a32e25; }
.bm-badge-warning { background:#fff2dd; color:#a85b00; }
.bm-badge-info { background:#e8f3fb; color:#22618e; }
.bm-badge-secondary { background:#edf0ee; color:#58615c; }
.bm-kv { display:flex; justify-content:space-between; gap:16px; padding:10px 0; border-bottom:1px solid var(--bm-border); }
.bm-kv:last-child { border-bottom:0; }
.bm-kv span { color:var(--bm-muted); font-size:.82rem; }
.bm-kv strong { text-align:right; font-size:.86rem; }
.bm-payment-row { display:flex; justify-content:space-between; gap:16px; padding:11px 0; border-bottom:1px solid var(--bm-border); }
.bm-payment-row:last-child { border-bottom:0; }
.bm-dashboard-list { display:grid; gap:3px; }
.bm-dashboard-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 2px; border-bottom:1px solid var(--bm-border); }
.bm-dashboard-item:last-child { border-bottom:0; }
.bm-sidebar { overflow-y:auto; }
.bm-sidebar::-webkit-scrollbar { width:5px; }
.bm-sidebar::-webkit-scrollbar-thumb { background:rgba(255,255,255,.18); border-radius:10px; }

.bm-row-danger { --bs-table-bg:#fff7f6; }
.bm-row-danger td:first-child { border-left:3px solid #c63b32; }
