:root{
  --bg:#f4f6f5;
  --panel:#fff;
  --text:#17201a;
  --muted:#6f7b73;
  --line:#e0e6e2;
  --green:#1f6c43;
  --green2:#174f33;
  --soft:#eaf4ee;
  --red:#a43b3b;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.shell{
  display:grid;
  grid-template-columns:240px 1fr;
  min-height:100vh;
}

aside{
  background:#14201a;
  color:#fff;
  padding:22px 16px;
  display:flex;
  flex-direction:column;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:28px;
}

.mark{
  width:42px;
  height:42px;
  border-radius:11px;
  background:#fff;
  color:var(--green2);
  display:grid;
  place-items:center;
  font-weight:900;
  font-size:21px;
}

.brand b{
  display:block;
}

.brand small{
  color:#b9c8bf;
}

nav{
  display:grid;
  gap:7px;
}

nav a,
nav span{
  padding:11px 12px;
  border-radius:9px;
  color:#c7d1cb;
  text-decoration:none;
}

nav a.active{
  background:#26362e;
  color:#fff;
}

.env{
  margin-top:auto;
  color:#aebdb4;
  font-size:12px;
}

main{
  padding:28px 34px 60px;
  min-width:0;
}

header h1{
  margin:3px 0 22px;
  font-size:28px;
}

header small{
  letter-spacing:.12em;
  color:var(--muted);
  font-weight:700;
}

.legal-banner{
  background:#fff7d9;
  border:1px solid #eadc9c;
  border-radius:12px;
  padding:13px 15px;
  margin-bottom:18px;
  line-height:1.5;
}

.panel{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:22px;
  margin-bottom:18px;
  box-shadow:0 8px 26px rgba(20,30,24,.05);
}

.panel-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.panel-title h2{
  margin:6px 0 18px;
}

.pill{
  display:inline-flex;
  background:var(--soft);
  color:var(--green2);
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
}

h3{
  margin:24px 0 10px;
}

.grid{
  display:grid;
  gap:14px;
}

.grid.two{
  grid-template-columns:1fr 1fr;
}

.grid.three{
  grid-template-columns:repeat(3,1fr);
}

label{
  display:grid;
  gap:6px;
  font-size:13px;
  font-weight:700;
}

input,
textarea{
  width:100%;
  border:1px solid #d9e1dc;
  border-radius:9px;
  padding:10px 11px;
  background:#fbfcfb;
  font:inherit;
}

textarea{
  min-height:72px;
  resize:vertical;
}

fieldset{
  border:1px solid var(--line);
  border-radius:13px;
  padding:15px;
}

legend{
  font-weight:800;
  padding:0 6px;
}

.shipment{
  margin-bottom:11px;
}

.hint,
.optional{
  color:var(--muted);
  font-size:12px;
}

button,
.mini,
.primary,
.secondary,
.whatsapp,
.danger{
  border:0;
  border-radius:9px;
  padding:10px 14px;
  font-weight:750;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font:inherit;
  cursor:pointer;
}

.primary{
  background:var(--green);
  color:#fff;
}

.secondary,
.soft{
  background:#fff;
  border:1px solid var(--line);
  color:var(--text);
}

.soft{
  padding:8px 10px;
}

.whatsapp{
  background:#1fa855;
  color:#fff;
}

.danger{
  background:var(--red);
  color:#fff;
}

.actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
}

.table-wrap{
  overflow:auto;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,
td{
  padding:11px 9px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:13px;
}

th{
  color:var(--muted);
  font-size:11px;
  text-transform:uppercase;
}

.empty{
  text-align:center;
  color:var(--muted);
}

.status{
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  background:#eef1ef;
}

.status.issued{
  background:#e7f4eb;
  color:#17613a;
}

.status.cancelled{
  background:#fae8e8;
  color:#8e2929;
}

.status.draft{
  background:#fff3d5;
  color:#7b5b0c;
}

.detail-body{
  padding:24px;
}

.detail-top{
  max-width:980px;
  margin:0 auto 14px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}

.share{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}

.document{
  max-width:980px;
  margin:auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  padding:30px;
  box-shadow:0 10px 35px rgba(20,30,24,.06);
}

.doc-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  border-bottom:3px solid #17201a;
  padding-bottom:16px;
}

.wordmark{
  font-size:29px;
  font-weight:900;
  letter-spacing:.06em;
}

.doc-head small{
  color:var(--muted);
}

.deca-title{
  font-weight:900;
  font-size:28px;
  text-align:right;
}

.deca-title small{
  display:block;
  font-size:11px;
  font-weight:500;
}

.doc-meta{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:16px 0;
}

.doc-meta div,
.box,
.doc-grid>div,
.shipment-card{
  border:1px solid var(--line);
  border-radius:10px;
  padding:11px;
}

.doc-meta small,
.doc-grid small{
  display:block;
  color:var(--muted);
  text-transform:uppercase;
  font-size:10px;
  letter-spacing:.06em;
  margin-bottom:4px;
}

.doc-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.shipment-card{
  margin-bottom:10px;
}

.trace{
  margin-top:22px;
  font-size:11px;
  color:var(--muted);
  line-height:1.5;
  word-break:break-all;
}

.control-panel,
.audit{
  max-width:980px;
  margin:14px auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
}

.control-panel form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.inline-form{
  margin-top:10px;
}

.audit div{
  padding:7px 0;
  border-bottom:1px solid var(--line);
  font-size:12px;
}

@media(max-width:850px){

  .shell{
    grid-template-columns:1fr;
  }

  aside{
    min-height:auto;
  }

  .env{
    display:none;
  }

  .grid.two,
  .grid.three,
  .doc-grid,
  .doc-meta{
    grid-template-columns:1fr;
  }

  main{
    padding:20px 14px;
  }

  .detail-body{
    padding:14px;
  }

  .detail-top{
    align-items:flex-start;
    flex-direction:column;
  }
}
