/* ============================================================
   RaiseRed — Political Fundraising Manager
   Primary: #cc0000
   ============================================================ */

:root {
  --rr-red:       #cc0000;
  --rr-red-dark:  #a30000;
  --rr-red-light: #f5e6e6;
  --rr-red-pale:  #fff5f5;
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --font:         'Inter', sans-serif;
  --radius:       .5rem;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --border:       #e5e7eb;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --bg:           #f8f9fb;
  --white:        #ffffff;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

a { color: var(--rr-red); text-decoration: none; }
a:hover { color: var(--rr-red-dark); }

/* ── LAYOUT ─────────────────────────────────────────────── */
.rr-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.rr-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* Sidebar Brand */
.rr-sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--rr-red);
  border-radius: .375rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

/* Sidebar Org Badge */
.sidebar-org-badge {
  margin: .5rem 1rem .75rem;
  padding: .4rem .75rem;
  background: rgba(255,255,255,.07);
  border-radius: .375rem;
  color: rgba(255,255,255,.6);
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar Nav */
.rr-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}
.rr-nav-section {
  padding: 1rem 1.25rem .35rem;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.3);
}
.rr-nav-item { margin: 0 .5rem .15rem; }
.rr-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .75rem;
  border-radius: .375rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.rr-nav-link i { width: 1.1rem; text-align: center; flex-shrink: 0; }
.rr-nav-link:hover  { background: rgba(255,255,255,.08); color: #fff; }
.rr-nav-link.active { background: var(--rr-red); color: #fff; }

/* Sidebar Footer */
.rr-sidebar-footer {
  padding: .75rem .5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── TOPBAR ─────────────────────────────────────────────── */
.rr-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 900;
}
.sidebar-toggle {
  color: var(--text-muted);
  border: none;
  background: none;
  padding: .25rem .4rem;
  cursor: pointer;
}
.rr-topbar-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}
.rr-topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* ── PAGE CONTENT ───────────────────────────────────────── */
.rr-content {
  padding: 1.5rem;
  flex: 1;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn-rr {
  background: var(--rr-red);
  color: #fff !important;
  border: 1px solid var(--rr-red);
  font-weight: 500;
}
.btn-rr:hover, .btn-rr:focus {
  background: var(--rr-red-dark);
  border-color: var(--rr-red-dark);
  color: #fff !important;
}
.btn-rr-outline {
  border: 1px solid var(--rr-red);
  color: var(--rr-red);
  background: transparent;
  font-weight: 500;
}
.btn-rr-outline:hover {
  background: var(--rr-red);
  color: #fff;
}

/* ── CARDS ──────────────────────────────────────────────── */
.rr-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.rr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
}
.rr-card-body {
  padding: 1.25rem;
}
.rr-card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 1.4rem;
  margin-bottom: .25rem;
  opacity: .8;
}
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

