/* ===== Tema warna Citilink (hijau tua & hijau muda) ===== */
:root {
  --green-deep: #063d1e;   /* hijau tua pekat */
  --green-dark: #0b5d2e;   /* hijau tua */
  --green-mid:  #2e9e4f;   /* hijau sedang */
  --lime:       #8dc63f;   /* hijau muda khas Citilink */
  --lime-soft:  #b7e07a;
  --green-tint: #eaf6e0;   /* hijau muda sangat terang (latar) */
  --green-tint2:#f4faef;
  --ink:        #17331f;
  --muted:      #5d7a63;
  --line:       #d7e9c7;
  --white:      #ffffff;
  --danger:     #b3261e;
  --danger-bg:  #fdeceb;
  --yellow:      #ffb400; /* Citilink accent yellow */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 100% -10%, #e7f6d8 0%, transparent 60%),
    var(--green-tint2);
  line-height: 1.5;
}

/* ===== Topbar ===== */
.topbar {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-dark) 55%, var(--green-mid) 85%, var(--yellow) 100%);
  color: var(--white);
  padding: 20px 24px;
  box-shadow: 0 4px 18px rgba(11, 93, 46, 0.25);
}
.topbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 52px; width: auto; }
.brand-mark {
  font-size: 30px; line-height: 1;
  background: var(--lime); color: var(--green-deep);
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(141, 198, 63, 0.5);
}
.brand-text h1 { margin: 0; font-size: 22px; letter-spacing: .2px; }
.brand-text p { margin: 2px 0 0; font-size: 13px; opacity: .85; }

/* ===== User Profile inside Topbar ===== */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 30px; /* pill-shaped */
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); color: var(--green-deep);
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 2px 8px rgba(141, 198, 63, 0.4);
  user-select: none;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}
.user-name {
  font-weight: 700;
  color: var(--white);
  font-size: 13px;
}
.user-role {
  font-size: 10.5px;
  color: var(--lime-soft);
  font-weight: 500;
}
.profile-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 4px;
}
.btn-logout {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 5px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-logout:hover {
  background: #ff3b30;
  color: var(--white);
  border-color: #ff3b30;
  box-shadow: 0 4px 14px rgba(255, 59, 48, 0.4);
  transform: translateY(-0.5px);
}
.btn-logout:active {
  transform: translateY(0.5px);
}
.logout-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}
.btn-logout:hover .logout-icon {
  transform: translateX(-2px);
}


/* ===== Layout ===== */
.wrap { max-width: 1040px; margin: 26px auto 40px; padding: 0 16px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 6px 24px rgba(11, 93, 46, 0.07);
  margin-bottom: 22px;
}
.card-title {
  margin: 0 0 18px; font-size: 17px; color: var(--green-dark);
  padding-bottom: 10px; border-bottom: 2px solid var(--green-tint);
}

/* ===== Form ===== */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.req { color: var(--lime); }
.field small { color: var(--muted); font-size: 12px; margin-top: 5px; }

input[type="file"], input[type="number"], input[type="text"], input[type="date"], select {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--green-tint2);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.28);
  background: var(--white);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(24%) sepia(87%) saturate(464%) hue-rotate(95deg) brightness(91%) contrast(98%);
  cursor: pointer;
}
input[type="file"] { padding: 8px; cursor: pointer; }
input[type="file"]::file-selector-button {
  border: 0; border-radius: 8px; padding: 8px 12px; margin-right: 12px;
  background: var(--green-dark); color: var(--white); font-weight: 600; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--green-mid); }

