/* Fotos — crew pages (mobile first) and the shared look of the admin. Green from the Florez logo. */
:root {
  --green: #2e7d32; --green-dark: #1f5a24; --green-light: #e8f3e9; --lime: #9fc24a; --brown: #3d1f1a;
  --bg: #f6f7f4; --card: #fff; --text: #1d2a1f; --muted: #66726a; --line: #dde3dc;
  --danger: #b3261e; --warn: #c77700; --radius: 14px;
}
/* Seasonal colors (New Jersey date, see season_name() in lib/helpers.php). Summer = the original Fotos green.
   --green = buttons/links/active states, --green-dark = second bar + text accents, --green-light = soft tint, --lime = focus ring,
   --on-dark = link text on the dark bar. All components use these variables, so a season is just one block. */
body.season-summer { --green: #2e7d32; --green-dark: #1f5a24; --green-light: #e8f3e9; --lime: #9fc24a; --on-dark: #d9f0da; }
body.season-spring { --green: #3a8527; --green-dark: #2a6a1c; --green-light: #ebf5e2; --lime: #b5d36a; --on-dark: #e0f2cf; }
body.season-autumn { --green: #b5541c; --green-dark: #8a3d10; --green-light: #fbefe6; --lime: #e0a84a; --on-dark: #ffe6d2; }
body.season-winter { --green: #3772a3; --green-dark: #285578; --green-light: #e8f0f7; --lime: #8cb8dc; --on-dark: #dcecf8; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--green-dark); }
h1 { font-size: 1.4rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.1rem; margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
body.noscroll { overflow: hidden; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: var(--green); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand img { object-fit: contain; }
.brand .brand-ico { flex: none; opacity: .95; }
.top-right { display: flex; align-items: center; gap: 8px; }
.langpill { display: inline-flex; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; overflow: hidden; }
.langpill a { padding: 4px 10px; color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; }
.langpill a.on { background: #fff; color: var(--green-dark); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: rgba(255,255,255,.2); color: #fff; }
.chip.warn { background: #ffe9b5; color: #6b4600; }
.switcher { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 14px; background: var(--green-dark); }
.switcher a { color: var(--on-dark, #d9f0da); text-decoration: none; font-size: .85rem; }
.switcher .push { margin-left: auto; }
.switcher { align-items: center; }
.switcher a.adm { color: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: 3px 10px; font-size: .8rem; }
.switcher a.adm:hover { background: rgba(255,255,255,.14); }
.switcher .adm + .adm { margin-left: -6px; }

.page { max-width: 720px; margin: 0 auto; padding: 14px 14px calc(40px + env(safe-area-inset-bottom)); }
.page > * + * { margin-top: 14px; }
.back { display: inline-block; text-decoration: none; font-size: .95rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:disabled { background: #9db8a0; border-color: #9db8a0; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: .9rem; border-radius: 10px; }
.btn-xl { min-height: 60px; font-size: 1.2rem; border-radius: 16px; }
.btn-block { display: flex; width: 100%; }
.pick { cursor: pointer; } .pick-row { display: grid; gap: 10px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; } .center-row { justify-content: center; }

/* forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.form-stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
input, textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #c9d1c8; border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--lime); border-color: var(--green); }
.search { margin: 8px 0; }
.alert { padding: 10px 12px; border-radius: 10px; font-size: .95rem; }
.alert-error { background: #fde7e5; color: var(--danger); } .alert-warn { background: #fff3d6; color: #6b4600; }
.alert-ok { background: var(--green-light); color: var(--green-dark); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }

/* album list */
.album-list { display: grid; gap: 8px; }
.album-row { display: flex; align-items: stretch; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: left; font: inherit; color: inherit; width: 100%; }
button.album-row { padding: 12px; cursor: pointer; }
.album-main { display: flex; flex: 1; align-items: center; gap: 12px; padding: 10px; color: inherit; text-decoration: none; min-width: 0; }
.album-cover { width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; background: var(--green-light); display: grid; place-items: center; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cover .ph { font-size: 1.6rem; }
.album-text { display: grid; min-width: 0; } .album-text strong, .album-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-cam { display: grid; place-items: center; width: 64px; flex: none; background: var(--green-light); text-decoration: none; font-size: 1.6rem; border-left: 1px solid var(--line); }
.album-title { margin-bottom: 0; }

/* photo grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #e3e8e2; cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #fff; }
.tagbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tagchip { --c: var(--green); padding: 6px 12px; border: 2px solid var(--c); border-radius: 999px; background: #fff; color: var(--c); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.tagchip.on { background: var(--c); color: #fff; }
.tagchip[data-tag="all"] { --c: #555; }

/* upload previews */
.previews .pv { cursor: default; display: grid; place-items: center; }
.pv-x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: .9rem; }
.pv-tag { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 3px 8px; border: 0; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font: inherit; font-size: .75rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-err { text-align: center; color: var(--danger); font-size: 1.4rem; padding: 4px; }
.spinner { width: 28px; height: 28px; border: 3px solid #cfd8cf; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dest-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dest-name { font-weight: 700; font-size: 1.1rem; }

/* done panel */
.done-icon { font-size: 2.6rem; color: var(--muted); } .done-icon.ok { color: var(--green); } .done-icon.warn { color: var(--warn); }
.progress { height: 10px; border-radius: 999px; background: #e3e8e2; overflow: hidden; margin: 8px 0 14px; }
.progress > div { height: 100%; width: 0; background: var(--green); transition: width .3s; }

/* bottom sheet + lightbox */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-box { width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 1.2rem; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 2rem; }
.lb-prev { left: 0; border-radius: 0 12px 12px 0; } .lb-next { right: 0; border-radius: 12px 0 0 12px; }
.lb-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); color: #fff; font-size: .9rem; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.7)); }

/* login */
.login-page { background: linear-gradient(#f6f7f4, var(--green-light)); min-height: 100vh; }
.login-card { max-width: 380px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px 30px; display: grid; gap: 12px; }
.login-card form { display: grid; gap: 12px; }
.login-logo { width: 78%; max-width: 280px; margin: 0 auto; display: block; }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.login-admin { color: var(--green-dark); border: 1px solid var(--green); border-radius: 8px; padding: 4px 12px; font-size: .85rem; font-weight: 600; text-decoration: none; }
.login-admin:hover { background: color-mix(in srgb, var(--green) 10%, transparent); }
.login-lang { border-color: var(--green); }
.login-lang a { color: var(--green-dark); } .login-lang a.on { background: var(--green); color: #fff; }
.login-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: .88rem; margin: 0; }
.login-card h1, .login-card p { text-align: center; }

/* ---------- admin (desktop-first) ---------- */
body.admin { font-size: 15px; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 18px; background: var(--green); color: #fff; }
.admin-bar .brand { margin-right: 8px; }
.admin-bar a { color: #e5f4e6; text-decoration: none; font-size: .9rem; }
.admin-bar .spacer { flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); background: #fff; }
.tabs button { padding: 9px 16px; border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--green-dark); border-bottom-color: var(--green); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; text-align: center; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar input[type=text] { width: auto; min-width: 240px; }
.admin .btn { min-height: 36px; padding: 5px 14px; font-size: .92rem; border-radius: 9px; }
.admin .btn-danger { background: #fff; color: var(--danger); border-color: #e7b5b1; }
.admin table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.admin th, .admin td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin th { background: #f1f4ef; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.admin td.num { text-align: right; } .admin td.actions { white-space: nowrap; text-align: right; }
.admin .thumb-sm { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #e3e8e2; display: block; }
.admin .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.admin .tile .sel { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; accent-color: var(--green); }
.admin .tile.picked { outline: 3px solid var(--green); }
.batch-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.batch-card .strip { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; }
.batch-card .strip img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.batch-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .88rem; }
.meter { height: 14px; border-radius: 999px; background: #e3e8e2; overflow: hidden; margin: 8px 0; } .meter > div { height: 100%; background: var(--green); }
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); display: grid; place-items: center; padding: 14px; }
.modal-box { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.modal-box.wide { max-width: 980px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; padding: 10px 18px; border-radius: 10px; background: #1d2a1f; color: #fff; }
.toast.err { background: var(--danger); }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; }
@media (max-width: 760px) { .admin th:nth-child(n+4), .admin td:nth-child(n+4) { display: none; } .admin td.actions { display: table-cell; } }
