/* Components — clean flat */

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

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

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg { width: 20px; height: 20px; }

.card-icon--primary { background: var(--color-primary-light); color: var(--color-primary); }
.card-icon--success { background: var(--color-success-light); color: var(--color-success); }
.card-icon--info    { background: var(--color-info-light);    color: var(--color-info); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 12px; border-radius: var(--radius-sm); }
  .card-header { margin-bottom: 8px; }
  .card-value { font-size: 22px; }
  .card-title { font-size: 10px; letter-spacing: 0.3px; }
  .card-subtitle { font-size: 11px; margin-top: 4px; }
  .card-icon { width: 30px; height: 30px; border-radius: 8px; }
  .card-icon svg { width: 14px; height: 14px; }
  .greeting { margin-bottom: 14px; }
  .greeting-hello { font-size: 20px; }
  .greeting-sub { font-size: 13px; margin-top: 2px; }
  .section { margin-top: 16px; }
  .section-title { font-size: 15px; }
  .section-header { margin-bottom: 8px; }
  .empty-state { padding: 24px 12px; }
  .empty-state-icon { width: 44px; height: 44px; margin-bottom: 12px; }
  .empty-state-icon svg { width: 20px; height: 20px; }
  .empty-state-title { font-size: 15px; }
  .empty-state-text { font-size: 13px; margin-bottom: 16px; }
  .btn { padding: 8px 18px; font-size: 13px; }
  .tab-item { font-size: 9px; padding: 4px 6px; }
  .tab-item svg { width: 20px; height: 20px; }
  .company-card { padding: 10px 12px; gap: 10px; }
  .company-card-avatar { width: 34px; height: 34px; font-size: 14px; }
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn svg { width: 18px; height: 18px; }

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

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

.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-surface-alt); }

.btn-lg { padding: 14px 32px; font-size: 15px; border-radius: var(--radius-lg); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state-text { font-size: 15px; color: var(--color-text-secondary); margin-bottom: 24px; max-width: 340px; }

/* Section */
.section { margin-top: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 700; }

/* Greeting */
.greeting { margin-bottom: 32px; }
.greeting-hello { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.greeting-name { color: var(--color-primary); }
.greeting-sub { font-size: 16px; color: var(--color-text-secondary); margin-top: 4px; }

/* Company avatar in sidebar */
.company-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-item--create {
  color: var(--color-primary) !important;
  opacity: 0.7;
}

.nav-item--create:hover { opacity: 1; }

/* Company cards in dashboard */
.company-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
}

.company-card:hover { background: var(--color-surface-alt); }

.company-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.company-card-info { flex: 1; overflow: hidden; }
.company-card-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-card-meta { font-size: 13px; color: var(--color-text-tertiary); margin-top: 2px; }
.company-card svg { width: 18px; height: 18px; color: var(--color-text-tertiary); flex-shrink: 0; }

/* Input */
.input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
}

.input:focus { border-color: var(--color-primary); }
.input::placeholder { color: var(--color-text-tertiary); }

/* Custom Select */
.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.custom-select-trigger:hover { border-color: var(--color-text-tertiary); }
.custom-select.open .custom-select-trigger { border-color: var(--color-primary); }

.custom-select-label { flex: 1; }

.custom-select-arrow {
  display: flex;
  transition: transform 0.15s;
}

.custom-select-arrow svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-tertiary);
}

.custom-select.open .custom-select-arrow { transform: rotate(180deg); }

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 100;
}

.custom-select.open .custom-select-dropdown { display: block; }

