/* PFACentral — Casa Esperanza Montessori PFA
   Brand: Casa green #6cbe45, navy #29417e, accent orange #e8622c */
:root {
  /* PFACentral brand: Heart of the School — forest, leaf, coral, ink */
  --green: #2F8F5B; --green-dark: #247147; --navy: #1F2B22; --navy-dark: #16201A;
  --orange: #F17A4A; --bg: #F5F8F1; --card: #ffffff; --ink: #1F2B22; --muted: #5E6E62;
  --line: #E2E8DC; --gold: #8FCE6A;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Quicksand', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; }
a { color: var(--navy); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 16px; padding: 10px 18px; flex-wrap: wrap; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; }
.brand img { height: 38px; width: 38px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.brand em { color: var(--green); font-style: normal; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.topbar nav a { color: #e8edf7; text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: 14.5px; font-weight: 600; }
.topbar nav a:hover { background: rgba(255,255,255,.14); }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 14px 0; box-shadow: 0 1px 3px rgba(41,65,126,.06); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 { margin: 0 0 10px; font-size: 19px; color: var(--navy); }
h1 { color: var(--navy); font-size: 26px; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 800px) { .grid2, .grid3 { grid-template-columns: 1fr; } .topbar { padding: 8px 10px; } }

.btn { display: inline-block; background: var(--green); color: #fff; border: none; border-radius: 999px; padding: 10px 20px; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-dark); }
.btn.navy { background: var(--navy); } .btn.navy:hover { background: var(--navy-dark); }
.btn.orange { background: var(--orange); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.5); }
.btn.outline { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn.danger { background: #c0392b; }

.flash { padding: 12px 16px; border-radius: 10px; margin: 10px 0; background: #e7f5dd; border: 1px solid var(--green); color: #2c5e12; font-weight: 600; }
.flash.err { background: #fdecea; border-color: #c0392b; color: #7c211a; }

form label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 14px; color: var(--navy); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=month], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; background: #fff;
}
textarea { min-height: 90px; }
.checkline { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; font-size: 14.5px; }
.checkline input { margin-top: 3px; }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:hover td { background: rgba(31,43,34,.05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green-dark); font-weight: 700; } .neg { color: #c0392b; font-weight: 700; }

.progress { position: relative; background: var(--line); border-radius: 999px; height: 26px; overflow: hidden; margin: 8px 0; }
.progress-fill { background: linear-gradient(90deg, var(--green), var(--green-dark)); height: 100%; border-radius: 999px; transition: width .4s; }
.progress-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--navy); }

.badge { display: inline-flex; align-items: center; gap: 5px; background: #eef5e8; border: 1px solid var(--green); color: var(--green-dark); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; margin: 2px; }
.badge.navy { background: #e8edf7; border-color: var(--navy); color: var(--navy); }
.badge.gold { background: #fdf3d7; border-color: var(--gold); color: #8a6410; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.pill.ok { background: #e7f5dd; color: #2c5e12; } .pill.warn { background: #fdf3d7; color: #8a6410; } .pill.bad { background: #fdecea; color: #7c211a; } .pill.info { background: #e8edf7; color: var(--navy); }

.announce { background: linear-gradient(135deg, #fdf6e3, #fdf3d7); border: 1.5px solid var(--gold); border-radius: 14px; padding: 14px 18px; margin: 12px 0; }
.announce h3 { margin: 0 0 4px; color: #8a6410; }
.celebrate { background: linear-gradient(135deg, #e7f5dd, #d5f0c0); border: 2px solid var(--green); border-radius: 14px; padding: 18px; text-align: center; font-size: 18px; font-weight: 800; color: var(--green-dark); margin: 12px 0; }

.steps { list-style: none; padding: 0; margin: 10px 0; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.step-dot { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: var(--line); color: var(--muted); }
.step-dot.done { background: var(--green); color: #fff; }

.chat-msg { padding: 8px 12px; border-radius: 12px; background: #f0f3ea; margin: 6px 0; max-width: 85%; }
.chat-msg .who { font-size: 12px; font-weight: 700; color: var(--navy); }
.chat-msg.held { background: #fdf3d7; border: 1px dashed var(--gold); }
.chat-msg.rejected { background: #fdecea; opacity: .7; }
.muted { color: var(--muted); font-size: 13.5px; }
.event-date { background: var(--navy); color: #fff; border-radius: 10px; padding: 6px 10px; text-align: center; min-width: 58px; font-weight: 800; line-height: 1.1; }
.event-date small { display: block; font-weight: 600; color: #bcd; font-size: 11px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery img { width: 100%; height: 120px; object-fit: cover; display: block; }
.gallery figcaption { padding: 6px 8px; font-size: 12.5px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }
.stat { background: #f7faf3; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--navy); }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Budget table column groups: Projected | Actual | Variance */
table.budget .gl { border-left: 2.5px solid #b9c6e0; }
table.budget .grphead { text-align: center; background: #eef2fa; color: var(--navy); letter-spacing: 1px; font-size: 12px; }
table.budget th { white-space: nowrap; }


/* In-place edit popups */
dialog.editdlg { border: none; border-radius: 16px; padding: 22px 24px; max-width: 520px; width: 92vw; box-shadow: 0 24px 70px rgba(31,43,34,.35); }
dialog.editdlg::backdrop { background: rgba(31,43,34,.45); }
dialog.editdlg h2 { margin: 0 0 8px; color: var(--navy); font-size: 19px; }

/* little info "i" badge */
button.infoI { display:inline-flex; align-items:center; justify-content:center; width:17px; height:17px; border-radius:50%;
  border:none; background: var(--navy); color:#fff; font-size:11px; font-weight:800; font-style:italic; cursor:pointer; vertical-align:2px; margin-left:4px; }
button.infoI:hover { background: var(--green); }

/* anchored rows land below the sticky header */
tr[id], a[id] { scroll-margin-top: 78px; }

/* themed line-item picker */
.pickbtn { display:inline-flex; align-items:center; gap:6px; background:#fff; border:1.5px solid var(--line); border-radius:10px; padding:7px 12px; font-size:13.5px; font-family:inherit; cursor:pointer; color:var(--ink); }
.pickbtn:hover { border-color: var(--green); }
.lp-panel { position:absolute; z-index:200; width:290px; max-height:330px; overflow-y:auto; background:#fff; border:1px solid var(--line); border-radius:14px; box-shadow:0 18px 50px rgba(31,43,34,.25); padding:10px; }
.lp-panel input { margin-bottom:8px; }
.lp-group { font-weight:800; color:var(--navy); font-size:12px; text-transform:uppercase; letter-spacing:.5px; padding:8px 6px 4px; display:flex; align-items:center; gap:6px; }
.lp-item { padding:7px 8px 7px 20px; border-radius:8px; cursor:pointer; font-size:14px; display:flex; align-items:center; gap:7px; }
.lp-item:hover { background:#EAF4E4; }
.lp-none { color:var(--muted); padding-left:8px; }
.lp-dot { display:inline-block; width:11px; height:11px; border-radius:50%; flex:none; }
