/* ============================================================
   AIRPAK EXPRESS NOVA — iOS 26 Component Library
   50+ Production-Ready Components
   ============================================================ */

/* ===== BUTTONS ===== */

/* Primary — filled blue button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--apple-blue);
  color: white;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.btn-primary:hover {
  background: var(--apple-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
  text-decoration: none;
  color: white;
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary — outlined button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--apple-fill);
  color: var(--apple-label);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--apple-separator);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.btn-secondary:hover {
  background: var(--apple-fill-secondary);
  border-color: var(--apple-gray3);
  text-decoration: none;
  color: var(--apple-label);
}

.btn-secondary:active {
  transform: scale(0.97);
  background: var(--apple-fill-tertiary);
}

/* Tertiary — text button */
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--apple-blue);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
}

.btn-tertiary:hover {
  background: rgba(0, 122, 255, 0.08);
  text-decoration: none;
}

.btn-tertiary:active {
  background: rgba(0, 122, 255, 0.12);
}

/* Danger / Destructive */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--apple-red);
  color: white;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 16px rgba(255, 59, 48, 0.3);
  -webkit-tap-highlight-color: transparent;
}

.btn-danger:hover {
  background: var(--apple-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
  text-decoration: none;
  color: white;
}

/* Success */
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--apple-green);
  color: white;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
  -webkit-tap-highlight-color: transparent;
}

.btn-success:hover {
  background: var(--apple-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4);
  text-decoration: none;
  color: white;
}

/* Ghost — transparent with hover bg */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--apple-label-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost:hover {
  background: var(--apple-fill);
  color: var(--apple-label);
  text-decoration: none;
}

/* Icon Button */
.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--apple-fill);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--apple-label-secondary);
  font-size: var(--text-base);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover {
  background: var(--apple-fill-secondary);
  color: var(--apple-label);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.93);
}

/* Pill Button */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast);
}

.btn-pill:hover,
.btn-pill.active {
  background: var(--apple-blue);
  color: white;
}

/* Size Variants */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-xl {
  padding: var(--space-5) var(--space-10);
  font-size: var(--text-xl);
}

.btn-block {
  width: 100%;
}

/* ===== BADGES ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-2xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
}

.badge-blue { background: rgba(0, 122, 255, 0.12); color: var(--apple-blue); }
.badge-green { background: rgba(52, 199, 89, 0.12); color: var(--apple-green); }
.badge-red { background: rgba(255, 59, 48, 0.12); color: var(--apple-red); }
.badge-orange { background: rgba(255, 149, 0, 0.12); color: var(--apple-orange); }
.badge-yellow { background: rgba(255, 204, 0, 0.15); color: #996B00; }
.badge-gray { background: var(--apple-fill); color: var(--apple-label-secondary); }
.badge-purple { background: rgba(88, 86, 214, 0.12); color: var(--apple-indigo); }
.badge-pink { background: rgba(255, 45, 85, 0.12); color: #C41060; }
.badge-teal { background: rgba(90, 200, 250, 0.12); color: #007A99; }

/* Status Badges */
.badge-pending { background: rgba(255, 149, 0, 0.12); color: var(--apple-orange); }
.badge-processing { background: rgba(0, 122, 255, 0.12); color: var(--apple-blue); }
.badge-shipped { background: rgba(88, 86, 214, 0.12); color: var(--apple-indigo); }
.badge-delivered { background: rgba(52, 199, 89, 0.12); color: var(--apple-green); }
.badge-cancelled { background: rgba(255, 69, 58, 0.12); color: var(--apple-red); }
.badge-returned { background: rgba(255, 149, 0, 0.12); color: var(--apple-orange); }
.badge-delay { background: rgba(255, 69, 58, 0.12); color: var(--apple-red); animation: pulse-dot 2s infinite; }

/* Service Tier Badges */
.badge-express { background: linear-gradient(135deg, rgba(255, 204, 0, 0.2), rgba(255, 149, 0, 0.2)); color: #996B00; border: 1px solid rgba(255, 204, 0, 0.3); }
.badge-economy { background: var(--apple-fill); color: var(--apple-label-tertiary); }

/* Notification Dot */
.notif-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--apple-red);
  border-radius: var(--radius-full);
  animation: pulse-dot 2s infinite;
}