.custom-select-option {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.custom-select-option:hover { background: var(--color-surface-alt); }

.custom-select-option--active {
  color: var(--color-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .custom-select-trigger { padding: 7px 10px; font-size: 13px; }
  .custom-select-option { padding: 10px 12px; font-size: 14px; }
}

/* Shimmer loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
}

.loading--sm { padding: 12px 0; gap: 8px; }

.loading-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--color-surface-alt);
  position: relative;
  overflow: hidden;
}

.loading--sm .loading-bar { height: 8px; }

.loading-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

.loading-bar:nth-child(1) { width: 60%; }
.loading-bar:nth-child(2) { width: 80%; }
.loading-bar:nth-child(3) { width: 45%; }
.loading-bar:nth-child(2)::after { animation-delay: 0.1s; }
.loading-bar:nth-child(3)::after { animation-delay: 0.2s; }

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Company create page */
.company-create-wrap {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100%;
  justify-content: center;
  padding: 32px 0;
}

.company-create-wrap form {
  width: 100%;
  text-align: start;
}

.company-create-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.company-create-icon svg { width: 28px; height: 28px; }

.company-create-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.company-create-sub {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin: 0 0 32px;
}

/* Floating label field */
.float-field {
  position: relative;
  margin-bottom: 24px;
}

/* Input — fixed padding, never changes */
.float-field__input {
  width: 100%;
  height: 56px;
  padding: 24px 16px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.25;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.float-field__input:focus { border-color: var(--color-primary); }

/* Label — moves only via transform, no layout shifts */
.float-field__label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 15px;
  color: var(--color-text-tertiary);
  pointer-events: none;
  transform: translateY(0);
  transform-origin: left top;
  transition: transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
}

[dir="rtl"] .float-field__label {
  left: auto;
  right: 16px;
  transform-origin: right top;
}

/* Floated state — scale down and slide up */
.float-field__input:focus ~ .float-field__label,
.float-field__input:not(:placeholder-shown) ~ .float-field__label {
  transform: translateY(-8px);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Textarea */
textarea.float-field__input {
  height: auto;
  resize: vertical;
  min-height: 88px;
  padding-top: 28px;
}

textarea.float-field__input ~ .float-field__label {
  top: 20px;
}

textarea.float-field__input:focus ~ .float-field__label,
textarea.float-field__input:not(:placeholder-shown) ~ .float-field__label {
  transform: translateY(-12px);
}

/* Field hint / char counter */
.field-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.field-hint-counter { font-variant-numeric: tabular-nums; }
.field-hint-counter--warn { color: var(--color-error, #c45a3a); }

/* Form error banner */
.form-error {
  background: rgba(196, 90, 58, 0.08);
  border: 1px solid rgba(196, 90, 58, 0.2);
  border-radius: var(--radius-sm);
  color: var(--color-error, #c45a3a);
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* Full-width button */
.btn-full { width: 100%; justify-content: center; }
.btn-full + .btn-full { margin-top: 8px; }

@media (max-width: 768px) {
  .company-create-wrap { max-width: 100%; }
  .company-create-title { font-size: 17px; }
}

/* Icon button (transparent, for gear/back) */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-tertiary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--color-surface-alt, rgba(0,0,0,0.04));
  color: var(--color-text);
}

.btn-icon svg { width: 20px; height: 20px; }

/* Hire wizard */
.hire-wizard {
  max-width: 520px;
  margin: 0 auto;
}

.hire-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.hire-step-header .btn-icon { transform: rotate(180deg); }

.hire-step-label {
  font-size: 20px;
  font-weight: 700;
}

.hire-goal-input { min-height: 120px !important; }

.hire-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.hire-hint-chip {
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.hire-hint-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Profile preview card */
.hire-profile-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.hire-profile-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.hire-profile-top > div:last-child { flex: 1; }

.hire-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hire-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.hire-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  letter-spacing: 0.04em;
}

.hire-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.hire-prompt-details { margin-top: 8px; }
.hire-prompt-details summary {
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.hire-prompt-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 12px;
  background: var(--color-surface-alt, rgba(0,0,0,0.02));
  border-radius: var(--radius-sm);
}

/* Account selection */
.hire-account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hire-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.hire-account-card:hover { border-color: var(--color-primary); }

.hire-account-card--selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.hire-account-name { font-size: 15px; font-weight: 600; }
.hire-account-username { font-size: 13px; color: var(--color-text-secondary); }

.hire-no-accounts {
  text-align: center;
  padding: 24px;
  color: var(--color-text-tertiary);
  font-size: 14px;
}

@media (max-width: 768px) {
  .hire-wizard { max-width: 100%; }
  .hire-profile-top { flex-direction: column; align-items: center; text-align: center; }
  .hire-metrics { justify-content: center; }
}

/* Toggle switch (generic reusable) */
.toggle-switch {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  transition: transform 0.2s;
}

.toggle-switch--on { background: var(--color-primary); }
.toggle-switch--on::after { transform: translateX(14px); }
