:root {
  --bg: #0f172a;
  --bg-dark: #020617;
  --card: rgba(15, 23, 42, 0.45);
  --accent: #1d4ed8;
  --text: #e2e8f0;
  --muted: #94a3b8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

body:not(.dash-body):not(.tracking-page) {
  background: radial-gradient(
    circle at top,
    #1d4ed8 0%,
    #0f172a 40%,
    #020617 80%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.wrapper {
  width: 100%;
  max-width: 1050px;
  background: rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.hero {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(15, 23, 42, 0) 70%
  );
  color: #fff;
  padding: 2.5rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tagline {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}
.hero h1 {
  font-size: 2.1rem;
  margin: 0 0 0.5rem;
}
.hero-text {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.login {
  background: #fff;
  padding: 2.5rem 2.5rem 2.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 450px;
}
.login h2 {
  margin: 0 0 0.4rem;
  color: #0f172a;
}
.desc {
  margin: 0 0 1.3rem;
  color: #64748b;
  font-size: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}
label {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.8rem;
}

.input-wrap {
  position: relative;
}
.input-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  border-radius: 0.9rem;
  padding-left: 2.6rem;
  padding-right: 2.6rem;
  outline: none;
  transition: 0.2s;
  font-size: 0.9rem;
}
.input-wrap input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.13);
}
.input-wrap .icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: #94a3b8;
}
.input-wrap .icon svg {
  width: 18px;
  height: 18px;
}

.pass-eye {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: #fff;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  color: #0f172a;
}
.pass-eye:hover {
  background: #e2e8f0;
}

.login .inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.muted-link {
  color: #94a3b8;
  font-size: 0.8rem;
  text-decoration: none;
}
.muted-link:hover {
  text-decoration: underline;
}

.alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #b91c1c;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
}
.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #166534;
  padding: 0.6rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
}

.btn-login {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: 0.25s;
  box-shadow: 0 16px 55px rgba(29, 78, 216, 0.34);
  width: 100%;
  justify-content: center;
  height: 46px;
}
.btn-login:hover {
  transform: translateY(-1px);
  background: #1e40af;
}

@media (max-width: 920px) {
  body:not(.dash-body):not(.tracking-page) {
    padding: 0;
    background: #0f172a;
  }
  .wrapper {
    grid-template-columns: 1fr;
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
  }
  .hero {
    order: -1;
    text-align: center;
    align-items: center;
    padding: 1.6rem 1.1rem 1rem;
  }
  .login {
    padding: 1.5rem 1.1rem 1.8rem;
  }
}
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }
}

body.dash-body,
body.tracking-page {
  background: radial-gradient(
    circle at top,
    #1d4ed8 0%,
    #020617 55%,
    #020617 100%
  ) !important;
  min-height: 100vh;
}

.dash-nav {
  background: linear-gradient(
    90deg,
    #0f172a 0%,
    #020617 60%,
    #1d4ed8 110%
  ) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-nav .navbar-brand {
  color: #fff !important;
}
.dash-nav .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.9rem;
  margin-right: 0.4rem;
  border-radius: 0.45rem;
  transition: 0.15s;
}
.dash-nav .nav-link.active,
.dash-nav .nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.dash-nav .dropdown-menu {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 0.75rem;
  padding: 0.35rem 0;
  min-width: 210px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.25);
}
.dash-nav .dropdown-menu .dropdown-item {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  padding: 0.45rem 1rem;
  border-radius: 0.4rem;
}
.dash-nav .dropdown-menu .dropdown-item:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
}

.dash-main {
  max-width: 1180px;
  margin-inline: auto;
  padding: 1.5rem 1.5rem 2rem;
}
@media (max-width: 768px) {
  .dash-main {
    padding-inline: 0.75rem;
  }
  .dash-nav .navbar-collapse {
    background: #020617;
    padding-bottom: 0.75rem;
  }
}

.stats-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.mini-stat {
  background: rgba(15, 23, 42, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1rem 1.1rem 0.9rem;
  min-height: 92px;
  backdrop-filter: blur(6px);
}
.mini-stat .label {
  font-size: 0.72rem;
  color: rgba(226, 232, 240, 0.6);
  margin-bottom: 0.4rem;
}
.mini-stat .value {
  font-size: 1.45rem;
  font-weight: 600;
  color: #fff;
}

@media (max-width: 768px) {
  .stats-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mini-stat {
    width: 100%;
    min-height: auto;
  }
}

.dash-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  color: #e2e8f0;
}

