:root{
  --bg:#f5f7fa;
  --panel:#ffffff;
  --txt:#0f172a;
  --muted:#64748b;
  --primary:#0f3d4c;
  --primary-600:#135062;
  --outline:#dbe3ee;
  --chip:#e9eef6;
  --success:#22c55e;
  --warning:#f59e0b;
  --danger:#ef4444;
  --rose:#f43f5e;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--txt);
  background:var(--bg);
}

/* Top bar */
.topbar{
  position:sticky; top:0; z-index:10;
  background:#0c2f3b; color:#fff; border-bottom:1px solid rgba(255,255,255,.08);
}
.nav{
  display:flex; gap:18px; align-items:center; height:52px;
  padding:0 14px; overflow-x:auto;
}
.nav-item{color:#d8e6ee; text-decoration:none; font-weight:600; white-space:nowrap}
.nav-item .ico{margin-right:6px}

/* Layout */
.container{max-width:1180px; margin:24px auto; padding:0 14px}
.panel{
  background:var(--panel); border:1px solid var(--outline);
  border-radius:12px; padding:20px 20px 28px;
  box-shadow: 0 6px 18px rgba(16,24,40,.06);
}
.panel-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px;
}
h1{margin:0 0 6px; font-size:26px; letter-spacing:.2px}
.subtitle{margin:0; color:var(--muted)}
.head-actions{display:flex; gap:8px}

/* Buttons / Inputs */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; height:40px; padding:0 14px; border-radius:10px;
  font-weight:700; letter-spacing:.2px; border:1px solid transparent; cursor:pointer;
}
.btn-primary{background:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-600)}
.btn-outline{background:#fff; border-color:var(--outline); color:#0f172a}
.btn-outline:hover{background:#f7fafc}
.btn-icon{border:none; background:transparent; cursor:pointer; font-size:18px}

.input, select.input, textarea.input{
  width:100%; height:42px; padding:10px 12px; border:1px solid var(--outline);
  border-radius:10px; background:#fff; color:var(--txt);
}
textarea.input{height:auto; resize:vertical}

.form-group{display:flex; flex-direction:column; gap:8px}
.grid-2{display:grid; grid-template-columns:1fr 1fr}
.gap{gap:16px}

.destino-title{
  margin:6px 0 14px;
  font-weight:800; color:var(--primary); letter-spacing:.4px
}

.table-wrap{width:100%; overflow:auto; border:1px solid var(--outline); border-radius:12px; margin-top:8px}
.table{width:100%; border-collapse:separate; border-spacing:0}
.table thead th{
  text-align:left; font-size:14px; color:#334155; background:#f2f6fb;
  position:sticky; top:0; z-index:1; padding:12px; border-bottom:1px solid var(--outline)
}
.table tbody td{padding:12px; border-bottom:1px solid var(--outline)}
.table tfoot td{padding:12px; background:#fafcff; border-top:1px solid var(--outline)}
.sum-label{text-align:right; font-weight:800; color:#0b2230}
.sum-val{text-align:left; font-weight:900}

/* Tags de origem/destino (lista) */
.tags{
  display:flex; flex-wrap:wrap; gap:6px;
}
.tag{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; line-height:1; padding:6px 10px;
  border-radius:999px; border:1px solid var(--outline); background:#eef4f7; font-weight:700;
}
.tag .lbl{opacity:.8}
.tag .val{font-weight:800}
.tag.origem{background:#eaf2ff; color:#1d4ed8}
.tag.destino{background:#e9fbea; color:#047857}

/* Actions under table */
.actions{display:flex; gap:10px; margin-top:14px}

/* List */
.list-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px; margin:10px 0 12px;
}
.btn-group{display:flex; gap:8px}
.chip{
  background:var(--chip); color:#0b2230; border:none; height:34px; padding:0 12px;
  border-radius:10px; font-weight:700; cursor:pointer;
}
.search{display:flex; gap:8px; align-items:center}

/* Status pill */
.pill{display:inline-flex; align-items:center; height:32px; padding:0 12px; border-radius:999px; font-weight:800; border:1px solid var(--outline); background:#eef4f7}
.pill.aprovar{background:#eaf2ff; color:#1d4ed8}
.pill.aprovado{background:#e9fbea; color:#047857}

/* Row actions */
.row-actions{display:inline-flex; gap:8px; align-items:center}
.icon-btn{
  width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--outline); border-radius:8px; background:#fff; cursor:pointer;
}
.icon-btn.danger{background:#fee2e2; border-color:#fecaca}
.icon-btn:hover{background:#f7fafc}

/* Modal (alto z-index + trava scroll) */
.modal{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background:rgba(15,18,23,.62); z-index:9999;
}
.modal[aria-hidden="false"]{display:flex}
.modal-dialog{
  width:min(1100px, 96vw); background:#fff; border-radius:16px; border:1px solid var(--outline);
  box-shadow:0 30px 80px rgba(0,0,0,.25); overflow:hidden; position:relative; z-index:10000;
}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:18px 18px; border-bottom:1px solid var(--outline)}
.modal-body{padding:18px; max-height:min(70vh, 70svh); overflow:auto}
.modal-foot{padding:16px 18px; border-top:1px solid var(--outline); display:flex; justify-content:flex-end}
.search-modal{display:flex; gap:10px; margin-bottom:10px}

/* Travar scroll do body quando modal aberto */
body.modal-open{overflow:hidden}

/* Toast */
.toast{
  position:fixed; bottom:20px; right:20px; min-width:220px; max-width:420px;
  padding:12px 14px; border-radius:12px; border:1px solid var(--outline);
  background:#fff; box-shadow:0 10px 28px rgba(0,0,0,.12); display:none; font-weight:700; z-index:11000;
}
.toast.show{display:block}

/* Helpers */
.text-muted{color:var(--muted)}
.text-right{text-align:right}
.w-100{width:100%}