.stat-card--red   { border-top: 3px solid var(--rr-red); }
.stat-card--red   .stat-icon { color: var(--rr-red); }
.stat-card--green { border-top: 3px solid #16a34a; }
.stat-card--green .stat-icon { color: #16a34a; }
.stat-card--blue  { border-top: 3px solid #2563eb; }
.stat-card--blue  .stat-icon { color: #2563eb; }
.stat-card--orange{ border-top: 3px solid #ea580c; }
.stat-card--orange .stat-icon { color: #ea580c; }

/* ── TABLES ─────────────────────────────────────────────── */
.rr-table { font-size: .875rem; }
.rr-table thead th {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  padding: .6rem .75rem;
}
.rr-table tbody td { padding: .65rem .75rem; vertical-align: middle; }
.rr-table tbody tr:hover { background: var(--rr-red-pale); }

/* ── AUTH PAGES ─────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-wrapper {
  width: 100%;
  max-width: 420px;
}
.auth-card {
  background: var(--white);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-logo {
  width: 64px; height: 64px;
  background: var(--rr-red);
  border-radius: 1rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(204,0,0,.35);
}
.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 .25rem;
  letter-spacing: -.04em;
}
.auth-subtitle { color: var(--text-muted); font-size: .875rem; margin: 0; }
.text-rr { color: var(--rr-red) !important; }

/* ── ORG SELECT ─────────────────────────────────────────── */
.org-select-list { display: flex; flex-direction: column; gap: .5rem; }
.org-select-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  width: 100%;
}
.org-select-btn:hover { border-color: var(--rr-red); background: var(--rr-red-pale); }
.org-icon {
  width: 40px; height: 40px;
  background: var(--rr-red-light);
  border-radius: .375rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--rr-red);
  flex-shrink: 0;
}
.org-name { font-weight: 600; font-size: .9rem; }
.org-role { font-size: .75rem; color: var(--text-muted); }

/* ── DONOR AVATARS ──────────────────────────────────────── */
.donor-avatar-sm {
  width: 32px; height: 32px;
  background: var(--rr-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.donor-avatar-lg {
  width: 72px; height: 72px;
  background: var(--rr-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── CONTACT ROW ────────────────────────────────────────── */
.contact-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem 0;
  font-size: .875rem;
  border-bottom: 1px solid #f3f4f6;
}
.contact-row:last-child { border-bottom: none; }
.contact-row i { width: 1rem; text-align: center; flex-shrink: 0; }

/* ── CALL QUEUE ─────────────────────────────────────────── */
.call-queue { }
.call-queue-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.call-queue-item:last-child { border-bottom: none; }
.call-queue-item:hover { background: #fafafa; }
.caller-avatar {
  width: 44px; height: 44px;
  background: var(--rr-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.opacity-60 { opacity: .6; }

/* ── REVIEW ITEMS ───────────────────────────────────────── */
.review-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.review-item:last-child { border-bottom: none; }
.review-info { flex: 1; }
.review-actions { flex-shrink: 0; }

/* ── TASK ITEMS ─────────────────────────────────────────── */
.task-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-type-icon {
  width: 32px; height: 32px;
  border-radius: .375rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.task-collect_donation  { background: #dcfce7; color: #16a34a; }
.task-send_thank_you    { background: #dbeafe; color: #2563eb; }
.task-send_note         { background: #fef9c3; color: #ca8a04; }
.task-schedule_meeting  { background: #f3e8ff; color: #7c3aed; }
.task-other             { background: #f3f4f6; color: #6b7280; }

/* ── ACTIVITY ITEMS ─────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  background: var(--rr-red);
  border-radius: 50%;
  margin-top: .3rem;
  flex-shrink: 0;
}

/* ── HISTORY ITEMS ──────────────────────────────────────── */
.history-item {
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.history-item:last-child { border-bottom: none; }

/* ── GIVING SUMMARY ─────────────────────────────────────── */
.giving-summary { text-align: center; }
.giving-total { font-size: 2rem; font-weight: 800; color: #16a34a; }

/* ── DISPOSITION GRID ───────────────────────────────────── */
.disposition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
}
.disposition-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  font-size: .8rem;
  font-weight: 500;
}
.disposition-card:hover { border-color: var(--rr-red); background: var(--rr-red-pale); }
.disposition-card.selected { border-color: var(--rr-red); background: var(--rr-red); color: #fff; }
.disposition-card.selected i { color: #fff; }
.disposition-card i { font-size: 1.25rem; color: var(--text-muted); }
.disposition-card input { display: none; }

/* ── DONOR SELECT GRID ──────────────────────────────────── */
.donor-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .5rem;
  max-height: 480px;
  overflow-y: auto;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.donor-select-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: var(--white);
}
.donor-select-card:hover { border-color: var(--rr-red); background: var(--rr-red-pale); }
.donor-select-card.selected { border-color: var(--rr-red); background: var(--rr-red-pale); }
.donor-select-card input { display: none; }
.donor-select-check {
  position: absolute;
  top: .5rem; right: .5rem;
  color: var(--rr-red);
  font-size: 1rem;
  display: none;
}
.donor-select-card.selected .donor-select-check { display: block; }
.donor-select-info { flex: 1; }
.donor-select-rating { margin-top: .25rem; font-size: .7rem; }

/* ── COMMUNICATIONS PAGE ────────────────────────────────── */
.comm-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all .15s;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.comm-card:hover {
  border-color: var(--rr-red);
  box-shadow: 0 4px 16px rgba(204,0,0,.12);
  color: var(--text);
  transform: translateY(-2px);
}
.comm-icon {
  width: 48px; height: 48px;
  background: var(--rr-red-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--rr-red);
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── PROGRESS BAR ───────────────────────────────────────── */
.rr-progress { height: 8px; border-radius: 4px; }
.bg-rr { background-color: var(--rr-red) !important; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-label.required::after {
  content: " *";
  color: var(--rr-red);
}
.section-heading {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.font-monospace { font-family: 'Courier New', monospace !important; }

.form-control:focus, .form-select:focus {
  border-color: var(--rr-red);
  box-shadow: 0 0 0 .2rem rgba(204,0,0,.2);
}

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  opacity: .25;
  display: block;
  margin-bottom: 1rem;
}
.empty-state p { margin-bottom: 1rem; }

/* ── ALERTS / BADGES ────────────────────────────────────── */
.badge { font-weight: 500; }

/* ── MOBILE SIDEBAR ─────────────────────────────────────── */
@media (max-width: 768px) {
  .rr-sidebar {
    transform: translateX(-100%);
  }
  .rr-sidebar.open {
    transform: translateX(0);
  }
  .rr-main {
    margin-left: 0;
  }
  .rr-content {
    padding: 1rem;
  }
  .disposition-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .donor-select-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
}

/* ── SCROLLBAR STYLING ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rr-red); }

/* ── UTILITIES ──────────────────────────────────────────── */
.col-md-2dot4 { flex: 0 0 auto; width: 20%; }
