/* Wyglad Insighto HUB. Zrodlo: makieta z artefaktu (ekran logowania + kafelki),
   rozszerzona o ekran ustawiania hasla i panel uzytkownikow.
   Akcent #eb4325 jest ten sam co INS_ACCENT w aplikacji desktopowej. */

/* Fonty (Roboto, Montserrat, Cousine) sa self-hosted — zaden zasob nie idzie
   do obcego serwera, a CSP nie musi wpuszczac fonts.gstatic.com.
   Regeneracja: node fetch_fonts.mjs */
@import url('/fonts/fonts.css');

:root {
  --surface: #ffffff;
  --surface-2: #fafafa;
  --hover: #f0f0f1;
  --ink: #3f3f3f;
  --muted: #808285;
  --line: #ededee;
  --line-strong: #dddddd;
  --accent: #eb4325;
  --accent-hover: #fd5b3d;
  --accent-soft: #fbe8e3;
  --warn: #b46a00;
  --warn-soft: #f8edd9;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 12px 30px rgba(0, 0, 0, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-2);
  color: var(--ink);
  font-family: 'Roboto', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 48px 20px 64px; }

/* ── logo ─────────────────────────────────────────────────────────────────── */

.brand-mark { display: flex; align-items: center; gap: 4px; }
.brand-mark img { height: 26px; width: auto; display: block; }
.brand-mark .hub-mark {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 22px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--accent);
}

/* ── gorny pasek ──────────────────────────────────────────────────────────── */

.hub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.user-menu { position: relative; }

.avatar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-strong); background: var(--accent); color: #fff;
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 12.5px;
  letter-spacing: .02em; cursor: pointer;
}
.avatar-btn:hover { border-color: var(--accent); filter: brightness(1.06); }

.avatar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 230px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; z-index: 20;
}
.avatar-dropdown[hidden] { display: none !important; }
.avatar-dropdown-name {
  font-weight: 500; font-size: 13.5px; padding: 8px 10px 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar-dropdown-mail {
  font-size: 12px; color: var(--muted); padding: 0 10px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avatar-dropdown-sep { height: 1px; background: var(--line); margin: 2px 0 4px; }
.avatar-dropdown-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; background: none; border: none; border-radius: 6px; padding: 8px 10px;
  font: inherit; font-size: 13px; color: var(--ink); cursor: not-allowed; opacity: .62;
  text-decoration: none;
}
.avatar-dropdown-item.active { cursor: pointer; opacity: 1; }
.avatar-dropdown-item.active:hover { background: var(--hover); }

/* ── kafelki ──────────────────────────────────────────────────────────────── */

.intro { margin-bottom: 34px; }
.intro h1 { font-size: 24px; margin-bottom: 8px; }
.intro p { max-width: 620px; color: var(--muted); font-size: 14.5px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }

.tile {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px; display: flex; flex-direction: column;
  gap: 10px; min-height: 168px; color: inherit;
}
a.tile { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }

.tile.soon { opacity: .62; }
.tile.soon:hover { transform: none; }
.tile.dragging { opacity: .4; }
.tile.drag-over { border-color: var(--accent); box-shadow: var(--shadow); }

.tile-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-family: 'Montserrat', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: .02em; color: #fff; background: var(--accent);
}
.tile.soon .tile-icon { background: var(--muted); }
.tile-name { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); }
.tile-desc { font-size: 13px; color: var(--muted); flex: 1 1 auto; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.tile-cta { color: var(--accent); font-weight: 500; }
a.tile:hover .tile-cta { color: var(--accent-hover); }

.badge-soon, .badge-draft {
  font-family: 'Cousine', ui-monospace, monospace; font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 9px;
}
.badge-soon { color: var(--muted); background: var(--hover); }
.badge-draft { color: var(--warn); background: var(--warn-soft); }

.empty-note {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; color: var(--muted); font-size: 13.5px;
}

footer.foot { margin-top: 40px; font-size: 12px; color: var(--muted); }

/* ── ekrany logowania i hasla ─────────────────────────────────────────────── */

.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); padding: 20px;
}
.login-card { width: 380px; max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.login-card .brand-mark { margin-bottom: 32px; }
.login-card .brand-mark img { height: 32px; }
.login-card .brand-mark .hub-mark { font-size: 28px; }

.login-box {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px; display: flex; flex-direction: column; gap: 16px;
}
.login-title { font-size: 16px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.login-sub { font-size: 13px; color: var(--muted); margin-top: -8px; }
.login-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-input, .field-input {
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 12px;
  font-size: 14px; color: var(--ink); background: var(--surface); width: 100%; font: inherit;
}
.login-input:focus, .field-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-btn {
  border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 6px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500; cursor: pointer; width: 100%;
  display: flex; justify-content: center; font-family: inherit;
}
.login-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.login-btn:disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--muted); cursor: not-allowed; }
.login-alt { font-size: 12.5px; text-align: center; }
.login-alt button {
  background: none; border: none; padding: 0; font: inherit; font-size: 12.5px;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}

.msg { font-size: 13px; border-radius: 6px; padding: 9px 12px; }
.msg[hidden] { display: none !important; }
.msg.error { color: #8a2612; background: var(--accent-soft); }
.msg.ok { color: #1f6b4a; background: #e4f3ec; }
.msg.info { color: var(--warn); background: var(--warn-soft); }

/* ── panel uzytkownikow ───────────────────────────────────────────────────── */

.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-head h1 { font-size: 22px; }
.panel-head p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  border-radius: 6px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.danger:hover { border-color: #b3261e; color: #b3261e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 18px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 500; }
.card-body { padding: 18px 20px; }

.users { width: 100%; border-collapse: collapse; font-size: 13px; }
.users th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.users td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.users tr:last-child td { border-bottom: none; }
.users .who { font-weight: 500; }
.users .who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

.mods { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mods label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; }
.mods label.off { color: var(--muted); }
.mods input { accent-color: var(--accent); }

.pill {
  font-family: 'Cousine', ui-monospace, monospace; font-size: 10.5px; letter-spacing: .05em;
  text-transform: uppercase; border-radius: 999px; padding: 3px 9px; white-space: nowrap;
}
.pill.active { color: #1f6b4a; background: #e4f3ec; }
.pill.invited { color: var(--warn); background: var(--warn-soft); }
.pill.disabled { color: var(--muted); background: var(--hover); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sel { border: 1px solid var(--line-strong); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12.5px; background: var(--surface); }

.add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.add-form .full { grid-column: 1 / -1; }
.add-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

@media (max-width: 720px) {
  .wrap { padding: 28px 16px 48px; }
  .users thead { display: none; }
  .users td { display: block; border-bottom: none; padding: 6px 14px; }
  .users tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
}