.notif-dot.green { background: var(--apple-green); }
.notif-dot.blue { background: var(--apple-blue); }
.notif-dot.orange { background: var(--apple-orange); }

/* ===== INPUTS ===== */

/* Text Input */
.input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--apple-fill);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--apple-label);
  outline: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  -webkit-appearance: none;
}

.input::placeholder { color: var(--apple-gray); }

.input:hover {
  border-color: var(--apple-separator);
  background: var(--apple-fill-secondary);
}

.input:focus {
  border-color: var(--apple-blue);
  background: var(--apple-fill);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.input.error {
  border-color: var(--apple-red);
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

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

/* Search Input */
.input-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  background: var(--apple-fill);
  border: 1.5px solid transparent;
  border-radius: var(--radius-full);
  height: 44px;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.input-search:focus-within {
  border-color: var(--apple-blue);
  background: var(--apple-fill-secondary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.input-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-base);
  color: var(--apple-label);
  min-width: 0;
}

.input-search input::placeholder { color: var(--apple-gray); }

.input-search .icon {
  font-size: var(--text-base);
  color: var(--apple-gray);
}

/* Textarea */
.textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: var(--space-3) var(--space-4);
  background: var(--apple-fill);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--apple-label);
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.textarea:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Floating Label Input */
.input-group {
  position: relative;
  margin-bottom: var(--space-5);
}

.input-group .floating-label {
  position: absolute;
  top: 50%;
  left: var(--space-4);
  transform: translateY(-50%);
  font-size: var(--text-base);
  color: var(--apple-gray);
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.input-group .input {
  padding-top: var(--space-5);
}

.input-group .input:focus + .floating-label,
.input-group .input:not(:placeholder-shown) + .floating-label {
  top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--apple-blue);
  transform: none;
}

/* Select Dropdown */
.select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--apple-fill);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--apple-label);
  cursor: pointer;
  outline: none;
  transition: all var(--duration-fast);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2386868C' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.select:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--apple-fill);
  border: 1.5px solid var(--apple-gray3);
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all var(--duration-fast);
  flex-shrink: 0;
}

.checkbox input[type="checkbox"]:checked {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
}

.checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox .label-text {
  font-size: var(--text-sm);
  color: var(--apple-label);
}

/* Radio */
.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.radio input[type="radio"] {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--apple-fill);
  border: 1.5px solid var(--apple-gray3);
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all var(--duration-fast);
  flex-shrink: 0;
}

.radio input[type="radio"]:checked {
  border-color: var(--apple-blue);
}

.radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  background: var(--apple-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.radio .label-text {
  font-size: var(--text-sm);
  color: var(--apple-label);
}

/* Toggle Switch */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  display: none;
}

.toggle-track {
  width: 51px;
  height: 31px;
  background: var(--apple-fill-tertiary);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration-normal) var(--ease-smooth);
  flex-shrink: 0;
}

.toggle input:checked + .toggle-track {
  background: var(--apple-green);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-spring);
}

.toggle input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.toggle .label-text {
  font-size: var(--text-sm);
  color: var(--apple-label);
}

/* Range Slider */
.range {
  width: 100%;
  height: 4px;
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  appearance: none;
  outline: none;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(0, 122, 255, 0.15);
  cursor: pointer;
}

/* ===== FORM FIELDS ===== */

.field {
  margin-bottom: var(--space-5);
}

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--apple-label);
  margin-bottom: var(--space-2);
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--apple-label-secondary);
  margin-top: var(--space-1);
}

.field-error {
  font-size: var(--text-xs);
  color: var(--apple-red);
  margin-top: var(--space-1);
}

.field-group {
  display: flex;
  gap: var(--space-4);
}

.field-group .field {
  flex: 1;
}

/* ===== CARDS ===== */

.card {
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-spring);
}

