@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── RESET & BASE ─────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #E8F6FD 0%, #D0EEFA 100%);
  min-height: 100vh;
  color: #1B2B65;
  overflow-x: hidden;
}

/* ── TOPBAR ───────────────────────────────────────────── */
.topbar {
  background: linear-gradient(90deg, #005F9E 0%, #0096D6 100%);
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 16px rgba(0, 96, 150, 0.28);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.2);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.brand img {
  height: 38px;
  border-radius: 8px;
}

.brand h1 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: 1.2;
}

.sub {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-right .welcome-text {
  font-size: 13px;
  color: rgba(255,255,255,0.88);
  font-weight: 500;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
#sidebar-wrapper {
  position: fixed;
  top: 60px;
  left: 0;
  z-index: 999;
  width: 56px;
  min-height: calc(100vh - 60px);
  background: linear-gradient(180deg, #005F9E 0%, #0078C1 100%);
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(0,96,150,0.18);
}

#sidebar-wrapper.sidebar-toggled {
  width: 210px;
}

/* sidebar title */
#sidebar-wrapper .sidebar-title {
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  padding: 18px 0 10px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#sidebar-wrapper.sidebar-toggled .sidebar-title {
  opacity: 1;
}

/* list items */
#sidebar-wrapper .list-group-item {
  background: transparent;
  border: none;
  padding: 4px 8px;
}

#sidebar-wrapper .list-group-item a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

#sidebar-wrapper.sidebar-toggled .list-group-item a {
  justify-content: flex-start;
  padding: 10px 14px;
}

#sidebar-wrapper .list-group-item a:hover,
#sidebar-wrapper .list-group-item a.active-menu {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

#sidebar-wrapper .list-group-item a i {
  font-size: 20px;
  min-width: 20px;
  flex-shrink: 0;
}

#sidebar-wrapper .list-group-item a span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease 0.05s, width 0.25s ease;
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
}

#sidebar-wrapper.sidebar-toggled .list-group-item a span {
  opacity: 1;
  width: auto;
}

/* ── PAGE CONTENT ─────────────────────────────────────── */
#wrapper {
  display: flex;
  position: relative;
}

#page-content-wrapper {
  margin-left: 56px;
  transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
  width: calc(100% - 56px);
  padding: 20px;
  min-height: calc(100vh - 60px);
}

#wrapper.sidebar-toggled #page-content-wrapper {
  margin-left: 210px;
  width: calc(100% - 210px);
}

/* ── SEARCH CARD ──────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #C8E8F8;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,96,150,0.08);
  overflow: hidden;
}

.card.search-card {
  padding: 20px 24px;
  margin-bottom: 16px;
}

.search-card .card-title {
  font-size: 16px;
  font-weight: 700;
  color: #005F9E;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.search-card .card-subtitle {
  font-size: 12px;
  color: #94A3B8;
  margin-bottom: 14px;
}

/* search box */
.position-relative { position: relative; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #0096D6;
  font-size: 16px;
  pointer-events: none;
}

.search-box {
  width: 100%;
  height: 44px;
  border: 1.5px solid #B8DDF4;
  border-radius: 10px;
  padding: 0 14px 0 42px;
  font-size: 14px;
  color: #1B2B65;
  font-family: inherit;
  background: #FAFCFF;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-box:focus {
  border-color: #0096D6;
  box-shadow: 0 0 0 3px rgba(0,150,214,0.12);
  background: #fff;
}

/* ── STAT CARDS ───────────────────────────────────────── */
.row.g-3 { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }

.stat-card {
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: none;
  box-shadow: 0 8px 28px rgba(0,96,150,0.14);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,96,150,0.2); }

