* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
}

.container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-right: 1px solid #334155;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  color: white;
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-header p {
  font-size: 11px;
  color: #94a3b8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #e2e8f0;
}

.nav-btn.active {
  background: #3b82f6;
  color: white;
}

.nav-btn i {
  width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid #334155;
  font-size: 12px;
  color: #94a3b8;
}

.sidebar-footer p {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot.online {
  background: #22c55e;
}

.status-dot.offline {
  background: #ef4444;
}

.status-dot.busy {
  background: #f59e0b;
}

.status-dot.break {
  background: #8b5cf6;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
  border-bottom: 1px solid #334155;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.header-title p {
  font-size: 13px;
  color: #94a3b8;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #475569;
  color: white;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s;
}

.kpi-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.kpi-card p {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.kpi-card strong {
  font-size: 32px;
  color: #3b82f6;
}

/* ===== PANELS ===== */
.panel {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid #334155;
}

.tab-btn {
  background: none;
  border: none;
  color: #94a3b8;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: #cbd5e1;
}

.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== FORMS ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.full {
  grid-template-columns: 1fr;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #cbd5e1;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: rgba(51, 65, 85, 0.5);
}

th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #cbd5e1;
  border-bottom: 1px solid #334155;
}

td {
  padding: 12px;
  border-bottom: 1px solid #334155;
}

tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-pending {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}
.badge-assigned {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.badge-en-route {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.badge-arrived {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}
.badge-on-trip {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}
.badge-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.badge-cancelled {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* ===== SEARCH & FILTERS ===== */
.search-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.search-filter input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
}

.search-filter select {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  cursor: pointer;
}

/* ===== PICKUP/DROPOFF POINTS ===== */
.pickup-dropoff-list {
  margin-bottom: 12px;
}

.point-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.point-item-content {
  flex: 1;
}

.point-item-location {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
}

.point-item-notes {
  font-size: 11px;
  color: #94a3b8;
}

.point-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 8px;
  font-size: 14px;
}

.point-item-remove:hover {
  color: #fca5a5;
}

.add-point-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px dashed #3b82f6;
  color: #3b82f6;
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 13px;
}

.add-point-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* ===== DRIVER ITEMS ===== */
.driver-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.driver-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.driver-name {
  font-weight: 600;
  font-size: 14px;
}

.driver-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
}

.driver-status.online {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.driver-status.offline {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.driver-status.busy {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

.driver-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.driver-detail-item {
  display: flex;
  flex-direction: column;
}

.driver-detail-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.driver-detail-value {
  color: #cbd5e1;
}

.driver-actions {
  display: flex;
  gap: 8px;
}

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.2s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 24px;
  transition: color 0.3s;
}

.modal-close:hover {
  color: #ef4444;
}

/* ===== ACTIVITY FEED ===== */
.activity-item {
  border-left: 3px solid #3b82f6;
  padding-left: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #334155;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  color: #94a3b8;
  font-size: 11px;
}

.activity-message {
  color: #cbd5e1;
  margin-top: 4px;
  font-size: 13px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #475569;
}

.empty-state p {
  margin-bottom: 24px;
  font-size: 14px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .driver-details {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-direction: column;
  }
}