.card.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--apple-separator);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--apple-label);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--apple-separator);
  background: var(--apple-fill);
}

/* Glass Card Variant */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
}

/* Stat Card */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-xl);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--apple-label);
  letter-spacing: var(--tracking-tight);
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
}

.stat-card .stat-change {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card .stat-change.up { color: var(--apple-green); }
.stat-card .stat-change.down { color: var(--apple-red); }

/* Service Card */
.service-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.service-card:hover {
  border-color: var(--apple-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.service-card .service-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.service-card .service-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--apple-label);
}

.service-card .service-desc {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
  line-height: var(--leading-relaxed);
}

/* Price Card */
.price-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8);
  background: var(--apple-bg-secondary);
  border: 2px solid var(--apple-separator);
  border-radius: var(--radius-2xl);
  text-align: center;
  transition: all var(--duration-normal) var(--ease-spring);
}

.price-card.featured {
  border-color: var(--apple-blue);
  background: rgba(0, 122, 255, 0.03);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.price-card .price {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--apple-label);
  letter-spacing: var(--tracking-tight);
}

.price-card .price span {
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
}

.price-card .features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.price-card .features li {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.price-card .features li::before {
  content: '✓';
  color: var(--apple-green);
  font-weight: var(--font-bold);
}

/* ===== TABLES ===== */

.table-container {
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: var(--space-4) var(--space-5);
  background: var(--apple-fill);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--apple-label-secondary);
  text-align: left;
  border-bottom: 1px solid var(--apple-separator);
}

.table td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--apple-label);
  border-bottom: 1px solid var(--apple-separator);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: var(--apple-fill);
}

/* User Cell in Table */
.table-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.table-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: white;
  flex-shrink: 0;
}

.table-user-info {
  min-width: 0;
}

.table-user-name {
  font-weight: var(--font-semibold);
  color: var(--apple-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-user-email {
  font-size: var(--text-xs);
  color: var(--apple-label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Buttons in Table Row */
.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ===== TABS ===== */

.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  width: fit-content;
}

.tab {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: none;
  background: transparent;
  text-decoration: none;
}

.tab:hover {
  color: var(--apple-label);
}

.tab.active {
  background: var(--apple-bg-secondary);
  color: var(--apple-label);
  box-shadow: var(--shadow-sm);
}

.tab .tab-count {
  margin-left: var(--space-2);
  padding: 1px 7px;
  background: var(--apple-fill-secondary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--apple-label-secondary);
}

.tab.active .tab-count {
  background: var(--apple-blue);
  color: white;
}

/* Segmented Control */
.segmented {
  display: flex;
  background: var(--apple-fill);
  border-radius: var(--radius-md);
  padding: 2px;
  width: fit-content;
}

.segmented .segment {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
}

.segmented .segment:hover {
  color: var(--apple-label);
}

.segmented .segment.active {
  background: var(--apple-bg-secondary);
  color: var(--apple-label);
  box-shadow: var(--shadow-sm);
}

/* ===== AVATAR ===== */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: var(--font-bold);
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: var(--text-2xs); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-sm); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-xl); }
.avatar-2xl { width: 96px; height: 96px; font-size: var(--text-2xl); }

/* Avatar with Status */
.avatar-wrap {
  position: relative;
  display: inline-flex;
}

.avatar-wrap .avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--apple-bg);
}

.avatar-status.online { background: var(--apple-green); }
.avatar-status.offline { background: var(--apple-gray); }
.avatar-status.busy { background: var(--apple-red); }
.avatar-status.away { background: var(--apple-orange); }

/* Avatar Group */
.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--apple-bg);
}

.avatar-group .avatar:not(:first-child) {
  margin-left: -12px;
}

/* ===== CHIP / TAG ===== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  background: var(--apple-fill-secondary);
}

.chip.active {
  background: var(--apple-blue);
  color: white;
}

.chip .chip-icon {
  font-size: var(--text-xs);
}

.chip .chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.chip .chip-remove:hover {
  background: rgba(0,0,0,0.2);
}

/* ===== LIST ITEMS ===== */

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--apple-bg-secondary);
  border-bottom: 1px solid var(--apple-separator);
  cursor: pointer;
  transition: background var(--duration-fast);
  text-decoration: none;
  color: inherit;
}

