/* ASCEND ERP [Genhu vAlpha0.0.1] by RCB 2026 for Generations Humanitarian
   file: static/css/erp.css
*/
:root {
  --brand: #B5451B;
  --brand-dark: #8F3615;
  --brand-soft: #C49A6C;
  --purple-2: #6610f2;
  --ink: #1a1210;
  --muted: #6c757d;
  --line: #e4d8d2;
  --paper: #f6f1ee;
  --card: #ffffff;
  --side: #2a120e;
  --side-2: #3a1a14;
  --side-text: #f3e6dc;
  --side-muted: #c9b4a8;
  --topbar-h: 48px;
  --logobar-h: 56px;
  --side-w: 248px;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(42, 18, 14, 0.12);
}
body.dark-mode {
  --paper: #12151c; --card: #1e2228; --ink: #e9ecef; --muted: #adb5bd;
  --line: #343a40; --shadow: 0 8px 24px rgba(0,0,0,.45);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.logo-bar {
  position: sticky; top: 0; z-index: 40; height: var(--logobar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 8px; background: linear-gradient(135deg, #0d6efd, var(--purple-2)); color: #fff;
}
.logo-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff !important; }

.logo-brand,
.logo-brand:hover,
.logo-brand:focus,
.logo-brand:visited {
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-width: 0;
  flex: 1;
  position: relative;
  color: #fff !important;
  text-decoration: none !important;
}
.home-name {
  position: absolute;
  left: calc(var(--side-w) + 15px - 8px);
  bottom: 11px;
  font-family: Montserrat, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  text-decoration: none !important;
}


.genhu-logo { height: 44px; width: auto; object-fit: contain; }
.home-name { font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-bar-right { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.45); border-radius: 6px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; color: #fff; font-weight: 700; font-size: 12px; padding: 4px 9px; cursor: pointer; }
.lang-switch button.on { background: rgba(255,255,255,.22); }
.btn-darkmode { border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff;
  font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }

.app-shell { display: flex; min-height: calc(100vh - var(--logobar-h)); }
.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: var(--logobar-h);
  height: calc(100vh - var(--logobar-h)); overflow: auto; z-index: 30;
}
.side-nav { padding: 8px 0 24px; }
.side-link, .side-group > summary {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px;
  color: var(--side-text); font-weight: 600; font-size: 13.5px; border: 0; background: transparent;
  cursor: pointer; text-align: left;
}
.side-link:hover, .side-group > summary:hover { background: var(--side-2); color: #fff; }
.side-link.on { background: var(--brand); color: #fff; }
.side-group { border: 0; }
.side-group > summary { list-style: none; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary::after { content: "▾"; margin-left: auto; font-size: 11px; opacity: .7; }
.side-group:not([open]) > summary::after { content: "▸"; }
.side-sub a { display: block; padding: 6px 16px 6px 32px; color: var(--side-muted); font-size: 13px; font-weight: 600; }
.side-sub a:hover { color: #fff; background: var(--side-2); }
.side-sub a.on { color: #fff; background: var(--brand-dark); }
.side-sep { margin: 10px 16px 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-soft); }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: var(--logobar-h); z-index: 20;
}
.fly-toggle { display: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  width: 36px; height: 32px; border-radius: 6px; font-size: 18px; cursor: pointer; }
.crumb { font-weight: 700; }
.top-right { margin-left: auto; display: flex; gap: 14px; font-weight: 600; font-size: 13px; }
.top-right a { color: var(--ink); }
.page { padding: 18px 20px 40px; max-width: 1400px; }
.page h1 { margin: 0 0 12px; font-size: 1.6rem; }
.flashes { margin-bottom: 12px; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; font-weight: 600; }
.flash.success, .flash.info { background: #d1e7dd; color: #0f5132; }
.flash.danger, .flash.error { background: #f8d7da; color: #842029; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: 8rem 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); font-weight: 700; } .kv dd { margin: 0; }
.narrow label { display: block; font-weight: 600; margin: 10px 0 6px; }
.narrow input[type="password"], .narrow input[type="email"], .narrow input[type="text"] {
  width: 100%; max-width: 28rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--ink);
}
.field-err { color: #b02a37; font-size: 13px; }
.narrow button, .narrow input[type="submit"] {
  margin-top: 12px; background: var(--brand); color: #fff; border: 0; padding: 8px 14px;
  border-radius: 6px; font-weight: 700; cursor: pointer;
}
.dash-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.dash-tabs button { border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.dash-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash-panel { display: none; } .dash-panel.on { display: block; }
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 140px; padding: 14px 16px; box-shadow: var(--shadow); }
.widget h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; color: var(--brand); }
.widget p { margin: 0; color: var(--muted); font-size: 13px; }
.widget .stat { font-size: 1.8rem; font-weight: 800; }

.auth-body { min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(160deg, #2a120e, #5b21d6 70%); }
.auth-card { width: min(420px, calc(100% - 24px)); background: #fff; color: #1a1210;
  padding: 28px 24px 22px; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.auth-brand img { height: 42px; }
.auth-sub { color: #6c757d; }
.auth-card form label { display: block; font-weight: 600; margin: 10px 0 4px; }
.auth-card input[type="email"], .auth-card input[type="password"], .auth-card input[type="text"] {
  width: 100%; padding: 9px 10px; border: 1px solid #ced4da; border-radius: 6px; }
.auth-card .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.auth-card button, .auth-card input[type="submit"] {
  width: 100%; margin-top: 14px; background: var(--brand); color: #fff; border: 0;
  padding: 10px 14px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.auth-links { margin: 14px 0 0; text-align: center; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 25; }
.scrim.open { display: block; }
@media (max-width: 960px) {
  .fly-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar { position: fixed; left: 0; top: var(--logobar-h); transform: translateX(-105%);
    transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.3); }
}
body.wall-page .page { max-width: none; padding: 0; }
body.dark-mode .topbar { background: #1e2228; }
body.dark-mode .auth-card { background: #1e2228; color: #e9ecef; }




.app-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted, #888);
  background: var(--card, #1e2228);
  border-top: 2px solid #B5451B;
}
.page { padding-bottom: 34px; }


.side-link,
.side-group > summary {
  font-size: 16px;
  padding: 10px 16px;
}
.side-sub a {
  font-size: 15px;
  padding: 8px 16px 8px 32px;
}
.side-sep {
  font-size: 12px;
}