:root {
  --ink: #0a1830;
  --muted: #647895;
  --line: #d9e6f5;
  --blue: #C1502E;
  --blue-dark: #973b21;
  --surface: #f5f8fd;
  --white: #fff;
  --success: #13784d;
  --error: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--surface); }
body { margin: 0; background: var(--surface); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 10%, rgba(38, 119, 233, .16), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(69, 149, 255, .13), transparent 28%),
    linear-gradient(135deg, #f8fbff, #eef5ff);
}

.auth-card {
  width: min(100%, 510px);
  padding: clamp(30px, 5vw, 52px);
  border: 1px solid rgba(45, 103, 181, .16);
  border-radius: 30px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 30px 90px rgba(24, 66, 125, .14);
  backdrop-filter: blur(18px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  color: #0b2448;
  font-weight: 850;
  letter-spacing: -.035em;
}

.admin-brand:before {
  content: "WK";
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  margin-right: 10px;
  border-radius: 11px;
  background: linear-gradient(145deg, #C1502E, #0E2340);
  color: #fff;
  box-shadow: 0 10px 25px rgba(23,107,234,.23);
}

.kicker {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15em;
}

.auth-card .kicker { margin-top: 45px; }
.auth-card h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 52px);
  line-height: .98;
  letter-spacing: -.055em;
}
.auth-lead { margin: 19px 0 30px; color: var(--muted); line-height: 1.7; }
.auth-card form { display: grid; gap: 15px; }
.auth-card label, .image-fields label {
  display: grid;
  gap: 8px;
}
.auth-card label > span, .image-fields label > span, .text-card > span {
  color: #526985;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .045em;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #fbfdff;
  color: var(--ink);
  transition: .22s;
}

select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #fbfdff;
  color: var(--ink);
  font: inherit;
}
input { min-height: 50px; padding: 0 15px; }
textarea { min-height: 105px; padding: 14px 15px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  border-color: #75acf2;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23,107,234,.08);
}

.auth-card button, .save-bar button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 19px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--blue), #398dff);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 15px 32px rgba(23,107,234,.24);
}

.alert {
  margin: 0 0 22px;
  padding: 14px 17px;
  border: 1px solid;
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.5;
}
.alert.success { border-color: #b9e6cf; background: #f0fbf5; color: var(--success); }
.alert.error { border-color: #f1c0bc; background: #fff4f2; color: var(--error); }

.admin-app { display: grid; grid-template-columns: 290px minmax(0,1fr); min-height: 100vh; }
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 27px 20px 21px;
  border-right: 1px solid rgba(130,167,216,.16);
  background:
    radial-gradient(circle at 20% 0, rgba(53,132,241,.2), transparent 28%),
    linear-gradient(160deg, #08182f, #0c2749);
  color: #fff;
}
.sidebar-caption {
  margin: 14px 0 30px 45px;
  color: #7190b8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .15em;
}
.admin-sidebar .admin-brand { color: #fff; }
.admin-sidebar nav { display: grid; gap: 5px; overflow: auto; padding-right: 3px; }
.admin-sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #9fb3ce;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  transition: .2s;
}
.admin-sidebar nav a i { color: #619cea; font-style: normal; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  border-color: rgba(122,176,245,.16);
  background: rgba(255,255,255,.07);
  color: #fff;
}
.logout-form { margin-top: auto; padding-top: 20px; }
.logout-form button {
  width: 100%;
  min-height: 43px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: transparent;
  color: #9db1cc;
  cursor: pointer;
}

.admin-main { min-width: 0; padding: clamp(26px, 4vw, 58px); }
.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 38px;
}
.admin-topbar h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
  letter-spacing: -.055em;
}
.preview-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid #bcd4f1;
  border-radius: 13px;
  background: #fff;
  color: #23568f;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 10px 25px rgba(31,76,139,.06);
}

