/* ==========================================================================
   DASHBOARD TIKET - MAIN STYLESHEET
   ========================================================================== */

/* --- IMPORT FONT --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- GLOBAL STYLES --- */
body {
  background-color: #f8fafc; /* Latar belakang sedikit lebih terang */
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #334155;
}

.wrapper {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  flex: 1;
}

/* ==================== SIDEBAR STYLES (MODERN DARK GLASS) ==================== */

#sidebar {
  width: 260px;
  height: 100vh;
  /* Background Gradient Gelap Mewah */
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #94a3b8;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1020;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

/* Judul Dashboard (Brand) */
#sidebar h4 {
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1.5rem 0 1rem 0;
  margin-bottom: 2rem !important;
  font-size: 1.25rem;
  text-align: center;
  /* Efek Teks Gradient */
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

/* Garis pemisah halus di bawah judul */
#sidebar h4::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #3b82f6;
  border-radius: 10px;
}

/* Container Link Navigasi */
#sidebar .nav {
  gap: 8px;
}

/* Style Link Navigasi */
#sidebar .nav-link {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px; /* Sudut membulat */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  margin: 0 10px;
}

/* Ikon Navigasi */
#sidebar .nav-link i {
  font-size: 1.3rem;
  min-width: 24px;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #64748b;
}

/* Efek Hover */
#sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  transform: translateX(4px);
}

#sidebar .nav-link:hover i {
  transform: scale(1.15) rotate(-5deg);
  color: #93c5fd;
}

/* State Aktif (Menu yang sedang dipilih) */
#sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.05) 100%);
  color: #60a5fa;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  font-weight: 600;
}

#sidebar .nav-link.active i {
  color: #60a5fa;
}

/* Indikator aktif di sebelah kiri */
#sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 4px;
  background-color: #60a5fa;
  border-radius: 0 4px 4px 0;
}

/* Footer Sidebar */
#sidebar .mt-auto {
  background: rgba(0, 0, 0, 0.2);
  margin: 0 -16px -16px -16px;
  padding: 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Hapus HR bawaan bootstrap di sidebar */
#sidebar hr.text-secondary { display: none; }

/* State Sidebar Mobile & Collapsed */
#sidebar.collapsed { transform: translateX(-100%); }

@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); width: 280px; }
  #sidebar.show { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
}

/* ==================== MAIN CONTENT LAYOUT ==================== */

#main-content {
  flex-grow: 1;
  padding: 2rem;
  width: 100%;
  min-width: 0;
  transition: margin-left 0.3s ease-in-out;
  margin-left: 260px; /* Sesuai lebar sidebar */
  padding-bottom: 40px;
}

#sidebar.collapsed ~ #main-content,
.wrapper #main-content.sidebar-collapsed {
  margin-left: 0;
}

@media (max-width: 991.98px) {
  #main-content { margin-left: 0 !important; }
}

#sidebar-overlay {
  display: none;
  position: fixed;
  z-index: 1010;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* ==================== COMPONENT STYLES (HEADER & BUTTONS) ==================== */

/* Judul Halaman */
#page-title {
  font-weight: 800;
  color: #1e293b;
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 5px;
}

/* Tombol Toggle Sidebar (Modern) */
#sidebar-toggle {
  background: white;
  border: none;
  color: #475569;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

#sidebar-toggle:hover {
  background: #ffffff;
  color: #3b82f6;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.15), 0 4px 6px -2px rgba(59, 130, 246, 0.1);
}

#sidebar-toggle:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Tombol Aksi Utama --- */
#main-actions .btn {
  border: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
}

#main-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Warna Tombol Spesifik */
#add-ticket-btn { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
button[onclick="generateReport()"] { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
#manage-technicians-btn { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }
#export-btn { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

/* ==================== REPORT MODAL STYLES ==================== */

#report-textarea {
  height: 500px; /* Tinggi yang cukup untuk laporan panjang */
  font-family: 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace; /* Font khusus koding/laporan agar rata */
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre; /* Menjaga spasi dan enter tetap sesuai format */
  
  /* Tampilan Modern */
  background-color: #f1f5f9; /* Abu-abu sangat muda, nyaman di mata */
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #334155;
  padding: 1.5rem;
  resize: vertical; /* User bisa tarik atas-bawah saja */
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); /* Shadow ke dalam agar terlihat seperti input area */
}

#report-textarea:focus {
  background-color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
}


/* Filter Box */
#date-filter-container {
  background: white;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  margin-bottom: 2rem !important;
  border: 1px solid #f1f5f9;
}

#date-filter-container label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

/* Input Styling */
.form-control, .form-select {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  padding: 0.375rem 0.75rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
  background-color: #fff;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Search Box */
#searchInput {
  padding-left: 1rem;
  background: #fff;
}

/* ==================== TABLE STYLES (CLASSIC DESIGN) ==================== */

.table-responsive {
  background-color: white;
  border-radius: 0.5rem;
  padding: 0;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  border: 1px solid #dee2e6;
  overflow: auto;
  max-height: calc(100vh - 320px);
}

.table {
  table-layout: fixed;
  width: 100%;
  margin-bottom: 0;
}

.table th, .table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border: 1px solid #dee2e6; /* Border klasik di setiap sel */
  word-wrap: break-word;
  color: #212529;
}

.table thead th {
  background-color: #0d6efd; /* Header Biru Klasik */
  color: white;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #dee2e6;
}

