/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav__brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.nav__brand span {
  color: var(--color-primary);
}

.nav__links {
  display: flex;
  gap: 4px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.nav__link:hover {
  background: var(--color-bg);
  color: var(--color-navy);
  text-decoration: none;
}

.nav__link--active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav__link ion-icon {
  font-size: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232, 93, 4, 0.35);
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn[aria-busy='true'] {
  pointer-events: none;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn--ghost:hover {
  background: var(--color-bg);
  color: var(--color-navy);
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn--full {
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-navy);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-group input,
.select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: var(--transition);
}

.form-group input:focus,
.select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* Custom select (native arrow hidden) */
.select-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.select-wrap .select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

.select-wrap__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--color-text-muted);
}

.select-wrap__chevron ion-icon {
  font-size: 18px;
}

.select-wrap:focus-within .select-wrap__chevron {
  color: var(--color-primary);
}

.input-file {
  font-size: 0.85rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  cursor: pointer;
}

.checkbox input {
  margin-top: 3px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

.photo-preview img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin-top: 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

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

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

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

.badge--muted {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table--compact th,
.table--compact td {
  padding: 8px 10px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 49, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-overlay--visible {
  opacity: 1;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform 0.2s;
}

.modal-overlay--visible .modal {
  transform: translateY(0);
}

.modal--wide {
  max-width: 640px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal__header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.terms-content {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
  line-height: 1.6;
}

.terms-content h3,
.terms-content h4 {
  color: var(--color-navy);
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.terms-content ul {
  padding-left: 20px;
  margin: 8px 0;
}

.terms-content--compact {
  max-height: 200px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s;
  max-width: 360px;
}

.toast--visible {
  transform: translateX(0);
}

.toast--success { background: #065f46; }
.toast--error { background: #991b1b; }

.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Confirmation dialog */
.confirm-dialog {
  max-width: 400px;
  text-align: center;
}

.confirm-dialog__body {
  padding: 28px 28px 8px;
}

.confirm-dialog__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.confirm-dialog__icon ion-icon {
  font-size: 26px;
}

.confirm-dialog__icon--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.confirm-dialog__body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.confirm-dialog__body p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.confirm-dialog__footer {
  justify-content: center;
  gap: 10px;
  padding-bottom: 24px;
}

.confirm-dialog__footer .btn {
  min-width: 120px;
}
