/* ============================================
   RESET & BASE
============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
}

/* ============================================
   NAVBAR (replaces sidebar)
============================================ */
.navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

.navbar-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-subtitle {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #0ea5e9;
}

.nav-link.active {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white;
  box-shadow: 0 4px 12px rgba(14,165,233,0.25);
}

.nav-link i {
  font-size: 14px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-clock {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 12px;
}

/* ============================================
   CONTENT AREA
============================================ */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* BREADCRUMB */
.breadcrumb {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb span {
  color: #0ea5e9;
  cursor: pointer;
  font-weight: 500;
}
.breadcrumb span:hover {
  text-decoration: underline;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

/* ============================================
   STATS CARDS
============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 16px;
  padding: 20px 22px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-card.teal {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
}
.stat-card.green {
  background: linear-gradient(135deg, #10b981, #059669);
}
.stat-card.orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.stat-card.purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-card-icon {
  font-size: 48px;
  opacity: 0.15;
  position: absolute;
  right: 18px;
  bottom: 8px;
}

/* ============================================
   FORM CARD
============================================ */
.form-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid rgba(0,0,0,0.04);
}

.form-card-header {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.form-card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.form-card-header p {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.form-card-header .header-icon {
  font-size: 20px;
  opacity: 0.9;
}

.form-card-body {
  padding: 22px;
}

/* ============================================
   MAIN LAYOUT (2 kolom)
============================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.col-left  { min-width: 0; }
.col-right { min-width: 0; }

/* ============================================
   FORM ELEMENTS
============================================ */
.section-title {
  font-weight: 700;
  font-size: 12px;
  color: #0ea5e9;
  margin: 18px 0 8px;
  padding-left: 10px;
  border-left: 3px solid #0ea5e9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="month"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  margin-top: 4px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

select { cursor: pointer; background: #fff; }
textarea { resize: vertical; min-height: 110px; }

#jenisKejadian {
  font-weight: 700;
  font-size: 14px;
  color: #0ea5e9;
  border: 2px solid #0ea5e9;
  background: #f0f9ff;
}

/* ============================================
   FIELD PESAWAT
============================================ */
.field-pesawat { display: none; }

.field-pesawat-inner {
  background: #f0f9ff;
  border: 1.5px dashed #0ea5e9;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

/* ============================================
   BUTTONS
============================================ */
.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-generate {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white;
  box-shadow: 0 4px 14px rgba(14,165,233,0.3);
}
.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14,165,233,0.4);
}

.btn-copy {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 0 4px 14px rgba(139,92,246,0.3);
}
.btn-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.4);
}

.btn-reset {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-reset:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
}

.btn-save {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}
.btn-save:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-log {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(139,92,246,0.3);
  border: none;
  cursor: pointer;
}
.btn-log:hover {
  transform: translateY(-1px);
}

/* ============================================
   OUTPUT BOX
============================================ */
.output-box {
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  min-height: 350px;
  line-height: 1.9;
  color: #1e293b;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.output-label {
  font-size: 13px;
  font-weight: 700;
  color: #0ea5e9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-success {
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 4px;
}

/* ============================================
   DIVIDER & NOTE
============================================ */
hr.divider {
  border: none;
  border-top: 1px dashed #e2e8f0;
  margin: 16px 0;
}

.note {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  font-style: italic;
}

/* ============================================
   BADGE
============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-pesawat    { background: #eff6ff; color: #2563eb; }
.badge-nonpesawat { background: #f0fdf4; color: #16a34a; }

/* ============================================
   SAVE NOTIFICATION
============================================ */
.save-notif {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}
.save-notif.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.save-notif.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

/* ============================================
   DETAIL TABLE
============================================ */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}
.detail-table td {
  padding: 7px 8px;
  color: #475569;
  vertical-align: top;
}
.detail-table td:first-child {
  font-weight: 600;
  color: #334155;
  width: 140px;
  white-space: nowrap;
}

.detail-desc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.8;
  color: #334155;
  margin-top: 6px;
  white-space: pre-wrap;
}

/* ============================================
   LOG TABLE
============================================ */
.table-responsive { overflow-x: auto; }

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px;
}
.log-table thead tr {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: white;
}
.log-table thead th {
  padding: 13px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.log-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.log-table tbody tr:hover {
  background: #f0f9ff;
}
.log-table tbody td {
  padding: 12px 14px;
  color: #475569;
  vertical-align: middle;
}

.id-badge {
  background: #f0fdf4;
  color: #16a34a;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.btn-action {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-view { background: #eff6ff; color: #2563eb; }
.btn-view:hover { background: #dbeafe; }
.btn-del { background: #fef2f2; color: #dc2626; }
.btn-del:hover { background: #fee2e2; }

/* ============================================
   PAGINATION
============================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 13px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.page-btn:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
  color: #0ea5e9;
}
.page-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  border-color: #0ea5e9;
  color: white;
}

.page-info {
  font-size: 12px;
  color: #94a3b8;
  margin-left: 8px;
}

/* ============================================
   EMPTY STATE
============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.empty-state i {
  font-size: 52px;
  margin-bottom: 15px;
  display: block;
  color: #cbd5e1;
}
.empty-state p {
  font-size: 15px;
  margin-bottom: 20px;
  color: #94a3b8;
}

/* ============================================
   MODAL
============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 40px 35px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1000000;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { transform: scale(0.8) translateY(-20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-icon {
  font-size: 50px;
  color: #ef4444;
  margin-bottom: 15px;
  display: block;
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.modal-box p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 28px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.modal-actions button {
  min-width: 120px;
  justify-content: center;
}

/* ============================================
   FOOTER
============================================ */
.footer {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
  margin-top: 20px;
}

/* ============================================
   FILTER ROW
============================================ */
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.filter-item {
  display: flex;
  flex-direction: column;
}

.filter-item label {
  margin-top: 0;
  margin-bottom: 4px;
}

.filter-btn {
  display: flex;
  gap: 8px;
  align-items: end;
  padding-bottom: 1px;
}

/* ============================================
   MOBILE CARDS (log.php)
============================================ */
.mobile-card {
  display: none;
}

.mobile-card-item {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.mobile-card-item .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mobile-card-item .card-body p {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.mobile-card-item .card-body p strong {
  color: #334155;
}

.mobile-card-item .card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ============================================
   HIDE HELPERS
============================================ */
.hide-xs { display: inline; }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .navbar-clock { display: none; }
  .navbar-nav .nav-text { display: none; }
  .nav-link { padding: 8px 12px; }
  .btn-group { flex-direction: column; }
  .modal-box { padding: 30px 20px; }
  .content { padding: 20px 16px; }
  .filter-row { grid-template-columns: 1fr; }
  .filter-btn { flex-direction: row; }
  .table-responsive .log-table { display: none; }
  .mobile-card { display: block; }
  .hide-xs { display: none; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .navbar { padding: 0 14px; }
}