:root {
  --admin-primary: #4D148C;
  --admin-accent: #FF6200;
  --admin-sidebar-bg: #1a0540;
  --admin-sidebar-hover: rgba(255,255,255,.07);
  --admin-sidebar-active: var(--admin-accent);
}

body { background: #f2f4f8; font-family: 'Segoe UI', Arial, sans-serif; }

/* Sidebar */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--admin-sidebar-bg);
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width .25s;
}
.admin-sidebar .sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.admin-sidebar .brand-name { color: #fff; font-size: 1.1rem; font-weight: 700; letter-spacing: .5px; }
.admin-sidebar .brand-name span { color: var(--admin-accent); }
.admin-sidebar .brand-logo { max-height: 40px; }
.admin-sidebar .nav-section { padding: 10px 0; }
.admin-sidebar .nav-section-title { color: rgba(255,255,255,.35); font-size: .68rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 20px 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s;
}
.sidebar-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: var(--admin-sidebar-hover); color: #fff; border-left-color: var(--admin-accent); }
.sidebar-nav a.active { background: rgba(255,98,0,.12); color: #fff; border-left-color: var(--admin-accent); font-weight: 700; }

/* Main content */
.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-topbar .page-title { font-size: 1.15rem; font-weight: 700; color: var(--admin-primary); }
.admin-content { padding: 28px; flex: 1; }

/* Cards */
.stat-card { border-radius: 10px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.stat-card .stat-val { font-size: 2.2rem; font-weight: 800; }
.stat-card .stat-lbl { font-size: .85rem; opacity: .85; font-weight: 500; }
.stat-card .stat-icon { position: absolute; right: 16px; bottom: 12px; font-size: 3.5rem; opacity: .18; }
.stat-purple { background: linear-gradient(135deg, #4D148C, #7c3aed); }
.stat-orange { background: linear-gradient(135deg, #FF6200, #ff8c00); }
.stat-green  { background: linear-gradient(135deg, #10b981, #059669); }
.stat-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-red    { background: linear-gradient(135deg, #ef4444, #dc2626); }

.admin-card { background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.admin-card .card-header { background: none; border-bottom: 1px solid #f0f0f0; padding: 16px 20px; font-weight: 700; color: var(--admin-primary); }

/* Table */
.admin-table { font-size: .88rem; }
.admin-table th { background: #f8f4ff; color: var(--admin-primary); font-weight: 700; border-bottom: 2px solid #e9e0ff; }
.admin-table td { vertical-align: middle; }
.admin-table tbody tr:hover { background: #faf8ff; }

/* Forms */
.form-label { font-weight: 600; color: #444; font-size: .88rem; }
.form-control:focus, .form-select:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 .2rem rgba(77,20,140,.15); }

/* Buttons */
.btn-admin-primary { background: var(--admin-primary); color: #fff; border: none; }
.btn-admin-primary:hover { background: #3a0f6e; color: #fff; }
.btn-admin-accent { background: var(--admin-accent); color: #fff; border: none; }
.btn-admin-accent:hover { background: #e05500; color: #fff; }

/* Avatar */
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.admin-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: var(--admin-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; }

/* Tracking timeline in admin */
.tracking-event { border-left: 3px solid var(--admin-primary); padding-left: 16px; margin-bottom: 16px; position: relative; }
.tracking-event::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--admin-primary); position: absolute; left: -6.5px; top: 4px; }

/* Badge status */
.badge-pending  { background: #6c757d; }
.badge-in_transit { background: #4D148C; }
.badge-delivered  { background: #10b981; }
.badge-exception  { background: #ef4444; }

/* Mail Viewer */
.mail-list-item { border-bottom: 1px solid #f0f0f0; padding: 12px 16px; cursor: pointer; transition: background .15s; }
.mail-list-item:hover { background: #f8f4ff; }
.mail-list-item.unread { font-weight: 700; }
.mail-preview { border-left: 4px solid var(--admin-primary); background: #f8f4ff; padding: 20px; border-radius: 0 8px 8px 0; }

@media(max-width:900px){
  .admin-sidebar{width:0;overflow:hidden;}
  .admin-main{margin-left:0;}
}
