/* SysuMC — panel licencji (wiele produktów)
   Paleta z makiety: rose / mauve / plum / maroon / blush, szkło (glassmorphism). */
:root {
  --rose: #d98890;
  --mauve: #c07399;
  --plum: #a1458e;
  --maroon: #6b1f1c;
  --blush: #f4d3d6;

  --ink: #3d1118;          /* tekst na jasnym szkle */
  --ink-2: #7c4250;        /* tekst drugorzędny */
  --ink-3: #a77482;        /* podpisy, placeholdery */
  --line: rgba(107, 31, 28, .12);

  --ok: #1f8a5b;
  --ok-bg: rgba(31, 138, 91, .12);
  --warn: #b86b0b;
  --warn-bg: rgba(214, 140, 30, .14);
  --bad: #c0303f;
  --bad-bg: rgba(192, 48, 63, .12);
  --off: #8a6c74;
  --off-bg: rgba(107, 31, 28, .07);

  --glass: rgba(255, 255, 255, .2);
  --glass-strong: rgba(255, 246, 247, .66);
  --glass-line: rgba(255, 255, 255, .55);
  --shadow: 0 24px 60px -24px rgba(107, 31, 28, .45);

  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --display: "Unbounded", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  background: #e3979f;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(161, 69, 142, .3); }

/* ---------- tło: piramidy jak na makiecie ---------- */
.scenery {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, #fbe6e8 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 110%, #b25a93 0%, transparent 60%),
    linear-gradient(165deg, #f3cfd2 0%, #e7a0a6 38%, #d98890 62%, #c07399 100%);
}
.scenery svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 78vh; display: block; }

/* ---------- ikony ---------- */
.ic { width: 20px; height: 20px; display: inline-block; flex: none; fill: currentColor; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }

/* ---------- rama aplikacji ---------- */
.frame {
  position: relative;
  max-width: 1360px;
  margin: 22px auto;
  min-height: calc(100vh - 44px);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,.12));
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  padding: 0 34px 34px;
}

/* ---------- górny pasek z wcięciem na logo ---------- */
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 78px;
}
.topbar .side { display: flex; align-items: center; gap: 8px; }
.topbar .side.right { justify-content: flex-end; }

.round-btn {
  width: 40px; height: 40px; border-radius: 999px; border: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: var(--maroon);
  box-shadow: 0 6px 16px -8px rgba(107,31,28,.5);
  transition: transform .15s ease, background .15s ease;
}
.round-btn:hover { transform: translateY(-1px); background: #fff; }

.nav-link {
  border: 0; background: transparent; color: #fff;
  font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 999px; text-decoration: none;
  opacity: .82; transition: opacity .15s, background .15s;
}
.nav-link:hover { opacity: 1; background: rgba(255,255,255,.14); }
.nav-link.active { opacity: 1; background: rgba(255,255,255,.24); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }

.notch {
  position: relative; align-self: start;
  margin-top: -1px;
  width: 170px; height: 58px;
  background: rgba(255,255,255,.94);
  border-radius: 0 0 26px 26px;
  display: grid; place-items: center;
  text-decoration: none;
}
.notch::before, .notch::after {
  content: ""; position: absolute; top: 0; width: 24px; height: 24px;
}
.notch::before { left: -24px; background: radial-gradient(circle at 0 100%, transparent 23.5px, rgba(255,255,255,.94) 24px); }
.notch::after { right: -24px; background: radial-gradient(circle at 100% 100%, transparent 23.5px, rgba(255,255,255,.94) 24px); }
.notch img { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; }
.notch .brand { display: flex; align-items: center; gap: 10px; }
.notch .brand b { font-family: var(--display); font-size: 12px; letter-spacing: .08em; color: var(--maroon); line-height: 1.1; }
.notch .brand b span { display: block; color: var(--plum); font-size: 9px; letter-spacing: .22em; }

.user-pill {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 6px 0 14px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.9); color: var(--maroon);
  font-weight: 700; font-size: 13px;
  box-shadow: 0 6px 16px -8px rgba(107,31,28,.5);
}
.user-pill .av { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--blush); }

.mobile-menu {
  display: none; position: absolute; top: 70px; left: 0; z-index: 30;
  min-width: 230px; padding: 8px; border-radius: var(--r-lg);
  background: rgba(255,248,249,.96); box-shadow: var(--shadow);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 700; color: var(--ink);
}
.mobile-menu a:hover, .mobile-menu a.active { background: rgba(161,69,142,.1); color: var(--plum); }

/* ---------- hero ---------- */
.hero {
  padding: 34px 6px 30px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.9);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: rgba(255,255,255,.8); }