.editor-toolbar {
  position: sticky;
  z-index: 20;
  top: 15px;
  display: grid;
  grid-template-columns: auto minmax(240px,1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  padding: 13px;
  border: 1px solid rgba(131,170,218,.25);
  border-radius: 18px;
  background: rgba(255,255,255,.91);
  box-shadow: 0 18px 42px rgba(31,76,139,.1);
  backdrop-filter: blur(18px);
}
.editor-stats { display: flex; gap: 13px; }
.editor-stats span {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f1f6fd;
  color: #60748f;
  font-size: 10px;
  white-space: nowrap;
}
.editor-stats b { color: var(--blue); }
.search-box { position: relative; display: block; }
.search-box span { position: absolute; top: 13px; left: 15px; color: #6f8caf; }
.search-box input { min-height: 44px; padding-left: 39px; }
.editor-tabs { display: flex; gap: 4px; }
.editor-tabs button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #60748f;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.editor-tabs button.active { background: #eaf3ff; color: var(--blue); }

.editor-form { display: grid; gap: 34px; }
.field-section, .history-section {
  padding: clamp(23px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(31,76,139,.055);
}
.section-heading { display: grid; max-width: 760px; margin-bottom: 26px; }
.section-heading h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.section-heading > p:not(.kicker) { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.text-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.field-card {
  border: 1px solid #dfebf7;
  border-radius: 16px;
  background: #fbfdff;
  transition: .2s;
}
.field-card:hover { border-color: #b7d1f1; box-shadow: 0 12px 28px rgba(31,76,139,.06); }
.field-card[hidden] { display: none !important; }
.text-card { display: grid; gap: 9px; padding: 15px; }
.text-card textarea, .text-card input { background: #fff; }
.image-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.image-card { display: grid; grid-template-columns: 180px minmax(0,1fr); overflow: hidden; }
.image-preview { min-height: 220px; border-right: 1px solid #dfebf7; background: #edf4fd; }
.image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-fields { display: grid; align-content: center; gap: 14px; padding: 20px; }
.image-fields h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.image-fields input[type=file] { min-height: auto; padding: 10px; font-size: 11px; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.check-row input { width: 17px; min-height: 17px; margin: 0; }

.save-bar {
  position: sticky;
  z-index: 19;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 15px 15px 15px 21px;
  border: 1px solid rgba(130,168,217,.3);
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 20px 50px rgba(20,58,110,.16);
  backdrop-filter: blur(18px);
}
.save-bar > div { display: grid; gap: 4px; }
.save-bar strong { font-size: 13px; }
.save-bar > div span { color: var(--muted); font-size: 10px; }
.save-bar button { flex: 0 0 auto; min-width: 210px; }
.history-section { margin-top: 34px; }
.history-list { display: grid; gap: 8px; }
.history-list form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 13px 11px 16px;
  border: 1px solid #e1ebf7;
  border-radius: 12px;
  background: #fbfdff;
}
.history-list span { color: #536b89; font-size: 12px; }
.history-list button {
  min-height: 35px;
  padding: 0 12px;
  border: 1px solid #c5d9f1;
  border-radius: 9px;
  background: #fff;
  color: #275a94;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.empty-state { color: var(--muted); font-size: 13px; }
.no-results { display: none; padding: 25px; text-align: center; color: var(--muted); }

.consent-admin__top-actions { display: flex; gap: 9px; }
.consent-admin__stats {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 13px;
  margin-bottom: 28px;
}
.consent-admin__stats article {
  display: grid;
  gap: 7px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(31,76,139,.05);
}
.consent-admin__stats span { color: #647895; font-size: 10px; font-weight: 750; }
.consent-admin__stats strong { color: #0c458a; font-size: 34px; line-height: 1; letter-spacing: -.04em; }
.consent-admin__stats small { color: #8292a8; font-size: 9px; }
.consent-admin__panel {
  margin-bottom: 28px;
  padding: clamp(23px,3vw,36px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(31,76,139,.055);
}
.consent-admin__filters {
  display: grid;
  grid-template-columns: minmax(240px,1.5fr) repeat(2,minmax(150px,.7fr)) minmax(190px,1fr) auto auto;
  align-items: end;
  gap: 10px;
}
.consent-admin__filters label { display: grid; gap: 7px; }
.consent-admin__filters label span { color: #526985; font-size: 9px; font-weight: 800; }
.consent-admin__filters button,
.consent-admin__filters > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 17px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.consent-admin__filters button { border: 0; background: var(--blue); color: #fff; }
.consent-admin__filters > a { border: 1px solid var(--line); background: #fff; color: #536b89; }
.consent-admin__table-wrap {
  overflow: auto;
  margin: 0 -12px -12px;
  padding: 0 12px 12px;
}
.consent-admin table {
  width: 100%;
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
}
.consent-admin th {
  padding: 11px 12px;
  border-bottom: 1px solid #dce7f4;
  color: #71839b;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
  text-align: left;
  text-transform: uppercase;
}
.consent-admin td {
  padding: 13px 12px;
  border-bottom: 1px solid #e7eef7;
  color: #536b89;
  font-size: 10px;
  line-height: 1.45;
  vertical-align: middle;
}
.consent-admin tbody tr:hover td { background: #f7faff; }
.consent-admin time { white-space: nowrap; }
.consent-admin__copy {
  display: block;
  max-width: 180px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #235d9f;
  font: 700 9px ui-monospace,SFMono-Regular,Consolas,monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.consent-admin__event {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 999px;
  background: #edf4fd;
  color: #376aab;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.consent-admin__event--consent_given { background: #eaf8f1; color: #16724c; }
.consent-admin__event--consent_withdrawn { background: #fff1ef; color: #a23b32; }
.consent-admin .is-yes,
.consent-admin .is-no {
  display: inline-flex;
  padding: 5px 7px;
  border-radius: 8px;
  font-size: 8px;
}
.consent-admin .is-yes { background: #eaf8f1; color: #16724c; }
.consent-admin .is-no { background: #f0f3f7; color: #687b94; }
.consent-admin__version { display: block; white-space: nowrap; }
.consent-admin__version--link { color: #2264af; font-weight: 750; }
.consent-admin__version--link:hover { text-decoration: underline; }
.consent-admin__path {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consent-admin__instruction ol {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 22px;
  color: #49617f;
  font-size: 12px;
  line-height: 1.6;
}
.consent-admin__instruction > p {
  margin: 21px 0 0;
  padding: 14px 16px;
  border-radius: 13px;
  background: #eef5fd;
  color: #536b89;
  font-size: 11px;
  line-height: 1.6;
}

@media(max-width:1180px) {
  .image-grid { grid-template-columns: 1fr; }
  .editor-toolbar { grid-template-columns: 1fr 1fr; }
  .editor-stats { grid-column: 1/-1; }
  .consent-admin__filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media(max-width:850px) {
  .admin-app { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .admin-sidebar nav { display: flex; overflow-x: auto; }
  .admin-sidebar nav a { min-width: 210px; }
  .logout-form { margin-top: 18px; }
  .admin-main { padding: 25px 18px 55px; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .editor-toolbar { position: relative; top: auto; grid-template-columns: 1fr; }
  .editor-stats { grid-column: auto; overflow-x: auto; }
  .text-grid { grid-template-columns: 1fr; }
  .save-bar { align-items: stretch; flex-direction: column; }
  .save-bar button { width: 100%; }
  .consent-admin__top-actions { width: 100%; }
  .consent-admin__top-actions .preview-link { flex: 1; justify-content: center; }
  .consent-admin__stats { grid-template-columns: 1fr; }
}

@media(max-width:560px) {
  .auth-shell { padding: 14px; }
  .auth-card { padding: 28px 21px; border-radius: 24px; }
  .field-section, .history-section { padding: 21px 15px; }
  .image-card { grid-template-columns: 1fr; }
  .image-preview { height: 230px; border-right: 0; border-bottom: 1px solid #dfebf7; }
  .editor-tabs { display: grid; grid-template-columns: repeat(3,1fr); }
  .consent-admin__filters { grid-template-columns: 1fr; }
  .consent-admin__top-actions { align-items: stretch; flex-direction: column; }
}

@media(prefers-reduced-motion:reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}

/* Elementy projektu WK */
.image-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}
.password-form label { display: grid; gap: 8px; }
.password-form label span { color: #526985; font-size: 10px; font-weight: 800; letter-spacing: .045em; }
.password-form button {
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
@media (max-width: 980px) {
  .password-form { grid-template-columns: 1fr; }
}
