:root {
  --red: #b91f2a;
  --red-dark: #8f111a;
  --red-soft: #fff0f1;
  --navy: #111a30;
  --muted: #71809a;
  --line: #e9e3e2;
  --surface: #ffffff;
  --background: #f8f6f5;
  --green: #16834a;
  --amber: #a35b00;
  --blue: #2864bd;
  --radius: 18px;
  --shadow: 0 14px 42px rgba(39, 20, 20, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--navy);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(420px, .95fr);
  background:
    radial-gradient(circle at 18% 24%, rgba(255,255,255,.18), transparent 23rem),
    linear-gradient(135deg, #7f0d16, #c92934 53%, #ef6770);
}
.login-brand {
  color: #fff;
  display: flex;
  gap: 20px;
  align-items: center;
  align-self: end;
  padding: clamp(40px, 8vw, 110px);
  padding-right: 40px;
  margin-bottom: 7vh;
}
.login-brand strong, .sidebar-brand strong { display: block; font-size: clamp(1.5rem, 3vw, 2.3rem); letter-spacing: .02em; }
.login-brand span, .sidebar-brand span { display: block; margin-top: 3px; opacity: .78; }
.brand-mark {
  width: 94px;
  height: 94px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.55rem;
  border: 4px solid currentColor;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.14);
}
.brand-mark.small { width: 54px; height: 54px; border-width: 2px; font-size: 1rem; color: var(--red); background: var(--red-soft); }
.login-card {
  align-self: stretch;
  background: #fff;
  padding: clamp(52px, 9vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: -20px 0 60px rgba(50, 0, 0, .12);
}
.eyebrow { color: var(--red); font-weight: 800; font-size: .76rem; letter-spacing: .13em; }
.login-card h1 { margin: 10px 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); max-width: 540px; line-height: 1.08; }
.login-card p { color: var(--muted); line-height: 1.6; max-width: 500px; margin: 0 0 34px; }
label { display: grid; gap: 8px; color: #3a455b; font-weight: 650; font-size: .92rem; }
.login-card label { margin-bottom: 20px; max-width: 500px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #dcdfe6;
  color: var(--navy);
  background: #fff;
  border-radius: 11px;
  padding: 12px 13px;
  outline: none;
  transition: border .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185,31,42,.1); }
textarea { min-height: 118px; resize: vertical; line-height: 1.5; }
.form-message { min-height: 22px; color: var(--red); font-size: .9rem; margin: 2px 0 8px; }

