:root {
  --navy: #10233d;
  --navy-light: #17304f;
  --gold: #c9a24b;
  --gold-light: #e0c07a;
  --bg: #f4f6f9;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #d64545;
  --success: #2e8b57;
  --border: #e2e6ec;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { text-decoration: none; color: inherit; }

/* ---- Top Nav ---- */
.topnav {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.topnav .brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--gold-light);
}
.topnav .brand span { color: #fff; font-weight: 400; font-size: 13px; display:block; }
.topnav nav a {
  color: #dbe2ec;
  margin-left: 18px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: .2s;
}
.topnav nav a:hover, .topnav nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.topnav .userbox { font-size: 13px; color: #cfd8e3; }
.topnav .userbox b { color: var(--gold-light); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 28px auto; padding: 0 20px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--navy); }
.page-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h3 { margin-top: 0; color: var(--navy); font-size: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px;}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #fbfcfd;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); background: #fff; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 7px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align:center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: #1f2937; }
.btn-gold:hover { background: var(--gold-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { background: #f8f9fb; color: var(--navy); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #fafbfd; }

/* ---- Badges ---- */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fdecea; color: #c0392b; }
.badge-progress { background: #fff4dc; color: #b7791f; }
.badge-completed { background: #e3f6e8; color: #1e7e34; }
.badge-delivered { background: #e6ecfb; color: #2c4ea3; }

/* ---- Stat cards ---- */
.stat { background:#fff; border-radius: var(--radius); border:1px solid var(--border); padding: 18px 20px; }
.stat .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing:.4px; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--navy); margin-top: 6px; }
.stat.gold .value { color: #a8791f; }
.stat.green .value { color: var(--success); }
.stat.red .value { color: var(--danger); }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 7px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e3f6e8; color: #1e7e34; }
.alert-error { background: #fdecea; color: #c0392b; }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy), #0b1626);
}
.login-box {
  background: #fff; padding: 40px 36px; border-radius: 14px; width: 360px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.login-box h1 { font-size: 20px; color: var(--navy); margin-bottom: 2px; }
.login-box p.sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box .btn { width: 100%; }
.role-tag { display:inline-block; margin-top:14px; font-size:12px; color: var(--muted); text-align:center; width:100%; }

/* ---- Search bar ---- */
.searchbar { display:flex; gap: 10px; margin-bottom: 20px; }
.searchbar input { margin-bottom: 0; flex: 1; }

/* ---- Print invoice ---- */
.invoice-sheet { max-width: 800px; margin: 20px auto; background:#fff; padding: 40px; border:1px solid var(--border); }
.invoice-head { display:flex; justify-content:space-between; border-bottom: 3px solid var(--navy); padding-bottom: 16px; margin-bottom: 20px;}
.invoice-head h2 { color: var(--navy); margin:0 0 4px 0; }
.invoice-meta { text-align:right; font-size:13px; color: var(--muted); }
.invoice-sheet table th { background:#eef1f6; }
.invoice-totals { width: 300px; margin-left: auto; margin-top: 14px; }
.invoice-totals td { border: none; padding: 5px 0; }
.invoice-totals tr.grand td { font-size: 17px; font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); padding-top:8px;}
.print-actions { text-align:center; margin: 20px 0; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .invoice-sheet { border: none; margin:0; padding:0; max-width:100%; }
}

.muted { color: var(--muted); font-size: 13px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.flex-between { display:flex; justify-content: space-between; align-items:center; }
