/* ── Vendor Portal Styles ── */

:root {
  --vendor-accent: #9B6BC5;
  --vendor-danger: #EF4444;
  --vendor-success: #10B981;
  --vendor-warning: #F59E0B;
}

/* ── Modal ── */
.vendor-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vendor-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 6, 0.8);
  backdrop-filter: blur(8px);
}

.vendor-modal__content {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(160deg, #111418 0%, #0C0E11 60%, #0A0C0F 100%);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

.vendor-modal__header {
  padding: 24px 24px 20px;
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.1) 0%, rgba(200, 169, 110, 0.03) 100%);
  border-bottom: 1px solid rgba(200, 169, 110, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vendor-modal__header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.vendor-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms;
}

.vendor-modal__close:hover {
  color: var(--color-text-primary);
}

.vendor-modal__body {
  padding: 24px;
}

.vendor-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 200ms, background 200ms;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(200, 169, 110, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.form-textarea {
  resize: vertical;
  font-family: inherit;
}

.form-input-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding-left: 12px;
  transition: border-color 200ms, background 200ms;
}

.form-input-group:focus-within {
  border-color: rgba(200, 169, 110, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.form-currency {
  color: var(--color-text-muted);
  font-weight: 500;
  margin-right: 4px;
}

.form-input-group .form-input {
  background: transparent;
  border: none;
  padding-left: 0;
}

.form-file {
  display: flex;
  width: 100%;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(200, 169, 110, 0.3);
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 200ms, background 200ms;
}

.form-file:hover {
  border-color: rgba(200, 169, 110, 0.5);
  background: rgba(200, 169, 110, 0.03);
}

/* ── Invoice List ── */
.invoice-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 12px;
  transition: border-color 200ms, background 200ms;
}

.invoice-card:hover {
  border-color: rgba(200, 169, 110, 0.2);
  background: rgba(200, 169, 110, 0.04);
}

.invoice-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.invoice-card__number {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.invoice-card__vendor {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.invoice-card__amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--vendor-success);
  font-family: var(--font-mono);
}

.invoice-card__body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.invoice-card__date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invoice-card__date .label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.invoice-card__approved {
  font-size: 11px;
  color: var(--vendor-success);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 8px;
}

/* ── Status Badge ── */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.status-badge--submitted {
  background: rgba(200, 169, 110, 0.15);
  color: rgba(200, 169, 110, 0.9);
}

.status-badge--processing {
  background: rgba(59, 130, 246, 0.15);
  color: rgb(96, 165, 250);
}

.status-badge--approved {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(52, 211, 153);
}

.status-badge--paid {
  background: rgba(34, 197, 94, 0.15);
  color: rgb(74, 222, 128);
}

.status-badge--rejected {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(248, 113, 113);
}

.status-badge--active {
  background: rgba(16, 185, 129, 0.15);
  color: rgb(52, 211, 153);
}

.status-badge--inactive {
  background: rgba(107, 114, 128, 0.15);
  color: rgb(156, 163, 175);
}

/* ── Vendor Cards ── */
.vendor-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 12px;
}

.vendor-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.vendor-card__header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.vendor-card__details {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.vendor-card__details p {
  margin: 4px 0;
}

.vendor-card__status-checks {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-check {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-check--verified {
  color: var(--vendor-success);
}

/* ── Approval Dashboard ── */
.approvals-dashboard {
  display: grid;
  gap: 24px;
}

.approvals-section {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
}

.approvals-section__title {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.approval-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
}

.approval-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.approval-item__header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.approval-item__amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--vendor-accent);
  font-family: var(--font-mono);
}

.approval-item__details {
  font-size: 12px;
  color: var(--color-text-muted);
  display: grid;
  gap: 4px;
}

.approval-item__details p {
  margin: 0;
}

.approval-item__actions {
  display: flex;
  gap: 8px;
}

.btn--small {
  padding: 6px 12px;
  font-size: 12px;
  height: auto;
}

.btn--success {
  background: rgba(16, 185, 129, 0.12);
  color: rgb(52, 211, 153);
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: background 200ms, color 200ms;
}

.btn--success:hover {
  background: rgba(16, 185, 129, 0.2);
  color: rgb(76, 230, 180);
}

.btn--danger {
  background: rgba(239, 68, 68, 0.12);
  color: rgb(248, 113, 113);
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: background 200ms, color 200ms;
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: rgb(254, 128, 128);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .vendor-modal__content {
    max-width: 100%;
  }

  .approval-item {
    grid-template-columns: 1fr;
  }

  .approval-item__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .approval-item__actions {
    width: 100%;
  }

  .approval-item__actions .btn {
    flex: 1;
  }
}

/* ── Scrollbar ── */
.vendor-modal__content::-webkit-scrollbar {
  width: 4px;
}

.vendor-modal__content::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 110, 0.2);
  border-radius: 2px;
}

.vendor-modal__content::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 169, 110, 0.3);
}