.list-item:hover {
  background: var(--apple-fill);
}

.list-item:last-child { border-bottom: none; }

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
  background: var(--apple-fill);
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--apple-label);
}

.list-item-subtitle {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-extra {
  flex-shrink: 0;
  color: var(--apple-label-tertiary);
}

.list-item-arrow {
  font-size: var(--text-lg);
  color: var(--apple-label-tertiary);
  flex-shrink: 0;
}

/* ===== PROGRESS ===== */

.progress-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-smooth);
}

.progress-bar-fill.animated {
  background: linear-gradient(
    90deg,
    var(--apple-blue) 25%,
    rgba(0, 122, 255, 0.6) 50%,
    var(--apple-blue) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

.progress-steps {
  display: flex;
  align-items: center;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  position: relative;
}

.progress-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 2px;
  background: var(--apple-fill);
}

.progress-step.completed::before {
  background: var(--apple-green);
}

.progress-step:last-child::before {
  display: none;
}

.progress-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--apple-fill);
  border: 2px solid var(--apple-fill-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--apple-label-tertiary);
  z-index: 1;
}

.progress-step.completed .progress-step-dot {
  background: var(--apple-green);
  border-color: var(--apple-green);
  color: white;
}

.progress-step.active .progress-step-dot {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.progress-step-label {
  font-size: var(--text-xs);
  color: var(--apple-label-tertiary);
  text-align: center;
}

.progress-step.completed .progress-step-label,
.progress-step.active .progress-step-label {
  color: var(--apple-label-secondary);
}

/* ===== TOOLTIP ===== */

.tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--apple-label);
  color: var(--apple-bg);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast) var(--ease-smooth);
  pointer-events: none;
  z-index: var(--z-tooltip);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== DROPDOWN ===== */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all var(--duration-fast) var(--ease-spring);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--apple-label);
  cursor: pointer;
  transition: background var(--duration-fast);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--apple-fill);
}

.dropdown-item .icon {
  width: 20px;
  text-align: center;
  color: var(--apple-label-secondary);
}

.dropdown-divider {
  height: 1px;
  background: var(--apple-separator);
  margin: var(--space-1) 0;
}

/* ===== MODAL ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  animation: fade-in 0.2s var(--ease-out) forwards;
}

.modal {
  background: var(--apple-bg-secondary);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow-ultra);
  max-width: 480px;
  width: 100%;
  animation: scale-in 0.3s var(--ease-spring) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--apple-separator);
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--apple-label);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--apple-fill);
  cursor: pointer;
  transition: all var(--duration-fast);
  border: none;
  font-size: var(--text-lg);
  color: var(--apple-label-secondary);
}

.modal-close:hover {
  background: var(--apple-fill-secondary);
  color: var(--apple-label);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-6);
  border-top: 1px solid var(--apple-separator);
  justify-content: flex-end;
}

/* Alert Modal */
.modal.alert .modal-body {
  text-align: center;
}

.modal.alert .modal-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.modal.alert .modal-message {
  font-size: var(--text-base);
  color: var(--apple-label-secondary);
  line-height: var(--leading-relaxed);
}

/* ===== ALERTS / BANNERS ===== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(0, 122, 255, 0.08);
  border-color: rgba(0, 122, 255, 0.15);
}

.alert-info .alert-icon { color: var(--apple-blue); }

.alert-success {
  background: rgba(52, 199, 89, 0.08);
  border-color: rgba(52, 199, 89, 0.15);
}

.alert-success .alert-icon { color: var(--apple-green); }

.alert-warning {
  background: rgba(255, 149, 0, 0.08);
  border-color: rgba(255, 149, 0, 0.15);
}

.alert-warning .alert-icon { color: var(--apple-orange); }

.alert-error {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.15);
}

.alert-error .alert-icon { color: var(--apple-red); }

.alert-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
  padding-top: 2px;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--apple-label);
  margin-bottom: var(--space-1);
}

.alert-message {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
  line-height: var(--leading-relaxed);
}

.alert-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--apple-label-tertiary);
  background: transparent;
  border: none;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.alert-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--apple-label);
}

/* Inline Banner */
.banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, var(--apple-blue), var(--apple-indigo));
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: opacity var(--duration-fast);
}

