/* ================================================
   HOMESERV MANAGEMENT SYSTEM - MAIN CSS
   Color Palette:
   - Primary: #037769 (teal green)
   - Accent: #fb650b (orange)
   - Gold: #f5a623
   - Background: #f5f7fa
   ================================================ */

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

:root {
  --primary: #037769;
  --primary-light: #04a08d;
  --primary-dark: #025c52;
  --primary-bg: #e8f5f3;
  --accent: #fb650b;
  --accent-light: #fd8444;
  --accent-bg: #fff2eb;
  --gold: #f5a623;
  --gold-bg: #fdf6e3;
  --white: #ffffff;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

html, body { height: 100%; overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==================== APP LAYOUT ==================== */
#app {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--text);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  flex-shrink: 0;
}
.brand-name { color: white; font-weight: 800; font-size: 16px; display: block; line-height: 1.2; }
.brand-sub { color: var(--text-muted); font-size: 10px; display: block; letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; padding: 12px 12px; }
.nav-section { margin-bottom: 24px; }
.nav-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0 8px 8px;
  display: block;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--text);
  z-index: 2;
}
.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.user-details { min-width: 0; }
.user-name { color: white; font-weight: 600; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--text-muted); font-size: 11px; display: block; }
.btn-logout {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.btn-logout:hover { background: var(--danger); color: white; }
#btnLogoutTop:hover { background: #fef2f2; color: var(--danger); }

/* ==================== MAIN CONTENT ==================== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== TOPBAR ==================== */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.btn-menu-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  display: none;
  align-items: center; justify-content: center;
  font-size: 16px;
}
.page-title h1 { font-size: 18px; font-weight: 700; color: var(--text); }
#pageBreadcrumb { font-size: 12px; color: var(--text-muted); display: block; margin-top: -2px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  position: relative;
  transition: all 0.2s;
}
.topbar-btn:hover { background: var(--primary-bg); color: var(--primary); }
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.user-avatar-sm {
  width: 26px; height: 26px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 11px;
}

/* ==================== NOTIFICATION PANEL ==================== */
.notif-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 16px;
  width: 340px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 200;
  max-height: 480px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 13px;
}
.btn-text { color: var(--primary); font-size: 12px; font-weight: 600; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-bg); }
.notif-item-title { font-weight: 600; font-size: 13px; color: var(--text); }
.notif-item-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-item-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ==================== PAGE CONTENT ==================== */
.page-content { flex: 1; padding: 24px; }