.stat-card.bg-primary {
  background: linear-gradient(135deg, #0096D6, #005F9E) !important;
}
.stat-card.bg-success {
  background: linear-gradient(135deg, #00C6F7, #0096D6) !important;
}
.stat-card.bg-dark {
  background: #fff !important;
  border: 1.5px solid #B8DDF4;
  box-shadow: 0 4px 20px rgba(0,96,150,0.08);
}

.stat-icon {
  font-size: 42px;
  opacity: 0.22;
  position: absolute;
  right: 18px;
  bottom: 10px;
  color: #fff;
}

.stat-card.bg-dark .stat-icon { color: #0096D6; opacity: 0.18; }

.stat-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}

.stat-card.bg-dark .stat-title { color: #0096D6; }

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-top: 4px;
}

.stat-card.bg-dark .stat-value { color: #005F9E; }

/* factory filter inside stat card */
.stat-card.bg-dark .form-select {
  margin-top: 6px;
  border: 1.5px solid #B8DDF4;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #005F9E;
  background-color: #F0FAFF;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.stat-card.bg-dark .form-select:focus {
  border-color: #0096D6;
  box-shadow: none;
}

/* ── TABLE CARD & TOOLBAR ─────────────────────────────── */
.card.table-card {
  padding: 0;
  border-radius: 16px;
}

.card-header {
  background: #F8FCFF;
  border-bottom: 1px solid #C8E8F8;
  padding: 14px 20px;
}

/* toolbar buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(90deg, #0096D6, #005F9E);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(0,96,150,0.25);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #007BB5, #004C80);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,96,150,0.32);
}

.btn-success {
  background: linear-gradient(90deg, #16A34A, #15803D);
  border: none;
  border-radius: 8px;
  font-size: 13px;
}

.btn-success:hover {
  background: linear-gradient(90deg, #15803D, #166534);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #F1F5F9;
  color: #64748B;
  border: none;
  border-radius: 8px;
}

.btn-secondary:hover {
  background: #E2E8F0;
  color: #475569;
}

/* date filter inputs */
.form-control.form-control-sm,
input[type="date"].form-control {
  border: 1.5px solid #B8DDF4;
  border-radius: 8px;
  font-size: 12px;
  color: #005F9E;
  background: #F8FCFF;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control.form-control-sm:focus,
input[type="date"].form-control:focus {
  border-color: #0096D6;
  box-shadow: 0 0 0 3px rgba(0,150,214,0.1);
  outline: none;
}

/* ── DATA TABLE ───────────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar { height: 6px; }
.table-responsive::-webkit-scrollbar-track { background: #F0F9FF; }
.table-responsive::-webkit-scrollbar-thumb { background: #0096D6; border-radius: 10px; }

#resultTable {
  width: 100%;
  min-width: 1400px;
  border-collapse: collapse;
  font-size: 13px;
  border: 2px solid #0096D6;
  table-layout: auto;
}

#resultTable thead tr {
  background: linear-gradient(90deg, #005F9E 0%, #0096D6 100%);
}

#resultTable thead th {
  background: #0078B8 !important;
  color: #fff !important;
  padding: 13px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.25) !important;
  vertical-align: middle;
}

/* Recreate the left-to-right gradient effect across all th cells */
#resultTable thead tr th:first-child  { background: #005F9E !important; }
#resultTable thead tr th:nth-child(2)  { background: #006aac !important; }
#resultTable thead tr th:nth-child(3)  { background: #0075ba !important; }
#resultTable thead tr th:nth-child(4)  { background: #0080c8 !important; }
#resultTable thead tr th:nth-child(5)  { background: #0087ce !important; }
#resultTable thead tr th:nth-child(6)  { background: #008dd4 !important; }
#resultTable thead tr th:nth-child(7)  { background: #0091d8 !important; }
#resultTable thead tr th:nth-child(8)  { background: #0094db !important; }
#resultTable thead tr th:nth-child(9)  { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(10) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(11) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(12) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(13) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(14) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(15) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(16) { background: #0096D6 !important; }
#resultTable thead tr th:nth-child(17) { background: #0096D6 !important; }

#resultTable tbody tr {
  border-bottom: 1px solid #B8DDF4;
  transition: background 0.15s;
}

#resultTable tbody tr:nth-child(even) {
  background: #F0F9FF;
}

#resultTable tbody tr:hover {
  background: #D8F0FC;
}

#resultTable td {
  padding: 11px 14px;
  color: #1B2B65;
  vertical-align: middle;
  border: 1px solid #C8E8F8;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* catatan column body — left align, normal case */
#resultTable td:nth-child(10) {
  text-align: left;
  text-transform: none;
  font-size: 12px;
  color: #374151;
  font-weight: 400;
  white-space: normal;
  max-width: 380px;
}

/* kolom TANGGAL (col 9) — fix width */
#resultTable th:nth-child(9),
#resultTable td:nth-child(9) {
  width: 95px;
  min-width: 95px;
  max-width: 95px;
  white-space: nowrap;
}

