/* ============================================================
   BARANGAY BUDGET MANAGEMENT SYSTEM — SHARED STYLESHEET
   Lolo-Friendly UI: large fonts, high contrast, clear labels
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --color-navy:     #0b3d91;
  --color-navy-dark:#072d6b;
  --color-navy-light:#1a56c4;
  --color-green:    #0a7d39;
  --color-green-light:#e6f5ec;
  --color-red:      #c0392b;
  --color-red-light:#fdecea;
  --color-gold:     #c9a227;
  --color-gold-light:#fdf6e3;
  --color-white:    #ffffff;
  --color-bg:       #f4f6f9;
  --color-text:     #1a1a1a;
  --color-text-muted:#555555;
  --color-border:   #d0d7e3;
  --color-grey:     #6c757d;
  --color-grey-light:#e9ecef;
  --sidebar-width:  240px;
  --topnav-height:  64px;
  --radius:         6px;
  --shadow:         0 2px 8px rgba(0,0,0,0.10);
  --shadow-card:    0 2px 12px rgba(0,0,0,0.08);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

a {
  color: var(--color-navy);
  text-decoration: underline;
}
a:hover {
  color: var(--color-navy-light);
}
a:focus {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

img, svg {
  display: inline-block;
  vertical-align: middle;
}

ul, ol {
  list-style: none;
}

/* --- Typography --- */
h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text); }
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--color-text); }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--color-text); }
h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--color-text); }
p  { margin-bottom: 0.75rem; }

