/* Package Tracker — basic, dependency-free styling */

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #6b7685;
  --border: #e2e6ec;
  --primary: #2f6feb;
  --primary-dark: #2454b8;
  --green: #1f9d55;
  --red: #d64545;
  --purple: #7c5cff;
  --gray: #8a94a3;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 12px; }

/* ---------- Layout: admin shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: #17223b;
  color: #cfd7e6;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand { padding: 20px 16px; font-weight: 700; font-size: 16px; color: #fff; }
.sidebar-nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; flex: 1; }
.sidebar-nav a { color: #cfd7e6; padding: 10px 12px; border-radius: 6px; }
.sidebar-nav a:hover { background: #223259; text-decoration: none; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 16px; border-top: 1px solid #223259; font-size: 13px; }
.sidebar-user { margin-bottom: 6px; color: #fff; }
.btn-link { color: #9fb4e0; }

.main-content { flex: 1; padding: 28px 32px; max-width: 1200px; }

/* ---------- Layout: agent shell (mobile-friendly) ---------- */
.agent-body { background: var(--bg); }
.agent-shell { max-width: 760px; margin: 0 auto; }
.agent-topbar {
  background: #17223b; color: #fff; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.agent-topbar-brand { font-weight: 700; }
.agent-topbar-brand .tag { background: var(--primary); font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
.agent-topbar-user { font-size: 13px; }
.agent-topbar-user a { color: #cfe0ff; }
.agent-content { padding: 20px 16px 60px; }

/* ---------- Cards / tables ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fafbfd; }

.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.table-toolbar form { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-gray { background: #eef0f3; color: var(--gray); }
.badge-blue { background: #e6eefc; color: var(--primary); }
.badge-purple { background: #efe9ff; color: var(--purple); }
.badge-green { background: #e6f7ec; color: var(--green); }
.badge-red { background: #fbe9e9; color: var(--red); }

/* ---------- Forms ---------- */
label { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.role-toggle { display: flex; gap: 16px; font-weight: 400; margin: 4px 0 10px; }
.role-toggle label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.role-toggle input { width: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #f5f6f8; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Alerts ---------- */
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #e6f7ec; color: #16743d; }
.alert-error, .alert-danger { background: #fbe9e9; color: #a12f2f; }
.alert-info { background: #e6eefc; color: var(--primary-dark); }

/* ---------- Auth pages ---------- */
.centered-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #eef1f6; }
.auth-card { background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 8px 30px rgba(20,30,60,.08); width: 360px; }
.auth-brand { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-subtitle { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.auth-hint { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.6; }

/* ---------- Task detail / timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 22px; border-left: 2px solid var(--border); position: relative; margin-left: 6px; }
.timeline li:last-child { border-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary);
}
.timeline .ts { color: var(--muted); font-size: 12px; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 10px; }
.image-grid figure { margin: 0; }
.image-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.image-grid figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: center; }

.task-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 12px 0 20px; }
.task-meta .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.task-meta .v { font-size: 15px; font-weight: 600; margin-top: 2px; }

.pay-highlight { background: #f0f6ff; border: 1px solid #d3e3fd; border-radius: 8px; padding: 16px; margin: 16px 0; }
.pay-highlight .amount { font-size: 28px; font-weight: 700; color: var(--primary-dark); }

.tracking-hero { text-align: center; padding: 40px 16px 10px; }
.tracking-code-box { max-width: 420px; margin: 0 auto; }

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
}
