:root {
  --primary: #0e8bca;
  --primary-dark: #0a6fa3;
  --primary-light: #e6f4fb;
  --bg: #f4f9fc;
  --card: #fff;
  --text: #0f2a3d;
  --muted: #6b8a9e;
  --border: #ddeaf2;
  --danger: #d92d20;
  --success: #0a6f3a;
  --shadow: 0 8px 30px rgba(14, 139, 202, 0.08);
  --shadow-lg: 0 20px 60px rgba(14, 139, 202, 0.14);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    Inter,
    Segoe UI,
    sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
.login-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  flex: 1;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-lg);
}
.login-card .form-group {
  margin-bottom: 14px;
}
.login-card .form-group label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  display: block;
}
.login-card .form-group input {
  padding-left: 12px;
  padding-right: 12px;
}
.login-card .btn {
  margin-top: 6px;
}
.sidebar {
  width: 300px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 20;
}
.brand {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(14, 139, 202, 0.18);
}
.brand h2 {
  font-size: 17px;
  color: var(--primary);
  font-weight: 900;
}
.brand span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 800;
}
.nav {
  flex: 1;
  padding: 14px;
  overflow: auto;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: 0.2s;
}
.nav a:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(2px);
}
.nav a.active {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: #fff;
  box-shadow: 0 10px 24px rgba(14, 139, 202, 0.28);
}
.nav .sec {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 20px 0 8px 14px;
  text-transform: uppercase;
  font-weight: 800;
  opacity: 0.65;
}
.main {
  margin-left: 300px;
  flex: 1;
}
.topbar {
  height: 70px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.content {
  padding: 24px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.2s;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #4fc3f7);
}
.kpi .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.kpi h4 {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
}
.kpi h2 {
  font-size: 28px;
  margin: 6px 0 4px;
  font-weight: 900;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 9px;
}
.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.18s;
}
.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: #fff;
  box-shadow: 0 6px 16px rgba(14, 139, 202, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
}
.btn-outline:hover {
  background: #f8fbfe;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 14px;
  background: #f8fbfe;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid #eef5fa;
  vertical-align: middle;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}
.form-group label i {
  color: var(--primary);
  font-size: 10.5px;
}
.form-group label em {
  font-style: normal;
  color: var(--danger);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 12px 11px 34px;
  border: 1.2px solid var(--border);
  border-radius: 11px;
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: 0.16s;
}
.form-group textarea {
  padding: 11px 12px 11px 34px;
  resize: vertical;
  min-height: 80px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.alert {
  padding: 12px 16px;
  border-radius: 13px;
  font-size: 13px;
  margin: 12px 0;
  font-weight: 600;
}
.alert-success {
  background: #d1f0e0;
  color: #0a4f2e;
  border: 1px solid #a8dcc0;
}
.alert-danger {
  background: #fee4e2;
  color: #912018;
  border: 1px solid #fecdca;
}
.empty {
  padding: 50px 20px;
  text-align: center;
  color: var(--muted);
}
.empty i {
  font-size: 38px;
  margin-bottom: 14px;
  color: #b8ddf0;
  display: block;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 45, 0.42);
  backdrop-filter: blur(12px);
  z-index: 100;
  overflow: auto;
  padding: 20px;
  display: none;
  opacity: 0;
  transition: opacity 0.22s;
}
.modal.active {
  display: block;
  opacity: 1;
}
.modal-card {
  max-width: 900px;
  margin: 20px auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.24);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal.active .modal-card {
  transform: translateY(0) scale(1);
}
.modal-card-sm {
  max-width: 560px;
  border-radius: 16px;
  margin: 24px auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}
.modal-card-md {
  max-width: 680px;
  border-radius: 16px;
  margin: 24px auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}
.modal-card-lg {
  max-width: 760px;
  border-radius: 16px;
  margin: 24px auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}