.text-muted { color: var(--color-text-muted); font-size: 0.9rem; }
.text-large { font-size: 22px; font-weight: 700; }
.text-small { font-size: 0.85rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.peso-amount { font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }

/* ============================================================
   TOP NAVIGATION BAR
   ============================================================ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-height);
  background-color: var(--color-navy);
  color: var(--color-white);
  display: flex;
  align-items: center;
  padding: 0 16px 0 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  text-decoration: none;
  color: var(--color-white);
  min-width: var(--sidebar-width);
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.top-nav-brand:hover { color: var(--color-gold); background: rgba(255,255,255,0.05); }

.top-nav-brand img,
.top-nav-brand svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 0.85rem; font-weight: 700; }
.brand-sub  { font-size: 0.7rem; opacity: 0.85; }

.top-nav-center {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.top-nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.role-badge {
  background-color: var(--color-gold);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-white);
  font-size: 0.9rem;
  text-decoration: none;
}
.nav-user:hover { color: var(--color-gold); }

.btn-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
  border-radius: var(--radius);
}
.btn-hamburger:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--topnav-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topnav-height));
  background-color: var(--color-navy-dark);
  color: var(--color-white);
  overflow-y: auto;
  z-index: 900;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.sidebar-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45);
  padding: 16px 16px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 48px;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: var(--color-white);
}
.sidebar-link.active {
  background: rgba(255,255,255,0.13);
  border-left-color: var(--color-gold);
  color: var(--color-white);
  font-weight: 600;
}

.sidebar-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 850;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.layout {
  display: flex;
  padding-top: var(--topnav-height);
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 28px 48px;
  min-width: 0;
  max-width: 100%;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  padding: 8px 12px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.breadcrumb a {
  color: var(--color-navy);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-border); }
.breadcrumb-current { color: var(--color-text); font-weight: 600; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-header-left h1 { margin-bottom: 2px; }
.page-header-left p  { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--color-navy);
}
.stat-card.green::before  { background: var(--color-green); }
.stat-card.red::before    { background: var(--color-red); }
.stat-card.gold::before   { background: var(--color-gold); }
.stat-card.navy::before   { background: var(--color-navy); }

.stat-card-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
  display: block;
}

.stat-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.stat-card.green .stat-card-value { color: var(--color-green); }
.stat-card.red   .stat-card-value { color: var(--color-red); }
.stat-card.gold  .stat-card-value { color: var(--color-gold); }

.stat-card-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: #fafbfd;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-header h2,
.card-header h3 { margin: 0; }

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  background: #fafbfd;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 24px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.btn:focus {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background-color: var(--color-navy);
  color: var(--color-white);
}
.btn-primary:hover { background-color: var(--color-navy-light); color: var(--color-white); text-decoration: none; }

.btn-success {
  background-color: var(--color-green);
  color: var(--color-white);
}
.btn-success:hover { background-color: #0b9944; color: var(--color-white); text-decoration: none; }

.btn-danger {
  background-color: var(--color-red);
  color: var(--color-white);
}
.btn-danger:hover { background-color: #a93226; color: var(--color-white); text-decoration: none; }

.btn-secondary {
  background-color: var(--color-grey);
  color: var(--color-white);
}
.btn-secondary:hover { background-color: #5a6268; color: var(--color-white); text-decoration: none; }

.btn-outline {
  background-color: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-navy);
}
.btn-outline:hover { background-color: var(--color-navy); color: var(--color-white); text-decoration: none; }

.btn-gold {
  background-color: var(--color-gold);
  color: var(--color-text);
}
.btn-gold:hover { background-color: #b8911f; color: var(--color-text); text-decoration: none; }

.btn-sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-icon { font-size: 1.1em; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.table th {
  background: var(--color-navy);
  color: var(--color-white);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table tbody tr:nth-child(even) td {
  background-color: #f8f9fc;
}
.table tbody tr:hover td {
  background-color: #eef2fb;
}
.table tbody tr:last-child td {
  border-bottom: none;
}

.table .amount-cell {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.table .actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active    { background: var(--color-green-light); color: var(--color-green); border: 1px solid #a8dfc0; }
.badge-approved  { background: var(--color-green-light); color: var(--color-green); border: 1px solid #a8dfc0; }
.badge-pending   { background: var(--color-gold-light);  color: #8a6d00;            border: 1px solid #f0d67a; }
.badge-rejected  { background: var(--color-red-light);   color: var(--color-red);   border: 1px solid #f5a99f; }
.badge-completed { background: var(--color-grey-light);  color: var(--color-grey);  border: 1px solid #c8cdd3; }
.badge-inactive  { background: var(--color-grey-light);  color: var(--color-grey);  border: 1px solid #c8cdd3; }
.badge-captain   { background: #e8edf8;  color: var(--color-navy); border: 1px solid #b3c2e8; }
.badge-treasurer { background: #fdf6e3;  color: #8a6d00;           border: 1px solid #f0d67a; }
.badge-manager   { background: #e6f5ec;  color: var(--color-green); border: 1px solid #a8dfc0; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-wrap {
  margin: 4px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.progress-bar-bg {
  background: var(--color-grey-light);
  border-radius: 20px;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: var(--color-navy);
  transition: width 0.3s ease;
}
.progress-bar.green  { background: var(--color-green); }
.progress-bar.gold   { background: var(--color-gold); }
.progress-bar.red    { background: var(--color-red); }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}
.form-label .required {
  color: var(--color-red);
  margin-left: 3px;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 18px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(11,61,145,0.12);
}
.form-control::placeholder { color: #aaa; }

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-navy);
}

/* ============================================================
   ALERTS / NOTICES
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 18px;
  font-size: 0.95rem;
}
.alert-icon { font-size: 1.3rem; flex-shrink: 0; }
.alert-info    { background: #e8edf8; border-color: #b3c2e8; color: var(--color-navy); }
.alert-success { background: var(--color-green-light); border-color: #a8dfc0; color: var(--color-green); }
.alert-warning { background: var(--color-gold-light);  border-color: #f0d67a; color: #8a6d00; }
.alert-danger  { background: var(--color-red-light);   border-color: #f5a99f; color: var(--color-red); }

/* ============================================================
   LEGEND BOX (for index.html)
   ============================================================ */
.legend-box {
  background: var(--color-gold-light);
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.legend-box h3 {
  color: #8a6d00;
  margin-bottom: 10px;
}
.legend-box ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--color-text);
}
.legend-box ul li {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* ============================================================
   PUBLIC PAGES LAYOUT (no sidebar)
   ============================================================ */
.public-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-height);
  background-color: var(--color-navy);
  color: var(--color-white);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  gap: 16px;
}

.public-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-white);
  flex: 1;
}
.public-nav-brand:hover { color: var(--color-gold); }

.public-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.public-nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.public-nav-link:hover { background: rgba(255,255,255,0.12); color: var(--color-white); }
.public-nav-link.active { background: rgba(255,255,255,0.18); color: var(--color-white); font-weight: 700; }

