/* =====================================================================
   Franklin County Foster Closet — staff & kiosk app styles
   Brand: sky blue #8cc5fc wash, accessible deep blue #2660a4 for actions,
   red heart #ee1c25 accent, charcoal-navy ink, Open Sans. "Be the Village."
   ===================================================================== */

:root {
    --navy:      #1f2a37;   /* logo linework + strong headings */
    --ink:       #26313f;   /* body text */
    --muted:     #5b6b7f;
    --line:      #e2e8f1;
    --line-soft: #eef2f8;

    --sky:       #8cc5fc;   /* brand sky blue */
    --sky-050:   #f2f8ff;
    --sky-100:   #e7f2ff;
    --sky-200:   #d4e8fe;

    --blue:      #2660a4;   /* primary action — accessible on white */
    --blue-700:  #1d4c84;   /* hover / active */
    --heart:     #ee1c25;   /* accent — use sparingly */

    --ok:     #1a7f5a;  --ok-bg:  #e7f6ef;
    --bad:    #b42318;  --bad-bg: #fdecea;

    --teal: var(--blue);    /* legacy alias: any older reference still resolves */
    --shadow-sm: 0 2px 8px rgba(31, 42, 55, 0.06);
    --shadow:    0 10px 34px rgba(31, 42, 55, 0.09);
    --radius:    14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, var(--sky-050) 0%, #f6f9fc 340px, #f6f9fc 100%);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---- top bar (app pages) ---- */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: 940px;
    margin: 0 auto;
    padding: 0.7rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand-seal { width: 44px; height: 44px; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { color: var(--navy); font-weight: 800; font-size: 1.02rem; letter-spacing: 0.01em; }
.brand-tag  { color: var(--blue); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }

.topnav { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.topnav .who { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }
.btn-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.topnav .btn-link {
    padding: 0.35rem 0.6rem; border-radius: 8px; font-size: 0.92rem;
    text-decoration: none; transition: background 0.15s, color 0.15s;
}
.topnav .btn-link:hover { background: var(--sky-100); color: var(--blue-700); text-decoration: none; }

/* ---- main card ---- */
.wrap {
    max-width: 820px;
    margin: 1.75rem auto 6rem;
    padding: 2rem 2.25rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

h1 {
    margin: 0.1rem 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--navy);
}
.wrap > h1:first-child { color: var(--navy); }

.tagline { margin: 0.2rem 0 1.5rem; color: var(--muted); }
.muted { color: var(--muted); }
h1 + .muted { margin-top: 0; }

/* ---- status banner + checks (health page) ---- */
.status { padding: 0.9rem 1.1rem; border-radius: 10px; font-weight: 600; margin-bottom: 1.5rem; }
.status.ok  { background: var(--ok-bg);  color: var(--ok);  }
.status.bad { background: var(--bad-bg); color: var(--bad); }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
    display: grid;
    grid-template-columns: 1.6rem 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
}
.checks .mark { font-weight: 700; font-size: 1.1rem; }
.checks li.ok  .mark { color: var(--ok);  }
.checks li.bad .mark { color: var(--bad); }
.checks .label  { font-weight: 600; }
.checks .detail { color: var(--muted); font-size: 0.9rem; text-align: right; }

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; max-width: 380px; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.form input {
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
}
.form input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.hint { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.btn {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(38, 96, 164, 0.25);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--blue-700); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(38, 96, 164, 0.28); }
.btn:active { transform: translateY(0); }

.alert {
    background: var(--bad-bg);
    color: var(--bad);
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(180, 35, 24, 0.18);
}

/* ---- dashboard cards ---- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 0.35rem; color: var(--navy); font-size: 1.05rem; font-weight: 800; }
.card .muted { margin: 0 0 0.5rem; font-size: 0.92rem; }
.soon { display: inline-block; font-style: italic; color: var(--muted); font-size: 0.8rem; }

.foot { margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; }

/* ===== Shoppers feature ===== */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 1rem; }

/* search bar */
.searchbar { display: flex; gap: 0.6rem; align-items: center; margin: 1rem 0 1.25rem; }
.searchbar input[type="search"] {
    flex: 1; padding: 0.7rem 0.8rem; border: 1px solid var(--line);
    border-radius: 10px; font-size: 1rem; font-family: inherit;
}
.searchbar input[type="search"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* data table */
.data-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.data-table th, .data-table td { text-align: left; padding: 0.65rem 0.6rem; border-bottom: 1px solid var(--line); }
.data-table thead th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--sky-050); border-bottom: 1px solid var(--line); }
.data-table thead th:first-child { border-top-left-radius: 8px; }
.data-table thead th:last-child { border-top-right-radius: 8px; }
.data-table td a { color: var(--blue); font-weight: 600; text-decoration: none; }
.data-table td a:hover { text-decoration: underline; }
.data-table tbody tr:hover { background: var(--sky-050); }