.banner:hover {
  opacity: 0.9;
  text-decoration: none;
}

.banner .banner-cta {
  margin-left: auto;
  padding: var(--space-1) var(--space-4);
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

/* ===== TOASTS ===== */

.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--apple-bg-secondary);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow-strong);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: slide-in-right 0.4s var(--ease-spring) forwards;
}

.toast.success { border-left: 4px solid var(--apple-green); }
.toast.error { border-left: 4px solid var(--apple-red); }
.toast.warning { border-left: 4px solid var(--apple-orange); }
.toast.info { border-left: 4px solid var(--apple-blue); }

.toast-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(52, 199, 89, 0.1); color: var(--apple-green); }
.toast.error .toast-icon { background: rgba(255, 59, 48, 0.1); color: var(--apple-red); }
.toast.warning .toast-icon { background: rgba(255, 149, 0, 0.1); color: var(--apple-orange); }
.toast.info .toast-icon { background: rgba(0, 122, 255, 0.1); color: var(--apple-blue); }

.toast-content { flex: 1; }

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--apple-label);
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--apple-label-secondary);
  margin-top: 2px;
}

/* ===== CHAT / MESSAGES ===== */

.message {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: 75%;
}

.message.sent {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message.received {
  align-self: flex-start;
}

.message-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: 18px;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  word-break: break-word;
  max-width: 100%;
}

.message.sent .message-bubble {
  background: var(--apple-blue);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
}

.message.received .message-bubble {
  background: var(--apple-fill);
  color: var(--apple-label);
  border-bottom-left-radius: var(--radius-sm);
}

.message-time {
  font-size: var(--text-2xs);
  color: var(--apple-label-tertiary);
  padding: 0 var(--space-2) var(--space-2);
}

.message.sent .message-time {
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--apple-fill);
  border-radius: 18px;
  border-bottom-left-radius: var(--radius-sm);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--apple-gray);
  border-radius: 50%;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ===== ACCORDION ===== */

.accordion {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--apple-separator);
  background: var(--apple-bg-secondary);
}

.accordion-item {
  border-bottom: 1px solid var(--apple-separator);
}

.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) var(--space-6);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--apple-label);
  text-align: left;
  transition: background var(--duration-fast);
}

.accordion-trigger:hover {
  background: var(--apple-fill);
}

.accordion-icon {
  font-size: var(--text-lg);
  color: var(--apple-label-secondary);
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-smooth);
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 0 var(--space-6) var(--space-5);
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
  line-height: var(--leading-relaxed);
}

/* ===== TIMELINE ===== */

.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--apple-fill);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 2px);
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--apple-fill);
  border: 3px solid var(--apple-bg);
  z-index: 1;
}

.timeline-item.completed .timeline-dot {
  background: var(--apple-green);
  border-color: var(--apple-green);
}

.timeline-item.active .timeline-dot {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--apple-label-tertiary);
  margin-bottom: var(--space-1);
}

.timeline-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--apple-label);
  margin-bottom: var(--space-1);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--apple-label-secondary);
}

/* ===== SEARCH ===== */

.search-container {
  position: relative;
}

.search-input-full {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: var(--apple-fill);
  border: 1.5px solid transparent;
  border-radius: var(--radius-xl);
  height: 52px;
  transition: all var(--duration-fast);
}

.search-input-full:focus-within {
  border-color: var(--apple-blue);
  background: var(--apple-fill-secondary);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.search-input-full input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-lg);
  color: var(--apple-label);
}

.search-input-full input::placeholder { color: var(--apple-gray); }

.search-input-full .search-icon {
  font-size: var(--text-lg);
  color: var(--apple-gray);
  flex-shrink: 0;
}

