* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #e85d04;
  --primary-dark: #c44d03;
  --secondary: #264653;
  --accent: #2a9d8f;
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-w: 250px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --radius: 10px;
}

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary), var(--primary-dark));
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .logo-icon {
  width: 60px; height: 60px; background: var(--primary); color: white;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 12px;
}
.login-logo h2 { font-size: 22px; }
.login-logo p { color: var(--text-light); font-size: 14px; }

.login-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 12px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: 14px; outline: none;
  transition: border-color 0.3s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.3s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.dashboard { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); background: var(--secondary); color: white;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100; transition: transform 0.3s;
}

.sidebar-header {
  padding: 20px; display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon-sm {
  width: 36px; height: 36px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px;
  transition: all 0.3s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.1); color: white; border-left-color: var(--primary); }
.nav-item i { width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; transition: color 0.3s;
}
.sidebar-footer a:hover { color: white; }

.main-content { flex: 1; margin-left: var(--sidebar-w); }

.topbar {
  background: white; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 18px; flex: 1; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }

.content { padding: 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }

.stat-card {
  background: white; border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.stat-icon.orders { background: #dbeafe; color: #2563eb; }
.stat-icon.revenue { background: #d1fae5; color: #059669; }
.stat-icon.pending { background: #fef3c7; color: #d97706; }
.stat-icon.packages { background: #ede9fe; color: #7c3aed; }
.stat-icon.suppliers { background: #fce7f3; color: #db2777; }
.stat-info h4 { font-size: 24px; font-weight: 700; }
.stat-info p { font-size: 13px; color: var(--text-light); }

.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 16px; }
.card-body { padding: 20px; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 12px 16px; background: var(--bg); font-weight: 600; font-size: 13px; color: var(--text-light); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }

.table-img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--bg); }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #2563eb; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

.section { display: none; }
.section.active { display: block; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.section-header h3 { font-size: 20px; }

.filter-group select {
  padding: 8px 14px; border: 2px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; outline: none;
}

.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal { background: white; border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-lg { max-width: 700px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.close-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-light); }

.actions { display: flex; gap: 8px; }

.toast-admin {
  position: fixed; bottom: 24px; right: 24px; background: var(--secondary); color: white;
  padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 3000;
  transform: translateY(20px); opacity: 0; transition: all 0.3s;
}
.toast-admin.show { transform: translateY(0); opacity: 1; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.active { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
