/* =====================================================================
   Petty Cash Module — Visual identity
   A back-office ledger feel: ink-navy sidebar, warm paper background,
   monospace figures for anything that's actually money, and a single
   accent (deep money-green) used deliberately rather than everywhere.
   ===================================================================== */

:root {
  --pc-ink:        #16242E;
  --pc-ink-soft:   #2B3B47;
  --pc-paper:      #FBFAF6;
  --pc-card:       #FFFFFF;
  --pc-line:       #E3DECF;
  --pc-accent:     #1F6F54;
  --pc-accent-soft:#E7F0EA;
  --pc-rust:       #B5562B;
  --pc-amber:      #C08A1E;
  --pc-amber-soft: #FBF1DD;
  --pc-red:        #A23B3B;
  --pc-red-soft:   #F6E7E5;
  --pc-green-soft: #E5F1EA;
  --pc-muted:      #6B7280;

  --pc-font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pc-font-head: 'Space Grotesk', var(--pc-font-ui);
  --pc-font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --bs-primary: var(--pc-accent);
  --bs-primary-rgb: 31, 111, 84;
  --bs-body-font-family: var(--pc-font-ui);
  --bs-body-color: var(--pc-ink);
  --bs-body-bg: var(--pc-paper);
}

body {
  background: var(--pc-paper);
  color: var(--pc-ink);
  font-family: var(--pc-font-ui);
}

h1, h2, h3, h4, h5, .pc-brand {
  font-family: var(--pc-font-head);
  letter-spacing: -0.01em;
}

a { color: var(--pc-accent); }
a:hover { color: #154f3c; }

/* ---------- Layout shell ---------- */

.pc-shell {
  display: flex;
  min-height: 100vh;
}

.pc-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--pc-ink);
  color: #E8ECEF;
  display: flex;
  flex-direction: column;
  border-right: 3px solid var(--pc-accent);
}

.pc-sidebar .pc-brand {
  display: block;
  padding: 1.35rem 1.25rem 1.1rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
}

.pc-sidebar .pc-brand small {
  display: block;
  font-family: var(--pc-font-ui);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8FA39B;
  margin-top: 0.15rem;
}

.pc-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.pc-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: #C7D0D4;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.pc-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.pc-nav a.active {
  background: var(--pc-accent);
  color: #fff;
  font-weight: 500;
}

.pc-nav .pc-nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6E7E84;
  margin: 1rem 0.75rem 0.35rem;
}

.pc-sidebar-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
}

.pc-sidebar-foot .pc-role {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8FA39B;
}

.pc-main {
  flex: 1;
  min-width: 0;
}

.pc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.75rem;
  background: var(--pc-card);
  border-bottom: 1px solid var(--pc-line);
}

.pc-topbar h1 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}

.pc-content {
  padding: 1.75rem;
  max-width: 1240px;
}

/* ---------- Cards & panels ---------- */

.pc-card {
  background: var(--pc-card);
  border: 1px solid var(--pc-line);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}

.pc-card-title {
  font-family: var(--pc-font-head);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pc-stat {
  border: 1px solid var(--pc-line);
  background: var(--pc-card);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}

.pc-stat .pc-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pc-muted);
  margin-bottom: 0.4rem;
}

.pc-stat .pc-stat-value {
  font-family: var(--pc-font-mono);
  font-size: 1.55rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--pc-ink);
}

.pc-stat .pc-stat-value.is-low { color: var(--pc-rust); }

/* ---------- Ledger figures ---------- */

.pc-figure {
  font-family: var(--pc-font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pc-figure.credit { color: var(--pc-accent); }
.pc-figure.debit  { color: var(--pc-rust); }

table.pc-ledger td.pc-figure,
table.pc-ledger th.pc-figure {
  text-align: right;
}

/* ---------- Badges ---------- */

.pc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  text-transform: capitalize;
}

.pc-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-pending   { background: var(--pc-amber-soft); color: #8a661a; }
.badge-pending::before   { background: var(--pc-amber); }

.badge-approved  { background: var(--pc-green-soft); color: #1c5b44; }
.badge-approved::before  { background: var(--pc-accent); }

.badge-rejected  { background: var(--pc-red-soft); color: var(--pc-red); }
.badge-rejected::before  { background: var(--pc-red); }

.badge-disbursed { background: #E6ECF3; color: #34495E; }
.badge-disbursed::before { background: #5B7A99; }

/* ---------- Tables ---------- */

.table > :not(caption) > * > * {
  border-bottom-color: var(--pc-line);
}

.pc-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pc-muted);
  border-bottom: 2px solid var(--pc-line);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn-pc-primary {
  background: var(--pc-accent);
  border-color: var(--pc-accent);
  color: #fff;
}
.btn-pc-primary:hover { background: #185c45; border-color: #185c45; color: #fff; }

.btn-pc-outline {
  border-color: var(--pc-line);
  color: var(--pc-ink);
  background: transparent;
}
.btn-pc-outline:hover { background: var(--pc-paper); }

/* ---------- Auth pages ---------- */

.pc-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pc-ink);
  padding: 1.5rem;
}

.pc-auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--pc-paper);
  border-radius: 12px;
  padding: 2rem 2rem 1.75rem;
  border-top: 4px solid var(--pc-accent);
}

.pc-auth-card .pc-brand {
  font-family: var(--pc-font-head);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  display: block;
}

.pc-demo-creds {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--pc-muted);
  border-top: 1px solid var(--pc-line);
  padding-top: 0.9rem;
}

.pc-demo-creds code {
  background: var(--pc-accent-soft);
  color: var(--pc-ink);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ---------- Empty states ---------- */

.pc-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--pc-muted);
}

.pc-empty strong { color: var(--pc-ink); display: block; margin-bottom: 0.3rem; font-family: var(--pc-font-head); }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .pc-shell { flex-direction: column; }
  .pc-sidebar { width: 100%; border-right: none; border-bottom: 3px solid var(--pc-accent); }
  .pc-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .pc-nav .pc-nav-section { display: none; }
  .pc-content { padding: 1.1rem; }
}

/* ---------- Focus visibility (accessibility) ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--pc-accent);
  outline-offset: 2px;
}
