:root {
  --ink: #14222e;
  --ink-soft: #4a5d6b;
  --bg: #eef3f4;
  --card: #ffffff;
  --teal: #0e7c7b;
  --teal-deep: #0a5958;
  --teal-pale: #e2f1f0;
  --amber: #b96a12;
  --amber-pale: #fdf1e0;
  --red: #b3382e;
  --red-pale: #fbe9e7;
  --line: #d6e0e2;
  --radius: 10px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--body); color: var(--ink);
  background: var(--bg); font-size: 15px; line-height: 1.55;
  display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; }
a { color: var(--teal-deep); }

/* --- pasek górny --- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem 1.4rem; background: var(--card);
  border-bottom: 2px solid var(--teal); flex-wrap: wrap;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.brand-mark { color: #fff; background: var(--teal); border-radius: 8px;
  width: 1.7rem; height: 1.7rem; display: grid; place-items: center; font-size: 1rem; }
.brand-plus { color: var(--teal); }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.topbar nav a:hover { color: var(--teal-deep); }
.nav-user { color: var(--ink); font-weight: 600; padding-left: .6rem;
  border-left: 1px solid var(--line); }

.topbar nav a.btn-primary{color:white;}
.topbar nav a.btn-primary:hover{background: var(--teal-deep);}
.container { width: min(1060px, 100% - 2.4rem); margin: 1.6rem auto; flex: 1; }
.footer { padding: 1rem 1.4rem; color: var(--ink-soft); font-size: .85rem;
  display: flex; gap: 1.4rem; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* --- przyciski / formularze --- */
.btn { display: inline-block; padding: .5rem 1rem; border-radius: var(--radius);
  border: 1px solid transparent; font: 600 .92rem var(--body); cursor: pointer;
  text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); background: transparent; }
.btn-danger { background: var(--red-pale); color: var(--red); }
.btn-sm { padding: .25rem .65rem; font-size: .82rem; }

label { display: block; font-weight: 600; font-size: .86rem; margin: .8rem 0 .25rem; }
input, select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: var(--radius); font: 400 .95rem var(--body); background: #fff;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 1px;
}
.hint { font-size: .8rem; color: var(--ink-soft); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400;
  font-size: .87rem; margin: .7rem 0; }
.check input { width: auto; margin-top: .2rem; }

/* --- karty --- */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1.1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--teal-deep); margin-bottom: .3rem; }
.muted { color: var(--ink-soft); }
.stat { font-family: var(--display); font-size: 2rem; font-weight: 700; }

/* --- tabele --- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft); padding: .45rem .6rem;
  border-bottom: 2px solid var(--line); }
td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }

/* --- statusy --- */
.tag { display: inline-block; padding: .1rem .55rem; border-radius: 99px;
  font-size: .76rem; font-weight: 600; }
.tag-ok { background: var(--teal-pale); color: var(--teal-deep); }
.tag-warn { background: var(--amber-pale); color: var(--amber); }
.tag-off { background: #e8ecee; color: var(--ink-soft); }
.tag-err { background: var(--red-pale); color: var(--red); }

/* --- komunikaty --- */
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--teal-pale); color: var(--teal-deep); border-color: #bcdedd; }
.flash-error { background: var(--red-pale); color: var(--red); border-color: #f0c8c4; }
.flash-warn { background: var(--amber-pale); color: var(--amber); border-color: #f1dab4; }

/* --- e-recepta: bilet z kodem (element charakterystyczny) --- */
.rx-ticket { display: flex; gap: 0; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  margin-bottom: 1rem; }
.rx-body { padding: 1rem 1.2rem; flex: 1; }
.rx-code { background: var(--teal-pale); border-left: 2px dashed var(--teal);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 1rem 1.4rem; min-width: 130px; }
.rx-code .code { font-family: var(--display); font-size: 1.9rem; font-weight: 700;
  letter-spacing: .12em; color: var(--teal-deep); }
.rx-code .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--teal-deep); }

/* --- czat --- */
.chat-box { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column;
  height: 62vh; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex;
  flex-direction: column; gap: .5rem; }
.msg { max-width: 72%; padding: .5rem .8rem; border-radius: 14px; font-size: .93rem; }
.msg .meta { font-size: .7rem; color: var(--ink-soft); margin-bottom: .1rem; }
.msg-them { background: var(--bg); border: 1px solid var(--line);
  align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-me { background: var(--teal); color: #fff; align-self: flex-end;
  border-bottom-right-radius: 4px; }
.msg-me .meta { color: #d4ecec; }
.chat-input { display: flex; gap: .6rem; padding: .8rem; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }

/* --- asystent głosowy --- */
.voice-orb { width: 130px; height: 130px; border-radius: 50%; margin: 1.5rem auto;
  background: radial-gradient(circle at 35% 30%, #34a3a2, var(--teal-deep));
  display: grid; place-items: center; color: #fff; font-size: 2.4rem;
  cursor: pointer; border: none; }
.voice-orb.listening { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(14,124,123,.45); }
  50% { box-shadow: 0 0 0 22px rgba(14,124,123,0); } }
@media (prefers-reduced-motion: reduce) { .voice-orb.listening { animation: none; } }

/* --- landing --- */
.hero { padding: 3rem 0 2rem; max-width: 640px; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; }
.hero .lede { font-size: 1.05rem; color: var(--ink-soft); margin: .8rem 0 1.4rem; }

.disclaimer { font-size: .8rem; color: var(--ink-soft); background: var(--amber-pale);
  border: 1px solid #f1dab4; border-radius: var(--radius); padding: .6rem .9rem; }

@media (max-width: 640px) {
  .topbar { padding: .6rem .9rem; }
  .msg { max-width: 88%; }
  .hero h1 { font-size: 1.8rem; }
}
