:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --line: #e3e7ee;
  --brand: #0b5cad;
  --brand-dark: #08457f;
  --accent: #d21034;
  --ok: #138a4b;
  --warn: #b7791f;
  --bad: #c53030;
  --side: #0d2a4a;
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 230px; flex-shrink: 0; background: var(--side); color: #fff;
  display: flex; flex-direction: column; padding: 18px 12px;
}
.side .brand, .auth .brand { font-weight: 800; font-size: 1.3rem; padding: 0 10px 4px; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 9px; }
.auth .brand { padding: 0; }
.auth .brand:hover { text-decoration: none; }
.logo-mark { height: 34px; width: 34px; flex-shrink: 0; }
.side .logo-mark { height: 30px; width: 30px; }
.brand-site .logo-mark { height: 36px; width: 36px; }
.brand-site.small .logo-mark { height: 22px; width: 22px; }
.brand-site { display: inline-flex; align-items: center; gap: 9px; }
.receipt .r-brand { display: inline-flex; align-items: center; gap: 5px; }
.receipt .r-brand img { width: 14px; height: 14px; }
.side .brand .wm > span { color: #ff6b81; }
.side .biz { padding: 0 10px 16px; font-size: .85rem; opacity: .75; }
.side .biz select { margin: 0; padding: 6px 8px; font-size: .85rem; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.side .biz select option { color: var(--text); }
.side .biz-add { display: block; padding: 0 10px 14px; font-size: .8rem; color: #9fc3ec; }
.side nav a {
  display: block; color: #d6e2f0; padding: 9px 12px; border-radius: 8px; margin-bottom: 2px;
}
.side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side nav a.active { background: var(--brand); color: #fff; }
.side .foot { margin-top: auto; padding: 10px; font-size: .85rem; }
.side .foot button { width: 100%; margin-top: 8px; }
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: 100%; padding: 12px; }
  .side nav { display: none; }
  .side.open nav { display: block; }
  .side .foot { display: none; }
  .side.open .foot { display: block; }
  .menu-btn { display: inline-block; position: absolute; right: 16px; top: 12px; }
  .main { padding: 16px; }
}

/* ---------- Composants ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.stat .value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat.ok .value { color: var(--ok); }
.stat.bad .value { color: var(--bad); }
.stat.brand .value { color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; color: var(--muted); letter-spacing: .4px; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fc; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge.aktif, .badge.vesman, .badge.peye { background: #e3f5ec; color: var(--ok); }
.badge.sispann, .badge.anile, .badge.retre, .badge.reta { background: #fde8e8; color: var(--bad); }
.badge.fini { background: #e6eefa; color: var(--brand); }
.badge.fix { background: #eef2f7; color: #334; }
.badge.kwasan { background: #fff4de; color: var(--warn); }
.badge.pasyel, .badge.annatant { background: #fff4de; color: var(--warn); }
.badge.ese { background: #e6eefa; color: var(--brand); }
.badge.apwouve { background: #e3f5ec; color: var(--ok); }
.badge.ekspire, .badge.rejte { background: #fde8e8; color: var(--bad); }

.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.banner.info { background: #e6eefa; color: var(--brand-dark); }
.banner.warn { background: #fff4de; color: #7a5212; }
.banner.bad { background: #fde8e8; color: #8a1f1f; }
.banner a { font-weight: 600; margin-left: 6px; }
code { background: #f0f3f7; padding: 1px 6px; border-radius: 4px; font-size: .85rem; }

.progress { height: 8px; background: #e8ecf2; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); }

button, .btn {
  font: inherit; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; display: inline-block;
}
button:hover, .btn:hover { background: var(--brand-dark); text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--brand); }
button.ghost:hover { background: #eef4fb; }
button.danger { background: var(--bad); border-color: var(--bad); }
button.ok { background: var(--ok); border-color: var(--ok); }
button.sm { padding: 4px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.side button.ghost { color: #fff; border-color: rgba(255,255,255,.3); }

form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--text);
  padding: 8px 10px; border: 1px solid #cfd6e0; border-radius: 8px; background: #fff;
}
input:focus, select:focus { outline: 2px solid #bcd6f3; border-color: var(--brand); }
.pw { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.pw input { margin-top: 0; }
.pw button { flex-shrink: 0; padding: 7px 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search { max-width: 320px; margin: 0; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.seg button { border: 0; border-radius: 0; background: #fff; color: var(--text); }
.seg button.on { background: var(--brand); color: #fff; }
.seg.lang button { padding: 4px 10px; font-size: .8rem; }
.side .seg.lang { border-color: rgba(255,255,255,.25); }
.side .seg.lang button:not(.on) { background: transparent; color: #d6e2f0; }

.calc-box { background: #f0f6fd; border: 1px solid #cfe1f5; border-radius: var(--radius); padding: 14px 16px; }
.calc-box .big { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.kv { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: .92rem; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv div:nth-child(even) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.day { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: .8rem; background: #fff; }
.day b { display: block; font-size: .9rem; }
.day.peye { background: #e3f5ec; border-color: #b9e2cb; }
.day.pasyel { background: #fff4de; border-color: #f2d7a1; }
.day.reta { background: #fde8e8; border-color: #f5c2c2; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

.chart .tip {
  position: absolute; top: 0; width: 140px; pointer-events: none; background: #1c2430; color: #fff;
  font-size: .8rem; line-height: 1.45; padding: 7px 10px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.chart .hit { cursor: crosshair; }

.modal-bg { position: fixed; inset: 0; background: rgba(10,20,35,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 560px; }
.modal h2 { margin-bottom: 16px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; max-width: 90vw; }
.toast.err { background: var(--bad); }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(135deg, #0b5cad 0%, #0d2a4a 60%, #d21034 140%); }
.auth .box { background: #fff; border-radius: 14px; padding: 28px; width: 100%; max-width: 420px; }
.auth .brand { color: var(--side); padding: 0; font-size: 1.8rem; }
.auth .brand .wm > span { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------- Sit piblik (paj akèy) ---------- */
.site { background: #fff; color: var(--text); }
.site-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.site h2 { font-size: 1.9rem; margin: 0 0 10px; letter-spacing: -.3px; }
.site h3 { font-size: 1.05rem; }
.site .lead { color: var(--muted); font-size: 1.05rem; max-width: 680px; margin: 0 0 26px; }
.site .eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #ffd166; margin-bottom: 10px; }
.site .eyebrow.dark { color: var(--accent); }
.btn.big { padding: 12px 22px; font-size: 1rem; font-weight: 600; border-radius: 10px; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.7); }
.btn.ghost.light:hover { background: rgba(255,255,255,.12); }

.site-nav { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand-site { font-weight: 800; font-size: 1.45rem; color: var(--side); letter-spacing: .3px; }
.brand-site .wm > span { color: var(--accent); }
.brand-site:hover { text-decoration: none; }
.brand-site.small { font-size: 1.05rem; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.burger, .mobile-only { display: none; }

.hero { position: relative; min-height: 600px; display: flex; align-items: center; overflow: hidden; background: #f9b97c; }
.hero-art { position: absolute; inset: 0; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero .slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; transform: scale(1.04); }
.hero .slide.on { opacity: 1; animation: heroZoom 9s ease-out forwards; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hero .slide.on { animation: none; transform: none; } }
.hero-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hero-thumb { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafcff; }
.hero-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.hero-thumb .badge { position: absolute; top: 8px; left: 8px; }
.hero-thumb .actions { padding: 8px; gap: 6px; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,35,70,.92) 0%, rgba(8,35,70,.78) 38%, rgba(8,35,70,.1) 68%, rgba(8,35,70,0) 100%); }
.hero-text { position: relative; color: #fff; width: 100%; padding-top: 40px; padding-bottom: 60px; }
.hero-text h1 { font-size: 2.7rem; line-height: 1.12; max-width: 560px; margin: 0 0 16px; letter-spacing: -.5px; }
.hero-text p { font-size: 1.12rem; max-width: 520px; line-height: 1.55; opacity: .93; margin: 0 0 26px; }
.hero-note { margin-top: 22px; font-size: .92rem; opacity: .9; }

.site-sec { padding: 72px 0; }
.site-sec.alt { background: #f4f7fb; }
.cards3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feat h3 { margin: 12px 0 6px; }
.feat p { margin: 0; color: var(--muted); line-height: 1.5; }
.feat .ico { width: 52px; height: 52px; border-radius: 12px; background: #e8f0fb; color: var(--brand); display: grid; place-items: center; }
.feat .ico svg { width: 30px; height: 30px; }
.feat .emo { font-size: 1.8rem; }
.about p { line-height: 1.65; }
.story { background: #fff; border-left: 4px solid var(--accent); border-radius: 12px; padding: 22px 24px; }
.steps { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.step { padding: 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.step .num { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; }
.step h3 { margin: 12px 0 6px; }
.step p { margin: 0; color: var(--muted); line-height: 1.5; }
.price-card { max-width: 420px; margin: 0 auto; background: #fff; border: 2px solid var(--brand); border-radius: 18px; padding: 28px; text-align: center; box-shadow: 0 12px 30px rgba(11,92,173,.12); }
.price-tag { display: inline-block; background: #e3f5ec; color: var(--ok); font-weight: 700; padding: 4px 12px; border-radius: 99px; font-size: .85rem; }
.price { font-size: 3rem; font-weight: 800; margin: 12px 0 2px; color: var(--side); }
.price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 22px; text-align: left; line-height: 2; }
.contact-list { list-style: none; padding: 0; line-height: 2.1; font-size: 1.02rem; }
.site-foot { background: var(--side); color: #c9d6e6; padding: 18px 0; font-size: .9rem; }
.site-foot a { color: #fff; }
.site-foot .brand-site { color: #fff; }
.foot-author { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; border-top: 1px solid rgba(255,255,255,.12); margin-top: 12px; padding-top: 12px; font-size: .85rem; }
.foot-author span { color: #9fb3c8; }
.msg.unread { border-left: 4px solid var(--brand); }

@media (max-width: 900px) {
  .nav-links { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 10px; order: 3; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; border-top: 1px solid var(--line); }
  .burger { display: inline-block; }
  .mobile-only { display: block; }
  .nav-actions .seg.lang { display: none; }
  /* Sou telefòn: ilistrasyon an anlè, tèks la anba sou fon ble a */
  .hero { display: block; min-height: 0; background: #082346; }
  .hero-art { position: relative; height: 250px; }
  .hero-shade { display: none; }
  .hero-text { padding-top: 26px; padding-bottom: 40px; }
  .hero-text h1 { font-size: 2rem; }
  .hero-text p { font-size: 1rem; }
  .site-sec { padding: 52px 0; }
  .site h2 { font-size: 1.55rem; }
}
@media (max-width: 480px) {
  .nav-actions .btn.ghost { display: none; }
  .hero-text .actions .btn { width: 100%; text-align: center; }
}

/* ---------- Foto kliyan ak kamera ---------- */
.modal.wide { max-width: 760px; }
.sec-title { margin: 8px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-slot { border: 1px dashed #c3ccd8; border-radius: 10px; padding: 10px; text-align: center; background: #fafcff; }
.photo-prev { height: 120px; border-radius: 8px; background: #eef2f7; display: grid; place-items: center; overflow: hidden; margin-bottom: 8px; }
.photo-prev span { font-size: 2.4rem; opacity: .6; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .actions { margin-top: 6px; gap: 6px; }
.cam-bg { position: fixed; inset: 0; background: rgba(5,12,24,.92); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 12px; }
.cam { width: 100%; max-width: 640px; }
.cam-title { color: #fff; font-weight: 600; text-align: center; margin-bottom: 10px; }
.cam-view { position: relative; border-radius: 12px; overflow: hidden; background: #000; }
.cam-view video { width: 100%; display: block; max-height: 70vh; object-fit: cover; }
.cam-view video.mirror { transform: scaleX(-1); }
.cam-frame { position: absolute; left: 8%; right: 8%; top: 50%; transform: translateY(-50%); aspect-ratio: 1.586; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
@media (max-width: 560px) {
  .photo-grid { grid-template-columns: 1fr; }
  .photo-prev { height: 150px; }
}

/* ---------- Resi ---------- */
.receipt {
  max-width: 380px; margin: 0 auto 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86rem; color: #111;
}
.receipt .r-head { text-align: center; margin-bottom: 10px; line-height: 1.45; }
.receipt .r-biz { font-weight: 800; font-size: 1.05rem; }
.receipt .r-title { text-align: center; font-weight: 700; letter-spacing: 1px; border-top: 1px dashed #999; border-bottom: 1px dashed #999; padding: 6px 0; margin-bottom: 8px; }
.receipt .r-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.receipt .r-row span:last-child { text-align: right; }
.receipt .r-row.strong { font-weight: 700; }
.receipt .r-sep { border-top: 1px dashed #999; margin: 8px 0; }
.receipt .r-amount { display: flex; justify-content: space-between; align-items: baseline; font-size: 1rem; }
.receipt .r-amount b { font-size: 1.35rem; }
.receipt .r-foot { text-align: center; margin-top: 12px; }
.receipt .r-foot span { font-size: .75rem; color: #666; }
.receipt-page { max-width: 420px; margin: 0 auto; padding: 20px 16px; }
.btn.whatsapp { background: #1f9d55; border-color: #1f9d55; }
.btn.whatsapp:hover { background: #17834a; }
.btn.sm { padding: 4px 10px; font-size: .85rem; }

@media print {
  .banner { display: none !important; }
  body { background: #fff; }
  .receipt { border: 0; max-width: 80mm; padding: 0; margin: 0 auto; }
  .receipt-page { padding: 0; }
  .side, .no-print, .topbar button { display: none !important; }
  .main { padding: 0; }
  .card { border: 0; }
}
