/* =====================================================================
   site.css - look of all pages (PC + tablet + phone)
   Phone layout (max 700px): lists become "Phone Cards"
   ===================================================================== */

/* ---------- colours ---------- */
:root {
    --main: #1f5fa8;        /* buttons, menu */
    --main-dark: #164a85;
    --main-light: #e8f0fa;
    --green: #1e8e4e;
    --red: #c62828;
    --orange: #e07b00;
    --grey: #6b7280;
    --line: #dde3ea;
    --bg: #f3f6fa;
    --text: #1f2933;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", Roboto, Arial, "Noto Sans Devanagari", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--main); }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.muted { color: var(--grey); }
.small { font-size: 12px; }
.mt { margin-top: 10px; }
.req { color: var(--red); font-weight: bold; }

/* ---------- admin frame ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px; background: var(--main); color: #fff; }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; flex: 1; min-width: 0; }
.brand-logo { height: 36px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-logout { color: #fff; text-decoration: none; opacity: .9; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; padding: 4px 8px; }
.shell { display: flex; min-height: calc(100vh - 54px - 40px); }
.sidemenu { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 10px 0; }
.sidemenu .menu-head { padding: 6px 16px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--grey); }
.sidemenu a { display: block; padding: 11px 16px; color: var(--text); text-decoration: none; border-left: 4px solid transparent; }
.sidemenu a:hover { background: var(--main-light); }
.sidemenu a.active { background: var(--main-light); border-left-color: var(--main); font-weight: 600; color: var(--main-dark); }
.content { flex: 1; min-width: 0; padding: 18px 20px 30px; }
.footer { text-align: center; font-size: 12px; color: var(--grey); padding: 12px; }
.page-title { margin-bottom: 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h1, .page-head h2 { margin: 0; }

/* ---------- user frame ---------- */
.userpage { background: linear-gradient(180deg, #e8f0fa 0, var(--bg) 220px); }
.user-head { text-align: center; padding: 18px 10px 4px; }
.user-logo { max-height: 70px; max-width: 260px; object-fit: contain; }
.user-company { font-size: 18px; font-weight: 600; color: var(--main-dark); margin-top: 6px; }
.user-main { max-width: 860px; margin: 0 auto; padding: 10px 14px 40px; }
.login-card { max-width: 420px; margin: 10px auto; }
.admin-link { text-align: center; margin-top: 14px; font-size: 12px; }
.user-main.wide { max-width: 1150px; }
/* login tabs: Employee | Department Head */
.login-tabs { display: flex; gap: 0; margin: -4px -4px 14px; background: #eef2f7; border-radius: 9px; padding: 4px; }
.login-tab { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--grey); cursor: pointer; }
.login-tab.active { background: #fff; color: var(--main-dark); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
/* Department Head form: whose entry is being filled */
.filling-for { font-size: 20px; margin: 2px 0; }
.filling-for b { color: var(--main-dark); background: var(--main-light); padding: 2px 10px; border-radius: 6px; }
.grid tr.row-pending td:first-child { border-left: 3px solid var(--orange); }
.preview-bar { background: #fff4d6; border: 1px solid #f0d58a; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }

/* ---------- cards / messages ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.empty { padding: 20px; text-align: center; color: var(--grey); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.flash ul { margin: 6px 0 0 18px; padding: 0; }
.flash-ok { background: #e6f6ec; border: 1px solid #a8dcb9; color: #145c32; }
.flash-err { background: #fdecec; border: 1px solid #f2b8b8; color: #8f1c1c; }
.flash-info { background: #eef4fd; border: 1px solid #bcd2f2; color: #173f73; }
.instructions { background: var(--main-light); border-left: 4px solid var(--main); padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; white-space: pre-line; }
.err-detail { white-space: pre-wrap; font-size: 11px; background: #f7f7f7; padding: 8px; overflow: auto; max-height: 300px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-col > .card { margin-bottom: 0; }
.two-col { margin-bottom: 14px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* locked button (shown with a lock + reason in its tooltip, never hidden) */
.btn-locked { opacity: .55; cursor: not-allowed; }
.btn-main { background: var(--main); border-color: var(--main); color: #fff; }
.btn-light { background: #f4f6f9; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-danger { background: #fff; border-color: #e7a3a3; color: var(--red); }
.btn-sm { padding: 5px 9px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
form.inline { display: inline; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.form-actions-left { margin-top: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(243,246,250,.95); padding: 10px 0; z-index: 5; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }

/* ---------- boxes ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.fld { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; min-width: 0; }
.fld-wide { grid-column: 1 / -1; }
.fld-wide-2 { grid-column: span 2; }
.fld-short input { max-width: 120px; }
.fld-btn { flex-direction: row; align-items: flex-end; gap: 8px; }
.fld label { font-weight: 600; font-size: 13px; }
.row-boxes { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.fld-grow { flex: 1; min-width: 220px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #c9d2dc; border-radius: 7px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus, .ss-btn:focus { outline: 2px solid #9cc1ec; outline-offset: 0; border-color: var(--main); }
textarea { resize: vertical; }
::placeholder { color: #b9c0c8; }
.help { font-size: 11.5px; color: var(--grey); }
.err-msg { font-size: 12px; color: var(--red); min-height: 0; }
.fld-err input, .fld-err textarea, .fld-err select, .fld-err .ss-btn, .fld-err .photo-prev { border-color: var(--red); background: #fff8f8; }
.uniq-tag { font-size: 10px; font-weight: 600; color: #6b4fa8; background: #f0eafb; border-radius: 8px; padding: 1px 6px; margin-left: 4px; }
.radio-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 4px; }
.radio-item { font-weight: normal !important; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tick { display: inline-flex; align-items: center; gap: 6px; font-weight: normal !important; margin: 8px 0; cursor: pointer; }
.tick-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.pair { display: flex; gap: 6px; }
.ro-val { padding: 8px 10px; background: #f7f9fb; border: 1px solid var(--line); border-radius: 7px; min-height: 36px; white-space: pre-line; }
/* View only field (value from the school's Unique ID Excel) */
.ro-val.view-only { background: #fff8e1; border-color: #f2d27a; font-weight: 600; }

/* ---------- user form ---------- */
.form-card h1 { font-size: 20px; }
.form-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.form-top-right { display: flex; gap: 8px; align-items: center; }

/* ---------- photo field ---------- */
.photo-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-prev { width: 130px; max-width: 40vw; background: #f1f4f8; border: 2px dashed #c3ccd6; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-prev.round { border-radius: 50%; }
.photo-box.photo-new .photo-prev { border-style: solid; border-color: var(--green); }
.no-photo { color: var(--grey); font-size: 12px; padding: 10px; text-align: center; }
.photo-btns { display: flex; flex-direction: column; gap: 6px; }
.btn-photo { background: var(--main-light); border-color: #b9cfea; color: var(--main-dark); font-weight: 600; }
/* camera button stands out a little: a fresh photo is usually sharper than an old forwarded one */
.btn-cam { background: var(--main); border-color: var(--main); color: #fff; }
.thumb { width: 42px; height: 52px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; }
.thumb.round { width: 46px; height: 46px; border-radius: 50%; }

/* ---------- chips / stats ---------- */
.chip { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-green { background: #e3f5ea; color: #16683a; }
.chip-red { background: #fde7e7; color: #a12020; }
.chip-orange { background: #fff0dc; color: #9a5600; }
.chip-grey { background: #eef1f4; color: #4b5563; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.stat { flex: 1; min-width: 120px; background: #f7f9fb; border: 1px solid var(--line); border-left: 4px solid var(--main); border-radius: 8px; padding: 8px 12px; }
.stat span { display: block; font-size: 12px; color: var(--grey); }
.stat b { font-size: 20px; }
.stat-green { border-left-color: var(--green); }
.stat-orange { border-left-color: var(--orange); }
.stat-red { border-left-color: var(--red); }

/* ---------- settings ---------- */
.logo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 220px; height: 90px; border: 1px dashed #c3ccd6; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fafbfc; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- grids (PC table) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { position: sticky; top: 0; background: #f0f4f9; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; z-index: 1; }
.grid td { padding: 7px 8px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.grid tbody tr:hover { background: #f8fbff; }
.grid td.num { text-align: right; }
.grid tr.row-locked td { background: #fff9f9; }
.tick-col { width: 34px; text-align: center !important; }
.old-val { color: #a12020; }
.new-val { color: #16683a; }

/* ---------- Excel-style header filter ---------- */
.xf-btn { border: 0; background: transparent; cursor: pointer; color: var(--grey); padding: 0 2px 0 6px; font-size: 12px; }
th.xf-on .xf-btn { color: #fff; background: var(--main); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
th.xf-asc::after { content: " \2191"; color: var(--main); }
th.xf-desc::after { content: " \2193"; color: var(--main); }
.xf-panel { position: absolute; z-index: 200; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 10px; }
.xf-title { font-weight: 600; margin-bottom: 8px; }
.xf-sort { display: flex; gap: 6px; margin-bottom: 8px; }
.xf-sort .btn { flex: 1; }
.xf-range { display: flex; gap: 6px; margin-bottom: 8px; }
.xf-contains { margin-bottom: 6px; }
.xf-all { display: block; font-size: 12.5px; padding: 4px 2px; border-bottom: 1px solid #eee; }
.xf-list { max-height: 220px; overflow-y: auto; font-size: 12.5px; }
.xf-list label { display: block; padding: 3px 2px; cursor: pointer; }
.xf-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.xf-bar { display: none; }

/* ---------- searchable dropdown ---------- */
.ss-wrap { position: relative; width: 100%; }
.ss-hidden { display: none !important; }
.ss-btn { width: 100%; text-align: left; padding: 8px 28px 8px 10px; border: 1px solid #c9d2dc; border-radius: 7px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center; font: inherit; color: var(--text); cursor: pointer; min-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-btn:disabled { background-color: #f1f3f5; cursor: not-allowed; }
.ss-panel { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 150; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,.14); padding: 6px; min-width: 220px; }
.ss-wrap.open .ss-panel { display: block; }
.ss-search { margin-bottom: 6px; }
.ss-list { max-height: 260px; overflow-y: auto; }
.ss-item { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.ss-item:hover, .ss-item.ss-active { background: var(--main-light); }
.ss-item.ss-chosen { font-weight: 600; color: var(--main-dark); }
.ss-none { padding: 8px; color: var(--grey); }

/* ---------- popup window (confirm, crop) ---------- */
.modal { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(15,23,42,.55); align-items: center; justify-content: center; padding: 14px; }
.modal.show { display: flex; }
.modal-box { background: #fff; border-radius: 12px; padding: 18px; width: 100%; max-width: 420px; max-height: 95vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal-small { max-width: 380px; }
.modal-title { font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.modal-text { font-size: 15px; margin-bottom: 16px; white-space: pre-line; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btns .btn { min-width: 90px; }

/* crop window */
.crop-view { position: relative; margin: 0 auto 8px; overflow: hidden; border-radius: 6px; background: #222; touch-action: none; }
.crop-canvas { display: block; cursor: move; touch-action: none; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border: 2px solid #fff; }
.crop-view.round .crop-mask { border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.5); }
.crop-help { text-align: center; margin-bottom: 6px; }
.crop-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.crop-zoom { flex: 1; }
/* brightness / contrast (crop window) - compact, same on PC and phone */
.crop-tools { margin-bottom: 8px; }
.crop-adj { border-top: 1px solid #e3e8ee; padding-top: 8px; margin-bottom: 12px; }
.crop-adj-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.crop-adj-top .crop-reset { margin-left: auto; }
.crop-auto { background: #fff4cc; border-color: #f0c84a; color: #6b4e00; font-weight: 600; }
.crop-adj-row { display: flex; align-items: center; gap: 8px; margin: 2px 0; font-size: 13px; }
.crop-adj-row span { width: 96px; flex: 0 0 96px; }
.crop-adj-row input { flex: 1; }

/* busy box */
.busy { display: none; position: fixed; inset: 0; z-index: 600; background: rgba(255,255,255,.6); align-items: center; justify-content: center; }
.busy.show { display: flex; }
.busy-inner { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 22px; box-shadow: 0 6px 20px rgba(0,0,0,.15); display: flex; align-items: center; gap: 10px; }
.spinner { width: 20px; height: 20px; border: 3px solid #d0dbe8; border-top-color: var(--main); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- template field cards ---------- */
.field-list { display: flex; flex-direction: column; gap: 12px; }
.fcard { border: 1px solid var(--line); border-left: 5px solid var(--main); border-radius: 10px; padding: 12px; background: #fcfdff; }
.fcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fcard-no { font-weight: 700; color: var(--main-dark); }
.fcard-name { font-weight: 600; flex: 1; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-btns { display: flex; gap: 4px; }

/* =====================================================================
   PHONE (max 700px) - menu slides in, lists become Phone Cards
   ===================================================================== */
@media (max-width: 700px) {
    body { font-size: 15px; }
    .menu-btn { display: block; }
    .topbar-logout { display: none; }
    .sidemenu { position: fixed; top: 54px; left: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 16px rgba(0,0,0,.15); overflow-y: auto; }
    body.menu-open .sidemenu { transform: translateX(0); }
    .content { padding: 12px 10px 24px; }
    .card { padding: 12px; }
    .two-col { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .fld, .fld-wide-2 { grid-column: 1 / -1; }
    .fld-short { grid-column: span 1; }
    .fld-short input { max-width: none; }
    .form-top { flex-direction: column; }
    .form-actions .btn, .form-actions form, .form-actions form .btn { flex: 1; }
    .action-bar form.inline { flex: 1; }
    .action-bar .btn { width: 100%; }
    .pair { flex-direction: column; }
    .xf-panel { position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 14px 14px 0 0; max-height: 75vh; overflow-y: auto; }
    .xf-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
    .xf-bar-title { font-size: 12px; color: var(--grey); }
    .xf-chip { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
    .xf-chip.xf-on { background: var(--main); color: #fff; border-color: var(--main); }

    /* Phone Card style: every row = a card with a coloured left edge */
    .table-wrap:has(table.cardify) { border: 0; background: transparent; overflow: visible; }
    table.cardify, table.cardify tbody { display: block; width: 100%; }
    table.cardify thead { display: none; }
    table.cardify tr { display: flex; flex-wrap: wrap; position: relative; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--main); border-radius: 10px; margin-bottom: 10px; padding: 10px 10px 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
    table.cardify tr.row-locked { border-left-color: var(--red); }
    table.cardify tr.row-pending { border-left-color: var(--orange); }
    table.cardify tr.row-pending td:first-child { border-left: 0; }
    table.cardify tr.row-locked td { background: transparent; }
    table.cardify td { display: block; width: 50%; border: 0; padding: 4px 6px 6px 0; min-width: 0; word-break: break-word; }
    /* label above the value */
    table.cardify td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--grey); font-weight: 600; }
    table.cardify td[data-label=""]::before { display: none; }
    /* heading on top, big */
    table.cardify td.card-head { width: 100%; order: -2; font-size: 16px; font-weight: 700; padding-right: 90px; }
    table.cardify td.card-head::before { display: none; }
    /* status chip top-right */
    table.cardify td.card-chip { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
    table.cardify td.card-chip::before { display: none; }
    /* tick box top-left */
    table.cardify td.card-tick { order: -3; width: auto; padding: 2px 8px 0 0; }
    table.cardify td.card-tick::before { display: none; }
    table.cardify td.card-tick input { width: 20px; height: 20px; }
    table.cardify tr:has(td.card-tick) td.card-head { width: calc(100% - 34px); }
    table.cardify td.card-wide { width: 100%; }
    table.cardify td.num { text-align: left; }
    table.cardify td.key-fig { font-weight: 700; color: var(--main-dark); }
    /* buttons at the bottom, equal width */
    table.cardify td.card-btns { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; border-top: 1px solid #eef1f4; margin-top: 4px; }
    table.cardify td.card-btns > .btn, table.cardify td.card-btns > form { flex: 1 1 30%; }
    table.cardify td.card-btns form .btn { width: 100%; }
    .thumb { width: 60px; height: 74px; }
    .thumb.round { width: 64px; height: 64px; }
}

/* Unique ID List: simple steps for the Pre-filled columns */
.prefill-help { background: #f3f8ff; border: 1px solid #cfe0f7; border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; line-height: 1.5; }
.prefill-help ol { margin: 4px 0 6px 18px; padding: 0; }

/* Entries page filter: Template + Filter on in row 1, From / To / buttons in row 2 */
.filter-row1 { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(220px, 1fr); gap: 12px 16px; }
.date-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-top: 12px; }
.dr-item { display: flex; flex-direction: column; gap: 4px; }
.dr-item label { font-weight: 600; font-size: 13px; }
.dr-boxes { display: flex; gap: 6px; }
.dr-date { width: 160px; }
.dr-time { width: 120px; }
.dr-btns { display: flex; gap: 8px; }
@media (max-width: 700px) {
    .filter-row1 { grid-template-columns: 1fr; }
    .dr-item { flex: 1 1 100%; }
    .dr-date, .dr-time { width: auto; flex: 1; min-width: 0; }
    .dr-btns { flex: 1 1 100%; }
    .dr-btns .btn { flex: 1; text-align: center; }
}

/* ---------- pages of the entry list (100 rows per page) ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.pager-go { display: inline-flex; align-items: center; gap: 6px; }
.pager .pager-go { flex-direction: row; white-space: nowrap; }
.pager .pager-go .pager-no { width: 70px; min-width: 0; flex: 0 0 70px; display: inline-block; padding: 5px 6px; text-align: center; margin: 0; }
.xf-loading { padding: 8px 2px; color: #777; font-size: 13px; }
@media (max-width: 700px) {
    /* phone: bigger buttons, page box on its own line */
    .pager .btn { padding: 8px 12px; }
    .pager-go { width: 100%; justify-content: center; order: -1; }
}

/* Template ID + photo folder next to the template name (Edit Template) */
.tpl-id { font-size: 14px; font-weight: 400; color: #6b7280; margin-left: 6px; white-space: nowrap; }
@media (max-width: 700px) {
    /* phone: on its own line under the name */
    .tpl-id { display: block; margin-left: 0; margin-top: 4px; font-size: 13px; white-space: normal; }
}