.button {
  border: 0;
  border-radius: 11px;
  padding: 12px 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.button.primary { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(185,31,42,.2); }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { background: #f0edec; color: var(--navy); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.full { width: 100%; max-width: 500px; }
.text-button { border: 0; background: transparent; color: #fff; padding: 7px 0; text-decoration: underline; text-underline-offset: 4px; }
.icon-button, .menu-button { border: 0; background: transparent; color: inherit; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #9d151f, #710b13);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  z-index: 20;
}
.sidebar-brand { display: flex; gap: 13px; align-items: center; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.16); }
.sidebar-brand strong { font-size: 1.05rem; }
.sidebar-brand span { font-size: .78rem; }
.sidebar nav { display: grid; gap: 5px; padding-top: 22px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 12px 14px;
  background: transparent;
  color: rgba(255,255,255,.76);
  text-align: left;
  font-weight: 650;
}
.nav-item span { width: 22px; text-align: center; font-size: 1.2rem; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.16); display: grid; gap: 2px; font-size: .82rem; overflow-wrap: anywhere; }
.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 20px clamp(22px, 4vw, 54px);
  background: rgba(248,246,245,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.topbar h1 { margin: 4px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.topbar-actions { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #1aa15a; box-shadow: 0 0 0 4px rgba(26,161,90,.12); }
.menu-button { display: none; font-size: 1.4rem; }
.content { padding: 30px clamp(22px, 4vw, 54px) 60px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; }
.metric, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric { padding: 22px; min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--red); background: var(--red-soft); font-size: 1.2rem; }
.metric strong { font-size: 1.75rem; }
.metric span { color: var(--muted); font-size: .86rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; margin-top: 18px; }
.panel { overflow: hidden; }
.panel-header { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 1.08rem; }
.panel-body { padding: 22px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.quick-action { border: 1px solid var(--line); border-radius: 13px; padding: 16px; background: #fff; color: var(--navy); text-align: left; font-weight: 750; }
.quick-action:hover { border-color: var(--red); color: var(--red); }
.security-note { border-left: 4px solid var(--green); padding: 4px 0 4px 16px; line-height: 1.6; color: var(--muted); }
.settings-form { display: grid; gap: 20px; padding: 22px; max-width: 860px; }
.settings-summary { display: grid; gap: 6px; padding: 18px; border-radius: 14px; color: #fff; background: var(--navy); }
.settings-summary span { color: rgba(255,255,255,.78); font-size: .88rem; line-height: 1.5; }
.settings-toggle-row { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.settings-toggle-row input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--red); }
.settings-toggle-text { display: grid; gap: 4px; }
.settings-toggle-text small { color: var(--muted); line-height: 1.45; }
.settings-url-label { display: grid; gap: 8px; font-weight: 700; }
.settings-compliance { display: grid; gap: 5px; padding: 16px 18px; border-radius: 14px; line-height: 1.5; }
.settings-compliance span { font-size: .86rem; }
.settings-compliance.locked { color: #6f3339; border: 1px solid #f0d7d9; background: var(--red-soft); }
.settings-compliance.approved { color: #146c3b; border: 1px solid #bde5ce; background: #e8f7ef; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 4px; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search { position: relative; max-width: 440px; flex: 1; }
.search input { padding-left: 40px; background: #fff; }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 9px; font-size: 1.2rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; background: #fdfcfc; }
td { font-size: .9rem; }
tbody tr:hover { background: #fdfafa; }
.clickable-row { cursor: pointer; }
.clickable-row:focus { outline: 2px solid var(--red); outline-offset: -2px; background: #fff7f7; }
.donation-table { min-width: 1080px; }
.donation-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.donation-summary-row.has-item-rows td { border-bottom-color: #e8dfe0; }
.donation-item-row { background: #fbf8f8; }
.donation-item-row:hover { background: #f8f2f2; }
.donation-item-row td { padding-top: 9px; padding-bottom: 9px; color: var(--muted); font-size: .82rem; border-bottom-color: #eee7e7; }
.donation-item-row td:nth-child(2) { color: var(--red); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.donation-item-row td:nth-child(3) { color: var(--navy); font-weight: 700; }
.donation-item-row.last-item-row td { border-bottom: 2px solid #e5d9da; }
.donation-table.without-selection .donation-item-row td:nth-child(1) { color: var(--red); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.donation-table.without-selection .donation-item-row td:nth-child(2) { color: var(--navy); font-size: .82rem; font-weight: 700; letter-spacing: normal; text-transform: none; }
.donation-filter-panel { margin-bottom: 16px; padding: 20px; overflow: visible; }
.donation-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 14px; }
.donation-filter-grid label { min-width: 0; }
.donation-filter-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.donation-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.donation-selection-text { color: var(--muted); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.donation-result-summary { margin: -3px 0 12px; color: var(--muted); font-size: .84rem; font-weight: 650; }
.reconciliation-panel { margin-bottom: 16px; }
.reconciliation-body { display: grid; gap: 18px; padding: 20px 22px; }
.reconciliation-metrics { display: grid; grid-template-columns: repeat(4,minmax(140px,1fr)); gap: 12px; }
.reconciliation-metric { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fdfcfc; }
.reconciliation-metric strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.reconciliation-metric span, .reconciliation-alert span, .reconciliation-alert small { color: var(--muted); font-size: .78rem; }
.reconciliation-alerts { display: grid; gap: 9px; }
.reconciliation-alerts h3 { margin: 0 0 3px; font-size: .95rem; }
.reconciliation-alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 13px 15px; border-left: 4px solid var(--amber); border-radius: 10px; background: #fff8eb; }
.reconciliation-alert.critical { border-left-color: var(--red); background: var(--red-soft); }
.reconciliation-alert > div { display: grid; gap: 4px; }
.reconciliation-alert small { flex: 0 0 auto; }
.reconciliation-alert-side { justify-items: end; }
.reconciliation-clear { margin: 0; color: var(--green); font-weight: 700; }
.bulk-sms-dialog { width: min(720px, 100%); }
.bulk-sms-form { display: grid; gap: 20px; padding: 24px 26px 0; }
.bulk-sms-form textarea { min-height: 180px; resize: vertical; }
.bulk-sms-form .receipt-footer { margin: 0 -26px; }
.table-title { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.table-title img { width: 54px; height: 45px; object-fit: cover; border-radius: 8px; background: #eee; }
.table-title strong { display: block; max-width: 330px; }
.table-title span { display: block; color: var(--muted); font-size: .77rem; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.badge.published, .badge.paid, .badge.sent, .badge.active { color: var(--green); background: #e8f7ef; }
.badge.draft, .badge.processing, .badge.pending, .badge.unknown { color: var(--amber); background: #fff4df; }
.badge.review_required { color: var(--red-dark); background: #ffe8e9; }
.badge.sending { color: var(--blue); background: #edf4ff; }
.badge.failed { color: var(--red); background: var(--red-soft); }
.badge.archived, .badge.inactive, .badge.cancelled, .badge.expired { color: #667085; background: #edf0f4; }
.badge.new { color: var(--red-dark); background: var(--red-soft); }
.badge.in_progress { color: var(--amber); background: #fff4df; }
.badge.answered { color: var(--green); background: #e8f7ef; }
.badge.closed, .badge.not_sent { color: #667085; background: #edf0f4; }
.sms-metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sms-metric { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.sms-metric-icon { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--red); background: var(--red-soft); font-size: 1.15rem; font-weight: 900; }
.sms-metric strong { font-size: 1.25rem; line-height: 1.1; }
.sms-metric > span:last-child { color: var(--muted); font-size: .78rem; }
.sms-toolbar-actions { display: flex; gap: 10px; align-items: center; }
.sms-toolbar-actions select { min-width: 210px; }
.sms-table { min-width: 1100px; }
.sms-message { max-width: 360px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.sms-compose-panel { max-width: 860px; }
.permission-field { margin: 4px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; }
.permission-field legend { padding: 0 8px; color: var(--ink); font-weight: 800; }
.permission-field > .field-hint { margin: 0 0 14px; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.permission-option { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.permission-option input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex: 0 0 auto; }
.permission-option span { display: grid; gap: 3px; }
.permission-option strong { color: var(--ink); font-size: .88rem; }
.permission-option small { color: var(--muted); font-size: .74rem; line-height: 1.4; }
.permission-field-disabled .permission-grid { opacity: .48; }
.permission-field-disabled .permission-option { cursor: default; }
.permission-role-note { margin-top: 13px; padding: 11px 13px; border-radius: 10px; color: #6f3339; background: var(--red-soft); font-size: .78rem; font-weight: 650; }
.notification-compose-panel { max-width: 860px; margin-bottom: 20px; }
.notification-compose-form { display: grid; gap: 18px; padding: 24px; }
.notification-compose-form textarea { min-height: 130px; resize: vertical; }
.notification-table { min-width: 900px; }
.sms-compose-form { display: grid; gap: 20px; padding: 24px; }
.sms-compose-grid { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr); gap: 20px; align-items: start; }
.sms-compose-form textarea { min-height: 190px; }
.sms-counter { display: flex; justify-content: flex-end; color: var(--muted); font-size: .78rem; font-weight: 500; }
.sms-counter.invalid { color: var(--red); font-weight: 750; }
.sms-safety { display: grid; gap: 5px; padding: 15px 17px; border: 1px solid #f0d7d9; border-radius: 13px; color: #6f3339; background: var(--red-soft); line-height: 1.5; }
.sms-safety strong { color: var(--red-dark); }
.sms-safety span { font-size: .86rem; }
.sms-compose-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 20px; }
.sms-compose-actions .button { min-width: 180px; }
.receipt-open { overflow: hidden; }
.receipt-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(13,19,35,.62); }
.receipt-dialog { width: min(900px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.receipt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 23px 26px; border-bottom: 1px solid var(--line); }
.receipt-header h2 { margin: 4px 0 2px; font-size: 1.55rem; }
.receipt-reference { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.receipt-close { font-size: 2rem; color: var(--muted); }
.receipt-body { overflow-y: auto; padding: 24px 26px; }
.receipt-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--red-dark), var(--red)); }
.receipt-summary div { display: grid; gap: 3px; }
.receipt-summary span { font-size: .8rem; }
.receipt-summary strong { font-size: 1.8rem; }
.receipt-summary .badge { background: #fff; }
.receipt-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.receipt-info-item { min-width: 0; display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fdfcfc; }
.receipt-info-item > span { color: var(--muted); font-size: .72rem; }
.receipt-info-item strong { overflow-wrap: anywhere; font-size: .9rem; }
.receipt-info-item small { color: var(--red); font-size: .68rem; }
.receipt-section { margin-top: 22px; }
.receipt-section h3 { margin: 0 0 11px; font-size: 1rem; }
.receipt-items { min-width: 600px; border: 1px solid var(--line); }
.receipt-items th, .receipt-items td { padding: 11px 13px; }
.receipt-note p { margin: 0; padding: 15px 17px; border-left: 4px solid var(--red); border-radius: 10px; background: var(--red-soft); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.receipt-note.empty-note p { color: var(--muted); border-left-color: var(--line); background: #f7f6f6; font-style: italic; }
.receipt-bank-error { padding: 17px; border: 1px solid #efc7cb; border-radius: 13px; background: linear-gradient(180deg,#fffafa,#fff4f5); }
.receipt-bank-error-heading { color: var(--red-dark); font-size: 1rem; font-weight: 800; }
.receipt-bank-error-description { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.receipt-bank-error-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.receipt-bank-error-item { min-width: 0; display: grid; gap: 5px; padding: 12px 14px; border: 1px solid #efd6d9; border-radius: 11px; background: #fff; }
.receipt-bank-error-item span { color: var(--muted); font-size: .72rem; }
.receipt-bank-error-item strong { color: var(--red-dark); overflow-wrap: anywhere; font-size: .9rem; }
.receipt-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 26px; border-top: 1px solid var(--line); background: #fff; }
.users-table { min-width: 1180px; }
.user-detail-dialog { width: min(1120px, 100%); }
.user-detail-summary small { color: rgba(255,255,255,.78); font-size: .78rem; }
.user-summary-badges { display: flex !important; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
.user-role-badge { color: var(--red-dark); background: #fff; }
.user-detail-section { padding-top: 2px; border-top: 1px solid var(--line); }
.user-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.user-section-heading h3 { margin: 0; }
.user-section-heading span { color: var(--muted); font-size: .78rem; }
.user-section-empty { padding: 24px; border: 1px dashed #d9d4d3; border-radius: 13px; color: var(--muted); text-align: center; background: #fdfcfc; }
.user-detail-table { min-width: 820px; border: 1px solid var(--line); }
.user-detail-table th, .user-detail-table td { padding: 11px 13px; }
.contact-table { min-width: 1180px; }
.contact-dialog { width: min(980px, 100%); }
.contact-message-body p { max-height: 260px; overflow-y: auto; }
.contact-reply-section { display: grid; gap: 10px; }
.contact-reply-section h3 { margin-bottom: 0; }
.contact-reply-section textarea { min-height: 170px; resize: vertical; }
.contact-send-sms { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fdfcfc; font-size: .86rem; font-weight: 650; }
.contact-send-sms input { width: 19px; height: 19px; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.row-button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; color: #43506a; font-weight: 700; font-size: .8rem; }
.row-button:hover { border-color: var(--red); color: var(--red); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); font-size: 1.08rem; margin-bottom: 4px; }
.loading { display: grid; place-items: center; min-height: 300px; color: var(--muted); }
.loading::before { content: ""; width: 30px; height: 30px; border: 3px solid #eadfe0; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(13,19,35,.55); display: grid; place-items: center; padding: 20px; }
.modal { width: min(920px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.modal > header { position: sticky; top: 0; z-index: 2; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.modal h2 { margin: 4px 0 0; font-size: 1.45rem; }
.modal .icon-button { font-size: 2rem; color: var(--muted); }
.modal form { padding: 24px 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 10px; padding-top: 26px; }
.check-label input { width: 20px; height: 20px; }
.field-hint { font-weight: 450; font-size: .76rem; color: var(--muted); }
.progress-actual-note { display: grid; gap: 4px; padding: 13px 15px; border: 1px solid #ead6d4; border-radius: 12px; background: var(--soft); }
.progress-actual-note strong { color: var(--ink); font-size: .9rem; }
.progress-actual-note span { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.image-uploader { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fdfcfc; }
.image-upload-preview { aspect-ratio: 2 / 1; overflow: hidden; display: grid; place-items: center; border: 1px dashed #d8d1d0; border-radius: 11px; color: var(--muted); background: #f3efee; }
.image-upload-preview > * { grid-area: 1 / 1; }
.image-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-upload-placeholder { padding: 14px; font-size: .78rem; text-align: center; }
.image-upload-controls { display: grid; align-content: center; gap: 9px; }
.image-upload-controls input[type="file"] { padding: 9px; background: #fff; }
.image-upload-status { color: var(--muted); font-size: .76rem; font-weight: 500; }
.image-upload-status.error { color: var(--red); font-weight: 700; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 10px; }
.toast { width: min(360px, calc(100vw - 44px)); padding: 14px 16px; border-radius: 12px; color: #fff; background: var(--navy); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { background: var(--red-dark); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .sms-metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .donation-filter-grid { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
}
@media (max-width: 800px) {
  .reconciliation-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reconciliation-alert { flex-direction: column; gap: 6px; }
  .reconciliation-alert-side { justify-items: start; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { align-self: auto; margin: 0; padding: 38px 28px; }
  .login-card { padding: 42px 28px; border-radius: 28px 28px 0 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: min(290px, 86vw); transition: transform .22s; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .topbar { justify-content: flex-start; min-height: 82px; }
  .topbar-actions { margin-left: auto; }
  .content { padding-top: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .permission-grid { grid-template-columns: 1fr; }
  .image-uploader { grid-template-columns: 1fr; }
  .sms-compose-grid { grid-template-columns: 1fr; }
  .receipt-info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .donation-filter-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
}
@media (max-width: 540px) {
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 118px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .button { width: 100%; }
  .donation-filter-grid { grid-template-columns: 1fr; }
  .donation-filter-actions, .donation-toolbar-actions { align-items: stretch; flex-direction: column; }
  .donation-filter-actions .button, .donation-toolbar-actions .button { width: 100%; }
  .sms-toolbar-actions { align-items: stretch; flex-direction: column; }
  .sms-toolbar-actions select { min-width: 0; }
  .topbar-actions span:last-child { display: none; }
  .quick-actions { grid-template-columns: 1fr; }
  .sms-compose-form { padding: 20px; }
  .sms-compose-actions .button { width: 100%; }
  .receipt-backdrop { padding: 0; align-items: end; }
  .receipt-dialog { max-height: 94vh; border-radius: 22px 22px 0 0; }
  .receipt-header, .receipt-body, .receipt-footer { padding-left: 19px; padding-right: 19px; }
  .receipt-info-grid { grid-template-columns: 1fr; }
  .receipt-bank-error-grid { grid-template-columns: 1fr; }
  .receipt-footer .button { flex: 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 22px 22px 0 0; }
  .login-brand .brand-mark { width: 68px; height: 68px; }
}

/* Kurban videoları */
.kurban-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.kurban-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.kurban-tab { border: 0; border-radius: 9px; padding: 9px 15px; background: transparent; color: #43506a; font-weight: 750; }
.kurban-tab.active { background: var(--red); color: #fff; }
.kurban-year { display: flex; align-items: center; gap: 10px; }
.kurban-year select { width: auto; min-width: 110px; padding: 9px 12px; }
.kurban-toolbar { flex-wrap: wrap; }
.kurban-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kurban-check { display: flex; align-items: center; gap: 8px; font-size: .84rem; white-space: nowrap; }
.kurban-check input { width: 18px; height: 18px; accent-color: var(--red); }
.kurban-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--red-soft); color: var(--red-dark); font-size: .82rem; font-weight: 750; }
.kurban-chip button { border: 0; background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.kurban-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.kurban-table { min-width: 960px; }
.kurban-table.kurban-animal-table { min-width: 900px; }
.kurban-animal-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.kurban-row-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 150px; max-width: 190px; margin-left: auto; }
.kurban-row-actions .row-button { white-space: nowrap; }
.kurban-toolbar .search { min-width: 240px; }
.kurban-row-actions a.row-button { text-decoration: none; }
.kurban-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.kurban-code { font-size: 1rem; letter-spacing: .03em; white-space: nowrap; }
.kurban-nowrap { white-space: nowrap; font-weight: 700; }
.kurban-cell-hint { display: block; margin-top: 3px; }
.kurban-dialog { width: min(620px, 100%); }
.kurban-dialog.wide { width: min(1040px, 100%); }
.kurban-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.kurban-form-body { display: grid; gap: 16px; padding: 22px 26px; overflow-y: auto; }
.kurban-dialog-note { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.kurban-paste { min-height: 160px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.kurban-preview { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.kurban-preview:empty { display: none; }
.kurban-preview-table { min-width: 900px; }
.kurban-preview-table th, .kurban-preview-table td { padding: 8px 11px; font-size: .8rem; }
.kurban-invalid-row td { background: var(--red-soft); }
.kurban-result-grid { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 0; }
.kurban-link-box { display: flex; gap: 10px; }
.kurban-link-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.kurban-copy-buffer { position: fixed; top: 0; left: -9999px; opacity: 0; }
.kurban-print-page { padding: 26px; border: 1px solid var(--line); border-radius: 14px; }
.kurban-print-code { font-size: clamp(2.6rem, 8vw, 4.6rem); font-weight: 900; letter-spacing: .04em; line-height: 1; }
.kurban-print-meta { margin-top: 10px; color: var(--muted); font-size: 1.05rem; font-weight: 650; }
.kurban-print-list { margin: 22px 0 0; padding-left: 34px; font-size: 1.35rem; line-height: 1.9; }
.kurban-print-empty { margin: 22px 0 0; color: var(--muted); font-size: 1.1rem; }
@media (max-width: 540px) {
  .kurban-tabs { width: 100%; }
  .kurban-tab { flex: 1; padding: 9px 8px; }
  .kurban-actions { margin-left: 0; }
  .kurban-actions .button { width: 100%; }
  .kurban-result-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kurban-link-box { flex-direction: column; }
  .kurban-form-body { padding-left: 19px; padding-right: 19px; }
}

@media print {
  body > :not(.receipt-backdrop) { display: none !important; }
  .receipt-backdrop { position: static; display: block; padding: 0; background: #fff; }
  .receipt-dialog { width: 100%; max-height: none; box-shadow: none; overflow: visible; }
  .receipt-body { overflow: visible; }
  .receipt-close, .receipt-footer { display: none !important; }
  .kurban-print-backdrop .receipt-header { display: none !important; }
  .kurban-print-backdrop .receipt-dialog, .kurban-print-backdrop .kurban-form { display: block; border-radius: 0; }
  .kurban-print-backdrop .kurban-form-body { display: block; padding: 0; overflow: visible; }
  .kurban-print-backdrop .form-message { display: none; }
  .kurban-print-page { border: 0; padding: 0; break-after: page; page-break-after: always; color: #000; }
  .kurban-print-page:last-of-type { break-after: auto; page-break-after: auto; }
  .kurban-print-code { font-size: 64pt; }
  .kurban-print-list { font-size: 20pt; }
}

/* Kurumun yatay logosu (sitedeki başlıkla aynı görsel) krem kart üzerinde */
.logo-kart { background: #f7f4ee; border-radius: 22px; padding: 18px 22px; box-shadow: 0 18px 40px rgba(0,0,0,.18); display: inline-flex; }
.logo-kart img { display: block; width: min(420px, 100%); height: auto; }
.logo-kart.kucuk { border-radius: 16px; padding: 10px 12px; box-shadow: none; width: 100%; box-sizing: border-box; }
.logo-kart.kucuk img { width: 100%; }
.sidebar-brand { flex-direction: column; align-items: stretch; gap: 8px; }
.sidebar-alt { color: #fff; opacity: .78; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; padding-left: 4px; }
@media (max-width: 900px) { .login-brand .logo-kart img { width: min(300px, 100%); } }

/* Yeni Asya Hesabı ile giriş */
.ortak-hesap { margin-top: 14px; }
.ortak-hesap .ayrac { display: flex; align-items: center; gap: 12px; color: var(--muted, #6b7280); font-size: .82rem; margin: 4px 0 14px; }
.ortak-hesap .ayrac::before, .ortak-hesap .ayrac::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .25; }
.ortak-hesap a.button { text-decoration: none; text-align: center; display: block; box-sizing: border-box; }
