/* ============================================================
   Panel użytkownika (konto) — wspólny dla otoauta.pl i osiedlo.pl
   Wymaga: otoauta.css (tokeny) + listing.css (slim header) + bootstrap-icons
   ============================================================ */
body { background: var(--bg); }

.kt-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1240px; margin: 0 auto; padding: 18px 16px 50px; }
.kt-wrap > * { min-width: 0; }
.kt-sec { min-width: 0; }

/* ===== Sidebar ===== */
.kt-side { position: sticky; top: 78px; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.kt-user { padding: 18px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.kt-user__av { width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(155deg, var(--navy-600), var(--navy-900)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.kt-user__n { font-family: var(--font-display); font-weight: 800; font-size: .98rem; line-height: 1.1; }
.kt-user__t { font-size: .76rem; color: var(--muted); }
.kt-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.kt-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: .9rem; cursor: pointer; transition: .12s; position: relative; }
.kt-nav a i { font-size: 1.1rem; color: var(--muted); width: 20px; text-align: center; }
.kt-nav a:hover { background: var(--navy-50); color: var(--navy-700); }
.kt-nav a:hover i { color: var(--navy-700); }
.kt-nav a.active { background: var(--navy-700); color: #fff; }
.kt-nav a.active i { color: #fff; }
.kt-nav a .badge-n { margin-left: auto; background: var(--orange-500); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: .1rem .42rem; }
.kt-nav a.active .badge-n { background: rgba(255,255,255,.25); }
.kt-nav__sep { height: 1px; background: var(--line-2); margin: 6px 4px; }
.kt-nav a.danger { color: var(--orange-700); }
.kt-nav a.danger i { color: var(--orange-700); }

/* mobilna nawigacja */
.kt-mobnav { display: none; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.kt-mobnav button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .5rem .9rem; font-weight: 700; font-size: .82rem; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.kt-mobnav button.active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }

/* ===== Sekcje ===== */
.kt-sec { display: none; }
.kt-sec.active { display: block; }
.kt-h { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; margin: 0 0 4px; }
.kt-hsub { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.kt-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.kt-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.kt-card h3 i { color: var(--orange-500); }

/* Statystyki */
.kt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 720px){ .kt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.kt-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.kt-stat__l, .kt-stat__d { overflow-wrap: anywhere; }
.kt-stat__ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; margin-bottom: 10px; }
.kt-stat__v { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1; }
.kt-stat__l { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kt-stat__d { font-size: .74rem; font-weight: 700; margin-top: 6px; }
.kt-stat__d.up { color: var(--green-600); } .kt-stat__d.down { color: var(--orange-600); }

/* Tabs statusów */
.kt-tabs { display: flex; gap: 4px; background: var(--bg-2); border-radius: 11px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.kt-tabs button { border: 0; background: transparent; font-weight: 700; font-size: .84rem; color: var(--muted); padding: .5rem .9rem; border-radius: 8px; cursor: pointer; }
.kt-tabs button.active { background: #fff; color: var(--navy-700); box-shadow: var(--shadow-sm); }

/* Wiersz ogłoszenia w panelu */
.kt-listing { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; background: #fff; }
.kt-listing__media { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--bg-2); position: relative; }
.kt-listing__media img { width: 100%; height: 100%; object-fit: cover; }
.kt-listing__st { position: absolute; top: 6px; left: 6px; font-size: .62rem; font-weight: 800; text-transform: uppercase; padding: .15rem .4rem; border-radius: 5px; }
.st-active { background: var(--green-100); color: var(--green-600); }
.st-pending { background: var(--gold-100); color: var(--gold-600); }
.st-expired { background: var(--bg-2); color: var(--muted); }
.kt-listing__t { font-family: var(--font-display); font-weight: 700; font-size: .98rem; line-height: 1.25; overflow-wrap: anywhere; }
.kt-listing__t a { color: var(--ink); }
.kt-listing__meta { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.kt-listing__price { font-family: var(--font-display); font-weight: 800; color: var(--navy-800); margin-top: 6px; }
.kt-listing__stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.kt-listing__stats span { display: inline-flex; align-items: center; gap: 5px; }
.kt-listing__act { display: flex; flex-direction: column; gap: 7px; align-items: stretch; min-width: 130px; }
.kt-mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: .8rem; padding: .5rem .7rem; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; transition: .12s; }
.kt-mini-btn:hover { border-color: var(--navy-500); color: var(--navy-700); }
.kt-mini-btn.promote { background: var(--orange-500); border-color: var(--orange-500); color: #fff; }
.kt-mini-btn.promote:hover { background: var(--orange-600); }
@media (max-width: 620px){ .kt-listing { grid-template-columns: 96px minmax(0, 1fr); } .kt-listing__act { grid-column: 1/-1; flex-direction: row; flex-wrap: wrap; } .kt-mini-btn { flex: 1; } }

/* Wiadomości */
.kt-msgs { display: grid; grid-template-columns: 300px 1fr; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 480px; background: #fff; }
.kt-convs { border-right: 1px solid var(--line-2); overflow-y: auto; max-height: 560px; }
.kt-conv { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.kt-conv:hover { background: var(--navy-50); }
.kt-conv.active { background: var(--navy-50); box-shadow: inset 3px 0 0 var(--orange-500); }
.kt-conv__av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--navy-100); color: var(--navy-700); font-weight: 800; font-size: .85rem; }
.kt-conv__n { font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; gap: 6px; }
.kt-conv__n small { color: var(--muted-2); font-weight: 600; font-size: .72rem; }
.kt-conv__last { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.kt-conv__sub { font-size: .74rem; color: var(--navy-700); font-weight: 600; margin-top: 3px; }
.kt-thread { display: flex; flex-direction: column; }
.kt-thread__hd { padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-weight: 800; font-family: var(--font-display); display: flex; align-items: center; gap: 10px; }
.kt-thread__body { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 420px; background: var(--bg); }
.kt-bub { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size: .88rem; line-height: 1.4; }
.kt-bub.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.kt-bub.out { background: var(--navy-700); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.kt-thread__input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); }
.kt-thread__input input { flex: 1; border: 1.5px solid var(--line); border-radius: 11px; padding: .6rem .8rem; outline: none; }
.kt-thread__input input:focus { border-color: var(--navy-500); }
@media (max-width: 720px){ .kt-msgs { grid-template-columns: 1fr; } .kt-thread { display: none; } .kt-msgs.show-thread .kt-convs { display: none; } .kt-msgs.show-thread .kt-thread { display: flex; } }

/* Obserwowane / siatka */
.kt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px){ .kt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .kt-grid { grid-template-columns: 1fr; } }

/* Zapisane wyszukiwania */
.kt-saved { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 10px; background: #fff; }
.kt-saved__ic { width: 42px; height: 42px; border-radius: 11px; background: var(--navy-50); color: var(--navy-700); display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.kt-saved__t { font-weight: 700; font-size: .92rem; }
.kt-saved__m { font-size: .8rem; color: var(--muted); }
.kt-saved__act { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.kt-switch { position: relative; width: 42px; height: 24px; flex: none; }
.kt-switch input { opacity: 0; width: 0; height: 0; }
.kt-switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.kt-switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.kt-switch input:checked + span { background: var(--green-600); }
.kt-switch input:checked + span::before { transform: translateX(18px); }

/* Promowanie / pakiety */
.kt-pkgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px){ .kt-pkgs { grid-template-columns: 1fr; } }
.kt-pkg { border: 1.5px solid var(--line); border-radius: 16px; padding: 20px; text-align: center; position: relative; background: #fff; }
.kt-pkg.best { border-color: var(--orange-500); box-shadow: 0 10px 30px rgba(245,99,30,.12); }
.kt-pkg__tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--orange-500); color: #fff; font-size: .68rem; font-weight: 800; padding: .2rem .7rem; border-radius: 999px; text-transform: uppercase; }
.kt-pkg__n { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.kt-pkg__p { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; color: var(--navy-800); margin: 8px 0 2px; }
.kt-pkg__p small { font-size: .42em; color: var(--muted); font-weight: 700; }
.kt-pkg ul { list-style: none; padding: 0; margin: 14px 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.kt-pkg li { font-size: .85rem; color: var(--ink-2); display: flex; gap: 8px; }
.kt-pkg li i { color: var(--green-600); }

/* Ustawienia / formularze */
.kt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kt-form .full { grid-column: 1/-1; }
@media (max-width: 620px){ .kt-form { grid-template-columns: 1fr; } }

/* Faktury */
.kt-invoice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px; font-size: .88rem; }
.kt-invoice__ic { color: var(--navy-600); font-size: 1.3rem; }
.kt-invoice__sp { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.kt-paid { color: var(--green-600); font-weight: 700; font-size: .8rem; }

.kt-empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.kt-empty i { font-size: 2.4rem; color: var(--muted-2); }

@media (max-width: 900px){
  .kt-wrap { grid-template-columns: minmax(0, 1fr); }
  .kt-side { display: none; }
  .kt-mobnav { display: flex; }
}

/* ===== Strona firmowa — budowa etapami ===== */
.kt-biz { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm); }
.kt-biz__head { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.kt-biz__logo { width: 52px; height: 52px; border-radius: 13px; background: linear-gradient(135deg, var(--navy-600), var(--navy-900)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; flex: none; }
.kt-biz__id b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.kt-biz__id span { font-size: .8rem; color: var(--muted); }
.kt-biz__status { margin-left: auto; background: var(--gold-100); color: var(--gold-600); font-weight: 800; font-size: .74rem; border-radius: 999px; padding: .32rem .75rem; }
.kt-biz__bar { height: 9px; border-radius: 999px; background: var(--bg-2); margin: 16px 0 18px; overflow: hidden; }
.kt-biz__bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--orange-500), var(--gold-600)); transition: width .4s ease; }
.kt-biz__steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 7px; counter-reset: none; }
.kt-biz__steps li { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 13px; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.kt-biz__steps li b { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; background: var(--bg-2); color: var(--muted); }
.kt-biz__steps li span { flex: 1; }
.kt-biz__steps li i { font-size: 1.05rem; }
.kt-biz__steps li.done { border-color: #cdebd9; background: #f4fbf7; }
.kt-biz__steps li.done b { background: var(--green-600); color: #fff; }
.kt-biz__steps li.done i { color: var(--green-600); }
.kt-biz__steps li.progress { border-color: #f6d9bd; background: #fff9f3; }
.kt-biz__steps li.progress b { background: var(--orange-500); color: #fff; }
.kt-biz__steps li.progress i { color: var(--orange-500); }
.kt-biz__steps li.todo { opacity: .75; }
.kt-biz__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.kt-biz__stats { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); }
.kt-biz__stats b { color: var(--ink); font-family: var(--font-display); }

/* mobile: wiersz nie rozpycha strony */
.kt-listing { overflow: hidden; }