.modal-header-sm {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.modal-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.modal-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.modal-header-sm h3 {
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.1;
}
.modal-header-sm span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.modal-close-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
}
.modal-close-sm:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.modal-body-sm {
  padding: 22px 20px;
  background: #fff;
  max-height: 78vh;
  overflow: auto;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap i {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  z-index: 2;
}
.input-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
}
.modal-foot {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.modal-foot .btn {
  min-width: 90px;
  justify-content: center;
  padding: 10px 16px;
  font-size: 12.5px;
}
#stationWarning {
  font-size: 10px;
  color: var(--danger);
  font-weight: 700;
  margin-left: 6px;
}
.search-wrap {
  position: relative;
}
.search-result {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  z-index: 30;
  max-height: 180px;
  overflow: auto;
  display: none;
}
.search-result.active {
  display: block;
}
.search-result div {
  padding: 10px 12px;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid #f2f6f9;
}
.search-result div:hover {
  background: var(--primary-light);
}
.badge {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-active {
  background: #d1f0e0;
  color: #0a6f3a;
}
.badge-closed {
  background: #fee4e2;
  color: #912018;
}
.badge-pending {
  background: #fff4cc;
  color: #8a6d00;
}
.badge-done {
  background: #d1f0e0;
  color: #0a6f3a;
}
.station-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.table-truncate {
  width: 100%;
  min-width: 750px;
  border-collapse: collapse;
  table-layout: auto;
}
.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 65vh;
  -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}
.table-wrap table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbfe;
}
.cell-ellipsis {
  display: block;
  white-space: nowrap;
  overflow: visible;
  max-width: none;
}
.cell-ellipsis b {
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: #f1f8fc;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-design {
  background: #fef6e8;
  border-color: #f9e3b0;
  color: #8a5a00;
}
.chip-service {
  background: #e8f5e9;
  border-color: #b7e1b9;
  color: #1b5e20;
}
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
}
.text-muted {
  color: var(--muted);
  font-size: 11.5px;
}
.cell-tooltip {
  position: absolute;
  z-index: 9999;
  background: #0f2a3d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  max-width: 320px;
  white-space: normal;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: 0.16s;
  pointer-events: none;
}
.cell-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cell-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #0f2a3d;
  rotate: 45deg;
}
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.month-card {
  background: linear-gradient(180deg, #f8fbfe 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}
.month-card b {
  font-size: 20px;
  display: block;
  color: var(--primary);
  font-weight: 900;
}
.month-card span {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
}
.chart-bar {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 120px;
  padding: 10px 0;
}
.chart-bar span {
  flex: 1;
  background: var(--primary-light);
  border-radius: 10px 10px 0 0;
  position: relative;
  min-width: 24px;
}
.chart-bar span.active {
  background: linear-gradient(
    180deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
}
.chart-bar span label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 700;
}
.chart-bar span b {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text);
  font-weight: 800;
}
.tabs {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  overflow: auto;
  background: #f8fbfe;
}
.tabs a {
  padding: 9px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  background: #fff;
  white-space: nowrap;
  font-weight: 700;
  color: var(--muted);
}
.tabs a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(14, 139, 202, 0.22);
}
@media (max-width: 1100px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 260px;
  }
  .main {
    margin-left: 260px;
  }
  .modal-card-sm,
  .modal-card-md,
  .modal-card-lg {
    margin: 12px;
    max-width: calc(100% - 24px);
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .month-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.qc-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  transition: 0.18s;
}
.qc-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}
.qc-thumb-empty {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f1f8fc;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
}
.qc-upload-wrap {
  border: 1.2px dashed var(--border);
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
  transition: 0.18s;
}
.qc-upload-wrap:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.qc-upload-label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  text-align: center;
  color: var(--muted);
}
.qc-upload-label input {
  display: none;
}
.qc-upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.qc-upload-label span {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
}
.qc-upload-label small {
  font-size: 10.5px;
  font-weight: 600;
}
.qc-upload-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  max-height: 260px;
}
.qc-upload-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}
.qc-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--danger);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.qc-preview-remove:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}
.detail-item {
  background: #fbfdff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.detail-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: block;
  line-height: 1;
}
.detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.detail-value b,
.detail-value strong {
  font-size: 13px;
  font-weight: 700;
}
.detail-value .icon-chip,
.detail-value .badge {
  font-size: 12px;
}
.detail-photo {
  padding: 0 16px 16px;
}
.detail-photo img {
  max-width: 420px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