.dash-card .table-responsive,
.table-wrap {
  border-radius: 1rem;
  overflow: hidden;
}

.dash-card table.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.dash-card table.table thead tr:first-child th:first-child {
  border-top-left-radius: 1rem;
}
.dash-card table.table thead tr:first-child th:last-child {
  border-top-right-radius: 1rem;
}
.dash-card table.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 1rem;
}
.dash-card table.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 1rem;
}

body.dash-body table.table {
  color: #e2e8f0;
}
body.dash-body .table thead th {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.15);
}
body.dash-body .table tbody tr {
  background: rgba(15, 23, 42, 0.3);
}
body.dash-body .table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.5);
}
body.dash-body .table tbody td {
  border-color: rgba(148, 163, 184, 0.12);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.table-wrap::-webkit-scrollbar {
  height: 0;
}

.table-action {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-start;
}
.table-action .btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  border-width: 1px;
}
.table-action .btn-icon i {
  font-size: 1.05rem;
  line-height: 1;
}

body.tracking-page .dash-main {
  max-width: 980px;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}
.search-row .search-input {
  flex: 1 1 auto;
}
.search-row .search-input .form-control {
  height: 46px;
  border-radius: 0.8rem;
  border: none;
  background: #ffffff;
  font-size: 0.9rem;
}
.search-row .search-btn {
  height: 46px;
  border-radius: 0.8rem;
  padding-inline: 1.5rem;
}

@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-row .search-input,
  .search-row .search-input .form-control,
  .search-row .search-btn {
    width: 100%;
  }
}

.track-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(10px);
}
.track-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0.8rem;
  background: linear-gradient(90deg, #1d4ed8 0%, #0f172a 60%);
  color: #fff;
}
.track-meta {
  background: rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.4rem;
  padding: 0.55rem 1.25rem 0.75rem;
}
.track-meta span {
  display: block;
  font-size: 0.65rem;
  color: rgba(226, 232, 240, 0.65);
}
.track-meta strong {
  color: #fff;
  font-size: 0.8rem;
}

.track-progress-single {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 0.9rem;
  overflow: hidden;
  margin: 0 1.25rem 1rem;
  position: relative;
  height: 15px;
}
.track-progress-fill {
  height: 15px;
  background: linear-gradient(90deg, #1d4ed8 0%, #38bdf8 100%);
  width: 0;
  transition: width 0.4s ease;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.track-progress-fill span {
  font-size: 0.7rem;
  margin-right: 0.35rem;
  color: #fff;
}

.track-timeline {
  margin-top: 1.25rem;
  padding: 0 1.5rem 1.5rem;
}
.track-timeline .timeline-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  margin-left: 0.25rem;
}
.track-timeline .timeline-list li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 0.9rem;
  align-items: center;
}
.track-timeline .tl-dot {
  width: 16px;
  height: 16px;
  border: 2px solid #3b82f6;
  border-radius: 999px;
  margin-left: 6px;
}
.track-timeline .timeline-title {
  font-weight: 500;
  color: #e2e8f0;
}
.track-timeline .timeline-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

@media (max-width: 720px) {
  .track-timeline {
    padding: 0 1rem 1.25rem;
  }
  .track-timeline .timeline-list li {
    grid-template-columns: 30px 1fr;
  }
  .track-timeline .timeline-time {
    grid-column: 2;
    font-size: 0.68rem;
  }
}

#modalDetail .modal-content,
#modalFormStok .modal-content.modal-sitta {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1.25rem;
  overflow: hidden;
}

#modalDetail .modal-header,
#modalFormStok .modal-header.sitta-head {
  background: linear-gradient(90deg, #1d4ed8 0%, #0f172a 50%, #020617 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #fff;
  padding: 0.95rem 1.25rem;
}

#modalDetail .btn-close,
#modalFormStok .btn-close {
  filter: invert(1);
  opacity: 0.8;
}
#modalDetail .btn-close:hover,
#modalFormStok .btn-close:hover {
  opacity: 1;
}
#modalDetail .modal-content {
  background: #020617 !important;
  border: 1px solid rgba(148, 163, 184, 0.15) !important;
  border-radius: 1.25rem;
  overflow: hidden;
}

#modalDetail .modal-body {
  gap: 1rem;
  padding: 1rem 1.2rem 1.25rem;
}

#modalDetail .detail-cover {
  flex: 0 0 220px;
  display: flex;
  justify-content: center;
  align-items: center;
}
#modalDetail .detail-cover img {
  width: 170px;
  max-height: 240px;
  border-radius: 1rem;
  background: #0f172a;
  object-fit: cover;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