.table-striped>tbody>tr:nth-of-type(odd)>* { background-color: rgba(0, 0, 0, 0.03); }
.table tbody tr:hover { background-color: rgba(0, 0, 0, 0.06); }

.badge {
  padding: 0.5em 0.8em;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 75%;
}

/* Lebar Kolom Tabel */
.table th:nth-child(1), .table td:nth-child(1) { width: 6ch; } /* No */
.table th:nth-child(2), .table td:nth-child(2) { width: 22ch; } /* ID Tiket */
.table th:nth-child(3), .table td:nth-child(3) { width: 10ch; } /* Kategori */
.table th:nth-child(4), .table td:nth-child(4) { width: 14ch; } /* Waktu */
.table th:nth-child(5), .table td:nth-child(5) { width: 14ch; } /* Update Terakhir */
.table th:nth-child(6), .table td:nth-child(6) { width: 50ch; } /* Deskripsi */
.table th:nth-child(7), .table td:nth-child(7) { width: 8ch; white-space: normal; text-align: center; } /* Status */
.table th:nth-child(8), .table td:nth-child(8) { width: 20ch; } /* Teknisi */
.table th:nth-child(9), .table td:nth-child(9) { width: 60ch; white-space: normal; } /* Update Progres */
.table th:nth-child(10), .table td:nth-child(10) { width: 12ch; white-space: normal; } /* Updated By */
.table th:nth-child(11), .table td:nth-child(11) { width: 12ch; white-space: normal; text-align: center; } /* Aksi */

/* --- Modal Teknisi (Classic Table Widths) --- */
#techniciansModal .table th:nth-child(1),
#techniciansModal .table td:nth-child(1) { width: 15%; text-align: left; }

#techniciansModal .table th:nth-child(2),
#techniciansModal .table td:nth-child(2) { width: 30%; }

#techniciansModal .table th:nth-child(3),
#techniciansModal .table td:nth-child(3) { width: 22%; }

#techniciansModal .table th:nth-child(4),
#techniciansModal .table td:nth-child(4) { width: 13%; text-align: left; }

#techniciansModal .table th:nth-child(5),
#techniciansModal .table td:nth-child(5) { width: 15%; text-align: left; }

/* --- Tab Kategori --- */
.category-tabs {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1.5rem !important;
  gap: 5px;
}

.category-tabs .nav-link {
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  transition: all 0.2s;
  cursor: pointer;
}

.category-tabs .nav-link:hover {
  color: #3b82f6;
  background: #f1f5f9;
}

.category-tabs .nav-link.active {
  background: #eff6ff;
  color: #3b82f6;
  box-shadow: none;
  border-bottom: 2px solid #3b82f6;
}

/* --- Modals --- */
.modal-content {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header { border-bottom: 1px solid #e9ecef; background: #f8f9fa; border-radius: 1rem 1rem 0 0; padding: 1.5rem;}
.modal-body { padding: 1.5rem; }
.modal-footer { border-top: 1px solid #e9ecef; padding: 1.25rem 1.5rem; }

/* ==================== STATISTICS STYLES (MODERN REDESIGN) ==================== */

#stats-summary-container { animation: fadeIn 0.6s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.stats-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  position: relative;
  padding-left: 12px;
}

.stats-section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  height: 20px; width: 4px; background: #3b82f6; border-radius: 4px;
}

/* Kartu Statistik Modern */
.stats-summary-card {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 120px;
  position: relative; overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  z-index: 1;
}

.stats-summary-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }

.stats-summary-card.bg-gradient-primary { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.stats-summary-card.bg-gradient-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.stats-summary-card.bg-gradient-info { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); color: white; }
.stats-summary-card.bg-gradient-secondary { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: white; }

.stats-summary-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); z-index: -1;
}

.stats-summary-card .icon {
  font-size: 2.5rem; background: rgba(255, 255, 255, 0.2);
  width: 60px; height: 60px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}

.stats-summary-card .stat-value { font-size: 2.25rem; font-weight: 800; line-height: 1; margin-bottom: 0.25rem; }
.stats-summary-card .stat-label { font-size: 0.95rem; font-weight: 500; opacity: 0.9; }

#stats-summary-row { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 32px; }
#stats-summary-row > .col-md-3, #stats-summary-row > .col-6 { padding: 0; flex: 1 1 250px; }

.card.h-100, .card.stats-chart-card {
  border: none; border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease; background: #ffffff;
}
.card.h-100:hover, .card.stats-chart-card:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); }

.card-header { background-color: transparent; border-bottom: 1px solid #f1f5f9; padding: 1.25rem 1.5rem; }
.list-group-item { border: none; border-bottom: 1px solid #f1f5f9; padding: 1rem 1.5rem; transition: background-color 0.2s; color: #475569; font-weight: 500; }
.list-group-item:hover { background-color: #f8fafc; color: #3b82f6; }

#stats-trend-chart { width: 100% !important; min-height: 300px !important; padding: 10px; }

@media (max-width: 767.98px) {
  .stats-summary-card { padding: 1.25rem; min-height: 100px; }
  .stats-summary-card .icon { width: 45px; height: 45px; font-size: 1.8rem; }
  .stats-summary-card .stat-value { font-size: 1.75rem; }
  #stats-summary-row { gap: 16px; }
}

/* ==================== FOOTER ==================== */
footer {
  background: transparent; color: #64748b; font-size: 0.9rem;
  text-align: center; padding: 20px 0; margin-top: auto; border-top: 1px solid #e2e8f0;
}
footer a { color: #3b82f6; text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; color: #2563eb; }