/* Senior Citizen Seva Sangh — receipts.
   Red "printed" labels and blue "pen" values mirror the paper receipt book.
   --accent is set per receipt type (membership red, gift green). */

:root {
    --paper: #fffdf8;
    --page: #f6f1e7;
    --ink: #1b3a8a;
    --text: #2b2622;
    --muted: #7a7068;
    --line: #e7dfd1;
}

body {
    font-family: 'Mukta Vaani', system-ui, sans-serif;
    font-size: 1.05rem;
    color: var(--text);
    background: var(--page);
    min-height: 100vh;
}

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--accent) 85%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--accent) 85%, #000);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: color-mix(in srgb, var(--accent) 75%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--accent) 75%, #000);
}

.btn-outline-accent {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: color-mix(in srgb, var(--accent) 45%, #fff);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
}

/* ---- Navigation ---- */

.app-nav {
    background: #fff;
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 1px 0 var(--line);
}

.navbar-brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-gu { font-family: 'Kumar One', serif; color: #c0282d; font-size: 1.35rem; }
.brand-sub { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.app-nav .nav-link {
    font-weight: 500;
    color: var(--text);
    border-radius: .5rem;
    padding-inline: .9rem !important;
}
.app-nav .nav-link small { color: var(--muted); font-weight: 400; }
.app-nav .nav-link.active {
    color: var(--nav-accent, var(--accent));
    background: color-mix(in srgb, var(--nav-accent, var(--accent)) 10%, #fff);
}

/* ---- Page header & listing ---- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-title { font-size: 1.75rem; font-weight: 700; color: var(--accent); margin: 0; }
.page-sub { color: var(--muted); }

.saved-alert {
    background: color-mix(in srgb, var(--accent) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, #fff);
    color: var(--text);
}
.saved-alert .bi-check-circle-fill { color: var(--accent); }

.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: .6rem;
    padding: .7rem 1rem;
}
.stat-label { font-size: .85rem; color: var(--muted); }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .6rem;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
}
.filter-bar .form-label { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
.filter-bar > div:first-child { min-width: 220px; }

.table-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .6rem;
    overflow: hidden;
}
.table-card thead th {
    background: color-mix(in srgb, var(--accent) 7%, #fff);
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 30%, #fff);
}
.table-card thead th small { color: var(--muted); font-weight: 400; margin-left: .2rem; }
.table-card td { font-variant-numeric: tabular-nums; }
.receipt-no { color: var(--accent); font-size: 1.1rem; }
.row-saved td { background: color-mix(in srgb, var(--accent) 6%, #fff) !important; }

/* ---- Paper-style entry form ---- */

.form-hint { color: var(--muted); margin-bottom: .75rem; }
.form-hint .bi { color: #c99a1b; }

.paper { max-width: 980px; }

.paper-above {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 2rem;
    padding: 0 1.25rem .5rem;
}

.paper-box {
    position: relative;
    background: var(--paper);
    border: 2px solid var(--accent);
    border-radius: 18px;
    padding: .75rem 1.75rem 1.25rem;
    box-shadow: 0 1px 0 #fff inset, 0 10px 30px -18px rgba(60, 40, 20, .45);
    color: var(--accent);
}

.paper-tag {
    position: absolute;
    top: .9rem;
    right: 1rem;
    border: 1.5px solid var(--accent);
    border-radius: 999px;
    padding: 0 .7rem;
    font-size: .85rem;
    font-weight: 600;
}

.paper-title {
    font-family: 'Kumar One', serif;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    text-align: center;
    line-height: 1.3;
}

.paper-sub {
    text-align: center;
    font-size: 1.1rem;
    padding-bottom: .35rem;
    margin-bottom: .5rem;
    border-bottom: 1.5px solid var(--accent);
}

.paper-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .35rem 1.5rem;
    margin-top: .7rem;
}

.pf {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    margin: 0;
    min-width: 0;
}
.pf.grow { flex: 1 1 280px; }
.pl { white-space: nowrap; font-size: 1.08rem; padding-bottom: .2rem; }

.pi {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-bottom: 1.5px solid var(--accent);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    padding: .1rem .35rem;
    outline: none;
    transition: background-color .15s;
}
.pi::placeholder { color: color-mix(in srgb, var(--accent) 35%, #fff); font-weight: 400; font-size: 1rem; }
.pi:focus { background: color-mix(in srgb, var(--ink) 6%, #fff); border-bottom-color: var(--ink); }
.pi.is-invalid { border-bottom-color: #dc3545; background: #fdecee; }

.pi-no { width: 8rem; flex: 0 0 auto; font-size: 1.35rem; }
.pi-static { display: inline-block; }
.pi-static small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.pi-date { width: 11rem; flex: 0 0 auto; }
.pi-year { width: 7rem; flex: 0 0 auto; }
.pi-phone { width: 13rem; flex: 0 0 auto; }
.pi-amount { width: 9rem; flex: 0 0 auto; font-size: 1.3rem; }
.pi-lines {
    resize: vertical;
    line-height: 2rem;
    background-image: linear-gradient(transparent calc(2rem - 1.5px), color-mix(in srgb, var(--accent) 60%, #fff) 0);
    background-size: 100% 2rem;
    border-bottom: 0;
}
.pf-sm .pl { font-size: 1rem; }
.pf-sm .pi { font-size: 1.05rem; }
.paper-above .pf:first-child .pi { width: 12rem; }

.lookup-msg {
    flex: 1 1 260px;
    align-self: center;
    color: #1d6b3d;
    background: #e9f6ee;
    border-radius: .4rem;
    padding: .3rem .7rem;
    font-size: .95rem;
}

.paper-purpose { margin-top: 1rem; font-size: 1.12rem; }
.paper-purpose .on { font-weight: 700; }
.paper-purpose .off { text-decoration: line-through; opacity: .45; }

.paper-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}
.paper-address { border: 1.5px solid var(--accent); padding: .35rem .8rem; font-size: .95rem; opacity: .75; }
.paper-sign { display: flex; flex-direction: column; align-items: flex-end; font-size: 1rem; }
.sign-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 70px;
    border: 1.5px solid var(--accent);
    background: #fff;
    overflow: hidden;
}
.sign-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sign-upload { cursor: pointer; margin: 0 1rem .2rem 0; transition: box-shadow .15s, background-color .15s; }
.sign-upload:hover, .sign-upload:focus-within { background: color-mix(in srgb, var(--accent) 6%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.sign-upload.is-invalid { border-color: #dc3545; background: #fdecee; }
.sign-hint { font-size: .8rem; line-height: 1.2; text-align: center; color: color-mix(in srgb, var(--accent) 60%, #fff); }
.sign-note { font-size: .78rem; color: var(--muted); margin: 0 1rem .2rem 0; max-width: 220px; text-align: right; }
.sign-note label { cursor: pointer; }
.sign-preview { --accent: #c0282d; flex: 0 0 auto; }

.age-chip {
    align-self: center;
    white-space: nowrap;
    font-size: .85rem;
    font-weight: 600;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    border-radius: 999px;
    padding: .05rem .6rem;
}

/* ---- Birthdays ---- */

.month-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .6rem;
    margin-bottom: 1.5rem;
}
.month-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: .6rem;
    padding: .6rem .8rem;
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.month-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.month-card.current { border-color: color-mix(in srgb, var(--accent) 45%, #fff); }
.month-card.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.month-name { font-weight: 600; }
.month-en { font-size: .78rem; color: var(--muted); }
.month-card.active .month-en { color: rgba(255, 255, 255, .8); }
.month-count { font-size: 1.7rem; font-weight: 700; line-height: 1.1; margin-top: .2rem; font-variant-numeric: tabular-nums; }

.section-title { font-size: 1.35rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.section-title small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.row-today td { background: color-mix(in srgb, var(--accent) 8%, #fff) !important; }
.today-badge { background: var(--accent); margin-left: .3rem; }

@media print {
    .app-nav, .no-print { display: none !important; }
    body { background: #fff; }
    main.container { max-width: none; padding: 0 !important; }
    .table-card { border: 0; }
    .table-card a { color: inherit !important; }
}

.form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }

/* ---- Settings & login ---- */

.settings-card { border-color: var(--line); }
.gu-input { font-family: inherit; }

.login-page { display: grid; place-items: center; padding: 1.5rem; }
.login-card {
    width: min(420px, 100%);
    background: var(--paper);
    border: 2px solid var(--accent);
    border-radius: 18px;
    padding: 2rem 1.75rem;
    box-shadow: 0 18px 40px -24px rgba(60, 40, 20, .5);
}
.login-title { font-family: 'Kumar One', serif; color: var(--accent); font-size: 1.9rem; text-align: center; line-height: 1.3; }
.login-sub {
    text-align: center;
    color: var(--accent);
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: .5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 575.98px) {
    .paper-box { padding: .75rem 1rem 1rem; }
    .paper-tag { position: static; display: inline-block; margin-bottom: .25rem; }
    .pi-date, .pi-phone, .pi-amount { width: auto; flex: 1 1 auto; }
    .filter-bar > div { flex: 1 1 100%; }
}

@media (max-width: 767.98px) {
    .month-grid { grid-template-columns: repeat(3, 1fr); }
}
