/* ==========================================================================
   VNPF Design System — shared tokens
   --------------------------------------------------------------------------
   Ported from the Falah / KAUM IT design system (demo.kaumit.com/falah).
   Structure, radii, spacing, type scale and component anatomy are unchanged.
   The only substantive change: the brand purple ramp (#663399 / #4E2676 /
   #F1ECF7) is replaced by a green ramp derived from the VNPF logo's fern
   wreath (hue 104deg, sampled #60AA45).

   Contrast (WCAG 2.1):
     --green      on #fff  5.21:1   AA normal text, AAA large
     --green-dark on #fff  8.23:1   AAA normal text
     --ink        on --green-light  14.02:1
   ========================================================================== */

:root {
  /* ---- Brand ramp (replaces Falah's purple) ---- */
  --green: #3f7a29;        /* primary   — was --purple      #663399 */
  --green-dark: #2c591c;   /* hover     — was --purple-dark #4E2676 */
  --green-light: #edf6ea;  /* tint      — was --purple-light #F1ECF7 */
  --green-brand: #60aa45;  /* logo fern green, for marks + charts */

  /* Backwards-compatible aliases so Falah component CSS ports verbatim */
  --purple: var(--green);
  --purple-dark: var(--green-dark);
  --purple-light: var(--green-light);

  /* ---- Secondary accents, sampled from the logo ---- */
  --amber: #f8991c;        /* logo chevron orange */
  --amber-tint: #fdf1e0;
  --amber-ink: #96570a;
  --gold: #fbd604;         /* logo "F" yellow */
  --gold-tint: #fdf7d9;
  --gold-ink: #8a7503;

  /* ---- Neutrals (unchanged from Falah) ---- */
  --bg: #f7f7f8;
  --card: #fff;
  --border: #e5e7eb;
  --ink: #1f2430;
  --muted: #64748b;

  /* ---- Status ---- */
  --danger: #dc2626;
  --danger-tint: #fdeaea;
  --danger-ink: #a81f1f;
  --success: var(--green);
  --success-tint: var(--green-light);

  /* ---- Shape + type ---- */
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px #102c220d;
  --shadow-soft: 0 12px 32px rgba(28, 40, 32, 0.08);
  --shadow-pop: 0 8px 24px rgba(31, 36, 48, 0.12);

  --font-display: "Outfit", system-ui, -apple-system, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 64px;
  --sidebar-w: 240px;
  --content-max: 1200px;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.14;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  font-weight: 700;
}

p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); }
a:hover { color: var(--green-dark); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.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;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ==========================================================================
   Buttons  (Falah anatomy: 8px radius, 9/16 padding, 14px 600)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-control);
  padding: 9px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-primary:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--green-light); color: var(--green); border-color: var(--green-light); }
.btn-ghost:disabled { color: var(--muted); cursor: not-allowed; }

.btn-light { background: #fff; color: var(--green-dark); }
.btn-light:hover { background: var(--green-light); color: var(--green-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-ink); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}
.card h2 { color: var(--ink); margin-bottom: 12px; font-size: 15px; }
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-header h2 { margin: 0; }

/* ==========================================================================
   Badges  (pill, 11px 600)
   ========================================================================== */

.badge {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active,
.badge-completed  { background: var(--green-light); color: var(--green-dark); }
.badge-scheduled,
.badge-normal     { background: var(--amber-tint); color: var(--amber-ink); }
.badge-important  { background: var(--gold-tint); color: var(--gold-ink); }
.badge-inactive,
.badge-neutral    { background: #eef1f5; color: #5b6474; }
.badge-cancelled,
.badge-urgent     { background: var(--danger-tint); color: var(--danger-ink); }

/* ==========================================================================
   Forms
   ========================================================================== */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 9px 11px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-light);
}

/* ==========================================================================
   Tables
   ========================================================================== */

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th {
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}
td { border-bottom: 1px solid var(--border); vertical-align: middle; padding: 10px; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 640px; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
  border-radius: var(--radius-control);
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}
.alert-success { background: var(--green-light); color: var(--green-dark); }
.alert-warning { background: var(--amber-tint); color: var(--amber-ink); }
.alert-error   { background: var(--danger-tint); color: var(--danger-ink); }
