:root {
  --bg-color: #f5f5f7;
  --card-bg: #ffffff;
  --border-color: #d2d2d7;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  
  --primary: #0071e3;
  --primary-hover: #0062c3;
  --primary-bg-light: #f5f5f7;
  
  --success: #34c759;
  --success-bg: #eafaf1;
  --warning: #ff9500;
  --warning-bg: #fff9f0;
  --danger: #ff3b30;
  --danger-bg: #ffebeb;
  
  --transition-fast: all 0.15s ease-out;
  --radius-large: 12px;
  --radius-small: 8px;
  --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Apple standard resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Minimalist Clean Card */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-light);
}

/* Typography */
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 6px;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 24px;
}

/* Professional Form Controls */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Standard HIG Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-small);
  border: none;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:disabled {
  background-color: var(--border-color);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--primary-bg-light);
  color: var(--primary);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  background-color: #e8e8ed;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Table Style: No vertical borders, thin light rows (Clean HIG table) */
.table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  background-color: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e5ea;
  vertical-align: middle;
}

th {
  background-color: #f5f5f7;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  text-transform: none;
  font-size: 0.8rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #fafafc;
}

/* Badges: Extremely clean and subtle */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-pending {
  background-color: #f5f5f7;
  color: var(--text-secondary);
}

.badge-completed {
  background-color: var(--success-bg);
  color: var(--success);
}

/* Progress bar */
.progress-container {
  background-color: #e5e5ea;
  border-radius: 100px;
  height: 6px;
  width: 100%;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar {
  background-color: var(--primary);
  height: 100%;
  width: 0;
  transition: width 0.3s ease;
}

/* Cards for Dealer items (Manager View) */
.dealer-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-large);
  padding: 18px 24px;
  margin-bottom: 12px;
  transition: var(--transition-fast);
}

.dealer-card.sent {
  background-color: #f5f5f7;
  border-color: #e5e5ea;
}

.dealer-card.sent .dealer-name {
  color: var(--text-secondary);
}

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

.dealer-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.dealer-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.action-row {
  display: flex;
  gap: 10px;
}

.action-row .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* Card highlight for auto-advance */
.dealer-card.highlight-focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
  background-color: #fff;
}

/* Questionnaire */
.question-box {
  background-color: #f5f5f7;
  border-radius: var(--radius-small);
  padding: 16px;
  margin-bottom: 16px;
}

.question-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
}

.required-star {
  color: var(--danger);
  margin-right: 2px;
}

/* Option grid button radios */
.option-btn {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-small);
  padding: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.option-btn:hover {
  background-color: #f5f5f7;
}

.option-btn.selected {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Copied Toast Banner */
.copy-success-tip {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1d1d1f;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-small);
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  opacity: 1;
  animation: toastFadeIn 0.2s ease-out;
}

/* Success Card View */
.success-icon {
  width: 56px;
  height: 56px;
  background-color: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px auto;
}

/* Admin Dashboard layout: Side-by-side or stacked clean sections */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 850px) {
  .dashboard-layout {
    grid-template-columns: 280px 1fr;
  }
}

.task-sidebar-item {
  padding: 12px 16px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: var(--transition-fast);
}

.task-sidebar-item:hover {
  background-color: #f5f5f7;
}

.task-sidebar-item.active {
  border-color: var(--primary);
  background-color: rgba(0, 113, 227, 0.04);
}

.task-sidebar-item.active .dealer-name {
  color: var(--primary);
}

/* Status indicator dot */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
