/* Shepherd Offerings — Design System */

:root {
  --color-brand:      #3D7DD6;
  --color-danger:     #DC2626;
  --color-text:       #111827;
  --color-text-muted: #6B7280;
  --color-bg:         #F9FAFB;
  --color-surface:    #FFFFFF;
  --color-border:     #E5E7EB;
  --color-green:      #16A34A;
  --color-yellow:     #EA580C;

  --radius: 0.5rem;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; }
a { color: var(--color-brand); text-decoration: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.header-brand { display: flex; align-items: center; gap: .625rem; }

.header-logo {
  width: 32px;
  height: 32px;
  background: var(--color-brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo svg { width: 20px; height: 20px; fill: #fff; }

.header-title { font-size: 1.05rem; font-weight: 700; color: var(--color-text); }

.header-actions { display: flex; align-items: center; gap: .25rem; }

.btn-header-icon {
  background: none;
  border: none;
  padding: .375rem;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}

.btn-header-icon:hover { background: var(--color-bg); }
.btn-header-icon svg { width: 24px; height: 24px; fill: currentColor; }
.btn-logout:hover { color: var(--color-danger); }

/* Main content */
.app-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem;
}

.app-main.wide { max-width: 560px; }

/* Cards / sections */
.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: .75rem;
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
  transition: opacity .15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover    { opacity: .88; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

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

.btn-secondary {
  display: block;
  width: 100%;
  padding: .75rem;
  background: none;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--color-danger); color: #fff; }

.btn-remove {
  padding: .25rem .625rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--color-danger);
  background: none;
  border: 1px solid var(--color-danger);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn-remove:hover { background: var(--color-danger); color: #fff; }

/* Filter / tab bar */
.filter-bar { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.btn-filter {
  flex: 1;
  padding: .4rem 0;
  font-size: .8rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
  white-space: nowrap;
}

.btn-filter.active {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

/* Badges */
.role-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .1rem .4rem;
  border-radius: .25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.status-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .15rem .5rem;
  border-radius: .25rem;
}

.status-badge.pending   { background: #FEF3C7; color: #92400E; }
.status-badge.needs-verified { background: #DBEAFE; color: #1E40AF; }
.status-badge.flagged   { background: #FEE2E2; color: #991B1B; }
.status-badge.verified  { background: #D1FAE5; color: #065F46; }
.status-badge.deposited { background: #F3F4F6; color: #374151; }

/* List rows */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--color-bg); margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }

.list-row-info { flex: 1; min-width: 0; }
.list-row-id   { font-size: .875rem; font-weight: 600; color: var(--color-text); }
.list-row-meta { font-size: .8rem; color: var(--color-text-muted); margin-top: .1rem; }
.list-row-amount { font-size: .95rem; font-weight: 700; white-space: nowrap; }

/* Form elements */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .375rem;
  color: var(--color-text);
}

.form-label .required { color: var(--color-danger); }

.form-input,
.form-select {
  width: 100%;
  padding: .625rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  appearance: auto;
}

.form-input:focus,
.form-select:focus {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}

.form-input:disabled,
.form-select:disabled {
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.form-input.readonly { background: var(--color-bg); cursor: default; }

/* Segmented toggle */
.segmented {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented-btn {
  flex: 1;
  padding: .5rem;
  font-size: .875rem;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: none;
  border-right: 1px solid var(--color-border);
  transition: background .15s, color .15s;
  cursor: pointer;
}

.segmented-btn:last-child { border-right: none; }
.segmented-btn.active { background: var(--color-brand); color: #fff; }

/* Empty state */
.empty-msg { font-size: .9rem; color: var(--color-text-muted); font-style: italic; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0,0,0,.2);
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  overflow-y: auto;
}

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

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-body { padding: 1.25rem; }

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: .75rem;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  padding: .25rem;
  cursor: pointer;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: var(--color-text);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  white-space: nowrap;
  transition: transform .25s ease;
  z-index: 9999;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* Alert banner */
.alert-banner {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}

.alert-banner.danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-banner.info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1rem 0;
}

/* Amount display */
.amount-display {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.amount-label {
  font-size: .8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Detail row */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { color: var(--color-text-muted); font-size: .8rem; }
.detail-row dd { font-weight: 600; text-align: right; }

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 0;
}
.checkbox-row input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  cursor: pointer;
  accent-color: var(--color-brand);
}

/* Select all row */
.select-all-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--color-border);
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* Loading spinner */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-size: .9rem;
}
