/* eCash Design System – Phase 1
   African Savannah inspired: warm sand backgrounds, deep earth, corporate blue accents.
   Clean, modern, high contrast, mobile-first.
*/

:root {
  --bg: #F8F5F0;
  --bg-card: #FFFFFF;
  --bg-muted: #F1EDE6;
  --text: #0F172A;
  --text-muted: #64748B;
  --primary: #1E40AF;
  --primary-hover: #1E3A8A;
  --primary-soft: #DBEAFE;
  --accent: #B45309;
  --success: #166534;
  --success-soft: #DCFCE7;
  --danger: #B91C1C;
  --danger-soft: #FEE2E2;
  --warning: #A16207;
  --border: #E7E2D9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* Layout */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.35rem; color: var(--text); text-decoration: none;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 1.1rem;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; text-decoration: none; }
.nav-links a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff !important; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--bg-muted); color: var(--text); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); text-decoration: none; }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  line-height: 1.2; margin: 0 0 1rem; color: var(--text);
}
.hero .lead {
  font-size: 1.15rem; color: var(--text-muted); max-width: 540px;
  margin: 0 auto 1.75rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* Feature grid */
.features { padding: 2.5rem 0 3.5rem; }
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.section-title p { margin: 0; color: var(--text-muted); }
.grid-3 {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem;
}
.feature-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; margin-bottom: 0.9rem; font-size: 1.25rem;
}
.feature-card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem;
}
.form-control {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; background: #fff; color: var(--text);
  transition: border-color 0.15s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  font-size: 0.95rem;
}
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }

/* Offline banner */
.offline-banner {
  display: none;
  background: var(--danger); color: #fff; text-align: center;
  padding: 0.6rem 1rem; font-weight: 600; font-size: 0.9rem;
}
.offline-banner.is-visible { display: block; }

/* Footer */
.site-footer {
  background: var(--text); color: #CBD5E1;
  padding: 2.5rem 0 1.5rem; margin-top: 3rem;
}
.site-footer a { color: #94A3B8; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand { font-weight: 700; color: #fff; font-size: 1.15rem; margin-bottom: 0.5rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-bottom {
  border-top: 1px solid #334155; padding-top: 1.25rem;
  font-size: 0.85rem; color: #64748B; text-align: center;
}

/* Admin */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--text); color: #E2E8F0;
  padding: 1.25rem 0; flex-shrink: 0;
}
.admin-sidebar .logo { color: #fff; padding: 0 1.25rem 1.5rem; }
.admin-nav a {
  display: block; padding: 0.55rem 1.25rem; color: #94A3B8;
  text-decoration: none; font-size: 0.95rem;
}
.admin-nav a:hover, .admin-nav a.active { background: #1E293B; color: #fff; }
.admin-main { flex: 1; padding: 1.5rem; background: var(--bg); }
.stat-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
}
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--text); }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 768px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .nav-links { display: none; }
}

/* —— Phase 11: Admin collapsible sticky sidebar —— */
.admin-shell { position: relative; }
.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  width: 260px;
  transition: width 0.2s ease, transform 0.2s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.admin-sidebar.is-collapsed {
  width: 72px;
}
.admin-sidebar.is-collapsed .nav-label,
.admin-sidebar.is-collapsed .sidebar-section-title,
.admin-sidebar.is-collapsed .logo span:not(.logo-mark) {
  display: none;
}
.admin-sidebar.is-collapsed .admin-nav a {
  text-align: center;
  padding: 0.65rem 0.5rem;
  justify-content: center;
}
.admin-sidebar.is-collapsed .admin-sidebar-header {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.35rem 1rem;
}
.admin-sidebar.is-collapsed .sidebar-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  background: #1E40AF;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 50;
  position: relative;
}
.admin-sidebar.is-collapsed .sidebar-toggle:hover {
  background: #2563EB;
}
.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 1rem 1rem;
  border-bottom: 1px solid #334155;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.admin-sidebar .logo { padding: 0; margin: 0; }
.sidebar-toggle {
  background: #1E293B;
  border: none;
  color: #E2E8F0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: #334155; }
.admin-nav { flex: 1; padding-bottom: 1.5rem; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}
.admin-nav a .nav-ico {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}
.admin-nav a.active {
  background: #1E40AF;
  color: #fff;
  border-left: 3px solid #93C5FD;
}
.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748B;
  padding: 0.85rem 1.25rem 0.35rem;
}
@media (max-width: 860px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar.is-collapsed { width: 260px; }
  .admin-main { padding-top: 3.5rem; }
  .admin-mobile-bar {
    display: flex !important;
  }
}
.admin-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--text);
  color: #fff;
  padding: 0.65rem 1rem;
  align-items: center;
  gap: 0.75rem;
}

/* Customer app action grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 520px) {
  .action-grid { grid-template-columns: repeat(3, 1fr); }
}
.action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.action-tile:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}
.action-tile .tile-ico { font-size: 1.4rem; line-height: 1; }
.app-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.app-subnav a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.app-subnav a:hover, .app-subnav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}


/* Modern feature grid – landing */
.feature-grid-modern {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}
@media (min-width: 900px) {
  .feature-grid-modern {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
  }
}
.feature-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 0.9rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
@media (min-width: 900px) {
  .feature-tile { padding: 1.35rem 1rem; gap: 0.5rem; }
}
.feature-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.12);
  text-decoration: none;
  color: inherit;
}
.feature-tile-ico {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: var(--primary-soft, #EFF6FF);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 700;
}
.feature-tile-label {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.25;
}
@media (min-width: 900px) {
  .feature-tile-label { font-size: 1rem; font-weight: 700; }
}
.feature-tile-blurb {
  display: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 400;
}
@media (min-width: 900px) {
  .feature-tile-blurb { display: block; }
}

/* Logo rounding */
.brand-logo-img,
.logo img {
  border-radius: 5px;
}
.logo-mark {
  border-radius: 5px !important;
}

/* Mobile header nav */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* Header layout */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  transition: color 0.15s;
}
.header-nav a:hover { color: var(--primary); }
.header-nav .btn { margin-left: 0.25rem; }

.header-notif {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.header-notif .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; background: #fff; }
  .header-inner {
    flex-wrap: wrap;
    gap: 0.35rem;
    position: relative;
  }
  .header-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.65rem 0.75rem 0.85rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--border);
    background: #ffffff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    font-size: 0.95rem;
    font-weight: 500;
  }
  .header-nav.is-open {
    display: flex;
  }
  .header-nav a {
    padding: 0.8rem 0.75rem;
    border-radius: 10px;
    color: var(--text);
  }
  .header-nav a:hover {
    background: var(--bg-muted, #F8FAFC);
    color: var(--primary);
  }
  .header-nav .btn {
    margin: 0.35rem 0 0;
    width: 100%;
    justify-content: center;
  }
  .logo {
    max-width: calc(100% - 6.5rem);
  }
  .logo img {
    max-height: 36px;
  }
  /* hide floating notif on mobile – use header one */
  .notif-bell-wrap { display: none !important; }
}
@media (min-width: 769px) {
  .header-notif { display: none; } /* desktop uses floating or dashboard header */
  .header-nav { gap: 2rem; }
}



/* Homepage login CTA – high contrast */
.hero-login-btn { background: #0f172a !important; color: #fff !important; }
.hero-login-btn:hover { background: #1e293b !important; color: #fff !important; text-decoration: none; }