/* ===== Actions ===== */
.actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--lime), var(--green-mid));
  color: var(--green-deep); font-weight: 700; font-size: 15px;
  border: 0; border-radius: 12px; padding: 13px 26px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(141, 198, 63, 0.4);
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(46, 158, 79, 0.45); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { filter: grayscale(.4) brightness(.95); cursor: not-allowed; box-shadow: none; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid rgba(6, 61, 30, 0.25); border-top-color: var(--green-deep);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-msg { font-size: 13.5px; color: var(--muted); }

/* ===== Hasil ===== */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head .card-title { margin: 0; border: 0; padding: 0; }
.btn-download {
  background: var(--green-dark); color: var(--white); text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 11px 18px; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(11, 93, 46, 0.25); transition: background .15s;
}
.btn-download:hover { background: var(--green-mid); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.tile {
  background: linear-gradient(160deg, var(--green-tint), #ffffff);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center;
}
.tile-num { font-size: 30px; font-weight: 800; color: var(--green-dark); line-height: 1.1; }
.tile-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.result-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; color: var(--green-dark); }

.table-scroll { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; background: var(--green-dark); color: var(--white);
  text-align: left; padding: 9px 12px; font-weight: 600;
}
tbody td { padding: 8px 12px; border-bottom: 1px solid var(--green-tint); }
tbody tr:nth-child(even) { background: var(--green-tint2); }
.badge-ok { color: var(--green-mid); font-weight: 600; }
.badge-skip { color: #b8860b; font-weight: 600; }

.log {
  margin: 0; background: var(--green-deep); color: #d5efb4;
  border-radius: 10px; padding: 14px; font-size: 12.5px; line-height: 1.55;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

/* ===== Error ===== */
.error {
  border-color: #f2c4c0; background: var(--danger-bg); color: var(--danger);
  font-size: 14px; white-space: pre-wrap;
}

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 10px 16px 30px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-tint2);
  color: var(--green-dark); font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 20px; cursor: pointer;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: var(--green-tint);
  border-color: var(--green-mid);
  color: var(--green-deep);
}
.btn-secondary:active {
  transform: translateY(0.5px);
}

/* ===== Responsif ===== */
@media (max-width: 760px) {
  .grid, .grid-5 { grid-template-columns: 1fr 1fr; }
  .result-cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .grid, .grid-5 { grid-template-columns: 1fr; }
  .brand-text h1 { font-size: 18px; }
}

/* ===== Dropzone & File List Styles ===== */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: var(--green-tint2);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
  margin-top: 6px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--green-mid);
  background: var(--green-tint);
  box-shadow: 0 4px 12px rgba(141, 198, 63, 0.15);
}
.dropzone-icon {
  font-size: 32px;
}
.dropzone-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.dropzone-text strong {
  color: var(--green-dark);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 5px;
}
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.file-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.file-item-name {
  color: var(--ink);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item-size {
  color: var(--muted);
  font-size: 11.5px;
}
.btn-delete-file {
  background: none;
  border: none;
  color: #ff3b30;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.btn-delete-file:hover {
  background: #ffe5e5;
}

/* Grid Parameter Utama */
.grid-parameter {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Input Metadata (Bulan, Tahun, Hub) di kiri */
.meta-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Card untuk Date Range di kanan */
.date-range-card {
  display: flex;
  flex-direction: column;
}
.date-range-label {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 6px;
  color: var(--green-dark);
}
.helper-text {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

/* Box Pemilih Tanggal Terpadu */
.date-range-picker-box {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--green-tint2);
  padding: 0 12px;
  height: 44px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.date-range-picker-box:focus-within {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.28);
  background: var(--white);
}

.calendar-icon {
  font-size: 16px;
  margin-right: 8px;
  user-select: none;
}
.range-arrow {
  font-weight: 700;
  color: var(--green-mid);
  margin: 0 8px;
  user-select: none;
}

/* Input Date bersih di dalam box */
.date-picker-clean {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 14px;
  color: var(--ink);
  width: 130px;
  height: 100%;
  outline: none !important;
  box-shadow: none !important;
}
.date-picker-clean::-webkit-calendar-picker-indicator {
  filter: invert(24%) sepia(87%) saturate(464%) hue-rotate(95deg) brightness(91%) contrast(98%);
  cursor: pointer;
}
/* ===== Ultra-Premium Progress Bar Lengkap dengan Prosentase ===== */
.progress-box {
  flex: 1;
  min-width: 280px;
  background: linear-gradient(135deg, rgba(239, 248, 228, 0.9), rgba(255, 255, 255, 0.95));
  border: 1.5px solid rgba(141, 198, 63, 0.55);
  border-radius: 14px;
  padding: 11px 16px;
  box-shadow: 0 4px 18px rgba(11, 93, 46, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInProgress 0.3s ease;
}

@keyframes fadeInProgress {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.progress-box.progress-error {
  border-color: #f2c4c0;
  background: linear-gradient(135deg, rgba(253, 237, 237, 0.95), rgba(255, 255, 255, 0.95));
  box-shadow: 0 4px 18px rgba(211, 47, 47, 0.15);
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.progress-status-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}

.progress-box.progress-error .progress-status-text {
  color: var(--danger);
}

.progress-percent-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--green-mid);
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  background: rgba(11, 93, 46, 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  transition: color 0.3s, background 0.3s;
}

.progress-box.progress-error .progress-percent-val {
  color: var(--danger);
  background: rgba(211, 47, 47, 0.08);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(11, 93, 46, 0.12);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1fa855, #8dc63f, #2e9e4f, #8dc63f);
  background-size: 300% 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  animation: progressShimmer 2s infinite linear;
  position: relative;
  box-shadow: 0 0 12px rgba(141, 198, 63, 0.6);
}

.progress-box.progress-error .progress-fill {
  background: linear-gradient(90deg, #d32f2f, #f44336);
  box-shadow: 0 0 12px rgba(211, 47, 47, 0.5);
  animation: none;
}

@keyframes progressShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Responsif */
@media (max-width: 760px) {
  .grid-parameter {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
@media (max-width: 480px) {
  .meta-inputs {
    grid-template-columns: 1fr;
  }
}


