/* Website admin panel: the core app's navy sidebar and card layout. */
body.admin { background: #f2f3ee; font-size: 15px; line-height: 1.5; }
.admin .plate { display: grid; place-items: center; background: #fff; border-radius: 18px; padding: 12px 14px; width: 96px; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .5); }
.admin .plate.sm { width: 36px; height: 46px; padding: 5px 6px; border-radius: 10px; box-shadow: none; }

.ad-login { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.ad-login-art { background: linear-gradient(160deg, #0b3aa8, #042272 48%, #021446); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.ad-login-art h1 { font-size: 40px; }
.ad-login-art p { color: #d7def3; max-width: 42ch; font-size: 17px; }
.ad-login-card { align-self: center; justify-self: center; width: min(420px, 100% - 32px); display: grid; gap: 14px; padding: 32px 0; }
.ad-login-card h2 { font-size: 26px; color: #042272; }
.ad-login-card label, .ad-f label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.ad-note { background: #e7ebf6; color: #042272; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.ad-note.bad, .ad-err { color: #b3261e; }
.ad-note.bad { background: #fbe3e0; }
.ad-err { margin: 0; font-weight: 600; min-height: 1px; }

.admin input, .admin textarea { font: inherit; font-weight: 400; border: 1.5px solid #c4cad8; border-radius: 10px; padding: 8px 11px; background: #fff; color: #141a2e; width: 100%; min-width: 0; }
.admin textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
/* A file input hidden behind its button keeps the hidden size, not the
   full width every other input gets. */
.admin input[type=file].sr { width: 1px; height: 1px; padding: 0; border: 0; }
.admin input:focus, .admin textarea:focus { outline: none; border-color: #042272; box-shadow: 0 0 0 3px #e7ebf6; }
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; background: #042272; color: #fff; font-weight: 600; font-size: 14.5px; padding: 8px 16px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.ad-btn:hover { filter: brightness(1.15); }
.ad-btn:disabled { opacity: .5; }
.ad-btn.ln { background: #fff; color: #141a2e; border-color: #d9dccf; }
.ad-btn.ln:hover { border-color: #042272; filter: none; }
.ad-btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.ad-btn.red { background: #b3261e; }
.ad-modal { position: fixed; inset: 0; z-index: 450; background: rgba(2, 10, 40, .5); display: grid; place-items: center; padding: 16px; animation: fadeUp .2s ease both; }
.ad-modal-box { background: #fff; border-radius: 16px; padding: 22px; width: min(440px, 100%); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55); display: grid; gap: 16px; }
.ad-modal-box p { margin: 0; font-size: 16px; }
.ad-modal-box .ad-acts { justify-content: flex-end; }
.ad-link { background: none; border: 0; color: #0b3aa8; font-weight: 600; padding: 0; text-decoration: underline; cursor: pointer; font-size: 14px; }

.ad { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100svh; }
.ad-side { position: sticky; top: 0; height: 100svh; overflow-y: auto; background: #021446; color: #dfe5f7; display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
.ad-brand { display: flex; gap: 11px; align-items: center; padding: 2px 6px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 6px; color: #fff; text-decoration: none; }
.ad-brand b { font-family: var(--fd); font-size: 19px; display: block; line-height: 1.1; }
.ad-brand small { color: #8e9bc6; font-size: 12px; }
.ad-side nav { display: grid; gap: 2px; }
.ad-nav { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: #dfe5f7; padding: 8px 10px; border-radius: 9px; text-align: left; font-size: 14.5px; }
.ad-nav:hover { background: rgba(255, 255, 255, .07); }
.ad-nav.on { background: #0d2766; color: #fff; font-weight: 600; }
.ad-nav.on .ic { color: #b9cc8a; }
.ad-nav i { margin-left: auto; color: #f2b632; font-style: normal; font-size: 20px; line-height: 1; }
.ad-nav em { margin-left: auto; font-style: normal; background: #ef6a5f; color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 0 7px; }
.ad-nav em:empty { display: none; }
.ad-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 6px; font-size: 12.5px; color: #8e9bc6; }
.ad-foot .ad-link { color: #b9cc8a; justify-self: start; }
.ad-pill { justify-self: start; background: #f2b632; color: #2a1d00; border-radius: 99px; padding: 1px 10px; font-weight: 700; font-size: 12px; }

.ad-main { padding: 24px clamp(16px, 3vw, 36px) 80px; min-width: 0; }
.ad-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; position: sticky; top: 0; z-index: 5; background: #f2f3ee; padding: 10px 0; }
.ad-head h1 { font-size: 26px; color: #042272; }
.ad-head p { color: #596178; margin: 0; font-size: 14px; }
.ad-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ad-view { display: contents; }
.ad-off { align-self: center; max-width: 360px; color: #596178; font-size: 13px; line-height: 1.35; }
.ad-fields { display: grid; gap: 14px; }
.ad-fields > *, .ad-list > * { min-width: 0; }
.ad-form > .ad-fields > .ad-f, .ad-card { background: #fff; border: 1px solid #d9dccf; border-radius: 14px; padding: 16px; }
.ad-card { margin-top: 18px; }
.ad-lbl { margin-bottom: 8px; }
.ad-lbl b { display: block; font-size: 15px; }
.ad-lbl small { color: #596178; font-size: 13px; }
.ad-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-two span { font-size: 12px; color: #596178; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ad-list { display: grid; gap: 10px; margin-bottom: 10px; }
.ad-item { border: 1px solid #e3e5dc; border-radius: 12px; background: #f7f8f3; }
.ad-item > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.ad-item > summary::before { content: "▸"; color: #596178; transition: transform .2s; }
.ad-item[open] > summary::before { transform: rotate(90deg); }
.ad-item > .ad-fields { padding: 4px 14px 14px; }
.ad-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-tools { display: flex; gap: 4px; }
.ad-tools button { border: 1px solid #d9dccf; background: #fff; border-radius: 7px; width: 30px; height: 28px; display: grid; place-items: center; color: #141a2e; }
.ad-tools button:disabled { opacity: .35; }
.ad-tools [data-del]:hover { color: #b3261e; border-color: #b3261e; }
.ad-icons { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-icons button { width: 44px; height: 44px; border: 1.5px solid #d9dccf; border-radius: 12px; background: #fff; display: grid; place-items: center; color: #596178; }
.ad-icons button.on { border-color: #042272; background: #e7ebf6; color: #042272; }
.ad-switch { display: flex !important; grid-auto-flow: column; align-items: center; gap: 10px; cursor: pointer; font-weight: 500 !important; }
.ad-switch input { position: absolute; opacity: 0; width: 1px; }
.ad-switch span { width: 42px; height: 24px; border-radius: 99px; background: #c4cad8; position: relative; transition: background .2s; flex: none; }
.ad-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ad-switch input:checked + span { background: #62763a; }
.ad-switch input:checked + span::after { transform: translateX(18px); }
.ad-switch input:focus-visible + span { outline: 3px solid #042272; outline-offset: 2px; }
.ad-switch.sm b { font-size: 13px; }
.ad-group .ad-fields { gap: 6px; }
.ad-img { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
/* one fixed track, so the picture's 100% is the box: an auto row would grow
   to a square or tall picture's own height and cut off its bottom */
.ad-thumb { width: 96px; height: 72px; border-radius: 10px; background: #eceee6; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; color: #858ca0; overflow: hidden; flex: none; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* logos are checked whole, as the site shows them */
.ad-f:is([data-field=logo], [data-field=logoUrl]) .ad-thumb img { object-fit: contain; background: #fff; padding: 4px; }
.ad-thumb.busy { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .4; } }
.ad-img-acts { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 240px; }
.ad-img-acts label { display: inline-flex !important; }
.ad-card-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.ad-card-h h2 { font-size: 19px; color: #042272; }
.ad-card-h p { color: #596178; margin: 0; font-size: 14px; }
.ad-card-h .ad-btn { cursor: pointer; }
.ad-drop { border: 2.5px dashed #62763a; border-radius: 14px; padding: 30px; text-align: center; color: #62763a; font-weight: 700; margin-bottom: 14px; background: #eef2e3; }
.ad-empty { color: #596178; text-align: center; padding: 20px; }
.ad-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ad-ph { border: 1px solid #e3e5dc; border-radius: 12px; overflow: hidden; background: #f7f8f3; display: grid; gap: 8px; padding-bottom: 12px; }
.ad-ph.off .ad-ph-img img { opacity: .4; filter: grayscale(1); }
.ad-ph label { padding: 0 12px; font-size: 12.5px; }
.ad-ph label span { color: #596178; }
.ad-ph-img { position: relative; aspect-ratio: 4 / 3; background: #eceee6; }
.ad-ph-img img { width: 100%; height: 100%; object-fit: cover; }
.ad-ph-tools { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }
.ad-ph-tools button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: #141a2e; }
.ad-ph-tools button:disabled { opacity: .4; }
.ad-ph-tools [data-del]:hover { background: #b3261e; color: #fff; }
.ad-ph-row { display: flex; align-items: flex-end; gap: 6px; }
.ad-ph-row > label:first-child { flex: 1; padding-right: 0; }
.ad-msgs { display: grid; gap: 12px; max-width: 860px; }
.ad-msg { background: #fff; border: 1px solid #d9dccf; border-left: 4px solid #f2b632; border-radius: 12px; padding: 14px 16px; }
.ad-msg.done { border-left-color: #c4cad8; opacity: .75; }
.ad-msg header { display: flex; justify-content: space-between; gap: 10px; }
.ad-msg time { color: #596178; font-size: 13px; }
.ad-msg p { margin: 6px 0 10px; }
.ad-msg footer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.ad-msg footer a { display: inline-flex; gap: 4px; align-items: center; }
.ad-msg .grow { flex: 1; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 400; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: #14532f; color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); animation: fadeUp .25s ease both; transition: all .35s; }
.toast.bad { background: #7d1d17; }
.toast.out { opacity: 0; transform: translateY(6px); }

@media (max-width: 860px) {
  .ad-login { grid-template-columns: 1fr; }
  .ad-login-art { padding: 28px 16px; }
  .ad-login-art h1 { font-size: 30px; }
  .ad { grid-template-columns: 1fr; }
  .ad-side { position: static; height: auto; }
  .ad-side nav { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ad-two { grid-template-columns: 1fr; }
  .ad-head { position: static; }
}

/* fields added for the multi-page site */
.admin select { font: inherit; border: 1.5px solid #c4cad8; border-radius: 10px; padding: 8px 11px; background: #fff; color: #141a2e; width: 100%; }
.admin select:focus { outline: none; border-color: #042272; box-shadow: 0 0 0 3px #e7ebf6; }
.ad-slug { display: block; margin-top: 4px; color: #596178; font-size: 13px; }
.ad-slug b { color: #042272; }
.ad-geo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.ad-geo-in { display: grid; gap: 10px; }
.ad-geo-in label { display: grid; gap: 4px; }
.ad-geo-in label span { font-size: 12px; color: #596178; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ad-geo-map { width: 100%; height: auto; aspect-ratio: 340 / 260; border-radius: 12px; border: 1px solid #d9dccf; cursor: crosshair; background: #dcecf8; }
.ad-geo-o { fill: #8a93a8; }
.ad-geo-me { fill: #d7332b; stroke: #fff; stroke-width: .6; }
@media (max-width: 860px) { .ad-geo { grid-template-columns: 1fr; } }

/* goal ticks and file fields */
.ad-goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.ad-goal-grid button { display: flex; gap: 8px; align-items: center; text-align: left; border: 1.5px solid var(--line, #e3dccb); background: #fff; border-radius: 10px; padding: 5px 8px; font-size: 13px; color: #2a3147; }
.ad-goal-grid i { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 800 12px/1 system-ui; font-style: normal; color: #042272; box-shadow: inset 0 0 0 2.5px var(--g); }
.ad-goal-grid button.on { border-color: var(--g); background: color-mix(in srgb, var(--g) 12%, #fff); font-weight: 700; }
.ad-goal-grid button.on i { background: var(--g); color: var(--gi, #fff); }
.ad-file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-file-row input[type="text"] { flex: 1 1 260px; }
.ad-file.busy { opacity: .6; pointer-events: none; }

/* Buttons that are switched off stay off; upload buttons show keyboard focus. */
.ad-btn[hidden] { display: none; }
label.ad-btn:focus-within { outline: 3px solid #042272; outline-offset: 2px; }
