/* Eleven Estate Admin - czat w stylu komunikatora, paleta betonu i grafitu jak na stronie */
:root {
  --tlo: #EFEDE9; --tlo-czatu: #E9E5DF; --karta: #FFFFFF; --boczny: #F7F6F3;
  --linia: #E2DED7; --tekst: #232220; --szary: #77726A; --szary-jasny: #A39E95;
  --grafit: #2B2A28; --grafit-2: #45423C; --moj: #DDE5D3; --moj-ciemny: #CFD9C2;
  --akcent: #8C7A5B; --ok: #4E8A55; --uwaga: #B4883A; --blad: #A3412F;
  --cien: 0 1px 2px rgba(35, 34, 32, .08), 0 1px 1px rgba(35, 34, 32, .04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--tlo); color: var(--tekst); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
svg { display: block; }
.znak-pionowy { font-weight: 300; letter-spacing: -.05em; margin-right: 6px; }

/* ---------- przyciski ---------- */
.przycisk-glowny, .przycisk-jasny {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: background .15s, transform .05s;
}
.przycisk-glowny { background: var(--grafit); color: #fff; }
.przycisk-glowny:hover { background: #000; }
.przycisk-glowny:active { transform: scale(.98); }
.przycisk-jasny { background: #fff; color: var(--grafit); box-shadow: inset 0 0 0 1px var(--linia); }
.przycisk-jasny:hover { box-shadow: inset 0 0 0 1px var(--szary-jasny); }
button:disabled { opacity: .55; cursor: wait; }

/* ---------- logowanie ---------- */
.strona-logowania { display: flex; min-height: 100%; }
.logowanie { margin: auto; padding: 32px 16px; width: 100%; max-width: 420px; }
.logo-duze { text-align: center; font-weight: 600; letter-spacing: .22em; font-size: 15px; margin-bottom: 28px; }
.logo-duze em, .logo em { font-style: normal; font-weight: 400; letter-spacing: .04em; color: var(--szary); margin-left: 6px; }
.karta { background: var(--karta); border-radius: 20px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(35, 34, 32, .08); }
.karta.szeroka { max-width: 520px; margin: 0 auto; }
.karta h1 { margin: 0 0 8px; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.karta h2 { margin: 28px 0 10px; font-size: 15px; }
.karta .opis { color: var(--szary); margin: 0 0 20px; }
.karta .przycisk-glowny { width: 100%; margin-top: 10px; padding: 14px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--szary); margin: 14px 0; }
.karta input:not([type=hidden]) {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 16px; color: var(--tekst);
  padding: 13px 14px; border: 1px solid var(--linia); border-radius: 12px; background: #FBFAF8;
}
.karta input:focus { outline: none; border-color: var(--grafit-2); background: #fff; box-shadow: 0 0 0 3px rgba(43, 42, 40, .08); }
.kod { font-size: 26px !important; letter-spacing: .4em; text-align: center; }
.qr { width: 220px; max-width: 100%; background: #fff; margin: 8px 0; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--linia); }
.qr svg { width: 100%; height: auto; }
.maly { font-size: 13px; color: var(--szary); }
code { font-size: 13px; background: var(--tlo); padding: 3px 8px; border-radius: 6px; word-break: break-all; }
.blad { color: var(--blad); font-weight: 600; font-size: 14px; }

/* ---------- aplikacja: dwie kolumny ---------- */
.aplikacja { display: grid; grid-template-columns: 340px 1fr; height: 100vh; height: 100dvh; overflow: hidden; }

.boczny { display: flex; flex-direction: column; background: var(--boczny); border-right: 1px solid var(--linia); min-height: 0; }
.boczny-gora { padding: 18px 16px 12px; }
.logo { font-weight: 600; letter-spacing: .2em; font-size: 13px; margin: 2px 4px 16px; white-space: nowrap; }
.nowy-czat {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  background: var(--grafit); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
}
.nowy-czat:hover { background: #000; }
.nowy-czat svg { width: 18px; height: 18px; }

.baner-akceptacja {
  margin: 0 16px 8px; padding: 10px 14px; border-radius: 12px; background: #F6EBD3; color: #6E5220;
  text-decoration: none; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.kropka { width: 8px; height: 8px; border-radius: 50%; background: var(--uwaga); flex: none; animation: puls 1.6s infinite; }
@keyframes puls { 50% { opacity: .35; } }

.lista-rozmow { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sekcja, .zakonczone summary { font-size: 12px; font-weight: 600; color: var(--szary); text-transform: uppercase; letter-spacing: .06em; padding: 12px 10px 6px; }
.zakonczone summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; user-select: none; }
.zakonczone summary::-webkit-details-marker { display: none; }
.zakonczone summary::before { content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.zakonczone[open] summary::before { transform: rotate(45deg); }
.licznik { background: var(--linia); color: var(--szary); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.pusto-boczny { color: var(--szary); font-size: 14px; padding: 16px 10px; }

.rozmowa { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-decoration: none; }
.rozmowa:hover { background: #EDEAE5; }
.rozmowa.wybrana { background: #E6E2DB; }
.rozmowa-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rozmowa-tytul { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rozmowa-podglad { font-size: 13px; color: var(--szary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rozmowa-czas { font-size: 12px; color: var(--szary-jasny); align-self: flex-start; margin-top: 2px; }
.rozmowa.zakonczona .rozmowa-tytul { font-weight: 500; color: var(--szary); }

.awatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.awatar svg { width: 18px; height: 18px; }
.a-aktywna { background: var(--grafit); color: #fff; }
.a-zakonczona { background: #DCE8D9; color: var(--ok); }
.a-claude { background: #E8E1D3; color: var(--akcent); }
.a-ja { width: 32px; height: 32px; background: var(--grafit-2); color: #fff; font-size: 13px; }

.boczny-dol { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--linia); }
.ja { flex: 1; font-weight: 600; font-size: 14px; }
.wyloguj { border: 0; background: none; color: var(--szary); font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.wyloguj:hover { background: var(--linia); color: var(--tekst); }

/* ---------- okno rozmowy ---------- */
.okno { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--tlo-czatu);
  background-image: radial-gradient(rgba(35, 34, 32, .045) 1px, transparent 1px); background-size: 18px 18px; }
.okno-gora { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--boczny); border-bottom: 1px solid var(--linia); }
.okno-tytul { min-width: 0; display: flex; flex-direction: column; }
.okno-tytul strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.okno-tytul span { font-size: 12px; color: var(--szary); }
.wstecz { display: none; width: 34px; height: 34px; border-radius: 50%; place-items: center; color: var(--grafit); }
.wstecz svg { width: 20px; height: 20px; }

.akceptacja {
  margin: 12px 20px 0; padding: 14px 16px; background: #fff; border-radius: 16px; box-shadow: var(--cien);
  border-left: 4px solid var(--uwaga); display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.akceptacja p { margin: 2px 0 0; color: var(--szary); font-size: 14px; }
.przyciski { display: flex; gap: 8px; flex-wrap: wrap; }

.wiadomosci { flex: 1; overflow-y: auto; padding: 16px 6% 10px; display: flex; flex-direction: column; gap: 4px; }
.dymek-info { align-self: center; max-width: 440px; text-align: center; background: #FBF6E9; color: #6B5E44; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--cien); margin: 12px 0; }
.separator { display: flex; justify-content: center; margin: 12px 0 6px; }
.separator span, .systemowa span { background: rgba(255, 255, 255, .85); color: var(--szary); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 8px; box-shadow: var(--cien); }
.systemowa { display: flex; justify-content: center; margin: 6px 0; text-align: center; }
.systemowa span { background: #E7F0E4; color: #3F6B44; max-width: 520px; }

.linia { display: flex; margin: 2px 0; }
.linia.moja { justify-content: flex-end; }
.dymek { position: relative; max-width: min(560px, 78%); padding: 7px 10px 6px 11px; border-radius: 12px; box-shadow: var(--cien); background: #fff; }
.moja .dymek { background: var(--moj); border-top-right-radius: 4px; }
.jego .dymek { border-top-left-radius: 4px; }
.autor { font-size: 12.5px; font-weight: 650; color: var(--akcent); margin-bottom: 2px; }
.tresc { overflow-wrap: anywhere; white-space: normal; padding-right: 4px; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--szary); margin-top: 2px; line-height: 1; }
.ptaszki svg { width: 17px; height: 11px; }
.ptaszki.s-nowe { color: var(--szary-jasny); }
.ptaszki.s-w_toku { color: var(--szary); }
.ptaszki.s-zrobione { color: #3B8BD0; }

.zalaczniki { display: grid; gap: 4px; margin: 1px -5px 5px -6px; }
.zal-obraz img { display: block; width: 100%; max-width: 320px; max-height: 320px; object-fit: cover; border-radius: 9px; }
.zal-plik { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: rgba(0, 0, 0, .045); border-radius: 9px; text-decoration: none; font-size: 14px; }
.zal-plik svg { width: 22px; height: 22px; flex: none; color: var(--szary); }
.zal-plik span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.zal-plik small { color: var(--szary); font-size: 12px; }

/* ---------- pole pisania ---------- */
.pisanie { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--boczny); border-top: 1px solid var(--linia); }
.pisanie .blad { margin: 0 4px 8px; }
.pisanie-wiersz { display: flex; align-items: flex-end; gap: 8px; }
.pisanie textarea {
  flex: 1; resize: none; max-height: 180px; font: inherit; font-size: 15px; color: var(--tekst);
  padding: 11px 16px; border: 0; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 1px var(--linia); line-height: 1.4;
}
.pisanie textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--grafit-2); }
.spinacz, .wyslij { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; margin: 0; }
.spinacz { color: var(--szary); cursor: pointer; }
.spinacz:hover { background: var(--linia); color: var(--tekst); }
.spinacz svg { width: 22px; height: 22px; }
.spinacz input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.spinacz:focus-within { box-shadow: 0 0 0 2px var(--grafit-2); }
.wyslij { border: 0; background: var(--grafit); color: #fff; }
.wyslij:hover { background: #000; }
.wyslij svg { width: 20px; height: 20px; margin-left: 2px; }
.wybrane { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 52px 8px; }
.wybrane span { background: #fff; box-shadow: inset 0 0 0 1px var(--linia); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- ekran powitalny ---------- */
.powitanie { margin: auto; text-align: center; padding: 32px; max-width: 420px; }
.znak-pionowy.duzy { font-size: 48px; color: var(--szary-jasny); margin: 0 0 8px; }
/* powitanie nad lista rozmow - tylko na telefonie (na komputerze jest na srodku okna) */
.powitanie-mobilne { display: none; }
.powitanie-zdjecie { display: block; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; box-shadow: 0 0 0 4px #fff, 0 8px 24px rgba(35, 34, 32, .15); }
img.a-ja { object-fit: cover; }
.powitanie h2 { margin: 0 0 8px; font-size: 22px; }
.powitanie p { color: var(--szary); margin: 0 0 20px; }
blockquote.cytat { margin: -4px auto 24px; max-width: 360px; font-size: 17px; line-height: 1.45; font-style: italic; color: var(--grafit-2); }
.powitanie-mobilne em.cytat { display: block; margin-top: 6px; font-size: 14px; color: var(--grafit-2); }

/* ---------- telefon: lista albo rozmowa ---------- */
@media (max-width: 820px) {
  .aplikacja { grid-template-columns: minmax(0, 1fr); }
  .boczny { min-width: 0; border-right: 0; }
  .widok-rozmowa .boczny { display: none; }
  .widok-lista .okno { display: none; }
  .powitanie-mobilne { display: flex; align-items: center; gap: 14px; margin: 4px 16px 14px; padding: 14px; background: #fff; border-radius: 16px; box-shadow: var(--cien); }
  .powitanie-mobilne img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
  .powitanie-mobilne .znak-pionowy { font-size: 30px; color: var(--szary-jasny); width: 56px; text-align: center; margin: 0; }
  .powitanie-mobilne strong { display: block; font-size: 18px; }
  .powitanie-mobilne span { color: var(--szary); font-size: 14px; }
  .wstecz { display: grid; margin-left: -8px; }
  .okno-gora { padding: 10px 12px; }
  .wiadomosci { padding: 12px 10px 8px; }
  .dymek { max-width: 86%; }
  .akceptacja { margin: 10px 10px 0; }
  .akceptacja .przyciski, .akceptacja .przyciski > * { width: 100%; }
  .akceptacja .przycisk-glowny, .akceptacja .przycisk-jasny { width: 100%; }
  .pisanie { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .wybrane { margin: 0 8px 8px; }
  .pisanie textarea { font-size: 16px; }
}