/* wider form + rows */
.form.wide { max-width: 560px; }
.form-row { display: flex; gap: 1rem; }
.form-row > label { flex: 1; }
.form-row > label.narrow { flex: 0 0 6rem; }
.form select {
    padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 10px;
    font-size: 1rem; background: #fff; font-family: inherit;
}
.form select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.form label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
.form label.check input { width: auto; }
.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }

/* detail list (shopper profile) */
.detail { display: grid; grid-template-columns: 9rem 1fr; gap: 0.55rem 1rem; margin: 1.25rem 0; }
.detail dt { color: var(--muted); font-size: 0.9rem; }
.detail dd { margin: 0; }

/* clickable dashboard card */
.card-link { text-decoration: none; color: inherit; display: block; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.card-link:hover { border-color: var(--sky); box-shadow: 0 10px 24px rgba(38, 96, 164, 0.14); transform: translateY(-2px); }
.card .go { display: inline-block; color: var(--blue); font-weight: 700; font-size: 0.9rem; }

/* ===== Checkout / visits ===== */

h2 { font-size: 1.25rem; color: var(--navy); font-weight: 800; margin: 1.75rem 0 0.5rem; }
.small { font-size: 0.85rem; }
.btn-secondary {
    display: inline-block; background: #fff; color: var(--blue); border: 1px solid var(--sky);
    border-radius: 10px; padding: 0.55rem 0.95rem; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; text-decoration: none; font-family: inherit; transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--sky-100); border-color: var(--blue); }

.checkout fieldset {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin: 0 0 1.25rem;
    background: #fff;
}
.checkout legend { font-weight: 800; color: var(--navy); padding: 0 0.5rem; }
.checkout label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.75rem; }
.checkout input[type="text"], .checkout input[type="tel"], .checkout input[type="date"],
.checkout input[type="number"], .checkout select, .checkout textarea {
    padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; background: #fff; font-family: inherit;
}
.checkout input:focus, .checkout select:focus, .checkout textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.checkout .form-row { display: flex; gap: 1rem; }
.checkout .form-row > label { flex: 1; }

/* children repeater */
.child-row { display: flex; gap: 0.75rem; align-items: flex-end; margin-bottom: 0.6rem; flex-wrap: wrap; }
.child-row > label { margin-bottom: 0; }
.child-row label.narrow { flex: 0 0 5rem; }
.child-row .removeChild { padding-bottom: 0.6rem; }

/* item picker */
.item-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; flex-wrap: wrap; position: sticky; top: 0; background: #fff; padding: 0.5rem 0; z-index: 2; }
#itemSearch { flex: 1; min-width: 12rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; }
.running-total { font-size: 0.95rem; color: var(--muted); white-space: nowrap; }
.running-total strong { color: var(--blue); font-size: 1.1rem; }

