/* MORIAH shared stylesheet */

:root {
  --brand:      #0a6b5c;
  --brand-dark: #085041;
  --brand-mid:  #1d8a74;
  --accent:     #e07020;
  --accent-dark:#c8601a;
  --text:       #1a2e2a;
  --muted:      #4a6660;
  --border:     #d0e8e2;
  --bg:         #f7fbfa;
  --card-bg:    #ffffff;
  --success:    #085041;
  --error:      #a33000;
  --focus-ring: rgba(10,107,92,0.18);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

/* ── Navigation ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  background: var(--brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand__logo {
  height: 34px;
  width: auto;
  display: block;
}

/* Fallback mark shown when logo image is unavailable */
.site-brand__mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}

.site-brand__name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 0;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 0 0.85rem;
  line-height: 60px;
  display: block;
  transition: color 0.15s;
  white-space: nowrap;
}

.site-nav a:hover { color: #fff; }

.site-nav a.active {
  color: #fff;
  border-bottom: 2px solid var(--accent);
}

.site-nav a.nav-donate {
  background: var(--accent);
  color: #fff !important;
  line-height: normal;
  padding: 7px 14px;
  border-radius: 6px;
  margin-left: 0.5rem;
  font-weight: 500;
}

.site-nav a.nav-donate:hover { background: var(--accent-dark); }

/* Admin nav gets a slightly darker teal to distinguish from public */
.site-header.admin-header { background: #085041; }

/* ── Page wrapper ── */
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
}

/* ── Typography ── */
h1 { font-size: 1.55rem; margin: 0 0 0.35rem; color: var(--text); }
h2 { font-size: 1.15rem; margin: 0 0 0.35rem; color: var(--text); }

.muted   { color: var(--muted); font-size: 0.92rem; }
.success { color: var(--success); font-weight: 600; }
.error   { color: var(--error);   font-weight: 600; }
.hidden  { display: none; }

.required-mark { color: var(--error); margin-left: 2px; }

/* ── Form elements ── */
label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.97rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

textarea { resize: vertical; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

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

.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

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

.btn-accent:hover:not(:disabled) { background: var(--accent-dark); }

.btn-block { display: block; width: 100%; margin-top: 1.25rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

/* ── Confirmation / detail box ── */
.detail-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  background: var(--bg);
  margin-top: 1rem;
}

.detail-box dt {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.detail-box dd {
  margin: 0;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

/* ── Checkbox row ── */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 4px;
  flex-shrink: 0;
}

.checkbox-row label {
  margin-top: 0;
  font-weight: normal;
}

/* ── Section heading within card ── */
.section-heading {
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

/* ── Dashboard stat cards ── */
.dashboard-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
}

.dashboard-card .count {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}

.dashboard-card .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ── Status badges ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-green  { background: #e0f2ee; color: #085041; }
.badge-orange { background: #fef3e8; color: #854f0b; }
.badge-gray   { background: #f1efe8; color: #5f5e5a; }
.badge-red    { background: #fcebeb; color: #791f1f; }

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: 1.25rem 1rem 2.5rem; }
  .site-nav a { padding: 0 0.5rem; font-size: 12px; }
  .site-brand__name { display: none; }
}

/* ── Admin sidebar layout ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #085041;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.admin-sidebar__brand {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.admin-sidebar__logo {
  height: 32px;
  width: auto;
}

.admin-sidebar__mark {
  width: 28px;
  height: 28px;
  background: #e07020;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.admin-sidebar__nav {
  flex: 1;
  padding: .75rem 0;
}

.admin-sidebar__section {
  padding: .5rem 1rem .25rem;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: .5rem;
}

.admin-sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .6rem 1rem;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}

.admin-sidebar__nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.admin-sidebar__nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: #e07020;
}

.admin-sidebar__footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.12);
}

.admin-sidebar__footer a {
  color: rgba(255,255,255,.5);
  font-size: 12px;
  text-decoration: none;
  display: block;
  padding: .35rem 0;
}

.admin-sidebar__footer a:hover { color: #fff; }

.admin-main {
  margin-left: 220px;
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
}

.admin-sidebar__toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: #085041;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar__toggle {
    display: flex;
  }
  .admin-main {
    margin-left: 0;
    padding: 1rem;
    padding-top: 3.5rem;
  }
  .admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
  }
  .admin-overlay.open { display: block; }
}