.hero h1 {
  margin: 0; color: #fff;
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(38px, 6.2vw, 86px); line-height: .94; letter-spacing: -.01em;
  text-shadow: 0 10px 40px rgba(107,31,28,.18);
}
.hero h1 .soft { color: rgba(255,255,255,.7); display: block; }
.hero h1 sup {
  font-size: .26em; vertical-align: top; position: relative; top: .45em; margin-left: .3em;
  font-weight: 600; letter-spacing: .02em; color: #fff;
}
.hero p.lead { margin: 16px 0 0; color: rgba(255,255,255,.88); max-width: 46ch; font-size: 15px; line-height: 1.55; }


/* ---------- statystyki ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5);
  color: #fff;
}
.stat .chip {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,.92); color: var(--plum); margin-bottom: 14px;
}
.stat .num { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }
.stat .lbl { margin-top: 6px; font-size: 12.5px; font-weight: 600; opacity: .88; }
.stat .trend { position: absolute; top: 18px; right: 16px; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.22); }

/* ---------- arkusze (jasne szkło na dane) ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.sheet {
  background: var(--glass-strong);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--r-xl);
  box-shadow: 0 18px 50px -28px rgba(107,31,28,.5);
  padding: 22px;
  min-width: 0;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sheet-head h2 { margin: 0; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--maroon); }
.sheet-head .sub { color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin-top: 3px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--plum), #c2559f); color: #fff; box-shadow: 0 10px 24px -12px rgba(161,69,142,.9); }
.btn-primary:hover { box-shadow: 0 14px 28px -12px rgba(161,69,142,1); }
.btn-dark { background: var(--maroon); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.7); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: rgba(192,48,63,.2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 0; display: inline-grid; place-items: center;
  background: transparent; color: var(--ink-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(161,69,142,.1); color: var(--plum); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

/* ---------- pola ---------- */
.field { display: grid; gap: 7px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px; border-radius: var(--r-md);
  background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-3); transition: box-shadow .15s, background .15s;
}
.input:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--plum); color: var(--plum); }
.input input, .input select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 600; }
.input input::placeholder { color: var(--ink-3); font-weight: 500; }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; color: var(--ink); font-weight: 500; outline: 0; resize: vertical; border: 0; width: 100%; }

