:root {
  --primary-color: #ff5c00;
  --bg-color: #ffffff;
  /* select icon and padding variables for precise alignment */
  --select-icon-offset: 18px;
  --select-padding-right: 44px;
  --text-main: #1a1a1a;
  --text-muted: #8e8e93;
  --border-color: #f2f2f7;
  --tag-bg: #ffefe5;
  --tag-text: #ff5c00;
  --font-family: "Outfit", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: #f9f9fb;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.mobile-container {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-color);
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Wider layout on larger screens */
@media (min-width: 900px) {
  .mobile-container {
    max-width: 1100px; /* increase for desktop */
    border-radius: 12px;
    margin: 20px; /* small outer margin */
  }
}

/* Header */
header {
  padding: 15px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: white;
  z-index: 100;
}

header h1 {
  font-size: 18px;
  font-weight: 700;
}

/* Topbar (page-level actions) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: white;
  height: 56px;
}
.topbar-center {
  font-weight: 700;
  font-size: 18px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-text-btn {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}
.nav-text-btn:active { opacity: 0.7; }

/* Search Bar */
.search-container {
  padding: 20px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 14px 14px 14px 45px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: #f5f5f7;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 92, 0, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  color: var(--text-muted);
}

/* Category Tabs */
.tabs-scroll {
  overflow-x: auto;
  white-space: nowrap;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: none;
  /* Firefox */
}

.tabs-scroll::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.tabs {
  display: flex;
  gap: 20px;
  padding: 0 10px;
}

.tab {
  padding: 15px 5px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab.active {
  color: var(--text-main);
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary-color);
}

/* List Items */
.benefit-list {
  flex: 1;
}

.benefit-item {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.benefit-item:active {
  background-color: #f9f9fb;
}

.logo-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #eee;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-container i {
  font-size: 24px;
  color: var(--primary-color);
}

.benefit-info {
  flex: 1;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  background-color: var(--primary-color);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 4px;
}

.benefit-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.benefit-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: #333231;
  line-height: 1.3;
}

/* Detail Page */
.detail-header {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.back-btn {
  font-size: 24px;
  cursor: pointer;
  margin-right: 15px;
}

.detail-content {
  padding: 20px 20px 100px 20px;
  /* Add bottom padding for sticky button */
}

.detail-main-img {
  width: 100%;
  border-radius: 16px;
  margin-top: 20px;
  display: block;
}

/* Sticky Footer */
.sticky-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: white;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.cta-button {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.cta-button:active {
  background-color: #e65200;
}

/* Forms */
.form-container {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: #f5f5f7;
  font-size: 15px;
  outline: none;
  transition: all 0.2s ease;
}

/* Custom styled select (dropdown) */

.custom-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  /* Position icon relative to right edge using variable so it lines up with padding */
  background-position: right var(--select-icon-offset) center, right calc(var(--select-icon-offset) - 6px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: var(--select-padding-right);
}

.custom-select:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 92, 0, 0.06);
}

.select-wrapper {
  position: relative;
}

/* remove select-wrapper/icon rules (we reverted to native/background arrow) */

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
}

.form-group input:focus,
.form-group textarea:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(255, 92, 0, 0.1);
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.inline-btn {
  padding: 8px 14px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Admin Styles */
.admin-list-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: white;
  text-decoration: none;
  display: block;
}

.admin-list-item:active {
  background-color: #f9f9fb;
}

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

.company-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.decision-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 20px;
  background: white;
  border-top: 1px solid var(--border-color);
  z-index: 100;
}

.btn-approve {
  background: #34c759;
  color: white;
  flex: 2;
}

.btn-reject {
  background: #ff3b30;
  color: white;
  flex: 1;
}

.review-section {
  padding: 24px;
  border-bottom: 8px solid #f2f2f7;
}

.review-section h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.review-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  font-size: 14px;
}

.review-label {
  color: var(--text-muted);
  font-weight: 500;
}

.review-value {
  color: var(--text-main);
}

.checkbox-item input[type="checkbox"] {
  min-width: 18px;
  min-height: 18px;
  accent-color: var(--primary-color);
}

/* Editor Mockup */
.editor-mock {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.editor-toolbar {
  background-color: #f5f5f7;
  padding: 8px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
}

.editor-toolbar i {
  color: #666;
  cursor: pointer;
  padding: 4px;
}

.editor-content {
  min-height: 150px;
  padding: 14px;
  background: white;
  font-size: 15px;
  outline: none;
}

/* Dashboard Status */
.status-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.status-draft {
  background: none;
  color: #5E57EC;
}

.status-pending {
  background: #fff4e5;
  color: #F46829;
}

.status-approved {
  background: #eaffea;
  color: #2F9E6F;
}

.status-rejected {
  background: #ffebeb;
  color: #ff3b30;
}

/* Better File Input */
.file-upload-wrapper {
  position: relative;
}

.file-input-custom {
  display: none;
}

.file-label-custom {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #f9f9fb;
  cursor: pointer;
  transition: all 0.2s;
  width: fit-content;
}

.file-label-custom:hover {
  border-color: var(--primary-color);
  background: #fffafa;
}

.file-label-custom i {
  font-size: 18px;
  color: var(--primary-color);
}

.file-label-custom span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.file-preview {
  margin-top: 10px;
  width: 100%;
  max-height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  object-fit: contain;
  background-color: #f9f9fb;
  display: none;
  /* Shown via JS or if value exists */
}

/* Toggle Switch */
.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: #f5f5f7;
  border-radius: 12px;
  margin-bottom: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Dashboard Actions */
.dashboard-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.action-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  border: none;
  outline: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel {
  display: inline-block;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #eef2ff;
  color: var(--text-main);
  border-radius: 12px;
  text-decoration: none;
}

.actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end; /* keep actions aligned to the right */
}

.btn-outline-danger {
  border: 1px solid #ff3b30;
  color: #ff3b30;
  background: transparent;
}

.action-btn:active {
  transform: scale(0.95);
  opacity: 0.8;
}

.primary-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s;
}

/* Loading state for buttons */
.primary-btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.primary-btn.loading::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-btn:active {
  transform: scale(0.98);
  background-color: #e65200;
}

/* Focus Animations */
@keyframes focus-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 92, 0, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(255, 92, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 92, 0, 0);
  }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  background-color: #fff;
  border-color: var(--primary-color);
  animation: focus-pulse 1.5s infinite;
}

/* Error Shake */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

.field-error {
  animation: shake 0.4s ease-in-out;
  border-color: #ff3b30 !important;
}

/* Status Refinement */
.status-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  background: #fff9e6;
  color: #d97706;
  border: 1px solid #fde68a;
}

.status-approved {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.status-rejected {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
