/* app-extra.css — additions for the Laravel build. The approved style.css is left unchanged. */

.alert--error { background: #f8d7da; border-left: 4px solid #c0392b; color: #721c24; }
.alert--warn { background: #fff3cd; border-left: 4px solid #e0a800; color: #6b5100; }
.error-list { margin: 0.35rem 0 0 1.1rem; }
.field-error { color: #c0392b; font-size: 0.78rem; }
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid { border-color: #c0392b; }
.inline-form { display: inline; margin: 0; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.muted-small { color: var(--muted, #6c757d); font-size: 0.8rem; }
.table-actions { white-space: nowrap; }
.table-actions form { display: inline; }
.text-right { text-align: right; }
.unread td { font-weight: 700; }

/* Pagination (Laravel simple-default) */
.pager { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pager a, .pager span { padding: 0.35rem 0.7rem; border: 1px solid #d0d7e2; border-radius: 6px; font-size: 0.85rem; text-decoration: none; }
.pager .is-current { background: var(--navy, #1a3c6e); color: #fff; border-color: transparent; }
.pager .is-disabled { color: #aaa; }

/* Detail lists */
.kv { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 0.4rem 1rem; margin: 0; }
.kv dt { color: var(--muted, #6c757d); font-size: 0.85rem; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid #d0d7e2; padding: 0.3rem 0 0.6rem 0.8rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.55rem; width: 11px; height: 11px; border-radius: 50%; background: var(--saffron, #e67e22); }
.timeline small { display: block; color: var(--muted, #6c757d); }

/* Admin form builder */
.fb-row { display: grid; grid-template-columns: 1.1fr 2fr 1fr auto; gap: 0.5rem; align-items: end; padding: 0.75rem; border: 1px solid #e3e8ef; border-radius: 8px; margin-bottom: 0.6rem; background: #fbfcfe; }
.fb-row .fb-extra { grid-column: 1 / -1; display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr auto auto; gap: 0.5rem; align-items: center; }
.fb-row label { font-size: 0.75rem; }
.fb-row input, .fb-row select { width: 100%; }
.check { display: inline-flex; gap: 0.35rem; align-items: center; font-size: 0.85rem; }
@media (max-width: 800px) {
  .fb-row, .fb-row .fb-extra { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* Printable certificate */
.cert-sheet { background: #fff; max-width: 800px; margin: 1.5rem auto; padding: 2.5rem 3rem; border: 6px double var(--navy, #1a3c6e); font-size: 1.05rem; line-height: 1.9; }
.cert-sheet__head { text-align: center; border-bottom: 2px solid var(--saffron, #e67e22); padding-bottom: 0.8rem; margin-bottom: 1.2rem; }
.cert-sheet__head h1 { margin: 0; font-size: 1.6rem; color: var(--navy, #1a3c6e); }
.cert-sheet__head p { margin: 0; font-size: 0.9rem; }
.cert-sheet__title { text-align: center; font-size: 1.3rem; font-weight: 700; margin: 1rem 0; text-decoration: underline; }
.cert-sheet__meta { display: flex; justify-content: space-between; font-size: 0.9rem; }
.cert-sheet__sign { display: flex; justify-content: space-between; margin-top: 3rem; font-size: 0.9rem; }
.cert-sheet__sign div { text-align: center; }
.cert-sheet__foot { margin-top: 2rem; font-size: 0.78rem; color: #555; border-top: 1px dashed #bbb; padding-top: 0.5rem; }
@media print {
  .topbar, .site-header, .primary-nav, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .cert-sheet { margin: 0; border-width: 4px; }
}

.dash-side__logout { display: block; background: none; border: 0; padding: 0.5rem 0.6rem; border-radius: 4px; width: 100%; text-align: left; cursor: pointer; font: inherit; font-size: 0.9rem; color: var(--text); }
.dash-side__logout:hover { background: var(--sky); color: var(--navy); font-weight: 600; }
.dash-side .dash-side__count { float: right; background: var(--saffron); color: #fff; border-radius: 10px; padding: 0 0.45rem; font-size: 0.75rem; }

/* Certificate-issued banner on the citizen application page */
.cert-ready { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; justify-content: space-between; background: #e8f6ee; border: 1px solid #9fd3b4; border-left: 5px solid var(--green, #2f9e6e); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.cert-ready__text { display: flex; flex-direction: column; gap: 0.3rem; }
.cert-ready__text strong { color: #155724; font-size: 1.05rem; }
.cert-ready__text span { color: #2d4a3a; font-size: 0.9rem; }
.mb-1 { margin-bottom: 0.5rem; }
.dash-side a.btn--green, .dash-side a.btn--green:hover { background: var(--green, #2f9e6e); color: #fff; text-align: center; font-weight: 700; }

/* Checkbox + label rows inside form fields (the base .field input rule makes inputs full width) */
.field label.check, label.check { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.field label.check input[type="checkbox"], label.check input[type="checkbox"] { width: auto; min-width: 1rem; height: 1rem; margin: 0; padding: 0; flex: none; }

/* Photo gallery page */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-item { margin: 0; background: var(--white, #fff); border: 1px solid var(--border, #dde3ea); border-radius: var(--radius, 8px); overflow: hidden; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-item figcaption { padding: 0.55rem 0.75rem; font-size: 0.85rem; color: var(--navy, #1a3c6e); }

/* "Pay at the Panchayat office" marker (shown while online payment is off) */
.pay-office { display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--navy, #1a3c6e); background: #eef4fb; border: 1px solid #c9d8ea; border-radius: 999px; padding: 0.2rem 0.65rem; white-space: nowrap; }

/* ---------- Printing (any page) ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .print-only { display: block; }
  .print-head { border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .print-head strong { font-size: 14pt; }
  .print-head small { display: block; color: #333; }
  .dash-side, .svc-side, .btn, button, .pager, .nav-toggle, .table-actions form, .alert form, .actions-row, .cert-ready .actions-row { display: none !important; }
  .page-band { background: none !important; padding: 0 0 6px !important; margin: 0 0 8px; border-bottom: 1px solid #999; }
  .page-band, .page-band * { color: #000 !important; }
  .page-band .breadcrumb { display: none; }
  .page-band h1 { font-size: 16pt; margin: 0; }
  .section { padding: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .dash-layout, .svc-layout { display: block !important; }
  .panel, .stat-card, .alert, .cert-ready { border: 1px solid #999 !important; box-shadow: none !important; break-inside: avoid; background: #fff !important; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  table.data { font-size: 10pt; }
  table.data th { background: #eee !important; color: #000 !important; }
  .table-wrap { overflow: visible !important; border: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  table.data .btn:not(.no-print) { display: inline !important; border: 0 !important; padding: 0 !important; background: none !important; font-weight: 400; }
  .cert-print .print-head { display: none !important; }
  .badge { border: 1px solid #666; background: #fff !important; color: #000 !important; }
}

/* Roles & Permissions grid */
.perm-grid td input[type="checkbox"] { width: 1.15rem; height: 1.15rem; cursor: pointer; }
.perm-grid td input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.45; }
.perm-grid th.text-center, .perm-grid td.text-center { text-align: center; width: 12%; }

/* Multi-photo field in content forms */
.gallery-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.gallery-edit__item { display: block; border: 1px solid var(--border, #dde3ea); border-radius: 6px; overflow: hidden; background: #fff; font-size: 0.8rem; cursor: pointer; }
.gallery-edit__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-edit__item span { display: flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.45rem; }
.gallery-edit__item input[type="checkbox"] { width: auto; }

/* Work detail page: content left, details right */
.work-detail { grid-template-columns: 1fr 320px; }
@media (max-width: 860px) { .work-detail { grid-template-columns: 1fr; } }

/* Official cards link to profiles; uploaded photos fill the tile */
a.mp-official { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.mp-official:hover { box-shadow: 0 4px 14px rgba(26, 60, 110, .15); transform: translateY(-2px); text-decoration: none; }
.mp-official__photo--img { background-size: cover !important; background-position: center top !important; color: transparent; }

/* Official profile page */
.official-profile { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
.official-profile__photo { width: 220px; aspect-ratio: 1; border-radius: 12px; background: linear-gradient(135deg, var(--navy, #1a3c6e), var(--green, #2f9e6e)) center/cover; color: #fff; display: grid; place-items: center; font-size: 3rem; font-weight: 700; border: 1px solid var(--border, #dde3ea); }
.official-profile__photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
@media (max-width: 700px) { .official-profile { grid-template-columns: 1fr; } .official-profile__photo { width: 160px; } }
.official-card__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
a.official-card { display: block; color: inherit; text-decoration: none; }
a.official-card:hover { box-shadow: 0 4px 14px rgba(26, 60, 110, .12); }

/* ================= Backend (staff) layout ================= */
body.backend { background: #eef2f7; }
.bk { display: flex; min-height: 100vh; }
.bk-side { width: 256px; flex: none; background: #0f2a4a; color: #cfd9e6; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.bk-brand { display: flex; gap: 0.6rem; align-items: center; padding: 1rem 1rem 0.9rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.1); }
.bk-brand:hover { text-decoration: none; color: #fff; }
.bk-brand__emblem { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.bk-brand strong { display: block; font-size: 0.95rem; line-height: 1.2; }
.bk-brand small { display: block; font-size: 0.72rem; color: #9fb3cc; }
.bk-nav { padding: 0.6rem 0.6rem 1.5rem; }
.bk-nav__group { margin: 1rem 0.6rem 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7f97b5; }
.bk-nav a, .bk-nav button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0.65rem; border-radius: 6px; color: #dbe4ef; text-decoration: none; font: inherit; font-size: 0.88rem; background: none; border: 0; cursor: pointer; text-align: left; }
.bk-nav a span, .bk-nav button span { width: 1.3rem; text-align: center; flex: none; }
.bk-nav a:hover, .bk-nav button:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.bk-nav a.is-active { background: #e67e22; color: #fff; font-weight: 600; }
.bk-nav__count { margin-left: auto; background: #e67e22; color: #fff; font-style: normal; font-size: 0.72rem; border-radius: 10px; padding: 0 0.45rem; }
.bk-nav a.is-active .bk-nav__count { background: #fff; color: #e67e22; }
.bk-nav form { margin: 0; }

.bk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bk-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 1.25rem; background: #fff; border-bottom: 1px solid #dde3ea; }
.bk-top__title { font-weight: 700; color: var(--navy, #1a3c6e); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-top__right { margin-left: auto; display: flex; align-items: center; gap: 0.9rem; }
.bk-top__right form { margin: 0; }
.bk-top__link { font-size: 0.85rem; color: var(--navy, #1a3c6e); white-space: nowrap; }
.bk-user { display: flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; }
.bk-user:hover { text-decoration: none; }
.bk-user img, .bk-user__avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.bk-user__avatar { display: grid; place-items: center; background: var(--navy, #1a3c6e); color: #fff; font-size: 0.78rem; font-weight: 700; }
.bk-user strong { display: block; font-size: 0.85rem; line-height: 1.15; color: var(--navy, #1a3c6e); }
.bk-user small { display: block; font-size: 0.72rem; color: var(--muted, #667); }
.bk-toggle { display: none; border: 1px solid #dde3ea; background: #fff; border-radius: 6px; font-size: 1.15rem; padding: 0.2rem 0.55rem; cursor: pointer; }
.bk-main { flex: 1; padding: 1.25rem 1.5rem 2rem; }
.bk-foot { padding: 0.8rem 1.5rem; font-size: 0.78rem; color: var(--muted, #667); border-top: 1px solid #dde3ea; background: #fff; }
.bk-overlay { display: none; }

/* Page header inside the backend: compact, on white */
.backend .page-band { background: none; color: var(--navy, #1a3c6e); padding: 0 0 0.9rem; margin: 0 0 1rem; border-bottom: 1px solid #dde3ea; }
.backend .page-band .container { max-width: none; padding: 0; }
.backend .page-band h1 { color: var(--navy, #1a3c6e); font-size: 1.45rem; margin: 0; }
.backend .page-band p { color: var(--muted, #667); margin: 0.2rem 0 0; font-size: 0.88rem; }
.backend .page-band .breadcrumb { display: none; }
.backend .container { max-width: none; padding-left: 0; padding-right: 0; }
.backend .section { padding: 0; }
.backend .bk-page > main, .backend .bk-page { min-width: 0; }
.backend .dash-layout { padding-top: 0; }

@media (max-width: 960px) {
  .bk-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 24px rgba(0,0,0,.25); }
  body.bk-open .bk-side { transform: none; }
  body.bk-open .bk-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .bk-toggle { display: inline-block; }
  .bk-top__link, .bk-user span { display: none; }
  .bk-main { padding: 1rem; }
}
@media print {
  .bk-side, .bk-top, .bk-foot, .bk-overlay { display: none !important; }
  .bk-main { padding: 0; }
}

/* Home banner carousel (2+ images from Website Content → Home Banner Images) */
.hero-carousel { position: relative; }
.hero-carousel__track { position: relative; aspect-ratio: 16 / 9; }
.hero-carousel__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .7s ease; }
.hero-carousel__slide.is-active { opacity: 1; z-index: 1; }
.hero-carousel__slide img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: auto; }
.hero-carousel__slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 0.9rem 0.6rem; color: #fff; font-size: 0.88rem; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.hero-carousel__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: #1a3c6e; font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.hero-carousel__nav:hover { background: #fff; }
.hero-carousel__nav--prev { left: 10px; }
.hero-carousel__nav--next { right: 10px; }
.hero-carousel__dots { position: absolute; bottom: 10px; right: 12px; z-index: 2; display: flex; gap: 6px; }
.hero-carousel__dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; }
.hero-carousel__dots button.is-active { background: #fff; }
@media (prefers-reduced-motion: reduce) { .hero-carousel__slide { transition: none; } }

/* Photo lightbox (gallery page, work photos) */
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 15, 28, .92); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb__figure { margin: 0; max-width: 90vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.lb__img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #111; }
.lb__cap { margin-top: 0.7rem; color: #f1f5f9; font-size: 0.95rem; text-align: center; max-width: 80vw; }
.lb__close { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; }
.lb__nav--prev { left: 16px; }
.lb__nav--next { right: 16px; }
.lb__close:hover, .lb__nav:hover { background: rgba(255,255,255,.28); }
.lb__close:focus-visible, .lb__nav:focus-visible { outline: 3px solid #e67e22; outline-offset: 2px; }
.lb__count { position: absolute; top: 20px; left: 20px; color: #cbd5e1; font-size: 0.9rem; }
.gallery-item a[data-lightbox] { cursor: zoom-in; display: block; }
@media (max-width: 600px) { .lb__nav { width: 42px; height: 42px; font-size: 1.8rem; } .lb__nav--prev { left: 6px; } .lb__nav--next { right: 6px; } }
@media print { .lb { display: none !important; } }
