/* ── Topstar Courier Express — Admin CSS ─────────────────────────────────── */

:root {
  --tce-navy:      #0f2d5e;
  --tce-navy-dark: #091e40;
  --tce-gold:      #f5a623;
  --tce-text:      #1a1a2e;
  --tce-muted:     #6b7280;
  --tce-bg:        #f4f6fb;
  --tce-white:     #ffffff;
  --tce-border:    #e2e8f0;
  --tce-sidebar-w: 240px;
  --tce-topbar-h:  56px;
  --tce-radius:    10px;
}

/* ── Reset / Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--tce-bg);
  color: var(--tce-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.tce-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--tce-topbar-h);
  background: var(--tce-white);
  border-bottom: 1px solid var(--tce-border);
  z-index: 1040;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.tce-brand-text {
  font-size: 15px;
  color: var(--tce-navy);
  letter-spacing: .3px;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.tce-layout {
  margin-top: var(--tce-topbar-h);
  min-height: calc(100vh - var(--tce-topbar-h));
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.tce-sidebar {
  width: var(--tce-sidebar-w);
  min-height: calc(100vh - var(--tce-topbar-h));
  background: var(--tce-navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--tce-topbar-h);
  flex-shrink: 0;
  transition: transform .25s ease;
}

.tce-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 14px;
}
.tce-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}
.tce-company-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--tce-white);
  line-height: 1.2;
}
.tce-company-sub {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  letter-spacing: .5px;
}

.tce-divider {
  border-color: rgba(255,255,255,.12);
  margin: 0 16px 8px;
}

/* ── Sidebar Nav ───────────────────────────────────────────────────────────── */
.tce-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex: 1;
}
.tce-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.tce-nav-link:hover {
  background: rgba(255,255,255,.1);
  color: var(--tce-white);
}
.tce-nav-link.active {
  background: var(--tce-gold);
  color: var(--tce-navy-dark);
  font-weight: 600;
}
.tce-nav-icon { font-size: 16px; flex-shrink: 0; }

.tce-sidebar-footer {
  padding: 10px 10px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ── Main Content ──────────────────────────────────────────────────────────── */
.tce-main { overflow-x: hidden; }
.tce-content {
  padding: 28px 28px;
  max-width: 1400px;
}

/* ── Page title ────────────────────────────────────────────────────────────── */
.tce-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--tce-navy);
  margin-bottom: 4px;
}
.tce-page-sub {
  font-size: 13px;
  color: var(--tce-muted);
  margin-bottom: 24px;
}

/* ── Stat Cards ────────────────────────────────────────────────────────────── */
.tce-stat {
  background: var(--tce-white);
  border: 1px solid var(--tce-border);
  border-radius: var(--tce-radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .15s;
}
.tce-stat:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.tce-stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tce-stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.tce-stat-label { font-size: 12px; color: var(--tce-muted); margin-top: 3px; }

/* Icon colour helpers */
.icon-navy   { background: #e8eef8; color: var(--tce-navy); }
.icon-green  { background: #e6f9f0; color: #1a9e5f; }
.icon-gold   { background: #fff4e0; color: #c07c0a; }
.icon-red    { background: #fdecea; color: #c0392b; }
.icon-purple { background: #f0ebff; color: #6c3fc5; }
.icon-teal   { background: #e0f7fa; color: #0097a7; }

/* ── Cards / Panels ────────────────────────────────────────────────────────── */
.tce-card {
  background: var(--tce-white);
  border: 1px solid var(--tce-border);
  border-radius: var(--tce-radius);
  overflow: hidden;
}
.tce-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--tce-border);
  font-weight: 600;
  font-size: 14px;
  color: var(--tce-navy);
}
.tce-card-body { padding: 20px; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.tce-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tce-table th {
  padding: 10px 14px;
  background: #f8fafc;
  color: var(--tce-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--tce-border);
  white-space: nowrap;
}
.tce-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tce-border);
  vertical-align: middle;
}
.tce-table tbody tr:hover { background: #f8fafc; }
.tce-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.tce-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-transit   { background: #fff4e0; color: #b8860b; }
.badge-delivered { background: #e6f9f0; color: #1a9e5f; }
.badge-pending   { background: #e8eef8; color: var(--tce-navy); }
.badge-failed    { background: #fdecea; color: #c0392b; }
.badge-paid      { background: #e6f9f0; color: #1a9e5f; }
.badge-unpaid    { background: #fdecea; color: #c0392b; }
.badge-active    { background: #e6f9f0; color: #1a9e5f; }
.badge-offline   { background: #f1f1f1; color: #888; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.tce-btn-primary {
  background: var(--tce-navy);
  color: var(--tce-white) !important;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
}
.tce-btn-primary:hover { background: var(--tce-navy-dark); }
.tce-btn-gold {
  background: var(--tce-gold);
  color: var(--tce-navy-dark) !important;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}
.tce-btn-gold:hover { background: #e09510; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.tce-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tce-navy);
  margin-bottom: 5px;
}
.form-control, .form-select {
  font-size: 13.5px;
  border-color: var(--tce-border);
  border-radius: 7px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--tce-navy);
  box-shadow: 0 0 0 3px rgba(15,45,94,.12);
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--tce-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tce-border);
}

/* ── Tracking timeline ─────────────────────────────────────────────────────── */
.tce-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.tce-timeline::before {
  content: '';
  position: absolute;
  left: 17px; top: 0; bottom: 0;
  width: 2px;
  background: var(--tce-border);
}
.tce-timeline li {
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}
.tce-timeline li:last-child { padding-bottom: 0; }
.tl-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  z-index: 1;
  background: var(--tce-white);
  border: 2px solid var(--tce-border);
}
.tl-dot.active { background: var(--tce-navy); color: #fff; border-color: var(--tce-navy); }
.tl-body { padding-top: 6px; }
.tl-title { font-weight: 600; font-size: 13.5px; }
.tl-meta  { font-size: 12px; color: var(--tce-muted); margin-top: 2px; }

/* ── Responsive sidebar ────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .tce-sidebar {
    position: fixed;
    top: var(--tce-topbar-h);
    left: 0; bottom: 0;
    z-index: 1030;
    transform: translateX(-100%);
  }
  .tce-sidebar.open { transform: translateX(0); }
  .tce-main { margin-left: 0 !important; }
  .tce-content { padding: 18px 16px; }
}