.search-results {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
  display: none;
}

.search-results.show { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.search-result-item:hover {
  background: var(--apple-fill);
}

.search-result-item .result-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--apple-fill);
  font-size: var(--text-base);
  flex-shrink: 0;
}

.search-result-item .result-text {
  flex: 1;
}

.search-result-item .result-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--apple-label);
}

.search-result-item .result-subtitle {
  font-size: var(--text-xs);
  color: var(--apple-label-secondary);
}

/* ===== EMPTY STATE ===== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  text-align: center;
}

.empty-state-icon {
  font-size: 64px;
  color: var(--apple-fill-tertiary);
  margin-bottom: var(--space-5);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--apple-label);
  margin-bottom: var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-base);
  color: var(--apple-label-secondary);
  margin-bottom: var(--space-6);
  max-width: 320px;
  line-height: var(--leading-relaxed);
}

/* ===== SKELETON ===== */

.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(
    90deg,
    var(--apple-fill-tertiary) 25%,
    var(--apple-fill-secondary) 50%,
    var(--apple-fill-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text { width: 100%; }
.skeleton-text-50 { width: 50%; }
.skeleton-text-75 { width: 75%; }
.skeleton-text-25 { width: 25%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); }
.skeleton-card { height: 160px; border-radius: var(--radius-xl); }

/* ===== CHAT WIDGET ===== */

.chat-widget {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: var(--z-sticky);
}

.chat-widget-trigger {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apple-blue), var(--apple-indigo));
  border: none;
  box-shadow: 0 8px 32px rgba(0, 122, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: white;
  transition: all var(--duration-fast) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
  animation: apple-spring-in 0.5s var(--ease-spring) forwards;
}

.chat-widget-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0, 122, 255, 0.5);
}

.chat-widget-trigger:active {
  transform: scale(0.95);
}

.chat-widget-trigger.open {
  transform: rotate(180deg);
}

.chat-widget-panel {
  position: absolute;
  bottom: calc(100% + var(--space-4));
  right: 0;
  width: 400px;
  height: 560px;
  background: var(--apple-bg-secondary);
  border: 1px solid var(--apple-separator);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow-ultra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-origin: bottom right;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-spring);
}

.chat-widget-panel.open {
  opacity: 1;
  visibility: visible;
  animation: slideUpBounce 0.4s var(--ease-spring) forwards;
}

.chat-widget-header {
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, var(--apple-blue), var(--apple-indigo));
  color: white;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chat-widget-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.chat-widget-info {
  flex: 1;
}

.chat-widget-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

.chat-widget-status {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.chat-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.chat-widget-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--apple-separator);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.chat-widget-input {
  flex: 1;
  height: 40px;
  padding: 0 var(--space-4);
  background: var(--apple-fill);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--apple-label);
  outline: none;
  transition: all var(--duration-fast);
}

.chat-widget-input:focus {
  border-color: var(--apple-blue);
}

.chat-widget-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--apple-blue);
  border: none;
  color: white;
  font-size: var(--text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
  flex-shrink: 0;
}

.chat-widget-send:hover {
  background: var(--apple-blue-dark);
  transform: scale(1.05);
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-5);
}

.quick-action-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--apple-fill);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--apple-label-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.quick-action-btn:hover {
  background: var(--apple-fill-secondary);
  color: var(--apple-label);
}

/* ===== UTILITY CLASSES ===== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-primary { color: var(--apple-blue); }
.text-success { color: var(--apple-green); }
.text-warning { color: var(--apple-orange); }
.text-danger { color: var(--apple-red); }
.text-muted { color: var(--apple-label-secondary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-2 { margin-left: var(--space-2); }
.ml-4 { margin-left: var(--space-4); }
.mr-2 { margin-right: var(--space-2); }
.mr-4 { margin-right: var(--space-4); }
.mx-auto { margin-left: auto; margin-right: auto; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .chat-widget-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .chat-widget-trigger {
    bottom: var(--space-6);
    right: var(--space-4);
  }

  .message { max-width: 90%; }
}