:root {
  /* Paletă extrasă din sigla BlinckyBill: auriu mediu #E1A751, auriu închis #C07828, negru #181411 */
  --bg: #F7F1E6; --card: #FFFDF8; --text: #181411; --muted: #5C5144;
  --primary: #E1A751; --primary-dark: #C07828; --on-primary: #111111;
  --ok: #1F6B45; --err: #A32A0D; --border: #D9CDB8;
  --header: #181411; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.4;
  padding-bottom: 40px; min-height: 100vh; position: relative;
}
/* Filigran discret cu sigla BlinckyBill Keukens, sub conținut */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("/img/logo.png?v=3") no-repeat center 42%;
  background-size: 66vmin auto;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
header {
  position: sticky; top: 0; z-index: 10; background: var(--header); color: #fff;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px;
}
header .brand { font-weight: 700; margin-right: auto; font-size: 17px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; }
header .brand-logo { width: 32px; height: 32px; border-radius: 8px; display: block; background: #111; }
header nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
header nav a {
  color: #fff; text-decoration: none; padding: 10px 11px; border-radius: 10px; font-weight: 600; white-space: nowrap; font-size: 16px;
  background: rgba(255,255,255,.08); min-height: 44px; display: inline-flex; align-items: center;
}
header nav a.active { background: var(--primary); color: var(--on-primary); }
header nav a.logout { background: transparent; font-weight: 400; opacity: .8; padding: 10px 8px; }
@media (max-width: 430px) {
  header { padding: 8px; }
  header nav a { padding: 8px 9px; font-size: 14px; min-height: 40px; }
  header nav a.badge-uploads { padding: 8px 10px; }
}

main { max-width: 900px; margin: 0 auto; padding: 14px; position: relative; z-index: 1; }
h1 { font-size: 24px; margin: 6px 0 14px; }
h2 { font-size: 20px; margin: 18px 0 10px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
label .req { color: var(--err); }
input[type=text], input[type=date], input[type=search], input[type=password], select, textarea {
  width: 100%; font-size: 18px; padding: 13px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text); min-height: 50px; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(225,167,81,.45); border-color: var(--primary-dark); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 18px; font-weight: 700; padding: 14px 18px; min-height: 56px; border-radius: 12px;
  border: none; cursor: pointer; text-decoration: none; background: #e7ebf1; color: var(--text);
  width: 100%; font-family: inherit;
}
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:active { background: var(--primary-dark); }
.btn.big { min-height: 64px; font-size: 20px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.pick-buttons { display: flex; gap: 10px; margin-top: 8px; }
.pick-buttons .btn { flex: 1; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.preview { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #dfe3ea; }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .noimg { display: flex; align-items: center; justify-content: center; text-align: center; height: 100%; font-size: 12px; padding: 4px; word-break: break-all; color: var(--muted); }
.preview button {
  position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; cursor: pointer; line-height: 1;
}
.hint { color: var(--muted); font-size: 14px; margin-top: 6px; }
.progress { height: 14px; background: #e3e7ee; border-radius: 7px; overflow: hidden; margin: 14px 0 6px; display: none; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.msg { padding: 14px; border-radius: 10px; margin: 12px 0; font-weight: 600; display: none; }
.msg.ok { background: #e3f6ee; color: var(--ok); display: block; }
.msg.err { background: #fdeceb; color: var(--err); display: block; }
.success { text-align: center; }
.success .big-icon { font-size: 56px; }
.success .btn { margin-top: 10px; }
.filters { }
.results { display: flex; flex-direction: column; gap: 12px; }
.mcard { display: block; text-decoration: none; color: inherit; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mcard:active { background: #F3E6C8; }
.mcard .title { font-weight: 700; font-size: 19px; }
.mcard .meta { color: var(--muted); font-size: 15px; margin-top: 2px; }
.mcard .note { font-size: 15px; margin-top: 6px; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.thumbs .t { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #dfe3ea; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .more { position: absolute; inset: 0; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.count { color: var(--muted); font-size: 15px; margin: 4px 2px 10px; }
.details dt { color: var(--muted); font-size: 14px; margin-top: 8px; }
.details dd { margin: 2px 0 0; font-size: 18px; white-space: pre-wrap; }
.gallery { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery a { display: block; border-radius: 10px; overflow: hidden; background: #dfe3ea; }
.gallery img { width: 100%; display: block; }
.gallery .fname { font-size: 13px; color: var(--muted); padding: 6px 8px; background: #fff; }
.login-wrap { max-width: 420px; margin: 6vh auto 0; padding: 16px; position: relative; z-index: 1; }
.login-wrap .logo { text-align: center; margin-bottom: 6px; }
.login-wrap .logo img { width: auto; height: auto; max-width: min(280px, 80vw); max-height: 150px; border-radius: 0; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-row .who { flex: 1; min-width: 140px; }
.user-row .who .name { font-weight: 700; }
.user-row .who .meta { color: var(--muted); font-size: 14px; }
.user-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.user-row .actions .btn { width: auto; min-height: 44px; padding: 10px 12px; font-size: 15px; }

header nav a.badge-uploads {
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}
header nav a.badge-uploads .n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; margin-left: 6px; padding: 0 6px;
  border-radius: 99px; background: #111; color: var(--primary); font-size: 13px;
}
.note-card { display: block; text-decoration: none; color: inherit; }
.note-card.unread { box-shadow: 0 0 0 2px var(--primary); }
.note-meta { color: var(--muted); font-size: 15px; margin-top: 2px; }
.push-box { margin-top: 8px; }

/* Hartă (Leaflet, doar admin) */
main.map-page { max-width: none; padding-bottom: 16px; }
#map {
  height: calc(100vh - 150px); min-height: 420px;
  border-radius: 12px; border: 1px solid var(--border);
  background: #efe6d4; z-index: 1;
}
.map-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
.map-toolbar .btn { width: auto; min-height: 40px; padding: 8px 14px; font-size: 15px; }
.map-hint { color: var(--muted); font-size: 14px; margin: 0; }
.map-popup h3 { margin: 0 0 6px; font-size: 16px; color: #181411; }
.map-popup .ap { font-size: 14px; margin: 4px 0; }
.map-popup a { color: #C07828; font-weight: 700; }
.map-popup .thumbs { margin-top: 8px; grid-template-columns: repeat(3, 64px); }
.map-popup .thumbs .t { width: 64px; height: 64px; aspect-ratio: auto; }
.map-status { font-size: 13px; color: var(--muted); }
.leaflet-container a { color: #C07828; }
.pin-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pin-form input { width: 110px; min-height: 36px; font-size: 14px; }
.backup-box { margin-top: 16px; }
.backup-box pre { white-space: pre-wrap; font-size: 13px; background: #f3eadc; padding: 10px 12px; border-radius: 8px; overflow: auto; }
.backup-box .ok { color: #1a6b2a; font-weight: 700; }
.backup-box .err { color: #8a1f1f; font-weight: 700; }

.gallery .gitem { display: flex; flex-direction: column; }
.gallery .gitem .btn-del-poza { width: auto; margin-top: 6px; min-height: 40px; font-size: 14px; }
.drive-box .stare { margin: 8px 0; }
