:root {
  --theme-primary: #CF0304;
  --theme-primary-light: #ff4d4d;
  --theme-teal: #00ACC2;
  --theme-teal-dark: #008b99;
  --theme-primary-rgb: 207, 3, 4;
  --primary: var(--theme-primary);
  --primary-light: var(--theme-primary-light);
  --teal: var(--theme-teal);
  --teal-dark: var(--theme-teal-dark);
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
}

.gradient-hero {
  background: linear-gradient(160deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%);
}

.gradient-primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
}

.shadow-soft {
  box-shadow: 0 4px 16px -2px rgba(207, 3, 4, 0.08);
}

.theme-color { color: var(--teal); }
.theme-bg { background-color: var(--teal); }
.theme-bg-hover:hover { background-color: var(--teal-dark); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  background-color: #e2e8f0;
  animation: pulse 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

input, select, textarea {
  outline: none;
}

.form-input {
  width: 100%;
  height: 3rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 0 1rem;
  font-size: 0.875rem;
}

.form-input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: white;
  border: 2px solid #e5e7eb;
  color: #374151;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
}

.step-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step-dot.active {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
  color: white;
}

.step-dot.done {
  background: #22c55e;
  color: white;
}

.step-dot.pending {
  background: #f3f4f6;
  color: #9ca3af;
}

.status-pending { background: #fef3c7; color: #d97706; }
.status-approved { background: #dcfce7; color: #16a34a; }
.status-rejected { background: #fee2e2; color: #dc2626; }

/* Admin dashboard layout */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 57px);
  position: relative;
}

.admin-sidebar {
  width: 16rem;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid #e5e7eb;
  padding: 1rem;
  overflow-y: auto;
}

.admin-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 72rem;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 57px;
  z-index: 25;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.admin-sidebar-backdrop.is-visible {
  display: block;
}

@media (max-width: 1023px) {
  .admin-sidebar {
    position: fixed;
    top: 57px;
    left: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .admin-main {
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .admin-sidebar-backdrop {
    display: none !important;
  }
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table-wrap table {
  min-width: 640px;
}

.admin-cards-mobile {
  display: block;
}

.admin-table-desktop {
  display: none;
}

@media (min-width: 768px) {
  .admin-cards-mobile {
    display: none;
  }

  .admin-table-desktop {
    display: block;
  }
}

.admin-data-card {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-data-card:last-child {
  border-bottom: none;
}

.admin-data-card:active {
  background: #f9fafb;
}

.admin-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .admin-filter-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.admin-settings-card {
  width: 100%;
  max-width: 42rem;
}

.admin-mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  .admin-mobile-nav {
    display: none;
  }
}

.admin-mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.4rem 0.25rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 0.75rem;
  min-height: 3rem;
}

.admin-mobile-nav-btn i {
  font-size: 1.1rem;
}

.admin-mobile-nav-btn.is-active {
  color: var(--theme-primary, #cf0304);
  background: rgba(var(--theme-primary-rgb, 207, 3, 4), 0.08);
}

body.admin-has-mobile-nav {
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  body.admin-has-mobile-nav {
    padding-bottom: 0;
  }
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.table-row:hover { background: #f9fafb; }

/* Custom dialog (ganti alert/confirm/prompt bawaan browser) */
.app-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.app-dialog-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.app-dialog-panel {
  width: 100%;
  max-width: 22rem;
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.28);
  transform: scale(0.92) translateY(8px);
  transition: transform 0.22s ease;
  text-align: center;
}

.app-dialog-backdrop.show .app-dialog-panel {
  transform: scale(1) translateY(0);
}

.app-dialog-icon-wrap {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.app-dialog-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
}

.app-dialog-message {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.55;
  white-space: pre-line;
}

.app-dialog-input-wrap {
  margin-bottom: 1rem;
  text-align: left;
}

.app-dialog-actions {
  display: flex;
  gap: 0.625rem;
  flex-direction: column-reverse;
}

@media (min-width: 420px) {
  .app-dialog-actions {
    flex-direction: row;
  }
}

.app-dialog-btn {
  flex: 1;
  height: 2.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.app-dialog-btn:active {
  transform: scale(0.98);
}

.app-dialog-btn-cancel {
  background: #fff;
  border: 2px solid #e5e7eb;
  color: #374151;
}

.app-dialog-btn-cancel:hover {
  background: #f9fafb;
}

.app-dialog-btn-ok.gradient-primary {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-primary-light));
}