/* ==================== CARDS ==================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ==================== STAT CARDS ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.green { background: var(--primary-bg); color: var(--primary); }
.stat-icon.orange { background: var(--accent-bg); color: var(--accent); }
.stat-icon.gold { background: var(--gold-bg); color: var(--gold); }
.stat-icon.blue { background: #eff6ff; color: var(--info); }
.stat-icon.red { background: #fef2f2; color: var(--danger); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); font-family: var(--font-mono); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ==================== TABLE ==================== */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ==================== STATUS BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-new { background: #eff6ff; color: var(--info); }
.badge-assigned { background: var(--gold-bg); color: #d97706; }
.badge-on_progress { background: var(--accent-bg); color: var(--accent); }
.badge-done { background: var(--primary-bg); color: var(--primary); }
.badge-cancelled { background: #fef2f2; color: var(--danger); }
.badge-pending { background: #fef2f2; color: var(--danger); }
.badge-contacted { background: var(--primary-bg); color: var(--primary); }
.badge-no_response { background: #f3f4f6; color: var(--text-secondary); }
.badge-waiting { background: #f3f4f6; color: var(--text-secondary); }
.badge-otw { background: var(--accent-bg); color: var(--accent); }
.badge-sampai { background: var(--gold-bg); color: #d97706; }
.badge-selesai { background: var(--primary-bg); color: var(--primary); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; }
.btn-ghost { background: var(--bg); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border); }

/* ==================== FORMS ==================== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(3,119,105,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }

/* ==================== FILTER BAR ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control { width: auto; min-width: 140px; padding: 8px 12px; font-size: 13px; }
.filter-bar .form-select { padding: 8px 30px 8px 12px; }
.search-input-wrap { position: relative; }
.search-input-wrap .fa-search { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.search-input-wrap input { padding-left: 32px; }

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: slideInToast 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: flex-end;
  margin-top: 16px;
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: 0.4; pointer-events: none; }

/* ==================== LOADING ==================== */
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg) 25%, #e2e8f0 50%, var(--bg) 75%); background-size: 200%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ==================== TIMELINE ==================== */
.timeline { padding-left: 4px; }
.timeline-item {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  border: 2px solid var(--primary);
}
.timeline-content { flex: 1; }
.timeline-title { font-weight: 600; font-size: 13.5px; }
.timeline-desc { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ==================== INFO LIST ==================== */
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; gap: 12px; }
.info-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 120px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 1px; }
.info-value { font-size: 14px; color: var(--text); flex: 1; }

/* ==================== EMPTY STATE ==================== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.empty-icon { font-size: 48px; color: var(--border); margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--text-muted); }

/* ==================== TASK CARDS (MOBILE) ==================== */
.task-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.task-customer { font-weight: 700; font-size: 15px; }
.task-address { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; display: flex; gap: 6px; align-items: flex-start; }
.task-address i { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.task-service { font-size: 12.5px; color: var(--text-secondary); padding: 8px 12px; background: var(--bg); border-radius: 8px; margin-bottom: 12px; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.task-action-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.task-action-btn.otw { background: var(--accent-bg); color: var(--accent); }
.task-action-btn.otw:hover { background: var(--accent); color: white; }
.task-action-btn.sampai { background: var(--gold-bg); color: #d97706; }
.task-action-btn.sampai:hover { background: var(--gold); color: white; }
.task-action-btn.selesai { background: var(--primary-bg); color: var(--primary); }
.task-action-btn.selesai:hover { background: var(--primary); color: white; }

/* ==================== CHART PLACEHOLDER ==================== */
.chart-bar-wrap { display: flex; flex-direction: column; gap: 10px; }
.chart-row { display: flex; align-items: center; gap: 12px; }
.chart-label { font-size: 12px; color: var(--text-secondary); min-width: 100px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-bg { flex: 1; height: 28px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.chart-bar { height: 100%; background: var(--primary); border-radius: 6px; transition: width 0.8s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }
.chart-bar span { font-size: 11px; font-weight: 700; color: white; }
.chart-bar.orange { background: var(--accent); }
.chart-value { font-size: 12px; font-weight: 700; color: var(--text); min-width: 28px; }

/* ==================== LOGIN PAGE ==================== */
.login-page {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-bg {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-decoration {
  position: absolute;
  top: -80px; right: -80px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(3,119,105,0.12) 0%, transparent 70%);
}
.login-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}
.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: white;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(3,119,105,0.25);
}
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-logo p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.input-icon {
  position: relative;
}
.input-icon > i:first-child {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
}
.input-icon input { padding-left: 38px; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 13px; padding: 4px;
}
.login-error {
  background: #fef2f2; color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  border-left: 3px solid var(--danger);
}
.btn-login {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
}
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }
.login-demo { margin-top: 24px; text-align: center; }
.login-demo p { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.demo-accounts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.demo-accounts button {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}
.demo-accounts button:hover { border-color: var(--primary); color: var(--primary); }

/* ==================== HEADER SECTION ==================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 18px; font-weight: 800; }
.page-header p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ==================== DETAIL VIEW ==================== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .btn-menu-toggle {
    display: flex;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row { grid-template-columns: 1fr; }
  .filter-bar .form-control { min-width: 120px; }
  .page-content { padding: 16px; }
  .notif-panel { width: calc(100vw - 32px); right: 16px; }
  .login-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .user-chip { display: none; }
}

/* Mobile overlay when sidebar open */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ==================== COURIER PAGE ==================== */
.courier-page { padding: 4px 0; }
.courier-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.courier-info h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.courier-info h3 i { color: var(--accent); }
.courier-source { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
.simcito-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary-bg); color: var(--primary);
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

/* Stats Row */
.courier-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); transition: all 0.2s;
  cursor: pointer;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.stat-card .stat-num { font-size: 22px; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.stat-card .stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.stat-assigned .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-assigned .stat-num { color: #3b82f6; }
.stat-progress .stat-icon { background: #fef3c7; color: #f59e0b; }
.stat-progress .stat-num { color: #f59e0b; }
.stat-done .stat-icon { background: #d1fae5; color: #10b981; }
.stat-done .stat-num { color: #10b981; }
.stat-cancelled .stat-icon { background: #fee2e2; color: #ef4444; }
.stat-cancelled .stat-num { color: #ef4444; }

/* Filter Bar */
.courier-filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.filter-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-right { display: flex; align-items: center; gap: 8px; }
.filter-group {
  display: flex; align-items: center; gap: 6px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
}
.filter-group i { color: var(--text-muted); font-size: 13px; }
.filter-group select, .filter-group input {
  border: none; outline: none; font-family: var(--font); font-size: 13px;
  background: transparent; color: var(--text); min-width: 140px;
}
.filter-group input { min-width: 200px; }

/* Courier Table */
.courier-cell { display: flex; align-items: center; gap: 10px; }
.courier-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.destination-cell { display: flex; align-items: flex-start; gap: 6px; }
.destination-cell i { margin-top: 3px; flex-shrink: 0; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: 12px; }

/* Type Badge */
.badge-type {
  background: var(--bg); color: var(--text-secondary);
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  font-weight: 500;
}

/* Pagination Container */
.pagination-container { margin-top: 16px; display: flex; justify-content: center; }

/* Table Container */
.table-container {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead { background: var(--bg); }
.table th {
  padding: 12px 14px; text-align: left; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
}
.table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover { background: var(--bg); }
.table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 768px) {
  .courier-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-group input { min-width: 120px; }
}

/* Courier: branch badge */
.badge-branch {
  background: #e8f5f3; color: #037769;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; white-space: nowrap;
}

/* Courier: total counter */
.courier-total {
  font-size: 12px; color: var(--text-secondary);
  font-weight: 600; display: flex; align-items: center; gap: 4px;
}

/* ==================== SLA PAGE ==================== */
.sla-page { padding: 4px 0; }
.sla-header { margin-bottom: 16px; }
.sla-header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sla-header h3 i { color: var(--accent); }
.sla-sub { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* SLA Summary Cards */
.sla-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.sla-card {
  background: var(--white); border-radius: var(--radius-sm);
  padding: 16px; border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 14px;
}
.sla-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.sla-card-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-secondary);
}
.sla-card-value {
  font-size: 26px; font-weight: 800; font-family: var(--font-mono);
  color: var(--text); line-height: 1.2;
}
.sla-card-value small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.sla-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sla-card-breach { font-size: 11px; margin-top: 4px; }

/* SLA Section */
.sla-section { margin-top: 8px; }
.sla-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.sla-section-header h4 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sla-section-header span { font-size: 12px; color: var(--text-muted); }

@media (max-width: 768px) {
  .sla-summary { grid-template-columns: repeat(2, 1fr); }
}
