:root {
  --bg-main: #f0f3f8;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #111827;
  
  --primary-dark: #111827;
  --primary-dark-hover: #1f2937;
  --accent-lime: #bbf246;
  --accent-lime-hover: #a3e635;
  --accent-lime-text: #0f172a;
  
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 8px -2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px 20px 100px;
  -webkit-font-smoothing: antialiased;
}

svg {
  display: inline-block;
  vertical-align: middle;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
}

/* Header */
header {
  position: sticky;
  top: 16px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 10px -3px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.8);
  flex-wrap: wrap;
  gap: 16px;
  transition: all 0.2s ease;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background-color: var(--primary-dark);
  color: var(--accent-lime);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.15);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--primary-dark);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--primary-dark-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.2);
}

.btn-accent {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
  font-weight: 700;
}
.btn-accent:hover {
  background-color: var(--accent-lime-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(187, 242, 70, 0.4);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-input);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* Upload Box */
.upload-card {
  background-color: var(--bg-card);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.upload-card:hover, .upload-card.dragover {
  border-color: var(--primary-dark);
  background-color: #fafbfc;
  box-shadow: var(--shadow-hover);
}

.upload-icon-wrapper {
  width: 64px;
  height: 64px;
  background-color: #f1f5f9;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--primary-dark);
}
.upload-icon-wrapper svg {
  width: 28px;
  height: 28px;
}

.upload-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.upload-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Compact Uploaded Card */
.uploaded-compact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  gap: 14px;
  transition: all 0.2s ease;
}

.uploaded-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uploaded-file-icon {
  width: 40px;
  height: 40px;
  background-color: #ecfdf5;
  color: #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uploaded-file-icon svg {
  width: 20px;
  height: 20px;
}

/* KPI Summary Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  border: 1px solid #f1f5f9;
  color: var(--text-main);
}
.stat-icon-circle svg {
  width: 16px;
  height: 16px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
}

/* Toolbar & Filters */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  background-color: var(--bg-card);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon-inside {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-icon-inside svg {
  width: 16px;
  height: 16px;
}

.search-input {
  background-color: var(--bg-input);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 9px 16px 9px 38px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: inherit;
  width: 280px;
  outline: none;
  transition: all 0.2s ease;
}
.search-input:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.filter-btn.active, .filter-btn:hover {
  background-color: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

/* Responsive Table Card */
.table-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

thead th {
  background-color: #f8fafc;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  vertical-align: middle;
}

tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}
tbody tr:hover {
  background-color: #fafbfc;
}

tbody td {
  padding: 14px 18px;
  vertical-align: middle;
}

/* Cell Column Layouts */
.td-no {
  width: 44px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}

.td-customer {
  min-width: 170px;
}

.td-alamat {
  min-width: 240px;
  max-width: 320px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

.td-resolusi {
  min-width: 220px;
}

.td-kurir {
  min-width: 130px;
}

.td-metode {
  min-width: 130px;
}

.td-status {
  min-width: 120px;
  text-align: center;
}

.td-aksi {
  min-width: 160px;
  text-align: center;
  white-space: nowrap;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning-text);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
}

.badge-dark {
  background-color: var(--primary-dark);
  color: #ffffff;
}

.badge-lime {
  background-color: var(--accent-lime);
  color: var(--accent-lime-text);
}

/* Location cell */
.loc-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.loc-primary {
  font-weight: 700;
  color: var(--text-main);
}
.loc-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.loc-zip {
  display: inline-block;
  background-color: #f1f5f9;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  border: 1px solid #e0f2fe;
}

/* Alert Boxes in Modals */
.alert-box {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.alert-box-title {
  font-weight: 700;
  color: #b45309;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.alert-box-title svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #b45309;
}

.alert-box-desc {
  font-size: 12px;
  color: #78350f;
  line-height: 1.4;
}

/* Pagination Bar */
.pagination-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 14px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-size-selector {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.page-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.page-btn:hover:not(:disabled) {
  background-color: var(--bg-input);
  border-color: #cbd5e1;
}
.page-btn.active {
  background-color: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-btn:hover {
  background-color: #f1f5f9;
  color: var(--text-main);
}
.close-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.location-results-list {
  list-style: none;
  margin-top: 14px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.location-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s;
}
.location-result-item:last-child {
  border-bottom: none;
}
.location-result-item:hover {
  background-color: #f8fafc;
}

/* Floating Bottom Action Bar */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 99;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

/* Mobile Media Query */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-input {
    width: 100%;
  }
  .filter-group {
    width: 100%;
  }
  .pagination-card {
    flex-direction: column;
    align-items: center;
  }
}
