/* --- Base --- */
:root{
  --bg:#0b1020;
  --panel:#161c34;
  --soft:#0e1430;
  --border:#2a3570;
  --text:#f5f7ff;
  --muted:#a9b1d6;
  --brand1:#2a48aa;
  --brand2:#20398a;
  --ok:#138a59;
  --warn:#b97b16;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* --- Top bar --- */
.topbar{
  position:sticky; top:0; z-index:50;
  background:#111733; border-bottom:1px solid #1e2a55;
  padding:12px 16px; text-align:center; font-weight:600;
}

/* --- Layout wrappers --- */
.wrap{max-width:1100px;margin:0 auto;padding:16px}
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 6px 22px rgba(0,0,0,.25);
  margin-bottom:16px; overflow:hidden;
}
.content{padding:14px}
h2{margin:0 0 12px 0;font-size:18px}

/* --- Controls --- */
.grid{display:grid; gap:10px}
.cols-3{grid-template-columns:1fr 1fr auto}
@media(max-width:768px){ .cols-3{grid-template-columns:1fr} }
.controls{margin-bottom:8px}

.label{font-size:12px;color:var(--muted);margin-bottom:4px}
input,select,button{
  padding:10px 12px;border-radius:10px;
  border:1px solid #273162;background:var(--soft);
  color:var(--text); font-size:14px; outline:none;
}
input::placeholder{color:#8da0e6}
button{
  cursor:pointer; font-weight:600;
  background:linear-gradient(180deg,var(--brand1),var(--brand2));
  border-color:#2d4ebd; color:#fff; transition:.2s;
}
button:hover{transform:translateY(-1px); box-shadow:0 6px 16px rgba(0,0,0,.25)}
.btn.primary{background:linear-gradient(180deg,#3555c0,#2a48aa)}
.align-end{display:flex;align-items:flex-end}

/* --- Table --- */
.table-wrap{width:100%; overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px;min-width:720px}
th,td{padding:10px;border-bottom:1px solid #223068;text-align:left}
th{
  font-size:12px;color:#cbd5ff;font-weight:700;letter-spacing:.4px;
  background:#111733; position:sticky; top:0; z-index:2;
}
tr:hover{background:#1b2150}
tr.hl{background:#243069}
.muted{color:var(--muted);font-size:12px}

/* --- Status chips --- */
.status{
  display:inline-block; padding:3px 8px; border-radius:999px;
  font-size:12px; border:1px solid #2a3570;
}
.status.before_delivery{background:#1a254d;color:#d3e2ff}
.status.sent_for_delivery{background:#16324c;color:#cfe9ff}
.status.completed{background:rgba(74,222,128,.15);color:#dcfce7;border-color:#256f46}

/* --- Detail panel --- */
#d_items{margin:10px 0 2px 18px}
#d_items li{margin:4px 0}
.total-pill{
  display:inline-block; margin-top:6px; padding:6px 12px; border-radius:999px;
  background:#243069; border:1px solid #2a3570; font-weight:600;
}

/* --- Mobile enhancements --- */
@media(max-width:600px){
  .wrap{padding:10px}
  .content{padding:12px}
  input,select,button{font-size:15px}
}

/* --- Standard header used on all pages --- */
.hero{
  background:#111733;
  border-bottom:1px solid #1e2a55;
  padding:10px 16px;
}
.brand{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  color:#e8ebff;
}
.brand b{ font-size:16px; }

/* --- Navbar --- */
.navbar{
  position:sticky; top:0; z-index:60;
  background:#0f1530;
  border-bottom:1px solid #1e2a55;
}
.nav-inner{
  max-width:1100px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 16px; gap:12px;
}
.brand{
  color:#e8ebff; font-weight:700; text-decoration:none;
}
.links{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.nav-link{
  color:#cbd5ff; text-decoration:none; padding:8px 10px; border-radius:10px;
}
.nav-link:hover{background:#1a2148}
.nav-link.active{background:#243069; border:1px solid #2a3570}

/* --- Anchor buttons (so <a class="btn"> looks like a button) --- */
a.btn{
  display:inline-block; text-decoration:none; color:#fff;
  background:linear-gradient(180deg,var(--brand1),var(--brand2));
  border:1px solid #2d4ebd; border-radius:10px; padding:10px 14px; font-weight:600;
}
a.btn:hover{transform:translateY(-1px); box-shadow:0 6px 16px rgba(0,0,0,.25)}
a.btn.primary{background:linear-gradient(180deg,#3555c0,#2a48aa)}

/* --- Small button variant for Logout --- */
.btn.small{padding:8px 12px; font-size:14px; border-radius:12px}
