/* KronoGYM – identyfikacja wizualna Kronospan (Brand Book v9.0): niebieski #005DAA, Arial */
:root {
  --blue: #005DAA;
  --navy: #05377B;
  --sky: #00A3E0;
  --tint: #E6EFF8;
  --bg: #F2F5F9;
  --ink: #1A1A1A;
  --muted: #5B6573;
  --line: #D6DEE8;
  --ok: #1E8E3E;
  --warn: #B26A00;
  --err: #C62828;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(5, 55, 123, .08), 0 4px 14px rgba(5, 55, 123, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- nagłówek ---------- */
.topbar { background: var(--blue); color: #fff; }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand img { height: 30px; display: block; }
.brand .app-name { font-weight: 700; font-size: 17px; letter-spacing: .5px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.45); line-height: 1.1; }
.brand .app-name small { display: block; font-weight: 400; font-size: 11.5px; opacity: .85; letter-spacing: 0; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.topnav a, .topnav button { color: #fff; text-decoration: none; background: transparent; border: 1px solid transparent; padding: 7px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.topnav a:hover, .topnav button:hover { background: rgba(255,255,255,.12); }
.topnav a.active { background: rgba(255,255,255,.18); }
.topnav .btn-login { border-color: rgba(255,255,255,.7); }
.user-chip { font-size: 13px; opacity: .9; padding: 0 6px; }
.stripe { height: 4px; background: linear-gradient(90deg, var(--navy), var(--blue) 40%, var(--sky)); }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
footer { background: var(--navy); color: #cfe0f3; font-size: 12.5px; }
footer .inner { max-width: 1180px; margin: 0 auto; padding: 16px 20px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer a { color: #fff; }
footer img { height: 18px; opacity: .95; }

h1 { font-size: 24px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 19px; margin: 26px 0 12px; color: var(--navy); }
h3 { font-size: 16px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 18px; }

/* ---------- przyciski / formularze ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 9px 16px; border-radius: 6px; font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--navy); border-color: var(--navy); }
.btn:disabled { background: #9DB3CB; border-color: #9DB3CB; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--blue); }
.btn.secondary:hover { background: var(--tint); }
.btn.danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: #FDECEC; }
.btn.small { padding: 5px 10px; font-size: 13px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--tint); }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=email], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); font-weight: 400; cursor: pointer; padding: 12px; background: var(--tint); border-radius: 6px; border: 1px solid #C9DAEE; }
.check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--blue); }

/* ---------- karty / komunikaty ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.alert { padding: 12px 14px; border-radius: 6px; margin: 0 0 16px; font-size: 14px; border-left: 4px solid; }
.alert.info { background: var(--tint); border-color: var(--blue); }
.alert.warn { background: #FFF6E5; border-color: var(--warn); }
.alert.err { background: #FDECEC; border-color: var(--err); }
.alert.ok { background: #E8F5EC; border-color: var(--ok); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tint); color: var(--navy); white-space: nowrap; }
.badge.ok { background: #E3F3E7; color: var(--ok); }
.badge.warn { background: #FFF1D6; color: var(--warn); }
.badge.err { background: #FDE2E2; color: var(--err); }
.badge.grey { background: #EEF1F4; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- kalendarz ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar .range { font-weight: 700; font-size: 17px; color: var(--navy); min-width: 220px; text-align: center; }
.cal-toolbar .nav-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; color: var(--blue); }
.cal-toolbar .nav-btn:hover { background: var(--tint); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip.on { border-color: var(--blue); background: var(--tint); font-weight: 700; }
.week { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 10px; }
.day { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); min-height: 170px; display: flex; flex-direction: column; overflow: hidden; }
.day-head { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.day-head .dname { font-weight: 700; text-transform: capitalize; color: var(--navy); }
.day-head .ddate { font-size: 13px; color: var(--muted); }
.day.today .day-head { background: var(--blue); }
.day.today .day-head .dname, .day.today .day-head .ddate { color: #fff; }
.day-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.day-empty { color: #A7B1BD; font-size: 13px; text-align: center; margin: auto 0; }
.session { border: 1px solid var(--line); border-left: 5px solid var(--c, var(--blue)); border-radius: 6px; padding: 10px 11px; cursor: pointer; background: #fff; text-align: left; width: 100%; font: inherit; color: inherit; transition: box-shadow .15s, transform .05s; }
.session:hover { box-shadow: 0 2px 10px rgba(0, 93, 170, .15); }
.session:active { transform: translateY(1px); }
.session .s-time { font-size: 13px; color: var(--muted); }
.session .s-name { font-weight: 700; font-size: 15px; margin: 2px 0 6px; letter-spacing: .3px; }
.session .bar { height: 5px; background: #E9EEF4; border-radius: 3px; overflow: hidden; margin: 6px 0 6px; }
.session .bar > i { display: block; height: 100%; background: var(--c, var(--blue)); }
.session .s-meta { font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; align-items: center; flex-wrap: wrap; }
.session.cancelled { opacity: .65; border-left-color: #999; }
.session.cancelled .s-name { text-decoration: line-through; }
.session.past { opacity: .55; }
.session.mine { background: #F3F8FD; border-color: #B8D0EA; }
.legend { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.legend .card { padding: 14px 16px; font-size: 13.5px; }
.legend strong { color: var(--navy); }

/* ---------- okno modalne ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 25, 55, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 10px; max-width: 520px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 4px solid var(--c, var(--blue)); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 20px; color: var(--navy); letter-spacing: .4px; }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- logowanie ---------- */
.auth-wrap { max-width: 420px; margin: 20px auto; }
.auth-wrap .card { padding: 26px; }
.auth-logo { text-align: center; margin-bottom: 16px; }
.auth-logo img { height: 48px; }
.phone-input { display: flex; }
.phone-input span { padding: 9px 11px; background: var(--tint); border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; font-weight: 700; color: var(--navy); }
.phone-input input { border-radius: 0 6px 6px 0; }
.code-input { font-size: 26px !important; letter-spacing: 10px; text-align: center; font-weight: 700; }

/* ---------- listy / tabele ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; align-items: center; gap: 14px; border-left: 5px solid var(--c, var(--blue)); flex-wrap: wrap; }
.item .when { min-width: 92px; text-align: center; }
.item .when .d { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1; }
.item .when .m { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.item .what { flex: 1; min-width: 160px; }
.item .what strong { font-size: 16px; letter-spacing: .3px; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.tbl th { text-align: left; background: var(--tint); color: var(--navy); font-weight: 700; padding: 9px 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid #C9DAEE; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #EDF1F5; vertical-align: middle; }
.tbl tr:hover td { background: #FAFCFE; }
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 14px; max-width: 92vw; animation: tin .2s ease-out; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- regulamin ---------- */
.doc { max-width: 820px; margin: 0 auto; }
.doc .card { padding: 30px 34px; }
.doc h1 { text-align: center; font-size: 20px; margin-bottom: 6px; }
.doc ol { padding-left: 22px; }
.doc ol ol { list-style: decimal; margin: 6px 0 12px; }
.doc li { margin: 4px 0; }
.doc .version { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 13px; }

/* ---------- panel admina ---------- */
.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 2px solid var(--line); }
.adm-tabs button { background: none; border: 0; padding: 10px 14px; font-size: 14.5px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; }
.adm-tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 4px solid var(--blue); }
.kpi .v { font-size: 28px; font-weight: 700; color: var(--navy); }
.kpi .l { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.att { display: inline-flex; gap: 4px; }
.att button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: 13px; }
.att button.on-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.att button.on-err { background: var(--err); border-color: var(--err); color: #fff; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.dropzone { border: 2px dashed #9FBCDD; border-radius: var(--radius); padding: 28px; text-align: center; background: #fff; cursor: pointer; }
.dropzone.over { background: var(--tint); border-color: var(--blue); }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day.no-sessions { display: none; }
  .chips { margin-left: 0; width: 100%; }
  .cal-toolbar .range { flex: 1; min-width: 0; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .brand img { height: 24px; }
  .brand .app-name { font-size: 15px; padding-left: 10px; }
  .brand .app-name small { display: none; }
  .topnav { width: 100%; justify-content: flex-start; margin-left: 0; }
  .topnav a, .topnav button { padding: 6px 9px; font-size: 13.5px; }
  main { padding: 16px 12px 30px; }
  h1 { font-size: 21px; }
  .doc .card { padding: 20px 18px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
}
@media print {
  .topbar, .stripe, footer, .no-print, .adm-tabs { display: none !important; }
  body { background: #fff; }
  .card, .tbl-wrap { box-shadow: none; }
}

/* ---------- ogłoszenia, statystyka, siłownia ---------- */
.announce { white-space: pre-line; }
.announce b:first-child { display: block; margin-bottom: 2px; }
.session .s-note { font-size: 12px; color: var(--warn); margin: -2px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-stats { margin: 0 0 6px; }
.my-stats .kpi .l { text-transform: none; letter-spacing: 0; }
.my-stats .types { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.gym-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.doc-text { white-space: pre-line; line-height: 1.5; }
.gym-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.gym-photos img, .gym-photos a img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.gym-photos a { position: relative; }
.req { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-left: 5px solid var(--blue); }
.req.done { border-left-color: var(--ok); }
.req .req-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.req .reply { margin-top: 10px; padding: 10px 12px; background: var(--tint); border-radius: 6px; font-size: 14px; }
.req .body { white-space: pre-line; margin: 6px 0; font-size: 14px; }
.note-chip { display: inline-block; font-size: 11.5px; background: #FFF6E5; color: var(--warn); border-radius: 4px; padding: 1px 6px; margin-left: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
@media (max-width: 900px) { .gym-grid { grid-template-columns: 1fr; } }

/* ---------- PWA ---------- */
.btn-install { border-color: rgba(255,255,255,.7) !important; font-weight: 700; }
.ios-steps { padding-left: 20px; }
.ios-steps li { margin: 8px 0; }
.ios-icon { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: var(--blue); font-weight: 700; }
@media (display-mode: standalone) {
  /* zainstalowana aplikacja: pasek nagłówka pod wycięciem ekranu (iPhone) */
  .topbar { padding-top: env(safe-area-inset-top); }
  footer { padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- widok miesiąca ---------- */
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.view-switch button { border: 0; background: transparent; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--navy); }
.view-switch button.on { background: var(--blue); color: #fff; }
.m-grid { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 6px; }
.m-wd { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 0 4px 2px; }
.m-day { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.m-day.other { background: transparent; box-shadow: none; border: 1px dashed var(--line); }
.m-day.other .m-num { color: #B4BEC9; }
.m-day.past:not(.other) { background: #F7F9FB; }
.m-num { font-size: 13px; font-weight: 700; color: var(--navy); line-height: 1; }
.m-day.today .m-num { display: inline-block; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; text-align: center; line-height: 24px; }
.m-sess { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--blue)); border-radius: 5px; background: #fff; padding: 4px 6px; font: inherit; font-size: 12px; color: inherit; cursor: pointer; line-height: 1.3; }
.m-sess:hover { box-shadow: 0 2px 8px rgba(0, 93, 170, .15); }
.m-sess .m-t { color: var(--muted); }
.m-sess .m-n { font-weight: 700; letter-spacing: .2px; }
.m-sess .m-i { display: block; margin-top: 3px; font-size: 10.5px; padding: 1px 6px; white-space: normal; }
.m-sess.cancelled { opacity: .6; border-left-color: #999; }
.m-sess.cancelled .m-n { text-decoration: line-through; }
.m-sess.past { opacity: .6; }
.m-sess.mine { border-color: var(--blue); background: var(--tint); }
.m-list { display: none; }
@media (max-width: 900px) {
  .m-grid { display: none; }
  .m-list { display: grid; gap: 10px; }
  .view-switch { order: 5; }
}

/* ---------- powiadomienia push, ogłoszenia siłowni ---------- */
.push-box { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--tint); border-radius: 6px; margin-bottom: 12px; }
.push-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.news h3 { margin-top: 0; }
.news-item { padding: 10px 0; border-top: 1px solid var(--line); }
.news-item:first-of-type { border-top: 0; }
.news-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