.public-wrapper {
  padding-top: var(--topnav-height);
  min-height: 100vh;
}

.public-hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: var(--color-white);
  padding: 48px 24px 40px;
  text-align: center;
}

.public-hero h1 {
  color: var(--color-white);
  font-size: 2rem;
  margin-bottom: 8px;
}

.public-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.public-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.public-footer {
  background: var(--color-navy-dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.85rem;
}

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dashboard-welcome h1 { color: var(--color-white); margin: 0; font-size: 1.5rem; }
.dashboard-welcome p  { color: rgba(255,255,255,0.85); margin: 4px 0 0; font-size: 0.95rem; }
.dashboard-welcome-date { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

/* ============================================================
   PROGRAM CARD (for lists)
   ============================================================ */
.program-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}
.program-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.13);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text);
}

.program-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.program-card h3 { margin: 0; font-size: 1.05rem; }
.program-card-manager { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 10px; }

.program-card-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.program-card-amount {
  background: var(--color-bg);
  border-radius: 4px;
  padding: 8px 10px;
}
.program-card-amount .label { font-size: 0.75rem; text-transform: uppercase; color: var(--color-text-muted); font-weight: 600; }
.program-card-amount .value { font-size: 1rem; font-weight: 700; }

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--color-white);
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.login-header {
  background: var(--color-navy);
  color: var(--color-white);
  text-align: center;
  padding: 28px 24px 20px;
}
.login-header img, .login-header svg { width: 60px; height: 60px; margin-bottom: 12px; }
.login-header h1 { color: var(--color-white); font-size: 1.3rem; margin: 0; }
.login-header p  { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin: 4px 0 0; }

.login-body { padding: 28px 28px 20px; }