#modalDetail .detail-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#modalDetail label {
  color: #e2e8f0 !important;
  font-weight: 500;
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

#modalDetail .form-control {
  background: rgba(2, 6, 23, 0.45) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #e2e8f0 !important;
  border-radius: 0.6rem !important;
  height: 36px !important;
  font-size: 0.8rem;
}
#modalDetail .form-control:focus {
  background: rgba(2, 6, 23, 0.75) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

#modalDetail .modal-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.6rem 1.2rem 0.85rem;
}
#modalDetail .btn-close-detail {
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 0.65rem;
  padding: 0.45rem 0.95rem 0.45rem;
  font-weight: 500;
  display: inline-flex;
  gap: 0.35rem;
}
#modalDetail .btn-close-detail i {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  #modalDetail .modal-body {
    flex-direction: column;
  }
  #modalDetail .detail-cover {
    margin-inline: auto;
  }
  #modalDetail .detail-cover img {
    width: 150px;
    max-height: 210px;
  }
}

.modal-sitta {
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1.25rem;
}
.modal-sitta .sitta-head {
  background: linear-gradient(90deg, #1d4ed8 0%, #020617 80%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.modal-sitta .sitta-body {
  gap: 1rem;
  padding: 1rem 1.2rem 1.25rem;
}
.modal-sitta .detail-cover {
  flex: 0 0 210px;
  display: flex;
  align-items: center;
}
.modal-sitta .detail-cover img {
  width: 100%;
  max-width: 190px;
  border-radius: 1rem;
  background: #0f172a;
  object-fit: cover;
  aspect-ratio: 3/4;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
}
.modal-sitta .detail-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.modal-sitta .detail-form .field input.form-control {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #fff;
  border-radius: 0.7rem;
  height: 38px;
  font-size: 0.8rem;
}
.modal-sitta .detail-form label {
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.6);
  margin-bottom: 0.18rem;
  font-weight: 500;
}
.modal-sitta .sitta-foot {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
@media (max-width: 768px) {
  .modal-sitta .sitta-body {
    flex-direction: column;
  }
  .modal-sitta .detail-cover {
    justify-content: center;
  }
}

#modalHapus .modal-dialog {
  max-width: 420px;
}

#modalHapus .modal-content {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1.1rem;
  overflow: hidden;
}

#modalHapus .modal-header {
  background: linear-gradient(120deg, #1d4ed8 0%, #020617 85%);
  color: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.7rem 1rem 0.65rem;
}

#modalHapus .modal-title {
  font-size: 0.95rem;
  font-weight: 600;
}

#modalHapus .modal-body {
  text-align: center;
  color: #e2e8f0;
  padding: 1.1rem 1.4rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

#modalHapus .modal-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.05);
  padding: 0.7rem 1rem 0.9rem;
  justify-content: flex-end;
  gap: 0.5rem;
}

#modalHapus .btn-cancel {
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.3);
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.28rem 0.9rem 0.35rem;
  font-size: 0.78rem;
}

#modalHapus .btn-cancel:hover {
  background: rgba(226, 232, 240, 0.05);
}

#modalHapus .btn-danger {
  border-radius: 0.6rem;
  padding: 0.28rem 1rem 0.35rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

#tblStok thead th {
  text-align: center;
  vertical-align: middle;
}

.status-badge {
  font-size: 0.8rem;
}

.action-icon {
  cursor: pointer;
  font-size: 1rem;
}

.action-icon:hover {
  opacity: 0.8;
}

.detail-cover {
  max-width: 180px;
}
.detail-cover img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

#tblStok thead th {
  text-align: center;
  vertical-align: middle;
}

.timeline-wrapper {
  max-width: 100%;
  margin: 0;
  padding: 0 1.25rem;
}

.timeline-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.timeline-scroll::-webkit-scrollbar {
  width: 6px;
}
.timeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.timeline-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.timeline li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin-left: 0.5rem;
  border-left: 1px solid rgba(148, 163, 184, 0.4);
}

.tl-dot {
  position: absolute;
  left: -5px;
  top: 0.95rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 2px solid #020617;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 0.9rem;
  color: #e5e7eb;
  font-weight: 500;
}

.timeline-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

.timeline-time {
  font-size: 0.8rem;
  color: #9ca3af;
  white-space: nowrap;
  margin-left: 0.5rem;
}

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

.table-wrap table {
  min-width: 900px;
}
