:root{
    --bg:#f4f6f9; --card:#ffffff; --blue:#2563eb;
    --green:#16a34a; --red:#dc2626; --nav:#060b15; --nav2:#1e293b;
    --muted:#6b7280; --radius:14px;
  }
  html, body { height:100%; margin:0; padding:0; overflow-x:hidden; overflow-y:auto; }
  body{ background:var(--bg); font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial,sans-serif; }
  .card{border:0;border-radius:var(--radius);box-shadow:0 6px 18px rgba(15,23,42,.08);}
  .small-muted{font-size:.86rem;color:var(--muted)}
  [data-view]{display:none} [data-view].active{display:block}
  header{
    background:#fff;
    color:#0f172a;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:.35rem .75rem !important;
    box-shadow:0 2px 8px rgba(15,23,42,.08);
    border-bottom:1px solid #e2e8f0;
    position:sticky;
    top:0;
    z-index:1030;
  }
  .header-compact{
    min-height:52px;
  }
  .header-inner{
    display:flex;
    align-items:center;
    gap:12px;
    width:100%;
  }
  .header-left{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
  }
.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
}
.superadmin-tenant{
  display:flex;
  align-items:center;
  gap:8px;
  padding:4px 8px;
  border-radius:10px;
  background:#f2f5fb;
  border:1px solid #e2e8f0;
}
.superadmin-tenant i{
  color:#1e293b;
  font-size:0.95rem;
}
.superadmin-tenant .form-select{
  min-width:180px;
  font-size:0.82rem;
  padding-top:4px;
  padding-bottom:4px;
}
.superadmin-tenant-hint{
  font-size:0.75rem;
  color:#64748b;
}
@media (max-width: 768px){
  .superadmin-tenant{
    width:100%;
    justify-content:flex-start;
  }
  .superadmin-tenant .form-select{
    min-width:140px;
  }
  .header-actions{
    flex-wrap:wrap;
  }
}
  header h3{font-size:1.1rem;margin:0;font-weight:700;letter-spacing:.5px;}
  .brand-home{
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:.5rem;
    overflow:visible;
    line-height:1;
    height:36px;
    position:relative;
    width:clamp(96px,10vw,128px);
    margin-left:14px;
    padding:0;
  }
  .brand-logo{
    height:clamp(29px,2.9vw,39px);
    max-width:106px;
    width:auto;
    display:block;
    position:absolute;
    left:0;
    top:58%;
    transform:translateY(-50%);
  }
  .header-compact .brand-home{
    width:auto;
    height:32px;
    margin-left:8px;
  }
  .header-compact .brand-logo{
    position:static;
    transform:none;
    height:32px;
    max-width:140px;
  }
  .header-compact .brand-logo:hover{ transform:scale(1.05); }
  .brand-logo{
    pointer-events:auto;
  }
  .brand-logo:hover{transform:translateY(-50%) scale(1.06);}
  #headerSubtitle{margin-left:.5rem !important;}
  #headerSubtitle{display:none;}
  .menu-btn{
    border:2px solid #e2e8f0;
    background:#fff;
    font-size:1.2rem;
    line-height:1;
    color:#0f172a;
    border-radius:10px;
    width:36px;
    height:34px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }
  .menu-btn:hover{
    background:#dcfce7;
    border-color:#86efac;
  }
  .menu-btn i{transition:.2s;display:inline-block;}
  .menu-btn:hover i{transform:scale(1.1);color:#0f172a;}
  .menu-icon{
    width:18px;
    height:18px;
    display:block;
    filter:drop-shadow(0 1px 2px rgba(15,23,42,.25));
  }
  .header-icons{display:flex;align-items:center;gap:16px}
  .header-icons i{font-size:1.32rem;cursor:pointer;transition:.2s;color:#0f172a}
  .header-icons i:hover{color:#0f172a;transform:scale(1.1)}
  .icon-btn{
    border:1px solid #e2e8f0;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    width:34px;
    height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition:.2s;
  }
  .icon-btn i{font-size:1.15rem;}
  .icon-btn:hover{background:#f1f5f9;}
  .avatar-btn{
    border:1px solid #e2e8f0;
    background:#fff;
    color:#0f172a;
    border-radius:10px;
    height:34px;
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:0 8px;
    transition:.2s;
  }
  .avatar-btn:hover{background:#f1f5f9;}
  .avatar-btn.dropdown-toggle::after{ display:none; }
  .avatar-circle{
    width:26px;
    height:26px;
    border-radius:50%;
    background:#e2e8f0;
    color:#0f172a;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight:700;
    font-size:.75rem;
    letter-spacing:.04em;
  }
  .low-stock-msg{
    font-size:.78rem;
    padding:.15rem .5rem;
    border-radius:999px;
    background:#facc15;
    color:#000;
    font-weight:700;
    border:1px solid #eab308;
    white-space:nowrap;
    cursor:pointer;
  }
  .low-stock-msg:hover{ filter:brightness(.95); }
  .pending-bar{
    background:#fff3cd;
    color:#7a5b00;
    border-bottom:1px solid #ffe69c;
  }
  .pending-bar .badge{background:#ffec99;color:#7a5b00;border:1px solid #ffe69c;}
  .offcanvas{background:#ffffff;color:#0f172a}
  .offcanvas-start{ width:220px !important; }
  .offcanvas .btn{display:flex;align-items:center;gap:6px;border-radius:12px;text-align:left;font-weight:700;font-size:.95rem}
  .offcanvas .btn i{ width:18px; text-align:center; }
  .card-head{border-radius:12px 12px 0 0;padding:10px 14px;font-weight:800;color:#fff}
  .head-purple{background:linear-gradient(135deg,#6d28d9,#7c3aed)}
  .head-blue{background:linear-gradient(135deg,#1d4ed8,#2563eb)}
  .dashboard-card{
    background:linear-gradient(180deg,#f8fbff 0%, #ffffff 45%);
    border:1px solid rgba(37,99,235,.18);
  }
  .dashboard-head{
    position:relative;
    overflow:hidden;
  }
  .dashboard-head::after{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(120deg, rgba(255,255,255,.22), transparent 60%);
    pointer-events:none;
  }
  .dashboard-chip{
    background:rgba(255,255,255,.2);
    color:#fff;
    border:1px solid rgba(255,255,255,.4);
    padding:2px 10px;
    border-radius:999px;
    font-size:.72rem;
    font-weight:700;
    letter-spacing:.3px;
  }
  .dashboard-body{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .dashboard-top{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:stretch;
  }
  .dashboard-filters{
    flex:1 1 210px;
    background:#eef2ff;
    border:1px solid rgba(37,99,235,.2);
    border-radius:12px;
    padding:8px;
  }
  .dashboard-filter-label{
    font-size:.72rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:700;
    color:#1e3a8a;
    margin-bottom:4px;
  }
  .dashboard-filter-group{
    display:flex;
    gap:6px;
  }
  .dashboard-filters .form-select{
    border-color:rgba(37,99,235,.35);
    background:#fff;
    font-weight:600;
  }
  .dashboard-kpi{
    flex:0 0 200px;
    background:linear-gradient(135deg,#16a34a,#0ea5e9);
    color:#fff;
    border-radius:14px;
    padding:12px 14px;
    box-shadow:0 12px 22px rgba(14,165,233,.25);
  }
  .dashboard-kpi-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    flex-wrap:nowrap;
  }
  .dashboard-kpi-label{
    font-size:.78rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    opacity:.9;
    white-space:nowrap;
  }
  .dashboard-kpi .kpi-box{
    background:rgba(255,255,255,.18);
    border:1px solid rgba(255,255,255,.35);
    font-size:1.25rem;
    margin-top:0;
    white-space:nowrap;
  }
  .dashboard-kpi-sub{
    font-size:.8rem;
    opacity:.9;
    margin-top:0;
  }
  .records-body{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .records-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
  }
  .records-span-2{
    grid-column:auto;
  }
.records-panel{
  background:#fff;
  border:1px solid rgba(37,99,235,.2);
  border-radius:12px;
  padding:4px 8px;
  box-shadow:0 6px 14px rgba(15,23,42,.06);
}
.records-summary-panel,
.records-filters-panel{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}
  .records-panel-title{
    font-size:.7rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:700;
    color:#1e3a8a;
    margin-bottom:8px;
  }
  .records-summary{
    font-size:.86rem;
    color:#0f172a;
    line-height:1.4;
  }
  .records-summary strong{
    color:#2563eb;
  }
  .records-kpi-badge{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    background:linear-gradient(135deg,#16a34a,#22c55e);
    color:#fff;
    border-radius:999px;
    padding:8px 12px;
    font-weight:700;
    box-shadow:0 10px 20px rgba(22,163,74,.25);
  }
  .records-kpi-badge strong{
    font-size:1rem;
  }
  .records-head-btn{
    border-radius:999px;
    font-weight:700;
    padding:2px 10px;
  }
  @media (max-width:992px){
    .records-kpi-badge{
      flex-direction:column;
      align-items:flex-start;
    }
  }
  .records-item{
    background:#fff;
    border:1px solid rgba(15,23,42,.08);
    border-radius:14px;
    padding:4px 8px;
    box-shadow:0 8px 18px rgba(15,23,42,.06);
    display:flex;
    flex-direction:column;
    gap:4px;
  }
  .records-item + .records-item{
    margin-top:10px;
  }
  .records-item-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
  }
  .records-item-title{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px;
  }
  .records-item-code{
    font-weight:800;
    font-size:1.05rem;
    color:#0f172a;
  }
  .records-item-meta{
    font-size:.85rem;
    color:#64748b;
    margin-top:0;
  }
  .records-item-desc{
    margin-top:0;
    font-size:.82rem;
    color:#1f2937;
    font-weight:600;
  }
  .records-delete{
    border:1px solid transparent;
    background:transparent;
    color:#94a3b8;
    border-radius:10px;
    padding:4px 6px;
    line-height:1;
    transition:background .2s,color .2s,border-color .2s;
  }
  .records-delete:hover{
    background:#fee2e2;
    color:#b91c1c;
    border-color:#fecaca;
  }
  .records-mini-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:4px;
  }
  .records-mini-grid-secondary{
    opacity:.9;
  }
  .records-mini-card{
    background:#f8fafc;
    border:1px solid rgba(148,163,184,.35);
    border-radius:12px;
    padding:8px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
  }
  .records-mini-label{
    font-size:.72rem;
    text-transform:uppercase;
    letter-spacing:.1em;
    color:#64748b;
    font-weight:700;
    margin-bottom:1px;
  }
  .records-mini-value{
    font-size:.95rem;
    font-weight:800;
    color:#0f172a;
  }
  .records-mini-info .records-mini-value{
    color:#1d4ed8;
  }
  .records-item-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:4px;
    flex-wrap:wrap;
  }
  .records-kpi-pill{
    background:linear-gradient(135deg,#16a34a,#22c55e);
    color:#fff;
    border-radius:999px;
    padding:5px 10px;
    font-weight:800;
    box-shadow:0 10px 20px rgba(22,163,74,.2);
    font-size:.86rem;
  }
  .records-chip-soft{
    background:#eff6ff;
    color:#1e3a8a;
    border:1px solid rgba(59,130,246,.35);
    font-weight:700;
  }
  @media (max-width:576px){
    .records-mini-grid{
      grid-template-columns:1fr;
    }
    .records-item{
      padding:8px;
    }
    .records-item-code{
      font-size:1rem;
    }
  }
  .dashboard-charts{
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .dashboard-chart-card{
    background:#fff;
    border:1px solid rgba(15,23,42,.08);
    border-radius:12px;
    padding:8px;
    box-shadow:0 8px 16px rgba(15,23,42,.06);
    display:flex;
    flex-direction:column;
    gap:4px;
    height:220px;
    min-height:220px;
    max-height:220px;
  }
  .chart-annual{
    margin-top:6px;
  }
  .dashboard-chart-card canvas{
    display:block;
    width:100% !important;
    height:100% !important;
    margin:0;
    flex:1 1 auto;
  }
  .report-chart-wrap{
    width:100%;
    max-width:100%;
    height:260px;
    min-height:260px;
    max-height:260px;
    position:relative;
    overflow:hidden;
    line-height:0;
  }
  .report-chart-wrap canvas{
    width:100% !important;
    height:100% !important;
    display:block;
  }
  .dashboard-chart-title{
    font-size:.78rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:700;
    color:#1f2937;
    margin-bottom:4px;
  }
  @media (max-width:576px){
    .dashboard-kpi{ flex:1 1 100%; }
    .dashboard-kpi-label{ font-size:.68rem; letter-spacing:.05em; }
    .dashboard-kpi .kpi-box{ font-size:1.05rem; }
  }
  .kpi-box{border-radius:12px;padding:10px 14px;color:#fff;font-weight:800;text-align:center}
  .kpi-green{background:#16a34a}
  .diff-pos{color:var(--green);font-weight:800}
  .diff-neg{color:var(--red);font-weight:800}
  .no-table{max-height:60vh;overflow:auto}
  .type-card{
    border:1px solid rgba(37,99,235,.25);
    border-top:3px solid var(--blue);
    border-radius:14px;
    box-shadow:0 6px 18px rgba(15,23,42,.08);
  }
  .card-blue-line{
    border:1px solid rgba(37,99,235,.25);
    border-top:3px solid var(--blue);
  }
  .card-blue-strong{
    border:2px solid #050a1a;
    border-top:4px solid #050a1a;
  }
  .card-blue-outline{
    border:1px solid rgba(37,99,235,.45);
  }
  .machine-card-dark{
    background:linear-gradient(145deg,#0b1220 0%, #121c2f 55%, #15233a 100%);
    color:#e2e8f0;
    border-color:rgba(37,99,235,.35);
    box-shadow:0 10px 18px rgba(15,23,42,.28);
  }
  .machine-card-donated{
    border:2px solid #f59e0b;
    background:linear-gradient(135deg,#0f172a 0%, #1e293b 55%, #1e40af 100%);
    box-shadow:0 12px 24px rgba(15,23,42,.35);
  }
  .machine-card-donated,
  .machine-card-donated *{
    color:#f8fafc !important;
  }
  .machine-card-donated .small-muted{
    color:#e2e8f0 !important;
  }
  .machine-card-donated .badge{
    background:rgba(15,23,42,.55) !important;
    color:#f8fafc !important;
    border-color:rgba(148,163,184,.45) !important;
  }
  .machine-card-dark .badge.text-bg-light,
  .machine-card-dark .badge.text-bg-primary-subtle{
    background:rgba(148,163,184,.18) !important;
    color:#e2e8f0 !important;
    border-color:rgba(148,163,184,.4) !important;
  }
  .badge-donated{
    background:#ecfdf3;
    color:#166534;
    border:1px solid #86efac;
    font-weight:700;
  }
  .badge-doses{
    background:#fef9c3;
    color:#92400e;
    border:1px solid #f59e0b;
    font-weight:700;
  }
  .badge-fichas{
    background:#eff6ff;
    color:#1e3a8a;
    border:1px solid #60a5fa;
    font-weight:700;
  }
  .machine-card-dark .badge-fichas{
    background:rgba(14,165,233,.18);
    color:#e0f2fe;
    border-color:rgba(56,189,248,.55);
  }
  .machine-card-dark .small-muted{
    color:#cbd5f5;
  }
  .machine-card-dark .btn-outline-primary,
  .machine-card-dark .btn-outline-danger{
    transition:none !important;
    box-shadow:none !important;
  }
  .machine-card-dark .btn-outline-primary:hover,
  .machine-card-dark .btn-outline-primary:focus{
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
  }
  .machine-card-dark .btn-outline-danger:hover,
  .machine-card-dark .btn-outline-danger:focus{
    background:#dc2626;
    border-color:#dc2626;
    color:#fff;
  }
  .btn-outline-primary,
  .btn-outline-danger{
    transition:none !important;
    box-shadow:none !important;
  }
  .btn-outline-primary:hover,
  .btn-outline-primary:focus{
    background:#2563eb;
    border-color:#2563eb;
    color:#fff;
  }
  .btn-outline-danger:hover,
  .btn-outline-danger:focus{
    background:#dc2626;
    border-color:#dc2626;
    color:#fff;
  }
  .moves-scroll{
    display:block;
    max-height:320px;
    overflow-y:auto !important;
    overflow-x:auto;
  }
  .product-list-scroll{
    display:block;
    max-height:200px;
    overflow-y:auto !important;
    overflow-x:auto;
  }
  .location-scroll{
    display:block;
    max-height:220px;
    overflow-y:auto !important;
    overflow-x:auto;
  }
  .stock-scroll{
    display:block;
    max-height:220px;
    overflow-y:auto !important;
    overflow-x:auto;
  }
  #productsList{overflow-x:auto;}
  .product-list-item{padding:.45rem .6rem;}
  .product-row{display:flex;align-items:center;gap:.5rem;flex-wrap:nowrap;min-width:900px;}
  .product-main{display:flex;align-items:center;gap:.35rem;flex-wrap:nowrap;min-width:0;}
  .product-name{font-weight:700;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .product-badge{font-size:.75rem;white-space:nowrap;}
  .product-row .actions{display:flex;gap:.25rem;justify-content:flex-end;}
  @media (max-width: 992px){.product-row{min-width:760px;}.product-name{max-width:160px;}}
  @media (max-width: 576px){.product-row{min-width:640px;}}
  .submenu-sm .btn{
    font-size:.85rem;
    padding:.3rem .6rem;
  }
  #menuCadastrosToggle .bi-chevron-down{
    transition: transform .2s ease;
  }
  #menuCadastrosToggle[aria-expanded="true"] .bi-chevron-down{
    transform: rotate(180deg);
  }
  .type-card .big{font-size:1.2rem;font-weight:800}
  .type-card .muted{color:#64748b}
  .btn-outline-warning{--bs-btn-color:#d97706; --bs-btn-border-color:#d97706; --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#d97706; --bs-btn-hover-border-color:#d97706;}
  .small-hint{font-size:.85rem;color:#6b7280;margin-top:2px}
  .content-wrap{padding-top:10px;}
  .content-wrap-tight{padding-top:10px;}
  .has-pending .content-wrap{padding-top:4px;}
  .has-pending .content-wrap-tight{padding-top:4px;}
  @media (min-width:768px){ .content-wrap{padding-top:14px;} }
  @media (min-width:768px){ .content-wrap-tight{padding-top:14px;} }
  @media (min-width:768px){ .has-pending .content-wrap{padding-top:8px;} }
  @media (min-width:768px){ .has-pending .content-wrap-tight{padding-top:8px;} }
  @media (min-width:1200px){ .content-wrap{padding-top:18px;} }
  @media (min-width:1200px){ .content-wrap-tight{padding-top:16px;} }
  @media (min-width:1200px){ .has-pending .content-wrap{padding-top:12px;} }
  @media (min-width:1200px){ .has-pending .content-wrap-tight{padding-top:10px;} }
  .input-group-blue .input-group-text{
    background:#eff6ff;
    border-color: rgba(37,99,235,.35);
    color:#1d4ed8;
    font-weight:700;
  }
  .input-group-blue .form-control{
    border-color: rgba(37,99,235,.35);
  }
  .input-group-blue .form-select{
    border-color: rgba(37,99,235,.35);
  }
  .input-group-blue .form-control:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
  }
  .input-group-blue .form-select:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
  }
  .input-blue{
    border-color: rgba(37,99,235,.35);
    background:#f8fafc;
  }
  .input-blue:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
    background:#fff;
  }
.recolha-card{
  display:flex;
  flex-direction:column;
  gap:8px;
}
  .recolha-section{
  background:#f8fbff;
  border:1px solid rgba(37,99,235,.18);
  border-radius:14px;
  padding:8px;
    box-shadow:0 6px 14px rgba(15,23,42,.05);
  }
  .recolha-section:first-of-type{
    padding:8px;
  }
  .recolha-section:first-of-type .recolha-section-title{
    margin-bottom:0;
  }
  .recolha-section:first-of-type .recolha-grid{
    gap:0;
  }
  .recolha-section:first-of-type .form-control{
    padding-top:4px;
    padding-bottom:4px;
    font-size:.86rem;
    height:32px;
    line-height:1.2;
    box-sizing:border-box;
  }
  .recolha-section:first-of-type .input-group-text{
    padding-top:4px;
    padding-bottom:4px;
    height:32px;
    line-height:1.2;
    box-sizing:border-box;
  }
  .recolha-section:first-of-type .input-group{
    align-items:center;
  }
  .recolha-section:first-of-type .recolha-field{
    min-width:0;
    width:100%;
    box-sizing:border-box;
  }
  .recolha-section:first-of-type .input-group,
  .recolha-section:first-of-type .product-picker,
  .recolha-section:first-of-type .product-dropdown{
    width:100%;
    max-width:100%;
  }
  .recolha-section:first-of-type .input-group{
    flex-wrap:nowrap;
  }
  .recolha-section:first-of-type .input-group > .form-control,
  .recolha-section:first-of-type .input-group > .form-select{
    flex:1 1 auto;
    min-width:0;
    width:1%;
  }
  .recolha-section:first-of-type .product-picker{
    min-width:0;
    box-sizing:border-box;
  }
  .recolha-section:first-of-type .product-picker > .form-control{
    width:100%;
    max-width:100%;
  }
  .recolha-section:first-of-type .input-group-text{
    flex:0 0 auto;
  }
  .recolha-section:first-of-type{
    overflow:hidden;
  }
.recolha-section-title{
    display:flex;
    align-items:center;
    gap:4px;
    font-size:.72rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:800;
    color:#1e3a8a;
  margin-bottom:4px;
}
.recolha-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:6px;
}
  .recolha-grid-single{
    grid-template-columns:1fr;
  }
.recolha-grid-tight{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:6px;
  align-items:stretch;
}
.recolha-mini-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:6px;
  align-items:stretch;
}
.recolha-mini-card{
  background:#fff;
  border:1px solid rgba(37,99,235,.2);
  border-radius:12px;
  padding:4px 8px;
  display:flex;
  flex-direction:column;
  height:100%;
}
.recolha-mini-card .form-control{
  margin-top:0;
  padding-top:4px;
  padding-bottom:4px;
  font-size:.86rem;
}
.recolha-mini-label{
  font-size:.58rem;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:700;
  color:#475569;
  margin-bottom:1px;
  white-space:nowrap;
}
  .recolha-mini-diff .recolha-mini-label{
    white-space:normal;
    line-height:1.2;
    font-size:.56rem;
    letter-spacing:.08em;
  }
.recolha-mini-card .small-hint{
  min-height:16px;
  margin-top:0;
}
  .recolha-mini-span{
    grid-column:span 2;
  }
  .recolha-mini-value{
    font-size:1rem;
    font-weight:800;
    color:#0f172a;
  }
  .recolha-mini-diff #diffText{
    font-size:1rem;
    font-weight:800;
    color:#0f172a;
  }
  .recolha-mini-diff .diff-pos,
  .recolha-mini-diff .diff-neg{
    font-size:1rem;
    font-weight:800;
  }
  .recolha-mini-info .form-control{
    border-color:rgba(37,99,235,.35);
    background:#f8fafc;
  }
  .recolha-mini-diff{
    display:flex;
    flex-direction:column;
    justify-content:center;
    height:100%;
  }
.recolha-diff-card{
  background:linear-gradient(135deg,#16a34a,#22c55e);
  color:#fff;
  border-radius:14px;
  padding:4px 8px;
  box-shadow:0 10px 20px rgba(22,163,74,.2);
  min-height:52px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  height:100%;
}
.recolha-diff-label{
  font-size:.72rem;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:700;
  opacity:.9;
  display:flex;
  align-items:center;
  gap:4px;
}
.recolha-diff-value{
  font-size:1.25rem;
  font-weight:800;
  margin-top:0;
}
.recolha-actions{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
}
  @media (min-width:768px){
    .recolha-grid{
      grid-template-columns:repeat(2, minmax(0,1fr));
    }
    .recolha-grid-single{
      grid-template-columns:1fr;
    }
    .recolha-mini-grid{
      grid-template-columns:repeat(3, minmax(0,1fr));
    }
    .recolha-actions{
      flex-wrap:nowrap;
    }
    .recolha-mini-span{
      grid-column:auto;
    }
  }
  .recolha-highlight{
    background:linear-gradient(180deg, rgba(37,99,235,.12), rgba(37,99,235,.03));
    border:1px solid rgba(37,99,235,.28);
    border-radius:12px;
    padding:4px 8px;
  }
  .recolha-highlight .form-label{
    font-weight:800;
    color:#1e3a8a;
  }
  .recolha-highlight .form-control{
    border-color:rgba(37,99,235,.55);
    background:#f8fbff;
  }
  .recolha-highlight .form-control:focus{
    border-color:#1d4ed8;
    box-shadow:0 0 0 .2rem rgba(37,99,235,.18);
    background:#fff;
  }
  .recolha-highlight .small-hint{
    color:#1e3a8a;
    font-weight:600;
  }
  .machine-form .form-label{
    font-weight:700;
    color:#1f2937;
  }
  .machine-form .form-control,
  .machine-form .form-select{
    border-color: rgba(37,99,235,.35);
    background:#f8fafc;
  }
  .machine-form .form-control:focus,
  .machine-form .form-select:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 .2rem rgba(37,99,235,.15);
    background:#fff;
  }
  .machine-form .form-control::placeholder{
    color:#94a3b8;
  }
  .machine-card-group h6,
  .machine-toolbar h6{
    font-weight:700;
    color:#111827;
  }
  .machine-card-group .badge{
    font-weight:600;
  }
  .sales-shell{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .sales-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    padding:8px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
  }
  .sales-tab.active{
    background:#2563eb;
    color:#fff;
    border-color:#2563eb;
  }
  .sales-view{ display:none; }
  .sales-view.active{ display:block; }
  .sales-card{
    border:1px solid rgba(37,99,235,.12);
    box-shadow:0 8px 18px rgba(15,23,42,.06);
    border-radius:14px;
  }
  .sales-section-title{
    font-size:.75rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:800;
    color:#1e3a8a;
    margin-bottom:8px;
  }
  .sales-divider{
    height:1px;
    background:#e2e8f0;
    margin:12px 0;
  }
  .sales-items-list{
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .sales-item-row{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 10px;
    border-radius:10px;
    background:#fff;
    border:1px solid #e2e8f0;
  }
  .sales-item-main{
    flex:1;
    min-width:0;
  }
  .sales-item-name{
    font-weight:700;
    color:#0f172a;
  }
  .sales-item-meta{
    font-size:.78rem;
    color:#64748b;
  }
  .sales-item-total{
    font-weight:700;
    color:#0f172a;
  }
  .sales-summary{
    display:grid;
    grid-template-columns:1fr auto;
    gap:6px 12px;
    align-items:center;
  }
  .sales-payments{
    display:grid;
    gap:6px;
  }
  .sales-actions{
    display:grid;
    gap:8px;
    margin-top:12px;
  }
  .sales-kpis{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(160px,1fr));
    gap:12px;
  }
  .sales-kpi{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    padding:10px;
    display:flex;
    flex-direction:column;
    gap:4px;
  }
  .sales-kpi span{ color:#64748b; font-size:.78rem; }
  .sales-kpi strong{ font-size:1.05rem; }
  .sales-list{
    display:flex;
    flex-direction:column;
    gap:8px;
  }
  .sales-list-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:8px 10px;
    border-radius:10px;
    background:#fff;
    border:1px solid #e2e8f0;
  }
  .sales-list-main{
    display:flex;
    flex-direction:column;
    gap:2px;
    min-width:0;
  }
  .sales-list-title{
    font-weight:700;
    color:#0f172a;
  }
  .sales-list-meta{
    font-size:.78rem;
    color:#64748b;
  }
  .sales-list-actions{
    display:flex;
    align-items:center;
    gap:8px;
  }
  .sales-list-item-canceled{
    border-color:#fed7aa;
    background:linear-gradient(90deg, rgba(255,237,213,0.6), rgba(255,255,255,0.8));
  }
  .settings-grid{
    display:grid;
    gap:16px;
    grid-template-columns: 1fr;
  }
  .settings-card{
    border:1px solid rgba(37,99,235,.12);
    box-shadow:0 8px 18px rgba(15,23,42,.06);
    border-radius:14px;
  }
  .settings-card-wide{
    grid-column: 1 / -1;
  }
  .settings-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:10px;
  }
  .settings-title{
    font-weight:700;
    color:#0f172a;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .settings-actions{
    margin-top:12px;
    display:flex;
    justify-content:flex-end;
    gap:8px;
  }
  .settings-muted{
    color:#64748b;
    font-size:.8rem;
    margin-top:10px;
  }
  .settings-switch{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:8px;
  }
  .settings-users{
    display:flex;
    flex-direction:column;
    gap:10px;
  }
  .settings-user-item{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 12px;
    border-radius:12px;
    border:1px solid #e2e8f0;
    background:#fff;
  }
  .settings-divider{
    height:1px;
    background:#e2e8f0;
    margin:14px 0;
  }
  .audit-log-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:260px;
    overflow:auto;
  }
  .audit-log-item{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:10px 12px;
    border-radius:12px;
    border:1px solid #e2e8f0;
    background:#fff;
  }
  .audit-log-meta{
    color:#64748b;
    font-size:.75rem;
  }
  .audit-log-details{
    color:#475569;
    font-size:.75rem;
    max-width:45%;
    text-align:right;
    word-break:break-word;
  }
  @media (min-width: 992px){
    .settings-grid{
      grid-template-columns: repeat(2, minmax(0,1fr));
    }
  }
  .machine-sections{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
  .machine-section-card{
    background:#f8fbff;
    border:1px solid rgba(37,99,235,.15);
    border-radius:12px;
    padding:12px;
  }
  .machine-section-title{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:.72rem;
    text-transform:uppercase;
    letter-spacing:.12em;
    font-weight:800;
    color:#1e3a8a;
    margin-bottom:8px;
  }
  .machine-code-field .form-control{
    font-weight:700;
    letter-spacing:.08em;
  }
  .machine-code-field .input-group-text{
    background:#dbeafe;
    color:#1d4ed8;
  }
  .machine-switch-card{
    border:1px dashed rgba(37,99,235,.25);
    border-radius:10px;
    padding:10px;
    background:#fff;
  }
  .machine-switch-label{
    font-weight:700;
    color:#1f2937;
  }
  .machine-switch-card .form-check-label{
    font-size:.9rem;
    color:#1f2937;
  }
  .machine-switch-card .form-check-input{
    cursor:pointer;
  }
  @media (max-width:576px){
    .machine-section-card{ padding:10px; }
  }
  .machine-toolbar .form-select,
  .machine-toolbar .form-control{
    width:100%;
  }
  .donated-inline{
    display:flex;
    align-items:flex-end;
    gap:6px;
    flex-wrap:nowrap;
  }
  .donated-inline .donated-toggle{
    min-width:0;
    flex:0 1 150px;
  }
  .donated-inline .donated-doses{
    min-width:0;
    flex:1 1 180px;
  }
  @media (max-width:576px){
    .donated-inline{ flex-wrap:wrap; }
  }
  .stock-overview .stock-row{
    display:flex;
    align-items:center;
    gap:12px;
    padding:6px 0;
    border-bottom:1px dashed #e5e7eb;
  }
  .stock-overview .stock-row:last-child{ border-bottom:0; }
  .stock-overview .stock-name{
    font-weight:700;
    min-width:160px;
  }
  .stock-overview .stock-meta{
    font-size:.85rem;
    color:#6b7280;
    min-width:100px;
    text-align:right;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:4px;
  }
  .stock-meta .stock-qty,
  .stock-meta .stock-min{
    display:inline-block;
    padding:2px 8px;
    border-radius:999px;
    font-weight:700;
    line-height:1.1;
  }
  .stock-meta .stock-qty{
    color:#0f172a;
    background:#e0f2fe;
    border:1px solid #38bdf8;
  }
  .stock-meta .stock-min{
    color:#92400e;
    background:#fef3c7;
    border:1px solid #f59e0b;
  }
  .stock-meta .stock-qty.low{
    color:#991b1b;
    background:#fee2e2;
    border-color:#ef4444;
  }
  .stock-bar{
    flex:1;
    height:10px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
  }
  .stock-bar-fill{
    height:100%;
    transition:width .2s ease;
  }
  .stock-bar-fill.green{ background:#16a34a; }
  .stock-bar-fill.yellow{ background:#f59e0b; }
  .stock-bar-fill.red{ background:#dc2626; }

  .product-picker{ position:relative; }
  .product-dropdown{
    --dropdown-item-height: 34px;
    position:absolute;
    left:0;
    right:0;
    top:100%;
    margin-top:6px;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 12px 24px rgba(15,23,42,.08);
    max-height:calc(var(--dropdown-item-height) * 5);
    overflow-y:auto;
    z-index:20;
    display:none;
  }
  .product-dropdown.show{ display:block; }
  .product-dropdown .dropdown-item{
    width:100%;
    text-align:left;
    padding:4px 8px;
    border:0;
    background:transparent;
    font-size:.86rem;
    min-height:var(--dropdown-item-height);
  }
  .product-dropdown .dropdown-item:hover{ background:#eff6ff; }

  /* ? Segurança: campo inválido */
  .input-invalid{
    border:2px solid #dc2626 !important;
    background:#fff1f2 !important;
  }

  /* Registros: melhoria visual */
  .min-w-0{min-width:0}
  .no-table .card{border-radius:14px}
  .records-chip{font-size:.75rem}
 
  /* ... TODO o CSS que já existe acima ... */

  /* Menu offcanvas - botoes claros com texto preto */
.offcanvas .btn-outline-light {
  --bs-btn-color: #0f172a;
  --bs-btn-border-color: #e2e8f0;
  --bs-btn-hover-color: #0f172a;
  --bs-btn-hover-bg: #f1f5f9;
  --bs-btn-hover-border-color: #cbd5f5;
}
/* ? Animação suave do menu (offcanvas) */
.offcanvas.offcanvas-start{
  transform: translateX(-100%);           /* estado fechado */
  transition: transform .28s ease, opacity .28s ease;
  opacity: .98;
}

.offcanvas.offcanvas-start.show{
  transform: translateX(0);              /* estado aberto */
  opacity: 1;
}

/* ? Fundo (backdrop) mais suave */
.offcanvas-backdrop{
  transition: opacity .28s ease !important;
  opacity: 0;
}
.offcanvas-backdrop.show{
  opacity: .45;                          /* pode ajustar */
}

/* Login */
.auth-locked header,
.auth-locked #sideMenu,
.auth-locked #pendingBar,
.auth-locked #libWarning{
  display:none !important;
}
.login-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2.5rem 1.5rem;
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbeafe 0%, rgba(219,234,254,0) 60%),
    radial-gradient(900px 400px at 110% 10%, #bfdbfe 0%, rgba(191,219,254,0) 60%),
    #f8fafc;
}
.login-card{
  width:min(420px, 100%);
  border:1px solid #e2e8f0;
  padding-top:1.25rem !important;
}
  .login-brand{
    display:flex;
    align-items:center;
    gap:.75rem;
  }
  .login-brand.compact-brand{margin-bottom:8px !important;}
  .login-title{margin-top:0;margin-bottom:.5rem;}
  .login-logo{height:clamp(48px,7.2vw,72px);width:auto;display:block;}
.login-card h4{
  font-weight:700;
  letter-spacing:.2px;
}