.login-demo {
  background: var(--color-gold-light);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 24px;
}
.login-demo p {
  font-size: 0.9rem;
  font-weight: 600;
  color: #8a6d00;
  margin-bottom: 10px;
}
.login-demo-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-demo-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 48px;
  transition: background 0.15s;
}
.login-demo-btn.treasurer { background: var(--color-navy); color: var(--color-white); }
.login-demo-btn.treasurer:hover { background: var(--color-navy-light); }
.login-demo-btn.captain   { background: var(--color-green); color: var(--color-white); }
.login-demo-btn.captain:hover { background: #0b9944; }
.login-demo-btn.manager   { background: var(--color-gold); color: var(--color-text); }
.login-demo-btn.manager:hover { background: #b8911f; }

.login-footer {
  text-align: center;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ============================================================
   APPROVAL QUEUE
   ============================================================ */
.approval-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.approval-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.approval-item h3 { font-size: 1.05rem; margin: 0; }
.approval-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}
.approval-item-meta span { display: flex; align-items: center; gap: 5px; }

.approval-item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  margin-top: 8px;
}

/* ============================================================
   REPORTS PAGE
   ============================================================ */
.report-chart-placeholder {
  background: linear-gradient(135deg, #f8f9fc 0%, #eef2fb 100%);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.report-chart-placeholder .chart-icon { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.w-full { width: 100%; }

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.info-item { }
.info-item .info-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.info-item .info-value {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================================
   RESPONSIVE — MOBILE (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  html { font-size: 17px; }

  /* Show hamburger, hide brand sidebar section */
  .btn-hamburger { display: flex !important; align-items: center; justify-content: center; }

  .top-nav-brand {
    min-width: unset;
    border-right: none;
  }

  .brand-text .brand-sub { display: none; }

  /* Sidebar becomes off-canvas */
  .sidebar {
    transform: translateX(-100%);
    z-index: 1100;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Overlay shows when sidebar open */
  .sidebar-overlay.visible {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 16px 14px 40px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .program-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .table th, .table td {
    padding: 10px 10px;
    font-size: 0.9rem;
  }

  .top-nav-title { display: none; }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  .btn { font-size: 16px; padding: 0 18px; }

  .public-hero h1 { font-size: 1.5rem; }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-header { flex-direction: column; align-items: flex-start; }
  .card-footer { flex-direction: column; align-items: stretch; }
  .card-footer .btn { width: 100%; }

  .login-body { padding: 20px 18px 16px; }

  .approval-item-actions { flex-direction: column; }
  .approval-item-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .program-card-amounts { grid-template-columns: 1fr; }
  .public-nav-links .public-nav-link span:not(.nav-icon) { display: none; }
}

/* ============================================================
   APP LAYOUT — LOGGED-IN SIDEBAR LAYOUT
   ============================================================ */
.top-nav {
  position: fixed; top:0; left:0; right:0;
  height: var(--topnav-height);
  background: var(--color-navy);
  color: #fff;
  display: flex; align-items: center; padding: 0 16px; z-index:1000;
  box-shadow: var(--shadow);
}
.top-nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-weight:700; font-size:1.1rem;
}
.top-nav-brand img { border-radius:4px; }
.brand-name-short { font-weight:700; }
.top-nav-right {
  margin-left: auto; display:flex; align-items:center; gap:14px;
}
.role-badge { padding:4px 12px; border-radius:20px; font-size:0.8rem; font-weight:700; }
.role-captain   { background:#c9a227; color:#1a1a1a; }
.role-treasurer { background:#0a7d39; color:#fff; }
.role-manager   { background:#1a56c4; color:#fff; }
.user-name-nav  { font-size:0.95rem; }
.btn-logout {
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(255,255,255,0.15); color:#fff;
  text-decoration:none; padding:6px 14px; border-radius:var(--radius);
  font-size:0.9rem; font-weight:600;
}
.btn-logout:hover { background:rgba(255,255,255,0.25); color:#fff; }

.sidebar {
  position: fixed; top: var(--topnav-height); left:0; bottom:0;
  width: var(--sidebar-width);
  background: #fff; border-right: 1px solid var(--color-border);
  overflow-y: auto; padding: 16px 0; z-index:900;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}
.sidebar-user {
  display:flex; align-items:center; gap:12px;
  padding: 12px 20px 16px; border-bottom:1px solid var(--color-border);
}
.sidebar-avatar { font-size:2rem; }
.sidebar-user-name { font-weight:700; font-size:1rem; }
.sidebar-user-role { font-size:0.85rem; color:var(--color-text-muted); }
.sidebar-nav { padding: 10px 0; }
.sidebar-link {
  display:flex; align-items:center; gap:10px;
  padding:12px 20px; color:var(--color-text);
  text-decoration:none; font-size:1rem; font-weight:500;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background:var(--color-grey-light); color:var(--color-navy); text-decoration:none; }
.sidebar-link.active { background:var(--color-navy); color:#fff; border-left-color:var(--color-gold); }
.sidebar-link .nav-icon { font-size:1.1rem; width:24px; text-align:center; }
.sidebar-divider { border:none; border-top:1px solid var(--color-border); margin:8px 0; }

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topnav-height);
  padding: 24px;
  min-height: calc(100vh - var(--topnav-height));
}

.sidebar-toggle { display:none; background:none; border:none; color:#fff; font-size:1.5rem; cursor:pointer; margin-right:12px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header { margin-bottom: 24px; }
.page-header h1 { margin-bottom: 4px; }
.page-header-row {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
}
.header-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-wrapper {
  min-height:calc(100vh - var(--topnav-height));
  display:flex; align-items:center; justify-content:center; padding:24px;
}
.login-card {
  background:#fff; border-radius:var(--radius); box-shadow:var(--shadow-card);
  padding: 40px 36px; width:100%; max-width:420px;
}
.login-header { text-align:center; margin-bottom:28px; }
.login-header img { margin-bottom:12px; }
.login-header h1 { font-size:1.6rem; }
.login-footer { margin-top:20px; text-align:center; font-size:0.95rem; }

/* ============================================================
   FORMS
   ============================================================ */
.form-card { padding: 28px; max-width: 800px; }
.form-group { margin-bottom: 18px; }
.form-label { display:block; font-weight:600; margin-bottom:6px; font-size:1rem; }
.required { color:var(--color-red); }
.form-control {
  width:100%; padding:12px 16px; font-size:1rem; border:2px solid var(--color-border);
  border-radius:var(--radius); background:#fff; color:var(--color-text);
  transition: border-color 0.15s;
}
.form-control:focus { outline:none; border-color:var(--color-navy); box-shadow:0 0 0 3px rgba(11,61,145,0.1); }
.form-control-lg { font-size:1.1rem; padding:14px 18px; }
.form-control-sm { font-size:0.9rem; padding:8px 12px; min-height:36px; }
.form-hint { font-size:0.85rem; color:var(--color-text-muted); margin-top:4px; }
.form-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:16px; }
.form-group-action { display:flex; align-items:flex-end; }
.form-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:24px; }
.btn-block { width:100%; }
.checkbox-label { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:1rem; }
.checkbox-label input { width:20px; height:20px; cursor:pointer; }

/* ============================================================
   BALANCE INDICATOR
   ============================================================ */
.balance-indicator {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:16px 20px; margin-bottom:20px; background:#f0f4ff;
  border-left: 4px solid var(--color-navy);
}
.balance-label { font-weight:700; }
.text-green { color:var(--color-green); }
.text-danger { color:var(--color-red); }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
  padding:14px 18px; border-radius:var(--radius); margin-bottom:16px;
  display:flex; align-items:center; gap:10px; font-size:1rem;
  position:relative;
}
.alert-close {
  margin-left:auto; background:none; border:none; cursor:pointer;
  font-size:1.2rem; opacity:0.6; padding:0 4px;
}
.alert-success { background:#e6f5ec; color:#0a4d23; border-left:4px solid var(--color-green); }
.alert-error   { background:#fdecea; color:#7d1a12; border-left:4px solid var(--color-red); }
.alert-info    { background:#e8f0fe; color:#0d3c8a; border-left:4px solid var(--color-navy-light); }
.alert-warning { background:#fdf6e3; color:#7a5900; border-left:4px solid var(--color-gold); }

/* ============================================================
   APPROVAL ITEMS
   ============================================================ */
.approval-item {
  display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap;
  padding:16px; border-bottom:1px solid var(--color-border);
}
.approval-item:last-child { border-bottom:none; }
.approval-meta { min-width:140px; }
.approval-program { font-weight:700; color:var(--color-navy); }
.approval-date { font-size:0.9rem; color:var(--color-text-muted); }
.approval-details { flex:1; }
.approval-actions { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-start; }
.card-inner { background:#fafbfd; border-radius:var(--radius); margin-bottom:8px; }

/* ============================================================
   COLLAPSE FORMS (funds page)
   ============================================================ */
.collapse-form {
  padding: 20px; background:#f4f6f9; border-radius:var(--radius);
  margin-bottom:16px; border:1px solid var(--color-border);
}

/* ============================================================
   ROW STATES
   ============================================================ */
.row-inactive td { opacity: 0.55; }

/* ============================================================
   BUTTON VARIANTS
   ============================================================ */
.btn-success { background:var(--color-green); color:#fff; min-height:40px; }
.btn-success:hover { background:#07622d; }
.btn-danger { background:var(--color-red); color:#fff; min-height:40px; }
.btn-danger:hover { background:#9e2d21; }
.btn-sm { min-height:36px; padding:0 14px; font-size:0.9rem; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  padding:40px 20px; text-align:center; color:var(--color-text-muted);
  font-size:1.1rem;
}

/* ============================================================
   DETAIL META (definition list)
   ============================================================ */
.detail-meta { display:grid; grid-template-columns:180px 1fr; gap:8px 16px; }
.detail-meta dt { font-weight:600; color:var(--color-text-muted); }
.detail-meta dd { margin:0; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .no-print, .sidebar, .top-nav, .sidebar-toggle,
  .btn, .form-actions, .breadcrumb, .filter-form, .alert { display:none !important; }
  .main-content { margin:0; padding:0; }
  .print-header { display:block !important; }
  .stat-card { break-inside:avoid; }
  body { background:#fff; font-size:12pt; }
  .table th, .table td { border:1px solid #ccc; padding:6px; }
}
.print-header { display:none; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display:block; }
  .main-content { margin-left:0; }
  .form-row { grid-template-columns:1fr; }
  .stat-cards { grid-template-columns:1fr 1fr; }
  .page-header-row { flex-direction:column; align-items:flex-start; }
  .approval-item { flex-direction:column; }
  .login-card { padding:24px 16px; }
  .top-nav { padding:0 12px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns:1fr; }
  .form-card { padding:16px; }
}