/* kolom TGL NEXT REVIEW (col 12) — fix width, allow header to wrap */
#resultTable th:nth-child(12) {
  width: 105px;
  min-width: 105px;
  max-width: 105px;
  white-space: normal;
  word-break: break-word;
}
#resultTable td:nth-child(12) {
  width: 105px;
  min-width: 105px;
  max-width: 105px;
  white-space: nowrap;
}

/* kolom CATATAN/TUGAS (col 10) header — center & bold */
#resultTable th:nth-child(10) {
  text-align: center !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  white-space: nowrap;
}

/* kolom NIK (col 2) */
#resultTable th:nth-child(2),
#resultTable td:nth-child(2) {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
  white-space: nowrap;
}

/* kolom KATEGORI (col 7) */
#resultTable th:nth-child(7),
#resultTable td:nth-child(7) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  white-space: nowrap;
}

/* kolom STATUS TUGAS (col 11) */
#resultTable th:nth-child(11) {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  white-space: normal;
  word-break: break-word;
}
#resultTable td:nth-child(11) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  white-space: nowrap;
}

/* kolom DOKUMEN (col 13) */
#resultTable th:nth-child(13),
#resultTable td:nth-child(13) {
  width: 85px;
  min-width: 85px;
  max-width: 85px;
  white-space: nowrap;
}

/* kolom ACTION (col 14) */
#resultTable th:nth-child(14),
#resultTable td:nth-child(14) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  white-space: nowrap;
}

/* ── BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge.bg-danger    { background: #FEE2E2 !important; color: #B91C1C !important; }
.badge.bg-warning   { background: #FEF3C7 !important; color: #92400E !important; }
.badge.bg-success   { background: #D1FAE5 !important; color: #065F46 !important; }
.badge.bg-primary   { background: #DBEAFE !important; color: #1E40AF !important; }
.badge.bg-secondary { background: #F1F5F9 !important; color: #475569 !important; }
.text-dark { color: inherit !important; }

/* ── EDIT BUTTON ──────────────────────────────────────── */
.btn-warning {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FED7AA;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: none;
}

.btn-warning:hover {
  background: #FFEDD5;
  color: #9A3412;
  border-color: #FDBA74;
  transform: none;
}

/* ── PAGINATION ───────────────────────────────────────── */
.pagination {
  gap: 5px;
  padding: 14px 20px;
  border-top: 1px solid #C8E8F8;
  background: #F8FCFF;
  flex-wrap: wrap;
}

.pagination .page-item .page-link {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #B8DDF4;
  background: #fff;
  color: #0096D6;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0;
  transition: all 0.15s;
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #0096D6, #005F9E);
  border-color: #0096D6;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,96,150,0.25);
}

.pagination .page-item .page-link:hover:not(.active) {
  background: #E8F6FD;
  border-color: #0096D6;
}

/* ── MODAL ────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(90deg, #005F9E, #0096D6);
  border: none;
  padding: 18px 24px;
}

.modal-title {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.3px;
}

.btn-close { filter: brightness(0) invert(1); }

.modal-body { padding: 20px 24px; }

label {
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  margin-top: 12px;
  margin-bottom: 4px;
  display: block;
}

.form-control,
.form-select {
  border: 1.5px solid #D1E9F7;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #1B2B65;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: #0096D6;
  box-shadow: 0 0 0 3px rgba(0,150,214,0.12);
  outline: none;
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230096D6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* ── TOGGLE SIDEBAR BUTTON ────────────────────────────── */
.btn-outline-light {
  border-color: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.9);
  border-radius: 8px;
  padding: 5px 10px;
}

.btn-outline-light:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

/* ── MISC UTILITIES ───────────────────────────────────── */
.btn-danger {
  background: #E53E3E;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.btn-danger:hover { background: #C53030; }

.footer-note {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
  padding: 14px 20px;
  text-align: center;
  border-top: 1px solid #C8E8F8;
}

.text-primary { color: #0096D6 !important; }
.fw-bold      { font-weight: 700 !important; }
.fw-semibold  { font-weight: 600 !important; }
.text-muted   { color: #94A3B8 !important; font-size: 12px; }

.highlight {
  background: linear-gradient(120deg, #BAE6FD, #0096D6);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 14px; }
  .brand h1 { font-size: 13px; }
  .topbar-right .welcome-text { display: none; }
  #page-content-wrapper { padding: 12px; }
  .stat-value { font-size: 26px; }
  .stat-icon  { font-size: 32px; }
}