/* Powłoka panelu GM (wzorzec Marketing OS). Kolory wyłącznie jako zmienne; klasy paska z prefiksem mt-. Zero inline (CSP). */

:root {
  --mt-bg: #f4f5f7;
  --mt-surface: #ffffff;
  --mt-surface-2: #eceef2;
  --mt-text: #16181d;
  --mt-muted: #6b7280;
  --mt-border: #d9dce3;
  --mt-accent: #d6232a;
  --mt-accent-text: #ffffff;
  --mt-danger: #b91c1c;
  --mt-danger-bg: #fdecec;
  --mt-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --mt-radius: 10px;
  --mt-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --mt-bg: #121419;
  --mt-surface: #1b1e25;
  --mt-surface-2: #242831;
  --mt-text: #eceef2;
  --mt-muted: #9aa1ad;
  --mt-border: #2f3440;
  --mt-accent: #ef4a50;
  --mt-accent-text: #ffffff;
  --mt-danger: #f87171;
  --mt-danger-bg: #3a1d1d;
  --mt-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--mt-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--mt-text);
  background: var(--mt-bg);
}

a { color: inherit; }

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

.mt-muted { color: var(--mt-muted); }

/* Ekrany pulpitu: widoczny tylko ten, którego data-for == body[data-screen] */
.mt-screen { display: none; }
body[data-screen="start"] .mt-screen[data-for="start"],
body[data-screen="logowanie"] .mt-screen[data-for="logowanie"],
body[data-screen="pulpit"] .mt-screen[data-for="pulpit"] { display: block; }

.mt-main { padding: 0 16px 48px; }

.mt-center {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mt-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--mt-accent);
  color: var(--mt-accent-text);
  font-weight: 700;
  letter-spacing: .02em;
  display: grid;
  place-items: center;
}

/* Pasek */
.mos-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  background: var(--mt-surface);
  border-bottom: 1px solid var(--mt-border);
}

.mos-top[hidden] { display: none; }

.mt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.mt-brand .mt-logo { width: 28px; height: 28px; border-radius: 8px; font-size: .8rem; }

.mt-tools {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.mt-tools a {
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--mt-muted);
}

.mt-tools a:hover { background: var(--mt-surface-2); color: var(--mt-text); }
.mt-tools a[aria-current="page"] { background: var(--mt-surface-2); color: var(--mt-text); font-weight: 600; }

.mt-spacer { flex: 1; }

.mt-date { color: var(--mt-muted); font-size: .9rem; }

.mt-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mt-surface-2);
  border: 1px solid var(--mt-border);
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 600;
}

/* Przyciski i pola */
.mt-btn {
  font: inherit;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  color: var(--mt-text);
  cursor: pointer;
}

.mt-btn:hover { background: var(--mt-surface-2); }
.mt-btn:disabled { opacity: .6; cursor: default; }
.mt-btn--primary { background: var(--mt-accent); border-color: var(--mt-accent); color: var(--mt-accent-text); }
.mt-btn--primary:hover { filter: brightness(.95); background: var(--mt-accent); }
.mt-btn--ghost { border-color: transparent; background: transparent; }
.mt-btn--icon { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; }

.mt-field { display: block; margin-bottom: 14px; }
.mt-field > span { display: block; font-size: .85rem; color: var(--mt-muted); margin-bottom: 4px; }

.mt-field input {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--mt-border);
  background: var(--mt-surface);
  color: var(--mt-text);
}

.mt-field input:focus { outline: 2px solid var(--mt-accent); outline-offset: 1px; border-color: transparent; }

.mt-error {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--mt-danger-bg);
  color: var(--mt-danger);
  font-size: .9rem;
}

.mt-error[hidden] { display: none; }

/* Karta logowania */
.mt-card {
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  box-shadow: var(--mt-shadow);
  padding: 24px;
}

.mt-login {
  max-width: 380px;
  margin: 12vh auto 0;
}

.mt-login .mt-logo { margin-bottom: 12px; }
.mt-login h1 { font-size: 1.25rem; margin-bottom: 18px; }
.mt-login .mt-btn { width: 100%; margin-top: 4px; }

/* Pulpit */
.mt-page { max-width: 960px; margin: 24px auto 0; }

.mt-page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.mt-tile {
  display: block;
  padding: 18px;
  background: var(--mt-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}

.mt-tile:hover { box-shadow: var(--mt-shadow); transform: translateY(-1px); }
.mt-tile h2 { margin-bottom: 4px; }
.mt-tile p { margin: 0; color: var(--mt-muted); font-size: .9rem; }
.mt-tile--wkrotce { opacity: .55; pointer-events: none; }
.mt-tile--wkrotce h2::after { content: "wkrótce"; margin-left: 8px; font-size: .7rem; font-weight: 500; color: var(--mt-muted); text-transform: uppercase; }

.mt-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--mt-accent);
  color: var(--mt-accent-text);
  font-size: .7rem;
  font-weight: 600;
}

.mt-badge[hidden] { display: none; }

/* Co nowego */
.mt-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  background: var(--mt-surface);
  color: var(--mt-text);
  box-shadow: var(--mt-shadow);
}

.mt-dialog::backdrop { background: rgba(0, 0, 0, .4); }

.mt-dialog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.mt-dialog h3 { font-size: .85rem; color: var(--mt-muted); margin: 14px 0 4px; }
.mt-dialog ul { margin: 0; padding-left: 18px; }

@media (max-width: 640px) {
  .mt-tools { display: none; }
  .mt-date { display: none; }
}