.item-cat h3 { margin: 1rem 0 0.35rem; color: var(--navy); font-size: 1rem; font-weight: 800; border-bottom: 2px solid var(--sky-200); padding-bottom: 0.25rem; }
.item-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line-soft); }
.item-info { flex: 1; display: flex; flex-direction: column; }
.item-name { font-weight: 600; }
.item-note { color: var(--muted); font-size: 0.8rem; }
.item-row .qtyInput { width: 4.5rem; text-align: center; }
.item-row label.dollar { flex-direction: row; align-items: center; gap: 0.2rem; margin: 0; font-weight: 600; }
.item-row .manualInput { width: 6rem; }

.sticky-actions { position: sticky; bottom: 0; background: #fff; padding: 0.9rem 0; border-top: 1px solid var(--line); margin-top: 0.5rem; }

/* right-aligned numeric table cells */
.data-table th.num, .data-table td.num { text-align: right; }

/* ===== Value badges (admin item values) ===== */
.badge {
    display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; padding: 0.12rem 0.5rem; border-radius: 999px; vertical-align: middle;
}
.badge-set { background: var(--ok-bg); color: var(--ok); }
.badge-placeholder { background: #fff4e5; color: #9a5b00; }
.badge-unpriced { background: #eef1f6; color: var(--muted); }
.item-row .valInput { width: 7rem; }

/* ===== Reports ===== */
.report-range { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 0.75rem; }
.report-range label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.report-range input[type="date"] { padding: 0.55rem 0.6rem; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; }
.report-range .presets { display: flex; gap: 0.9rem; align-items: center; }

.cards.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cards.stats .card { text-align: center; padding: 1.25rem 0.75rem; background: linear-gradient(180deg, var(--sky-050), #fff); }
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--blue); }
.stat-label { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

/* ===== Community Impact ===== */
.data-table input.mini { width: 5.5rem; text-align: right; padding: 0.4rem 0.5rem; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; }
.computed-row { background: var(--sky-050); }

/* ===== App footer ===== */
.app-foot {
    max-width: 820px; margin: -3.5rem auto 2.5rem; padding: 0 2.25rem;
    color: var(--muted); font-size: 0.82rem; display: flex; align-items: center; gap: 0.5rem; justify-content: center;
}
.app-foot .heart { color: var(--heart); }

/* ===== Small screens ===== */
@media (max-width: 560px) {
    .topbar-inner { padding: 0.6rem 1rem; }
    .wrap { padding: 1.5rem 1.25rem; margin: 1rem auto 4rem; border-radius: 12px; }
    .brand-name { font-size: 0.92rem; }
    .form-row { flex-direction: column; gap: 0.75rem; }
}

/* ===== Item order arrows (items management) ===== */
.data-table td.order-cell { white-space: nowrap; width: 3.4rem; }
.arrow {
    border: 1px solid var(--line); background: #fff; color: var(--blue);
    border-radius: 7px; width: 1.9rem; height: 1.7rem; font-size: 0.62rem; line-height: 1;
    cursor: pointer; padding: 0; vertical-align: middle;
}
.arrow:hover:not([disabled]) { background: var(--sky-100); border-color: var(--blue); }
.arrow[disabled] { color: var(--line); cursor: default; }

/* ===== Child identity: DCN or initials+birthday ===== */
.child-row .child-or { align-self: flex-end; padding-bottom: 0.55rem; color: var(--muted); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ===== Copyable one-time link (admin reset link) ===== */
.copybox { width: 100%; padding: 0.7rem 0.8rem; border: 2px solid var(--sky); border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; background: var(--sky-050); }

/* A .btn inside a data table must keep its own colors: the `.data-table td a`
   rule is more specific than `.btn`, which otherwise made button text render
   blue-on-blue (invisible). */
.data-table td a.btn { color: #fff; }
.data-table td a.btn:hover { color: #fff; text-decoration: none; }
.data-table td a.btn-secondary { color: var(--blue); }
.data-table td a.btn-secondary:hover { text-decoration: none; }
