:root{
  --usal-green:#006847;
  --usal-green-dark:#004d35;
  --usal-green-deep:#003d2b;
  --usal-green-light:#e8f3ee;
  --usal-gold:#c49a35;
  --usal-gold-dark:#9b7420;
  --usal-cream:#f7f4ec;
  --usal-bg:#f3f6f4;
  --usal-card:#ffffff;
  --usal-border:#d9e4df;
  --usal-text:#18332a;
  --usal-muted:#6b7e76;
  --usal-danger:#b83a3a;
  --usal-shadow:0 10px 30px rgba(0,72,50,.09);
  --usal-radius:18px;
}

*{box-sizing:border-box}
body{
  margin:0;
  min-height:100vh;
  background:var(--usal-bg);
  color:var(--usal-text);
  font-family:Montserrat,Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}
a{text-decoration:none}
.bb-topbar{
  min-height:72px;
  background:linear-gradient(105deg,var(--usal-green-deep),var(--usal-green));
  border-bottom:4px solid var(--usal-gold);
  box-shadow:0 5px 22px rgba(0,0,0,.15);
}
.bb-brand{display:flex;align-items:center;gap:13px;color:#fff!important;font-weight:800}
.bb-brand-mark{
  min-width:46px;height:46px;padding:0 10px;border-radius:12px;
  display:grid;place-items:center;
  background:#fff;color:var(--usal-green);
  font-family:Georgia,serif;font-size:16px;font-weight:900;
  box-shadow:0 3px 12px rgba(0,0,0,.18);
}
.bb-shell{min-height:calc(100vh - 72px)}
.bb-sidebar{
  width:280px;min-height:calc(100vh - 72px);
  background:#fff;border-right:1px solid var(--usal-border);
  padding:22px 16px;position:sticky;top:72px;align-self:flex-start;
}
.bb-nav-title{
  padding:14px 14px 7px;color:#8a9992;font-size:.71rem;
  font-weight:800;text-transform:uppercase;letter-spacing:.12em;
}
.bb-nav-link{
  display:flex;align-items:center;gap:11px;padding:11px 13px;margin:3px 0;
  border-radius:11px;color:#40564e;font-weight:650;transition:.18s ease;
}
.bb-nav-link:hover{background:var(--usal-green-light);color:var(--usal-green);transform:translateX(2px)}
.bb-nav-icon{
  width:27px;height:27px;border-radius:8px;display:grid;place-items:center;
  background:#edf4f0;color:var(--usal-green);font-size:13px;
}
.bb-content{flex:1;min-width:0;padding:30px}
.bb-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}
.bb-title{margin:0;font-weight:850;color:var(--usal-green-dark);letter-spacing:-.025em}
.bb-subtitle{margin:.4rem 0 0;color:var(--usal-muted)}
.bb-card{
  background:var(--usal-card);border:1px solid var(--usal-border);
  border-radius:var(--usal-radius);box-shadow:var(--usal-shadow);
}
.bb-card-header{
  padding:18px 20px;border-bottom:1px solid var(--usal-border);
  display:flex;justify-content:space-between;align-items:center;gap:12px;
}
.bb-card-body{padding:22px}
.bb-stat{padding:21px;position:relative;overflow:hidden;min-height:145px}
.bb-stat::after{
  content:"";position:absolute;right:-32px;bottom:-46px;width:130px;height:130px;
  border-radius:50%;background:rgba(255,255,255,.15)
}
.bb-stat .value{font-size:1.55rem;font-weight:900;line-height:1.1}
.bb-stat .label{font-weight:750;margin-top:9px}
.bb-stat .hint{font-size:.83rem;opacity:.84;margin-top:5px}
.bb-stat.blue,.bb-stat.green{background:linear-gradient(145deg,var(--usal-green-dark),var(--usal-green));color:#fff}
.bb-stat.orange{background:linear-gradient(145deg,var(--usal-gold-dark),var(--usal-gold));color:#fff}
.bb-stat.purple{background:linear-gradient(145deg,#586c63,#789287);color:#fff}
.bb-module{height:100%;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.bb-module:hover{transform:translateY(-5px);box-shadow:0 18px 35px rgba(0,72,50,.14);border-color:#b9d2c7}
.bb-module-icon{
  width:50px;height:50px;border-radius:15px;display:grid;place-items:center;
  font-size:22px;background:var(--usal-green-light);color:var(--usal-green);margin-bottom:16px
}
.bb-module h3{font-size:1.05rem;font-weight:800;color:var(--usal-green-dark)}
.bb-module p{font-size:.9rem;color:var(--usal-muted);margin-bottom:0}
.form-label{font-weight:750;color:#385047;font-size:.9rem}
.form-control,.form-select{min-height:44px;border-radius:11px;border-color:#cadbd3}
.form-control:focus,.form-select:focus{
  border-color:var(--usal-green);box-shadow:0 0 0 .23rem rgba(0,104,71,.13)
}
.btn{border-radius:10px;font-weight:750}
.btn-primary{background:var(--usal-green);border-color:var(--usal-green)}
.btn-primary:hover{background:var(--usal-green-dark);border-color:var(--usal-green-dark)}
.btn-danger{background:var(--usal-danger);border-color:var(--usal-danger)}
.btn-outline-secondary{color:#52675f;border-color:#aebfb8}
.bb-safe{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;font-size:.82rem;font-weight:800}
.bb-safe.readonly{background:#e8f4ee;color:var(--usal-green)}
.bb-safe.write{background:#fbf1d8;color:#88630f}
.bb-user-card{height:100%;border-top:5px solid var(--usal-green)}
.bb-user-card.provisional{border-top-color:var(--usal-gold)}
.bb-user-card.definitive{border-top-color:var(--usal-green)}
.bb-avatar{
  width:58px;height:58px;border-radius:18px;display:grid;place-items:center;
  background:linear-gradient(145deg,var(--usal-green-dark),var(--usal-green));
  color:#fff;font-weight:900;font-size:18px
}
.bb-user-name{font-size:1.08rem;font-weight:850;color:var(--usal-green-dark)}
.bb-user-meta{color:var(--usal-muted);font-size:.86rem}
.bb-data-list{margin:0}
.bb-data-list div{
  display:grid;grid-template-columns:minmax(135px,38%) 1fr;gap:12px;padding:9px 0;
  border-bottom:1px dashed #dfebe5
}
.bb-data-list div:last-child{border-bottom:0}
.bb-data-list dt{color:#758980;font-size:.83rem}
.bb-data-list dd{margin:0;font-weight:650;overflow-wrap:anywhere}
.bb-alert-duplicate{border:0;border-left:5px solid var(--usal-gold);background:#fcf7e9;color:#735410;border-radius:13px}
.bb-alert-ok{border:0;border-left:5px solid var(--usal-green);background:#ebf6f1;color:#145d42;border-radius:13px}
.bb-table-wrap{overflow:auto;max-height:680px;border:1px solid var(--usal-border);border-radius:14px}
.bb-table{margin:0;font-size:.84rem}
.bb-table thead th{
  position:sticky;top:0;z-index:3;background:var(--usal-green-dark);
  color:#fff;white-space:nowrap;padding:12px;border-bottom:3px solid var(--usal-gold)
}
.bb-table tbody td{padding:10px 12px;vertical-align:top;min-width:100px}
.bb-table tbody tr:hover{background:#edf6f1}
.bb-json{max-height:680px;overflow:auto;background:#10271f;color:#dcebe5;border-radius:14px;padding:18px;font-size:.78rem}
.bb-tabs .nav-link{color:#64786f;font-weight:750;border-radius:10px 10px 0 0}
.bb-tabs .nav-link.active{color:var(--usal-green)}
.bb-empty{text-align:center;padding:40px 20px;color:var(--usal-muted)}
.bb-login-page{
  min-height:100vh;
  background:
    radial-gradient(circle at 15% 20%,rgba(196,154,53,.22),transparent 30%),
    radial-gradient(circle at 82% 75%,rgba(0,104,71,.25),transparent 30%),
    linear-gradient(140deg,var(--usal-green-deep),var(--usal-green-dark));
  display:grid;place-items:center;padding:24px
}
.bb-login-card{
  width:min(980px,100%);display:grid;grid-template-columns:1.05fr .95fr;
  overflow:hidden;border-radius:25px;box-shadow:0 30px 80px rgba(0,0,0,.3);background:#fff
}
.bb-login-hero{
  color:#fff;padding:55px;
  background:
    linear-gradient(150deg,rgba(0,61,43,.96),rgba(0,104,71,.93));
  border-right:6px solid var(--usal-gold)
}
.bb-login-form{padding:55px}
.bb-login-feature{display:flex;gap:11px;align-items:flex-start;margin-top:19px;color:#dcebe5;font-size:.92rem}
.bb-login-feature span{
  width:28px;height:28px;border-radius:8px;background:rgba(196,154,53,.28);
  display:grid;place-items:center;flex:0 0 auto
}
.bb-code{background:#edf4f0;padding:2px 7px;border-radius:6px;color:#314a40}
.alert-success{border-color:#b9d9c9;background:#edf7f2;color:#135d40}
@media(max-width:991.98px){
  .bb-sidebar{display:none}.bb-content{padding:22px 16px}
  .bb-login-card{grid-template-columns:1fr}.bb-login-hero{display:none}
}
@media(max-width:575.98px){
  .bb-page-head{display:block}.bb-content{padding:16px 10px}
  .bb-card-body{padding:17px}.bb-login-form{padding:30px 22px}
}

:root{--usal-green:#006847;--usal-dark:#004d35;--usal-gold:#c99b2f;--usal-bg:#f3f6f4;--usal-card:#fff;--usal-border:#d9e4df;--usal-text:#18332a;--usal-muted:#6b7e76}
body{font-family:Montserrat,sans-serif;background:var(--usal-bg);color:var(--usal-text)}
.bb-topbar{background:linear-gradient(105deg,#003d2b,#006847);border-bottom:4px solid var(--usal-gold)}
.bb-header-logo{height:44px;max-width:410px;background:#fff;border-radius:8px;padding:4px 8px}.bb-global-search{width:min(500px,35vw)}.bb-global-search input{background:rgba(255,255,255,.14);color:#fff}.bb-sidebar{width:285px}.bb-menu-brand img{width:100%;max-width:250px;background:#fff;border-radius:8px;padding:6px}.bb-safe.master-off{background:#f2dddd;color:#8c2424}.bb-api-status{padding:9px 13px;border-radius:999px}.bb-api-status.ok{background:#e7f5ee;color:#136543}.bb-api-status.error{background:#f9e6e6;color:#8b2929}.bb-action-tile{padding:15px;border:1px solid var(--usal-border);border-radius:12px;color:var(--usal-text)}.bb-search-result{display:flex;flex-direction:column;padding:12px 0;border-bottom:1px solid var(--usal-border)}.bb-search-result small{color:var(--usal-muted)}
:root[data-theme="dark"]{--usal-bg:#101714;--usal-card:#18211d;--usal-border:#2d3a34;--usal-text:#e7f0eb;--usal-muted:#a5b5ad}:root[data-theme="dark"] body,:root[data-theme="dark"] .offcanvas,:root[data-theme="dark"] .modal-content{background:var(--usal-bg);color:var(--usal-text)}:root[data-theme="dark"] .bb-card,:root[data-theme="dark"] .bb-sidebar{background:var(--usal-card);color:var(--usal-text)}:root[data-theme="dark"] .form-control,:root[data-theme="dark"] .form-select{background:#111a16;color:#fff;border-color:#3b4b44}
