:root {
  --navy-950: #071629;
  --navy-900: #0b1f3a;
  --navy-800: #12345a;
  --ink: #122033;
  --muted: #657286;
  --line: #e1e7ef;
  --panel: #ffffff;
  --surface: #f4f7fb;
  --hyper: #e30613;
  --express: #0068b5;
  --supeco: #e99a00;
  --dedeman-omega: #f97316;
  --dedeman-katrein: #7c3aed;
  --shadow: 0 20px 55px rgba(6, 22, 43, 0.2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body,
.app-shell,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body { overflow: hidden; background: #dce5ef; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.auth-screen {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow: auto;
  padding: 28px;
  color: white;
  background:
    radial-gradient(circle at 14% 18%, rgba(33, 104, 174, 0.42), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(227, 6, 19, 0.18), transparent 28%),
    linear-gradient(135deg, #061426 0%, #0b1f3a 52%, #123b68 100%);
}

.auth-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom right, black, transparent 68%);
}

.auth-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  align-items: center;
  gap: clamp(48px, 8vw, 110px);
  width: min(980px, 100%);
}

.auth-brand { max-width: 490px; }
.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 18px 50px rgba(0,0,0,.16);
  backdrop-filter: blur(12px);
}
.auth-brand-mark svg { width: 49px; fill: var(--hyper); filter: drop-shadow(0 8px 12px rgba(227,6,19,.24)); }
.auth-brand-mark circle { fill: white; }
.auth-eyebrow { margin: 0 0 10px; color: #9fc2e5; font-size: .78rem; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.auth-brand h1 { margin: 0; font-size: clamp(2.35rem, 5vw, 4.25rem); line-height: .98; letter-spacing: -.055em; }
.auth-intro { max-width: 465px; margin: 22px 0 0; color: #c6d8ea; font-size: 1.05rem; line-height: 1.65; }
.auth-formats { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 30px; color: #d8e5f2; font-size: .82rem; font-weight: 670; }
.auth-formats span { display: inline-flex; align-items: center; gap: 8px; }
.format-dot { width: 9px; height: 9px; border-radius: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,.07); }
.format-dot.hyper { background: var(--hyper); }
.format-dot.express { border-radius: 50%; background: #2795e8; }
.format-dot.supeco { background: #ffc747; transform: rotate(45deg); }
.format-dot.dedeman-omega { background: var(--dedeman-omega); }
.format-dot.dedeman-katrein { border-radius: 50%; background: var(--dedeman-katrein); }

.auth-card {
  padding: 30px;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 30px 80px rgba(2, 12, 25, .38);
  backdrop-filter: blur(18px);
}
.auth-card-header { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.auth-card-header p { margin: 0 0 3px; color: #718096; font-size: .72rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.auth-card-header h2 { margin: 0; color: var(--navy-900); font-size: 1.55rem; letter-spacing: -.035em; }
.auth-lock { display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 14px; color: white; background: var(--navy-900); }
.auth-lock svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-field { display: block; margin-top: 17px; }
.auth-field > span:first-child { display: block; margin: 0 0 7px 2px; color: #38475b; font-size: .82rem; font-weight: 740; }
.auth-field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #ccd7e3;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #f7f9fc;
  font-size: 1rem;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.auth-field input:focus { border-color: #3d7fbd; background: white; box-shadow: 0 0 0 4px rgba(0,104,181,.11); }
.auth-field input:disabled { opacity: .7; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 50px; }
.password-toggle { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px; color: #65758a; background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--navy-900); background: #eaf0f6; }
.password-toggle:focus-visible { outline: 3px solid rgba(0,104,181,.22); }
.password-toggle svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.auth-error { margin: 15px 0 0; padding: 10px 12px; border: 1px solid #fac7cc; border-radius: 10px; color: #8b1821; background: #fff1f2; font-size: .8rem; line-height: 1.4; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 51px; margin-top: 20px; padding: 0 18px; border: 0; border-radius: 12px; color: white; background: linear-gradient(135deg, #0b1f3a, #174f80); box-shadow: 0 10px 24px rgba(11,31,58,.22); font-weight: 770; cursor: pointer; transition: transform 150ms, box-shadow 150ms, opacity 150ms; }
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(11,31,58,.28); }
.auth-submit:focus-visible { outline: 3px solid rgba(0,104,181,.25); outline-offset: 3px; }
.auth-submit:disabled { cursor: wait; opacity: .72; }
.auth-submit svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.auth-submit.loading svg { animation: auth-pulse 900ms ease-in-out infinite alternate; }
.auth-note { margin: 18px 0 0; color: #7c8999; font-size: .73rem; text-align: center; }
@keyframes auth-pulse { to { transform: translateX(4px); opacity: .45; } }

.app-shell { position: relative; isolation: isolate; }
#map { z-index: 0; background: #d9e3ed; }

.side-panel {
  position: absolute;
  z-index: 800;
  inset: 18px auto 18px 18px;
  width: min(390px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 180ms ease;
}

.side-panel:not(.open) { opacity: 0; pointer-events: none; transform: translateX(calc(-100% - 48px)); }

.panel-handle { display: none; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  color: white;
  background:
    radial-gradient(circle at 92% 12%, rgba(58, 116, 176, 0.4), transparent 32%),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark svg { width: 28px; fill: var(--hyper); }
.brand-mark circle { fill: white; }
.eyebrow { margin: 0 0 2px; color: #a9c4e0; font-size: 0.73rem; font-weight: 720; letter-spacing: 0.09em; text-transform: uppercase; }
.panel-header h1 { margin: 0; font-size: 1.32rem; line-height: 1.2; letter-spacing: -0.025em; }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
}

.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.panel-close { display: grid; margin-left: auto; color: white; }
.panel-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.admin-button { color: #d5e3f1; }
.admin-button:hover { color: white; background: rgba(255,255,255,.1); }
.logout-button { color: #d5e3f1; }
.logout-button:hover { color: white; background: rgba(255,255,255,.1); }

.summary-row {
  display: grid;
  grid-template-columns: 0.7fr 0.7fr 1.35fr;
  align-items: stretch;
  gap: 1px;
  min-height: 68px;
  color: white;
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.summary-row > div,
.summary-row > button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 14px;
  border: 0;
  color: inherit;
  background: rgba(255, 255, 255, 0.035);
}

.summary-row strong { font-size: 1.18rem; line-height: 1; }
.summary-row span { margin-top: 5px; color: #a9b8c9; font-size: 0.76rem; }
.summary-row > button { align-items: flex-start; flex-direction: row; gap: 8px; font-size: 0.79rem; font-weight: 700; cursor: pointer; }
.summary-row > button:hover { background: rgba(255, 255, 255, 0.09); }
.summary-row > button svg { width: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.controls { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; top: 50%; left: 13px; width: 20px; transform: translateY(-50%); fill: none; stroke: #708096; stroke-width: 1.8; stroke-linecap: round; }
.search-box input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 43px;
  border: 1px solid #d8e0ea;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.92rem;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}

.search-box input:focus { border-color: #4c84bd; background: white; box-shadow: 0 0 0 4px rgba(0, 104, 181, 0.1); }
.search-box input::placeholder { color: #8a96a7; }
.format-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin: 14px 0 0; padding: 0; border: 0; }
.format-filters legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.filter-card { position: relative; grid-column: span 2; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 91px; padding: 10px 9px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer; transition: transform 150ms, border-color 150ms, background 150ms; }
.filter-dedeman-omega, .filter-dedeman-katrein { grid-column: span 3; min-height: 82px; }
.filter-card:hover { transform: translateY(-1px); border-color: #c6d2e0; }
.filter-card input { position: absolute; opacity: 0; pointer-events: none; }
.filter-icon { display: grid; place-items: center; width: 29px; height: 29px; margin-bottom: 8px; border-radius: 9px; color: white; }
.filter-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-hyper .filter-icon { background: var(--hyper); }
.filter-express .filter-icon { background: var(--express); border-radius: 50%; }
.filter-supeco .filter-icon { color: #3a2900; background: #ffc747; transform: rotate(45deg); border-radius: 6px; }
.filter-supeco .filter-icon svg { transform: rotate(-45deg); }
.filter-dedeman-omega .filter-icon { background: var(--dedeman-omega); }
.filter-dedeman-katrein .filter-icon { background: var(--dedeman-katrein); border-radius: 50%; }
.filter-copy { min-width: 0; }
.filter-copy strong { display: block; overflow: hidden; font-size: 0.78rem; line-height: 1.15; text-overflow: ellipsis; }
.filter-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.67rem; line-height: 1.15; }
.check-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #c5ceda; }
.filter-card:has(input:checked) { border-color: #b8c8d9; background: #f9fbfe; }
.filter-card:has(input:checked) .check-dot { background: #2a9b5f; box-shadow: 0 0 0 3px rgba(42, 155, 95, 0.12); }
.filter-card:has(input:focus-visible) { outline: 3px solid rgba(0, 104, 181, 0.22); outline-offset: 2px; }

.results-heading { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.79rem; }
.results-heading #visible-count { color: var(--ink); font-weight: 800; }
.results-actions { display: flex; align-items: center; gap: 10px; }
.results-actions .text-button:disabled { opacity: .58; cursor: wait; }
.text-button { padding: 5px 0; border: 0; color: #005da4; background: transparent; font-size: 0.76rem; font-weight: 700; cursor: pointer; }
.export-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid #c5d3e1; border-radius: 8px; color: #285477; background: #fff; white-space: nowrap; }
.export-toggle:hover, .export-toggle[aria-expanded="true"] { border-color: #8eabc4; color: var(--navy-900); background: #eef5fb; }
.export-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.export-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.portfolio-export { display: grid; gap: 10px; padding: 13px 16px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, #f8fbfe, #eef5fb); }
.portfolio-export[hidden] { display: none; }
.portfolio-export-copy strong, .portfolio-export-copy span { display: block; }
.portfolio-export-copy strong { color: var(--navy-900); font-size: .78rem; }
.portfolio-export-copy span { margin-top: 3px; color: #718196; font-size: .62rem; line-height: 1.45; }
.portfolio-export-scope > span { display: block; margin: 0 0 5px 1px; color: #526176; font-size: .63rem; font-weight: 760; }
.portfolio-export-scope select { width: 100%; min-height: 40px; padding: 8px 32px 8px 10px; border: 1px solid #c6d4e2; border-radius: 9px; outline: 0; color: var(--ink); background: white; font: inherit; font-size: .7rem; }
.portfolio-export-scope select:focus { border-color: #3d7fbd; box-shadow: 0 0 0 3px rgba(0,104,181,.1); }
.portfolio-export-actions { display: grid; grid-template-columns: 1.18fr 1fr; gap: 8px; }
.portfolio-export-actions button { min-height: 40px; padding: 7px 10px; border-radius: 9px; font-size: .65rem; font-weight: 780; cursor: pointer; }
.portfolio-export-primary { border: 1px solid #0d355c; color: white; background: var(--navy-900); }
.portfolio-export-primary:hover { background: #123d68; }
.portfolio-export-secondary { border: 1px solid #c4d3e2; color: #285477; background: white; }
.portfolio-export-secondary:hover { background: #f5f9fc; }
.portfolio-export-actions button:disabled, .portfolio-export-scope select:disabled { opacity: .6; cursor: wait; }
.portfolio-export-note { margin: 0; color: #748397; font-size: .58rem; line-height: 1.45; }
.portfolio-export-status { margin: 0; padding: 8px 9px; border: 1px solid #c9d8e7; border-radius: 8px; color: #315571; background: rgba(255,255,255,.75); font-size: .62rem; line-height: 1.45; }
.portfolio-export-status[data-type="success"] { border-color: #bfe1cd; color: #176340; background: #edf9f2; }
.portfolio-export-status[data-type="pending"] { border-color: #f0d79c; color: #7e5a0c; background: #fff9e9; }
.portfolio-export-status[data-type="error"] { border-color: #f1bfc4; color: #941d29; background: #fff0f1; }
.store-list { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c5cfdb transparent; }
.store-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: start; padding: 13px 16px; border: 0; border-bottom: 1px solid #edf1f5; text-align: left; color: inherit; background: white; cursor: pointer; }
.store-item:hover, .store-item:focus-visible { background: #f5f8fc; outline: none; }
.store-item.active { background: #edf5fc; box-shadow: inset 3px 0 0 var(--express); }
.store-symbol { display: grid; place-items: center; width: 30px; height: 30px; margin-top: 1px; border-radius: 9px; color: white; }
.store-symbol svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.store-symbol.Hyper { background: var(--hyper); }
.store-symbol.Express-Super { background: var(--express); border-radius: 50%; }
.store-symbol.Supeco { color: #3a2900; background: #ffc747; transform: rotate(45deg); border-radius: 6px; }
.store-symbol.Supeco svg { transform: rotate(-45deg); }
.store-symbol.Dedeman-Omega { background: var(--dedeman-omega); }
.store-symbol.Dedeman-Katrein { background: var(--dedeman-katrein); border-radius: 50%; }
.store-main { min-width: 0; }
.store-name { display: block; overflow: hidden; color: #142238; font-size: 0.88rem; font-weight: 760; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.store-address { display: -webkit-box; margin-top: 4px; overflow: hidden; color: #667488; font-size: 0.74rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.store-county { padding-top: 2px; color: #718096; font-size: 0.65rem; font-weight: 760; letter-spacing: 0.04em; text-transform: uppercase; }
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty-state svg { width: 35px; fill: none; stroke: #8b99aa; stroke-width: 1.5; }
.empty-state strong { display: block; margin-top: 10px; color: var(--ink); font-size: 0.92rem; }
.empty-state span { display: block; margin-top: 5px; font-size: 0.78rem; line-height: 1.45; }
.panel-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 10px; padding: 9px 16px; border-top: 1px solid var(--line); color: #8591a1; background: #fafbfd; font-size: 0.65rem; text-align: center; }
.panel-footer strong { color: #536174; }

.panel-toggle {
  position: absolute;
  z-index: 780;
  top: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 14px;
  color: white;
  background: var(--navy-900);
  box-shadow: 0 10px 30px rgba(4, 18, 34, 0.3);
  font-size: .86rem;
  font-weight: 760;
  cursor: pointer;
}
.panel-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.panel-toggle strong { min-width: 27px; padding: 4px 6px; border-radius: 8px; color: var(--navy-900); background: white; font-size: .7rem; text-align: center; }
.panel-backdrop { position: absolute; z-index: 790; inset: 0; background: rgba(3, 14, 29, 0.32); backdrop-filter: blur(2px); }
.map-error { position: absolute; z-index: 1000; top: 22px; left: 50%; width: min(480px, calc(100% - 32px)); padding: 14px 18px; transform: translateX(-50%); border-radius: 13px; color: #721c24; background: #fff0f1; box-shadow: var(--shadow); font-size: 0.9rem; }

.leaflet-control-zoom { border: 0 !important; box-shadow: 0 8px 24px rgba(8, 30, 54, 0.2) !important; }
.leaflet-control-zoom a { width: 39px !important; height: 39px !important; line-height: 38px !important; border-color: #e1e7ef !important; color: var(--navy-900) !important; }
.leaflet-control-attribution { padding: 3px 7px !important; color: #556274; background: rgba(255,255,255,.86) !important; font-size: 10px !important; }
.leaflet-control-scale-line { border-color: #43556b !important; color: #26384d !important; background: rgba(255,255,255,.82) !important; }
.custom-marker { background: transparent; border: 0; }
.map-pin { position: relative; display: grid; place-items: center; width: 36px; height: 42px; filter: drop-shadow(0 4px 5px rgba(5, 21, 39, 0.32)); transform-origin: 50% 100%; transition: transform 140ms; }
.map-pin:hover { transform: translateY(-2px) scale(1.06); }
.map-pin svg { position: relative; z-index: 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.map-pin::before { content: ""; position: absolute; inset: 0 1px 6px; background: var(--marker-color); border: 2px solid white; }
.map-pin.Hyper::before { border-radius: 11px 11px 14px 14px; clip-path: polygon(5% 0,95% 0,95% 76%,50% 100%,5% 76%); }
.map-pin.Express-Super::before { border-radius: 50% 50% 50% 9px; transform: rotate(-45deg) scale(.86); }
.map-pin.Supeco::before { inset: 3px 4px 8px; border-radius: 7px 7px 14px 7px; transform: rotate(45deg); }
.map-pin.Dedeman-Omega::before { border-radius: 8px 8px 16px 16px; clip-path: polygon(50% 0, 96% 24%, 90% 76%, 50% 100%, 10% 76%, 4% 24%); }
.map-pin.Dedeman-Katrein::before { border-radius: 50% 50% 10px 50%; transform: rotate(45deg) scale(.88); }
.map-pin.Hyper { --marker-color: var(--hyper); color: white; }
.map-pin.Express-Super { --marker-color: var(--express); color: white; }
.map-pin.Supeco { --marker-color: #ffc747; color: #3a2900; }
.map-pin.Dedeman-Omega { --marker-color: var(--dedeman-omega); color: white; }
.map-pin.Dedeman-Katrein { --marker-color: var(--dedeman-katrein); color: white; }
.map-pin.Supeco svg { width: 17px; }
.marker-cluster { background: transparent !important; }
.marker-cluster div { display: grid; place-items: center; width: 42px !important; height: 42px !important; margin: 0 !important; border: 3px solid white; border-radius: 50%; color: white; background: var(--navy-900); box-shadow: 0 5px 14px rgba(7, 22, 41, 0.35); font-size: 0.76rem; font-weight: 820; }
.marker-cluster.cluster-dedeman-omega div { background: var(--dedeman-omega); }
.marker-cluster.cluster-dedeman-katrein div { background: var(--dedeman-katrein); }
.marker-cluster.cluster-dedeman-mixed div { background: linear-gradient(135deg, var(--dedeman-omega) 0 50%, var(--dedeman-katrein) 50% 100%); }
.marker-cluster span { line-height: 1; }
.leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 15px; box-shadow: 0 16px 38px rgba(5, 19, 36, 0.24); }
.leaflet-popup-content { width: min(280px, calc(100vw - 72px)) !important; margin: 0 !important; }
.store-popup { padding: 16px; }
.popup-top { display: flex; align-items: flex-start; gap: 10px; }
.popup-format { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 999px; color: white; font-size: 0.67rem; font-weight: 800; }
.popup-format.Hyper { background: var(--hyper); }
.popup-format.Express-Super { background: var(--express); }
.popup-format.Supeco { color: #3a2900; background: #ffc747; }
.popup-format.Dedeman-Omega { background: var(--dedeman-omega); }
.popup-format.Dedeman-Katrein { background: var(--dedeman-katrein); }
.store-popup h2 { margin: 9px 0 0; color: var(--ink); font-size: 1rem; line-height: 1.25; }
.store-popup address { margin-top: 8px; color: #5e6d80; font-size: 0.79rem; font-style: normal; line-height: 1.45; }
.popup-meta { margin-top: 10px; color: #7a8797; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.popup-accuracy { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #8a6100; font-size: .7rem; font-weight: 700; }
.popup-accuracy svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.popup-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 13px; padding: 9px 11px; border-radius: 9px; color: white !important; background: var(--navy-900); font-size: 0.75rem; font-weight: 760; text-decoration: none; }
.popup-link svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.admin-modal { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 24px; }
.admin-backdrop { position: absolute; inset: 0; border: 0; background: rgba(3, 14, 29, .6); backdrop-filter: blur(5px); cursor: default; }
.admin-dialog { position: relative; width: min(880px, 100%); max-height: min(88dvh, 820px); overflow: hidden; border: 1px solid rgba(255,255,255,.8); border-radius: 22px; background: white; box-shadow: 0 34px 90px rgba(2, 12, 25, .38); }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 21px; color: white; background: linear-gradient(135deg, var(--navy-950), var(--navy-800)); }
.admin-header h2 { margin: 0; font-size: 1.25rem; }
.admin-header .icon-button:hover { background: rgba(255,255,255,.1); }
.admin-content { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(360px, 1.4fr); max-height: calc(min(88dvh, 820px) - 81px); overflow: hidden; }
.admin-content h3 { margin: 0; color: var(--navy-900); font-size: .95rem; }
.admin-create-form { padding: 21px; border-right: 1px solid var(--line); background: #f7f9fc; }
.admin-create-form label { display: block; margin-top: 15px; }
.admin-create-form label > span, .admin-role > span, .admin-scope > span { display: block; margin: 0 0 6px 2px; color: #526176; font-size: .72rem; font-weight: 750; }
.admin-create-form input, .admin-create-form select, .admin-role select, .admin-scope select { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid #ccd7e3; border-radius: 10px; outline: 0; color: var(--ink); background: white; }
.admin-create-form input:focus, .admin-create-form select:focus, .admin-role select:focus, .admin-scope select:focus { border-color: #3d7fbd; box-shadow: 0 0 0 3px rgba(0,104,181,.1); }
.admin-primary { width: 100%; min-height: 44px; margin-top: 18px; border: 0; border-radius: 10px; color: white; background: var(--navy-900); font-weight: 760; cursor: pointer; }
.admin-primary:disabled { opacity: .6; cursor: wait; }
.admin-users-section { min-width: 0; overflow: auto; padding: 21px; }
.admin-users-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-status { margin: 13px 0 0; padding: 9px 11px; border-radius: 9px; color: #38516c; background: #edf4fb; font-size: .76rem; }
.admin-status[data-type="error"] { color: #8b1821; background: #fff1f2; }
.admin-status[data-type="success"] { color: #16613d; background: #edf9f2; }
.admin-users { display: grid; gap: 10px; margin-top: 14px; }
.admin-user { display: grid; grid-template-columns: minmax(0, 1fr) 125px 155px; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.admin-user.disabled { opacity: .7; background: #f7f8fa; }
.admin-user-main { min-width: 0; }
.admin-user-main strong { display: block; overflow: hidden; color: var(--navy-900); text-overflow: ellipsis; white-space: nowrap; }
.admin-user-main span { display: block; margin-top: 5px; color: var(--muted); font-size: .67rem; line-height: 1.35; }
.admin-role select, .admin-scope select { min-height: 36px; font-size: .76rem; }
.admin-scope select:disabled { color: #78869a; background: #f0f3f6; }
.admin-user-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.admin-user-actions button { min-height: 34px; padding: 0 10px; border: 1px solid #ced8e4; border-radius: 8px; color: #28405d; background: #f8fafc; font-size: .69rem; font-weight: 720; cursor: pointer; }
.admin-user-actions button:hover:not(:disabled) { border-color: #9eb3ca; background: #eef4fa; }
.admin-user-actions .admin-danger { border-color: #efc2c7; color: #9b1c28; background: #fff7f7; }
.admin-user-actions .admin-danger:hover:not(:disabled) { border-color: #dc8d96; background: #ffebed; }
.admin-user-actions button:disabled { opacity: .48; cursor: not-allowed; }
.admin-empty { color: var(--muted); font-size: .8rem; }

@media (max-width: 899px) {
  .auth-screen { padding: 20px; }
  .auth-layout { grid-template-columns: 1fr; gap: 34px; width: min(460px, 100%); }
  .auth-brand { text-align: center; }
  .auth-brand-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 19px; }
  .auth-brand-mark svg { width: 42px; }
  .auth-eyebrow { margin-bottom: 7px; }
  .auth-brand h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .auth-intro { margin-top: 14px; font-size: .94rem; line-height: 1.5; }
  .auth-formats { justify-content: center; margin-top: 19px; }
  .side-panel {
    inset: auto 10px 10px;
    width: auto;
    max-height: min(78vh, 700px);
    border-radius: 22px 22px 18px 18px;
    transform: translateY(calc(100% + 24px));
    transition: transform 220ms cubic-bezier(.2,.8,.2,1);
  }
  .side-panel.open { transform: translateY(0); }
  .side-panel:not(.open) { opacity: 1; transform: translateY(calc(100% + 24px)); }
  .panel-handle { display: block; position: absolute; z-index: 2; top: 7px; left: 50%; width: 42px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.38); transform: translateX(-50%); }
  .panel-header { padding-top: 22px; }
  .panel-close { display: grid; }
  .panel-toggle {
    position: absolute;
    z-index: 780;
    left: 12px;
    top: auto;
    bottom: max(15px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 14px;
    color: white;
    background: var(--navy-900);
    box-shadow: 0 10px 30px rgba(4, 18, 34, 0.3);
    font-size: .86rem;
    font-weight: 760;
    cursor: pointer;
  }
  .panel-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .panel-toggle strong { min-width: 27px; padding: 4px 6px; border-radius: 8px; color: var(--navy-900); background: white; font-size: .7rem; text-align: center; }
  .leaflet-top.leaflet-left { display: none; }
  .leaflet-control-attribution { max-width: calc(100vw - 24px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .admin-modal { padding: 10px; }
  .admin-dialog { max-height: 94dvh; }
  .admin-content { grid-template-columns: 1fr; max-height: calc(94dvh - 81px); overflow: auto; }
  .admin-create-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-users-section { overflow: visible; }
}

@media (max-width: 560px) {
  .auth-screen { align-items: start; padding: max(22px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom)); }
  .auth-layout { gap: 23px; }
  .auth-brand-mark { width: 54px; height: 54px; margin-bottom: 13px; border-radius: 16px; }
  .auth-brand-mark svg { width: 35px; }
  .auth-eyebrow { font-size: .68rem; }
  .auth-brand h1 { font-size: 2.15rem; }
  .auth-intro { margin-inline: auto; font-size: .86rem; }
  .auth-formats { gap: 7px 13px; margin-top: 14px; font-size: .72rem; }
  .auth-card { padding: 23px 20px; border-radius: 20px; }
  .auth-card-header { margin-bottom: 19px; }
  .auth-field { margin-top: 14px; }
  .side-panel { max-height: 84vh; }
  .panel-header { padding-inline: 15px; }
  .summary-row { min-height: 62px; }
  .controls { padding: 13px 12px 10px; }
  .format-filters { gap: 5px; }
  .filter-card { min-height: 86px; padding: 9px 7px; }
  .filter-copy strong { font-size: .72rem; }
  .filter-copy small { font-size: .62rem; }
  .store-item { padding-inline: 13px; }
  .admin-header { padding: 15px; }
  .admin-create-form, .admin-users-section { padding: 15px; }
  .admin-user { grid-template-columns: 1fr; }
  .admin-role, .admin-scope { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* Previzualizare izolată: fișa operațională a locației */
select, textarea { font: inherit; }
.preview-banner {
  position: absolute;
  z-index: 1000;
  top: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 460px);
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 99px;
  color: #33475f;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 24px rgba(7,22,41,.14);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  font-size: .68rem;
  font-weight: 760;
  letter-spacing: .02em;
  white-space: nowrap;
}
.preview-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.14); }
.preview-static-map { background: #e9eef1; }
.preview-map-art { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.preview-map-art svg { width: 100%; height: 100%; opacity: .92; }
.preview-map-art .map-regions { fill: #e9eee8; stroke: #cbd4cd; stroke-width: 2; }
.preview-map-art .map-water { fill: none; stroke: #acd5e7; stroke-width: 54; opacity: .65; }
.preview-map-art .map-roads { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; }
.preview-map-art .map-roads path + path { stroke: #f4d7a4; stroke-width: 5; }
.preview-map-art .map-labels { fill: #87958d; font-size: 16px; font-weight: 750; letter-spacing: 1.5px; }
.static-map-note { position: absolute; right: 12px; bottom: 8px; padding: 4px 7px; border-radius: 5px; color: #687a8d; background: rgba(255,255,255,.84); font-size: 9px; }

.popup-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.popup-actions .popup-link { min-height: 38px; margin-top: 0; border: 0; cursor: pointer; }
.popup-record-button { color: var(--navy-900) !important; background: #eaf2fa; }
.popup-record-button:hover { background: #dceaf7; }

.location-record-modal { position: fixed; z-index: 4000; inset: 0; }
.record-backdrop { position: absolute; inset: 0; border: 0; background: rgba(3,14,29,.3); backdrop-filter: blur(2px); }
.record-dialog {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  width: min(630px, calc(100vw - 430px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 24px;
  background: #f4f7fb;
  box-shadow: 0 34px 100px rgba(2,12,25,.38);
  animation: record-in 220ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes record-in { from { opacity: 0; transform: translateX(32px); } }
.record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  color: white;
  background: radial-gradient(circle at 85% -20%, rgba(63,129,194,.52), transparent 45%), linear-gradient(135deg, #071629, #123b68);
}
.record-heading { min-width: 0; }
.record-format { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border-radius: 99px; color: white; background: var(--dedeman-omega); font-size: .68rem; font-weight: 820; }
.record-format[data-format="Dedeman Katrein"] { background: var(--dedeman-katrein); }
.record-format[data-format="Hyper"] { background: var(--hyper); }
.record-format[data-format="Express + Super"] { background: var(--express); }
.record-format[data-format="Supeco"] { color: #3a2900; background: #ffc747; }
.record-header h2 { margin: 10px 0 0; font-size: 1.46rem; line-height: 1.12; letter-spacing: -.025em; }
.record-header p { max-width: 490px; margin: 7px 0 0; color: #c3d5e7; font-size: .8rem; line-height: 1.45; }
.record-close { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: white; background: rgba(255,255,255,.07); cursor: pointer; }
.record-close:hover { background: rgba(255,255,255,.14); }
.record-close:focus-visible { outline: 3px solid rgba(255,255,255,.28); }
.record-close svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

.record-tabs { display: grid; grid-template-columns: .82fr 1.45fr .92fr .92fr; min-height: 62px; border-bottom: 1px solid var(--line); background: white; }
.record-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; padding: 7px 6px; border: 0; color: #6b788a; background: transparent; font-size: .76rem; font-weight: 760; cursor: pointer; }
.record-tab > span:not(.tab-count) { line-height: 1.18; text-align: center; }
.record-tab::after { content: ""; position: absolute; right: 22%; bottom: -1px; left: 22%; height: 3px; border-radius: 3px 3px 0 0; background: var(--dedeman-omega); opacity: 0; transform: scaleX(.4); transition: 150ms; }
.record-tab:hover { color: var(--navy-900); background: #f8fafc; }
.record-tab.active { color: var(--navy-900); }
.record-tab.active::after { opacity: 1; transform: scaleX(1); }
.record-tab svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; color: #526177; background: #eaf0f6; font-size: .62rem; }

.record-body { flex: 1; overflow: auto; overscroll-behavior: contain; }
.record-view { padding: 20px 22px 28px; }
.record-view.active { animation: view-in 160ms ease both; }
@keyframes view-in { from { opacity: .35; transform: translateY(4px); } }
.record-status-strip { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 12px 14px; border: 1px solid #cfe6db; border-radius: 15px; background: #f2fbf6; }
.record-status-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; color: white; background: #1e9b64; }
.record-status-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.record-status-strip > div { min-width: 0; }
.record-status-strip strong, .record-status-strip span { display: block; }
.record-status-strip strong { color: #16613d; font-size: .79rem; }
.record-status-strip div span { margin-top: 3px; color: #5d7d6d; font-size: .66rem; }
.sync-pill { margin-left: auto; padding: 5px 8px; border-radius: 99px; color: #16613d; background: #d9f3e5; font-size: .6rem; font-weight: 820; }
.sync-pill[data-state="syncing"] { color: #315d83; background: #e2eef9; }
.sync-pill[data-state="pending"] { color: #815b0d; background: #fff0c7; }
.sync-pill[data-state="error"] { color: #941d29; background: #ffe5e8; }
.record-dialog[aria-busy="true"] .record-body { opacity: .58; pointer-events: none; }

.record-export-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid #cddbeb; border-radius: 14px; background: linear-gradient(135deg, #f8fbfe, #edf5fb); }
.record-export-toolbar > div:first-child { min-width: 0; }
.record-export-toolbar strong, .record-export-toolbar span { display: block; }
.record-export-toolbar strong { color: var(--navy-900); font-size: .76rem; }
.record-export-toolbar span { margin-top: 3px; color: #6f8094; font-size: .62rem; line-height: 1.4; }
.record-export-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.record-export-buttons button { min-height: 34px; padding: 0 10px; border: 1px solid #b9cadb; border-radius: 9px; color: #244d70; background: white; font-size: .62rem; font-weight: 780; cursor: pointer; }
.record-export-buttons button:hover { border-color: #86a7c4; background: #f7fbff; }
.record-export-buttons button:disabled { opacity: .6; cursor: wait; }
.record-export-toolbar .record-inline-status { grid-column: 1 / -1; margin: 0; }

.record-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 13px; }
.record-metrics article { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 64px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; font-size: .9rem; }
.metric-icon.orange { background: #fff0e5; }
.metric-icon.blue { background: #e8f3fc; }
.metric-icon.purple { color: #6d28d9; background: #f1eafe; font-size: 1.2rem; }
.record-metrics strong, .record-metrics span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-metrics strong { color: var(--navy-900); font-size: .7rem; }
.record-metrics span { margin-top: 3px; color: #7b8796; font-size: .6rem; }

.record-card { margin-top: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 4px 15px rgba(10,33,57,.035); }
.card-heading-row, .view-heading, .visit-heading, .form-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-kicker { display: block; margin-bottom: 4px; color: #8390a1; font-size: .6rem; font-weight: 820; letter-spacing: .1em; }
.record-card h3, .view-heading h3, .new-visit-form h3, .plan-preview-card h3 { margin: 0; color: var(--navy-900); font-size: .94rem; }
.record-card p { margin: 12px 0 0; color: #56667a; font-size: .76rem; line-height: 1.58; }
.record-card .empty-copy { color: #8491a1; font-style: italic; }
.record-empty-card { display: flex; align-items: center; gap: 13px; border-style: dashed; background: #fbfcfe; }
.empty-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; color: #416b91; background: #eaf2fa; font-size: 1.25rem; }
.record-empty-card p { margin-top: 5px; }
.record-inline-status { margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; color: #38516c; background: #edf4fb; font-size: .68rem; }
.record-inline-status[data-type="success"] { color: #16613d; background: #e6f7ee; }
.record-inline-status[data-type="pending"] { color: #7e5a0c; background: #fff5d8; }
.record-inline-status[data-type="error"] { color: #921f2a; background: #ffeaec; }
.subtle-action, .inline-link { padding: 0; border: 0; color: #1b609a; background: transparent; font-size: .7rem; font-weight: 760; cursor: pointer; }
.general-notes-editor { width: 100%; margin-top: 12px; padding: 11px; resize: vertical; border: 1px solid #b9c8d9; border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfe; font-size: .76rem; line-height: 1.5; }
.general-notes-editor:focus { border-color: #3d7fbd; box-shadow: 0 0 0 3px rgba(0,104,181,.1); }
.edit-note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: #8290a1; font-size: .66rem; }
.activity-meta span { position: relative; }
.activity-meta span + span::before { content: "·"; position: absolute; left: -10px; }
.status-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 99px; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.status-chip.completed { color: #176340; background: #e1f6ea; }
.status-chip.draft { color: #865b08; background: #fff3cf; }
.inline-link { display: inline-flex; margin-top: 12px; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 11px; font-weight: 770; cursor: pointer; }
.primary-button { border: 0; color: white; background: linear-gradient(135deg, var(--navy-900), #174f80); box-shadow: 0 8px 20px rgba(11,31,58,.16); }
.primary-button:hover { transform: translateY(-1px); }
.primary-button.compact { min-height: 38px; padding-inline: 13px; font-size: .72rem; }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.secondary-button { border: 1px solid #cbd7e4; color: #42566d; background: white; }
.new-visit-button { width: 100%; margin-top: 13px; }

.view-heading { align-items: center; margin-bottom: 15px; }
.view-heading p { max-width: 390px; margin: 6px 0 0; color: #708095; font-size: .7rem; line-height: 1.45; }
.plan-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.new-visit-form { margin-bottom: 16px; padding: 17px; border: 1px solid #cbd9e8; border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(8,30,54,.07); }
.form-close { width: 32px; height: 32px; border: 0; border-radius: 9px; color: #718096; background: #edf2f7; font-size: 1.2rem; cursor: pointer; }
.visit-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.new-visit-form label > span { display: block; margin: 0 0 6px 2px; color: #526176; font-size: .67rem; font-weight: 750; }
.new-visit-form input, .new-visit-form select, .new-visit-form textarea { width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid #cbd6e2; border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfe; font-size: .75rem; }
.new-visit-form textarea { min-height: 92px; resize: vertical; }
.new-visit-form input:focus, .new-visit-form select:focus, .new-visit-form textarea:focus { border-color: #3d7fbd; box-shadow: 0 0 0 3px rgba(0,104,181,.1); }
.full-field { display: block; margin-top: 11px; }
.photo-capture-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.photo-capture-row > span { color: #7a8797; font-size: .62rem; }
.photo-capture-button { display: inline-flex; align-items: center; gap: 7px; min-height: 41px; padding: 0 12px; border: 1px solid #c9d6e4; border-radius: 10px; color: #284f73; background: #eef5fb; font-size: .68rem; font-weight: 760; cursor: pointer; }
.photo-capture-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plan-upload-files { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.plan-upload-file { min-width: 0; padding: 11px; border: 1px solid #d2deea; border-radius: 11px; background: #f7fafd; }
.plan-upload-file input[type="file"] { min-height: 38px; padding: 5px; background: white; }
.plan-upload-file small { display: block; margin: 6px 2px 0; color: #7b899a; font-size: .58rem; line-height: 1.4; }
.plan-upload-help { margin: 8px 2px 0; color: #738296; font-size: .61rem; line-height: 1.45; }
.plan-upload-form[aria-busy="true"] { opacity: .7; pointer-events: none; }
.photo-preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.photo-preview:empty { display: none; }
.photo-preview figure { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f5f7fa; }
.photo-preview img { display: block; width: 100%; height: 70px; object-fit: cover; }
.photo-preview figcaption { overflow: hidden; padding: 6px; color: #607086; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.pending-photo-tile { position: relative; }
.pending-photo-remove { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 2px solid white; border-radius: 50%; color: white; background: rgba(10,31,56,.86); box-shadow: 0 2px 8px rgba(10,31,56,.24); font-size: 1rem; line-height: 1; cursor: pointer; }
.pending-photo-remove:hover { background: #a51c28; }
.pending-photo-remove:focus-visible { outline: 3px solid rgba(0,104,181,.3); outline-offset: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.collection-heading { align-items: flex-start; }
.system-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.system-choice { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 9px; min-height: 68px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; color: #53657a; background: white; text-align: left; cursor: pointer; }
.system-choice:hover { border-color: #aebfd1; background: #fbfdff; }
.system-choice.active { border-color: #6e98bf; background: #f2f8fd; box-shadow: 0 0 0 2px rgba(0,104,181,.08); }
.system-choice-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: white; background: #244c70; font-size: 1rem; }
.system-choice[data-system="fire"] .system-choice-icon { background: #c62f3b; }
.system-choice[data-system="cctv"] .system-choice-icon { background: #163d66; }
.system-choice[data-system="intrusion"] .system-choice-icon { background: #7743bd; }
.system-choice[data-system="access"] .system-choice-icon { background: #c8661d; }
.system-choice[data-system="public_address"] .system-choice-icon { background: #237b75; }
.system-choice[data-system="network"] .system-choice-icon { background: #35639b; }
.system-choice strong, .system-choice small { display: block; min-width: 0; }
.system-choice strong { color: var(--navy-900); font-size: .69rem; line-height: 1.25; }
.system-choice small { margin-top: 4px; color: #7b899a; font-size: .57rem; }
.system-choice-state { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #cbd5df; box-shadow: 0 0 0 1px rgba(18,48,77,.08); }
.system-choice[data-state="present"] .system-choice-state { background: #24a46d; }
.system-choice[data-state="absent"] .system-choice-state { background: #e09a2e; }

.system-form { overflow: hidden; border: 1px solid #cbd9e8; border-radius: 16px; background: white; box-shadow: 0 8px 24px rgba(8,30,54,.06); }
.system-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 17px; border-bottom: 1px solid #e1e8f0; background: linear-gradient(135deg, #f9fbfd, #f1f6fb); }
.system-form-header h4 { margin: 0; color: var(--navy-900); font-size: .96rem; }
.system-form-header p { margin: 5px 0 0; color: #718196; font-size: .67rem; line-height: 1.45; }
.system-last-update { flex: 0 0 auto; color: #77879a; font-size: .58rem; text-align: right; }
.system-form-body { padding: 17px; }
.presence-question { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 13px; border: 1px solid #d9e3ed; border-radius: 13px; background: #f9fbfd; }
.presence-question strong { display: block; color: var(--navy-900); font-size: .77rem; }
.presence-question span { display: block; margin-top: 4px; color: #748397; font-size: .62rem; }
.presence-options { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 11px; background: #e8eef5; }
.presence-options label { position: relative; }
.presence-options input { position: absolute; opacity: 0; pointer-events: none; }
.presence-options b { display: grid; place-items: center; min-width: 58px; min-height: 36px; padding: 0 12px; border-radius: 8px; color: #607187; font-size: .72rem; cursor: pointer; }
.presence-options input:checked + b { color: white; background: var(--navy-900); box-shadow: 0 3px 10px rgba(10,31,56,.18); }
.presence-options input:focus-visible + b { outline: 3px solid rgba(0,104,181,.2); }
.system-fields { margin-top: 14px; }
.system-meta-grid, .system-common-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.system-meta-grid { margin-bottom: 12px; }
.system-common-grid { margin-top: 12px; }
.system-field > span, .system-observations > span { display: block; margin: 0 0 6px 2px; color: #526176; font-size: .67rem; font-weight: 760; }
.system-field input, .system-field select, .system-observations textarea { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid #cbd6e2; border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfe; font-size: .75rem; }
.system-field input:focus, .system-field select:focus, .system-observations textarea:focus { border-color: #3d7fbd; box-shadow: 0 0 0 3px rgba(0,104,181,.1); }
.system-observations { display: block; margin-top: 11px; }
.system-observations textarea { min-height: 98px; resize: vertical; line-height: 1.5; }
.equipment-list { display: grid; gap: 10px; }
.equipment-card { padding: 13px; border: 1px solid #d7e1eb; border-radius: 13px; background: #fcfdff; }
.equipment-card[hidden] { display: none; }
.equipment-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.equipment-card-header h5 { margin: 0; color: var(--navy-900); font-size: .78rem; }
.equipment-card-header span { color: #8190a1; font-size: .58rem; }
.equipment-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 9px; }
.equipment-card[data-no-quantity="true"] .equipment-inputs { grid-template-columns: 1fr; }
.equipment-photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.equipment-photo-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 11px; border: 1px solid #c6d4e2; border-radius: 9px; color: #285477; background: #edf5fb; font-size: .66rem; font-weight: 760; cursor: pointer; }
.equipment-photo-button:hover { background: #e2eff8; }
.equipment-photo-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.equipment-photo-tools > span { flex: 1 1 170px; color: #8390a0; font-size: .58rem; line-height: 1.45; }
.equipment-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.equipment-photo-grid:empty { display: none; }
.equipment-photo-tile { min-width: 0; overflow: hidden; margin: 0; padding: 0; border: 1px solid #d6e0ea; border-radius: 9px; color: #51647a; background: white; text-align: left; cursor: pointer; }
figure.equipment-photo-tile { cursor: default; }
.equipment-photo-tile img { display: block; width: 100%; height: 66px; object-fit: cover; background: #d7e0e8; }
.equipment-photo-tile span, .equipment-photo-tile figcaption { display: block; overflow: hidden; padding: 6px; font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
.review-photo-card { margin-top: 12px; padding: 13px; border: 1px solid #cbdbea; border-radius: 13px; background: linear-gradient(145deg, #f8fbfe, #f2f7fb); }
.review-photo-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-photo-heading h5 { margin: 0; color: var(--navy-900); font-size: .78rem; }
.review-photo-heading p { margin: 4px 0 0; color: #748397; font-size: .62rem; line-height: 1.45; }
.review-photo-heading > span { flex: 0 0 auto; color: #6f8195; font-size: .58rem; }
.system-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.system-save-status { margin: 0; color: #526a82; font-size: .66rem; line-height: 1.4; }
.system-save-status[data-type="success"] { color: #16613d; }
.system-save-status[data-type="pending"] { color: #815b0d; }
.system-save-status[data-type="error"] { color: #941d29; }
.system-no-details { margin: 12px 0 0; padding: 12px; border: 1px dashed #d5dee8; border-radius: 11px; color: #708095; background: #fafbfd; font-size: .68rem; line-height: 1.5; }
.visit-save-notice { margin-bottom: 13px; padding: 10px 12px; border: 1px solid #f0d79c; border-radius: 10px; color: #7e5a0c; background: #fff9e9; font-size: .7rem; }
.visit-save-notice[data-type="success"] { border-color: #bfe1cd; color: #176340; background: #edf9f2; }
.visit-save-notice[data-type="error"] { border-color: #f1bfc4; color: #941d29; background: #fff0f1; }
.record-empty-state { display: grid; justify-items: center; gap: 6px; padding: 32px 18px; border: 1px dashed #cbd7e4; border-radius: 15px; color: #7a899b; background: rgba(255,255,255,.68); text-align: center; }
.record-empty-state > span { font-size: 1.55rem; }
.record-empty-state strong { color: #42566d; font-size: .8rem; }
.record-empty-state p { margin: 0; font-size: .68rem; line-height: 1.45; }

.visit-timeline { display: grid; }
.visit-entry { display: grid; grid-template-columns: 26px 1fr; gap: 9px; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::after { content: ""; position: absolute; top: 18px; bottom: -1px; width: 2px; background: #d9e2ec; }
.visit-entry:last-child .timeline-rail::after { display: none; }
.timeline-rail span { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 17px; border: 3px solid #cad6e3; border-radius: 50%; background: white; }
.visit-entry.featured .timeline-rail span { border-color: var(--dedeman-omega); box-shadow: 0 0 0 4px #ffeadb; }
.visit-content { min-width: 0; margin-bottom: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.visit-heading h4 { margin: 4px 0 0; color: var(--navy-900); font-size: .9rem; }
.visit-date { color: #748397; font-size: .63rem; font-weight: 720; }
.visit-content p { margin: 11px 0 0; color: #56667a; font-size: .73rem; line-height: 1.55; }
.visit-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.visit-photos button { min-width: 0; overflow: hidden; padding: 0; border: 1px solid #d7e0ea; border-radius: 10px; background: white; cursor: pointer; }
.visit-photos button > span:last-child { display: block; overflow: hidden; padding: 7px; color: #4d5e73; font-size: .61rem; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.photo-visual { display: block; height: 72px; background-color: #cdd9e5; background-size: cover; }
.photo-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visit-photos button.unavailable { opacity: .58; }
.photo-visual.camera { background: linear-gradient(145deg, rgba(13,38,62,.2), rgba(13,38,62,.05)), linear-gradient(160deg, #9cafbf 0 48%, #d9e2ea 48% 58%, #697d8f 58%); }
.photo-visual.rack { background: repeating-linear-gradient(0deg, #263c51 0 9px, #89a0b4 9px 11px); }
.photo-visual.entrance { background: linear-gradient(90deg, #7f93a6 0 15%, #dbe3e9 15% 47%, #647a8e 47% 52%, #dbe3e9 52% 84%, #7f93a6 84%); }
.added-photos-note { margin-top: 10px; color: #496982; font-size: .67rem; font-weight: 720; }

.revision-pill { padding: 6px 9px; border-radius: 99px; color: #16613d; background: #dcf4e7; font-size: .6rem; font-weight: 820; white-space: nowrap; }
.plan-types { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.plan-type { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; min-width: 0; min-height: 64px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; text-align: left; cursor: pointer; }
.plan-type:hover { border-color: #b3c6da; }
.plan-type.active { border-color: #7da5c9; background: #f5faff; box-shadow: 0 0 0 2px rgba(0,104,181,.08); }
.plan-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-weight: 850; }
.plan-icon.navy { color: white; background: var(--navy-900); }
.plan-icon.red { color: #a51c28; background: #ffe8ea; }
.plan-icon.purple { color: #6d28d9; background: #f0e8ff; }
.plan-icon.orange { color: #a74c0d; background: #fff0e4; }
.plan-type span:nth-child(2) { min-width: 0; }
.plan-type strong, .plan-type small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-type strong { color: var(--navy-900); font-size: .72rem; }
.plan-type small { margin-top: 3px; color: #7c8999; font-size: .58rem; }
.plan-type b { color: #2c6595; font-size: .6rem; }

.plan-preview-card { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.plan-preview-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-actions a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 9px; border: 1px solid #cad6e2; border-radius: 8px; color: #37526d; background: #f8fafc; font-size: .58rem; font-weight: 740; text-decoration: none; cursor: pointer; }
.plan-actions a:hover { border-color: #9eb3ca; background: #eef4fa; }
.floor-plan { padding: 12px; background: #f8fafc; }
.plan-file-preview { display: grid; place-items: center; min-height: 180px; color: #6f7f92; font-size: .72rem; text-align: center; }
.floor-plan > svg { display: block; width: 100%; height: auto; border: 1px solid #cfd9e4; border-radius: 10px; background-color: #f5f9fc; background-image: linear-gradient(#dfe7ee 1px, transparent 1px), linear-gradient(90deg, #dfe7ee 1px, transparent 1px); background-size: 20px 20px; }
.floor-plan .walls { fill: none; stroke: #263c51; stroke-width: 5; stroke-linejoin: round; }
.floor-plan .doors { fill: none; stroke: #688096; stroke-width: 2; }
.floor-plan .labels { fill: #61758a; font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.floor-plan .camera-pins circle { fill: #0b1f3a; stroke: white; stroke-width: 3; }
.floor-plan .camera-pins path, .floor-plan .camera-pins rect { fill: none; stroke: white; stroke-width: 2; stroke-linejoin: round; }
.floor-plan .camera-pins text { fill: #334b62; font-size: 11px; font-weight: 800; text-anchor: middle; }
.floor-plan .camera-pins .hot circle { fill: var(--dedeman-omega); stroke: #fff1e7; stroke-width: 6; }
.plan-legend { display: flex; align-items: center; gap: 15px; margin-top: 9px; color: #6b7b8e; font-size: .57rem; }
.plan-legend span:last-child { margin-left: auto; }
.plan-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: var(--navy-900); }
.plan-legend .legend-selected { background: var(--dedeman-omega); }
.plan-preview-card > footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); color: #77869a; font-size: .56rem; }

@media (max-width: 1100px) {
  .record-dialog { width: min(610px, calc(100vw - 24px)); }
  .record-backdrop { background: rgba(3,14,29,.42); }
  .preview-banner { max-width: calc(100vw - 32px); }
}

@media (max-width: 899px) {
  .preview-banner { top: max(11px, env(safe-area-inset-top)); max-width: calc(100vw - 115px); overflow: hidden; text-overflow: ellipsis; }
  .record-dialog { top: 8px; right: 8px; bottom: 8px; left: 8px; width: auto; border-radius: 20px; }
  .record-header { padding: 19px 18px 15px; }
  .record-header h2 { font-size: 1.3rem; }
  .record-view { padding: 16px 16px 24px; }
  .record-tabs { min-height: 56px; }
  .system-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-user { grid-template-columns: minmax(0, 1fr) 125px; }
  .admin-scope { grid-column: 2; }
}

@media (max-width: 580px) {
  .record-dialog { inset: 0; border: 0; border-radius: 0; }
  .record-header { padding-top: max(18px, env(safe-area-inset-top)); }
  .record-tabs { grid-template-columns: .72fr 1.35fr .82fr .82fr; }
  .record-tab { gap: 4px; padding-inline: 3px; font-size: .65rem; }
  .record-tab svg { width: 16px; }
  .record-metrics { grid-template-columns: 1fr; }
  .record-export-toolbar { grid-template-columns: 1fr; }
  .record-export-buttons { justify-content: stretch; }
  .record-export-buttons button { flex: 1 1 calc(50% - 6px); }
  .record-metrics article { min-height: 55px; }
  .sync-pill { display: none; }
  .view-heading { align-items: flex-start; }
  .plan-heading-actions { align-items: flex-end; flex-direction: column; }
  .plan-types { grid-template-columns: 1fr; }
  .visit-form-grid { grid-template-columns: 1fr; }
  .plan-upload-files { grid-template-columns: 1fr; }
  .photo-capture-row { align-items: flex-start; flex-direction: column; }
  .portfolio-export-actions { grid-template-columns: 1fr; }
  .system-picker { grid-template-columns: 1fr 1fr; }
  .system-choice { min-height: 64px; }
  .system-form-header, .presence-question, .system-form-actions { align-items: flex-start; flex-direction: column; }
  .presence-question { grid-template-columns: 1fr; }
  .presence-options { width: 100%; }
  .presence-options b { min-width: 0; }
  .system-meta-grid, .system-common-grid, .equipment-inputs { grid-template-columns: 1fr; }
  .equipment-photo-grid { grid-template-columns: 1fr 1fr; }
  .system-form-actions .primary-button { width: 100%; }
  .visit-photos { grid-template-columns: 1fr 1fr; }
  .plan-preview-card > header { align-items: flex-start; flex-direction: column; }
  .plan-preview-card > footer { flex-direction: column; }
  .admin-user { grid-template-columns: 1fr; }
  .admin-role, .admin-scope { grid-column: 1; }
}
