/* ════════════════════════════════════════════════════
   MAPO Software Solutions — Shared theme
   Tokens, base resets, shared topbar/footer, badges
   ════════════════════════════════════════════════════ */

:root {
  /* Brand */
  --red: #ab161b;
  --red-hover: #8e1215;
  --red-light: rgba(171, 22, 27, 0.08);
  --red-mid:   rgba(171, 22, 27, 0.15);
  --red-border: rgba(171, 22, 27, 0.25);

  /* Greyscale */
  --black: #000000;
  --dkgray: #333333;
  --ltgray: #7f7f7f;
  --white: #ffffff;

  /* Backgrounds */
  --bg: #ffffff;
  --bg-subtle: #f8f8f8;
  --bg-panel:  #f2f2f2;

  /* Borders */
  --border: #e0e0e0;
  --border-strong: #c8c8c8;

  /* Text */
  --text-primary:   #000000;
  --text-secondary: #333333;
  --text-muted:     #7f7f7f;

  /* Status accents */
  --green: #1a7a4a;
  --green-bg: rgba(26, 122, 74, 0.08);
  --green-border: rgba(26, 122, 74, 0.25);

  --amber: #b06000;
  --amber-bg: rgba(176, 96, 0, 0.08);
  --amber-border: rgba(176, 96, 0, 0.25);

  --blue: #1a5a9a;
  --blue-bg: rgba(26, 90, 154, 0.08);
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-subtle);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
body.dash-active { overflow: hidden; }

/* ── Shared brand mark ──
   Holds either the CI icon (img) or a fallback "M" letter.
   The container is the brand square; an inner <img> sits on top of it. */
.brand-mark {
  width: 36px;
  height: 36px;
  background: transparent;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  letter-spacing: 0.5px;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* When no image is supplied, the "M" text shows on a red square */
.brand-mark.text-fallback {
  background: var(--red);
}
.brand-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--black);
}

/* ── Wide brand banner ──
   Horizontal MAPO CI logo. Use anywhere the full lockup belongs
   (login screen, splash, footer, print headers).
   Default height fits a 64px topbar with breathing room. */
.brand-wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  line-height: 0;
}
.brand-wide img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
.brand-wide.sm { height: 36px; }
.brand-wide.lg { height: 80px; }
.brand-wide.xl { height: 110px; }

/* Fallback when wide logo image is missing — show "M + MAPO" lockup */
.brand-wide-fallback {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ── Shared badges (Sales Solution style) ── */
.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge i { font-size: 10px; }
.badge-red   { background: var(--red-light);   color: var(--red);   border: 1px solid var(--red-border); }
.badge-green { background: var(--green-bg);    color: var(--green); border: 1px solid var(--green-border); }
.badge-amber { background: var(--amber-bg);    color: var(--amber); border: 1px solid var(--amber-border); }
.badge-gray  { background: var(--bg-panel);    color: var(--text-muted); border: 1px solid var(--border); }

/* ── Shared section label ── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-label .count {
  background: var(--bg-panel);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
}
.section-label .count strong { font-weight: 700; }

/* ── Shared footer bar (dark) ── */
.app-footer {
  height: 30px;
  background: var(--dkgray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.app-footer .l,
.app-footer .r {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.3px;
}
.app-footer span { color: rgba(255, 255, 255, 0.7); }

/* ── Shared scrollbar ── */
.scroll-y::-webkit-scrollbar { width: 6px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ── Visually hidden ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