.search { height: 40px; border-radius: 999px; min-width: 240px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0;
  background: rgba(255,255,255,.6); color: var(--ink-2); font-weight: 700; font-size: 12.5px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.chip-btn .n { opacity: .55; margin-left: 4px; }
.chip-btn.on { background: var(--maroon); color: #fff; box-shadow: none; }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(107,31,28,.07); gap: 4px; }
.seg button { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.seg button.on { background: #fff; color: var(--plum); box-shadow: 0 4px 12px -6px rgba(107,31,28,.4); }

.stepper { display: inline-flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--line); }
.stepper button { width: 34px; height: 34px; border-radius: 999px; border: 0; background: #fff; color: var(--maroon); display: grid; place-items: center; box-shadow: 0 2px 6px -3px rgba(107,31,28,.5); }
.stepper output { min-width: 34px; text-align: center; font-family: var(--display); font-weight: 700; }

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0 4px; min-width: 860px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  padding: 6px 12px;
}
.tbl td { padding: 12px; background: rgba(255,255,255,.55); vertical-align: middle; }
.tbl td:first-child { border-radius: 14px 0 0 14px; }
.tbl td:last-child { border-radius: 0 14px 14px 0; }
.tbl tbody tr { cursor: pointer; transition: transform .12s ease; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.92); }
.tbl .actions { text-align: right; white-space: nowrap; }

.key {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; color: var(--maroon);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.owner { display: flex; align-items: center; gap: 10px; min-width: 0; }
.owner .av { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; flex: none; }
.owner b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--ink-3); font-weight: 600; }
.cell-2 b { display: block; font-weight: 700; }
.cell-2 small { color: var(--ink-3); font-weight: 600; font-size: 11.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill.active { color: var(--ok); background: var(--ok-bg); }
.pill.unused { color: var(--warn); background: var(--warn-bg); }
.pill.expired { color: var(--off); background: var(--off-bg); }
.pill.blocked { color: var(--bad); background: var(--bad-bg); }

.tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12.5px; }
.tag .ic { color: var(--plum); }

.empty { text-align: center; padding: 40px 10px; color: var(--ink-3); font-weight: 600; }
.empty .ic { width: 34px; height: 34px; color: var(--mauve); margin-bottom: 8px; }

/* ---------- aktywność ---------- */
.feed { display: grid; gap: 4px; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; }
.feed-item:hover { background: rgba(255,255,255,.6); }
.feed-item .dot { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; }
.feed-item .dot.ok { background: var(--ok-bg); color: var(--ok); }
.feed-item .dot.bad { background: var(--bad-bg); color: var(--bad); }
.feed-item .dot.info { background: rgba(161,69,142,.12); color: var(--plum); }
.feed-item b { font-weight: 700; }
.feed-item small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; margin-top: 2px; }
.feed-item time { color: var(--ink-3); font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* ---------- szuflada szczegółów ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(61,17,24,.28);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 41; top: 14px; right: 14px; bottom: 14px; width: min(460px, calc(100vw - 28px));
  border-radius: var(--r-xl); background: rgba(255,247,248,.97); box-shadow: -20px 0 60px -20px rgba(61,17,24,.45);
  transform: translateX(110%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer.open { transform: none; }
.drawer-head { padding: 22px 22px 18px; background: linear-gradient(135deg, var(--plum), var(--rose)); color: #fff; position: relative; }
.drawer-head .eyebrow { display: flex; margin-bottom: 8px; }
.drawer-head > .key { display: flex; padding-right: 40px; flex-wrap: wrap; }
.drawer-head .key { color: #fff; font-size: 15px; }
.drawer-head .close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.2); color: #fff; }
.drawer-head .close:hover { background: rgba(255,255,255,.34); color: #fff; }
.drawer-body { padding: 18px 22px 22px; overflow-y: auto; flex: 1; display: grid; gap: 18px; align-content: start; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv div { background: rgba(255,255,255,.75); border-radius: 14px; padding: 11px 13px; box-shadow: inset 0 0 0 1px var(--line); }
.kv small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.kv b { font-weight: 700; }
.section-title { font-family: var(--display); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--maroon); margin: 0 0 8px; }
.device { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--line); }
.device + .device { margin-top: 6px; }
.device .ic { color: var(--plum); }
.device .meta { flex: 1; min-width: 0; }
.device .meta b { display: block; font-weight: 700; }
.device .meta small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; z-index: 42; left: 50%; top: 50%; width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow-y: auto;
  transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
  border-radius: var(--r-xl); background: rgba(255,247,248,.98); box-shadow: 0 30px 80px -30px rgba(61,17,24,.6);
  padding: 26px;
}
.modal.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.modal h3 { margin: 0 0 4px; font-family: var(--display); font-size: 18px; text-transform: uppercase; color: var(--maroon); }
.modal .sub { color: var(--ink-3); font-weight: 600; margin: 0 0 20px; }
.modal .form { display: grid; gap: 16px; }
.modal .row-2 { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.days .input { height: 36px; width: 96px; border-radius: 999px; }

.keybox {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--plum), var(--rose)); color: #fff;
}
.keybox .key { color: #fff; font-size: 16px; }
.keybox .icon-btn { color: #fff; background: rgba(255,255,255,.2); }
.success-mark { width: 54px; height: 54px; border-radius: 999px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); margin-bottom: 14px; }

/* ---------- ustawienia ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings .sheet .form { display: grid; gap: 14px; }
.codebox { font-family: var(--mono); font-size: 12px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(107,31,28,.06); color: var(--maroon); word-break: break-all; line-height: 1.5; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(161,69,142,.08); color: var(--ink-2); font-weight: 600; font-size: 12.5px; line-height: 1.5; }
.note .ic { color: var(--plum); margin-top: 1px; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 12px; border-radius: 999px;
  background: var(--maroon); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 14px 30px -12px rgba(61,17,24,.7);
  animation: toast-in .25s ease;
}
.toast .ic { color: var(--blush); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.demo-flag {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.22); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}

.view { display: none; }
.view.on { display: block; animation: view-in .3s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- logowanie ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  position: relative; width: min(440px, 100%);
  padding: 74px 34px 30px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.18));
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}
.login-card .notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); }
.login-card h1 { margin: 0; text-align: center; color: #fff; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 30px; line-height: 1; }
.login-card h1 .soft { color: rgba(255,255,255,.62); display: block; }
.login-card p.lead { text-align: center; color: rgba(255,255,255,.9); margin: 12px 0 26px; font-weight: 600; }
.login-card form { display: grid; gap: 14px; }
.login-card .field > span { color: #fff; }
.login-card .input { background: rgba(255,255,255,.82); }
.login-card .err { display: none; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.85); color: var(--bad); font-weight: 700; font-size: 13px; }
.login-card .err.show { display: flex; }
.login-foot { text-align: center; color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- responsywność ---------- */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .frame { margin: 0; border-radius: 0; min-height: 100vh; padding: 0 16px 24px; border-left: 0; border-right: 0; }
  .topbar .nav-link { display: none; }
  .notch { width: 132px; }
  .notch .brand b { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 26px; }
  .settings { grid-template-columns: 1fr; }
  .user-pill .name { display: none; }
  .user-pill { padding: 0 5px; }
}
@media (max-width: 760px) {
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .num { font-size: 24px; }
  .stat .trend { display: none; }
  .sheet { padding: 16px; border-radius: var(--r-lg); }
  .search { min-width: 0; flex: 1; }
  .toolbar { width: 100%; }
  /* tabela -> karty */
  table.tbl { min-width: 0; border-spacing: 0; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { background: rgba(255,255,255,.6); border-radius: 16px; padding: 8px 4px; margin-bottom: 8px; }
  .tbl td { background: transparent !important; padding: 6px 10px; border-radius: 0 !important; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .tbl td::before { content: attr(data-l); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .tbl td.no-l::before { content: none; }
  .tbl .actions { justify-content: flex-end; }
  .table-wrap { margin: 0; }
  .kv, .drawer-actions { grid-template-columns: 1fr; }
  .modal .row-2 { grid-template-columns: 1fr; }
}

/* ---------- produkty ---------- */
.prod { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.prod i, .prod-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }
.prod-select { height: 40px; border-radius: 999px; padding-right: 10px; }
.prod-select select { cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 4px; }
.add-row { display: flex; gap: 8px; margin-top: 12px; }
.add-row .input { flex: 1; }
#prodList { display: grid; gap: 6px; }
#prodList .device + .device { margin-top: 0; }
#prodList .prod-dot { width: 14px; height: 14px; border-radius: 5px; }
@media (max-width: 760px) { .prod-select { flex: 1; } }
#prodList .meta small { font-family: var(--body); }

/* ---------- szuflada: zakładki i edycja ---------- */
.dtabs { display: flex; }
.dtabs button { flex: 1; justify-content: center; }
.edit-form { display: grid; gap: 16px; }
.edit-form .days { margin-top: 8px; }
.edit-form select { cursor: pointer; appearance: none; -webkit-appearance: none; }
.edit-form input[type=date] { cursor: pointer; }
.hint { margin: 10px 2px 0; color: var(--ink-3); font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.pill.disabled { color: #6d5a8a; background: rgba(109, 90, 138, .13); }

/* ---------- własna lista rozwijana ---------- */
.csel { position: relative; cursor: pointer; user-select: none; outline: none; }
.csel select.csel-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.csel-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.csel-label .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csel > svg.ic:last-of-type { transition: transform .2s ease; }
.csel.open > svg.ic:last-of-type { transform: rotate(180deg); }
.csel:focus-visible, .csel.open { background: #fff; box-shadow: inset 0 0 0 2px var(--plum); color: var(--plum); }
.csel-list {
  position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; min-width: 100%; max-height: 280px; overflow-y: auto;
  padding: 6px; border-radius: 18px; cursor: default;
  background: rgba(255, 250, 251, .98);
  box-shadow: 0 22px 50px -18px rgba(61, 17, 24, .55), 0 0 0 1px rgba(107, 31, 28, .08);
  animation: csel-in .16s ease;
}
@keyframes csel-in { from { opacity: 0; transform: translateY(-4px); } }
.csel-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; cursor: pointer; }
.csel-opt .t { flex: 1; }
.csel-opt.hl { background: rgba(161, 69, 142, .1); color: var(--plum); }
.csel-opt.on { font-weight: 800; color: var(--maroon); }
.csel-opt .ic { color: var(--plum); }
.csel-dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.prod-select { min-width: 220px; }

/* ---------- zarządzanie produktami ---------- */
.prod-row .meta b { display: flex; align-items: center; gap: 8px; }
.prod-row .meta small { font-family: var(--body); }
.prod-row.archived .prod-dot { opacity: .45; }
.prod-row.archived .meta b { color: var(--ink-2); }
.mini-badge { font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--off-bg); color: var(--off); text-transform: uppercase; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; max-width: 220px; }
.swatch { width: 26px; height: 26px; border-radius: 9px; border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--maroon); }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; }
.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: var(--r-md); background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.switch-row > span { flex: 1; }
.switch-row b { display: block; font-weight: 700; }
.switch-row small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11.5px; margin-top: 2px; line-height: 1.4; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: rgba(107,31,28,.18); position: relative; flex: none; transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 2px 6px rgba(61,17,24,.3); transition: transform .18s; }
.switch-row input:checked + .switch { background: var(--plum); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(161,69,142,.35); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* atrybut hidden ma wygrywać z display ustawionym w klasach (np. .demo-flag) */
[hidden] { display: none !important; }
