
* { box-sizing: border-box; margin: 0; }
:root {
  /* Design tokeny instalacji (branding G-Digital) */
  --brand: #2A47D1; --brand-hover: #243BB0;
  --brand-tint: #EEF2FF; --brand-border: rgba(42, 71, 209, 0.15);
  /* jasna powłoka marki (2026-07): sidebar biały jak strona www, nie granatowy */
  --sidebar: #ffffff; --sidebar-2: #F1F5F9;
  --bg: #F4F5F7; --card: #ffffff; --border: #E2E8F0;
  --text: #0F172A; --muted: #64748B;
  --ok: #16A34A; --ok-bg: #F0FDF4;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --err: #DC2626; --err-bg: #FEF2F2;
}
body {
  font-family: 'Mundial', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
}
h1, h2, h3, .title { font-family: 'Eurostile', 'Mundial', sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--err); font-size: 14px; }
code { background: var(--brand-tint); color: var(--brand); padding: 2px 6px; border-radius: 6px; font-size: 13px; }


/* ---------- layout ---------- */
/* 56px zarezerwowane po prawej na pasek Unified Shell (gd-shell) — bez tego
   prawa krawędź treści (np. kolumna akcji w tabelach) chowa się pod railем. */
.app-layout { display: flex; height: 100vh; overflow: hidden; padding-right: 56px; }
main { flex: 1; overflow-y: auto; padding: 32px; }
main > section { max-width: 1060px; margin: 0 auto; }
#view-stopki { max-width: none; height: 100%; }

/* ---------- sidebar ---------- */

/* awatary użytkowników (zdjęcie z Google albo inicjały) */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; background: var(--brand-tint); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.nav-section { margin-bottom: 18px; }
.gd-nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- przyciski / formularze ---------- */
button.primary { background: var(--brand); color: #fff; border: none; border-radius: 14px;
  padding: 11px 20px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all .2s; box-shadow: 0 8px 24px rgba(42,71,209,.20); }
button.primary:hover { background: var(--brand-hover); transform: translateY(-1px); }
button.primary:disabled { opacity: .55; cursor: default; transform: none; }
button.ghost { background: transparent; border: 1.5px solid var(--brand); border-radius: 12px;
  padding: 8px 16px; font-size: 13px; font-family: inherit; cursor: pointer; color: var(--brand); transition: all .2s; }
button.ghost:hover { background: var(--brand); color: #fff; }

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

/* ---------- karty i listy ---------- */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 18px 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03); transition: box-shadow .2s; }
.row { display: flex; align-items: center; gap: 16px; }
.row .grow { flex: 1; min-width: 0; }
.title { font-weight: 700; font-size: 15px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.pill { border-radius: 999px; padding: 4px 13px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #BBF7D0; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #FDE68A; }
.pill.err { background: var(--err-bg); color: var(--err); border: 1px solid #FECACA; }
.pill.neutral { background: var(--brand-tint); color: var(--brand); border: 1px solid var(--brand-border); }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #CBD5E1; border-radius: 26px; transition: background .15s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.members { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 9px; }
.member-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.link-btn { background: none; border: none; color: var(--brand); font-size: 13px; cursor: pointer;
  padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- moduł stopek (iframe) / placeholder kontaktów ---------- */
#stopki-frame, #kontakty-frame { width: 100%; height: calc(100vh - 64px); border: 1px solid var(--border);
  border-radius: 20px; background: #fff; }
.empty-module { text-align: center; padding: 64px 32px; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--brand-tint);
  color: var(--brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.empty-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.empty-module .title { font-size: 19px; margin-bottom: 6px; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #0F172A;
  color: #fff; padding: 13px 24px; border-radius: 14px; font-size: 14px;
  box-shadow: 0 10px 40px rgba(15,23,42,.35); z-index: 10; max-width: 90vw; }

/* ---------- Moduł 0: konsola zespołu (siatka kolumnowa) ---------- */
/* stałe kolumny = skanowanie listy w pionie; puste wartości pokazują "—" */
/* Kolumny: Osoba | Stanowisko | Dział | Telefony | Grupy | Sync grup | Akcje.
   Dział wydzielony ze stanowiska, telefony w dwóch wierszach (służbowy +
   komórkowy) — brakujący numer zostaje jako kreska, żeby luki były widoczne. */
.user-grid { display: grid;
  grid-template-columns: minmax(160px, 1fr) 132px 104px 118px 60px 94px 172px;
  gap: 8px; align-items: center; }
/* Na węższych ekranach dział i sync ustępują miejsca — dane pozostają
   dostępne w modalu profilu, a wiersz nie ucieka poza kartę. */
@media (max-width: 1180px) {
  .user-grid { grid-template-columns: minmax(140px, 1fr) 116px 104px 84px 170px; }
  .user-grid > .dept-cell, .user-grid > .sync-cell,
  .user-cols > :nth-child(3), .user-cols > :nth-child(6) { display: none; }
}
.phone-line { display: block; line-height: 1.45; white-space: nowrap; }
.user-cell button.link-btn { line-height: 1.35; }

/* Modal profilu pracownika (stanowisko, dział, telefony) */
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.profile-fields label { display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--muted); }
.profile-fields input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 400; color: var(--text); background: #fff; }
.profile-fields input:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
@media (max-width: 720px) { .profile-fields { grid-template-columns: 1fr; } }
.user-cols { padding: 2px 22px; font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); }
.user-cell-empty { color: #CBD5E1; }
.user-cell button.link-btn { text-align: left; }
.user-actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }

/* ---------- Moduł 0: konsola zespołu ---------- */
.section-heading { font-size: 17px; margin: 28px 0 6px; display: flex; align-items: center; gap: 10px; }
.card.guest { border-left: 3px solid #F59E0B; }
.card.guest .avatar { background: var(--warn-bg); color: var(--warn); }
.pill.role { background: #F1F5F9; color: #475569; border: 1px solid var(--border); }

/* modal uprawnień */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 26px;
  width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
.modal .modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); }
.perm-row .perm-name { flex: 1; font-weight: 600; font-size: 14px; }
.perm-row .perm-name .sub { font-weight: 400; }
.perm-row select { border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px;
  font: inherit; font-size: 13px; background: #fff; }
.perm-row select:disabled { opacity: .55; }

/* ---------- Moduł 0: edytor zdjęcia (kadr miniaturki) ---------- */
.photo-modal { max-width: 560px; }
.crop-stage { max-width: 100%; border-radius: 14px; overflow: hidden; background: #F1F5F9;
  min-height: 120px; text-align: center; }
.crop-stage.muted { padding: 40px 24px; }
.crop-wrap { position: relative; display: inline-block; line-height: 0; }
/* UWAGA: max-width w px, nie %: procent wewnątrz inline-block (shrink-to-fit
   wrapa) tworzy cykl wymiarów i clientWidth=0 */
.crop-img { display: block; max-width: 508px; max-height: 440px; width: auto; height: auto;
  user-select: none; }
.crop-overlay { position: absolute; border: 2px solid #fff; border-radius: 10px; cursor: move;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55); outline: 1px solid rgba(15,23,42,.4); }
.crop-overlay::after { content: ''; position: absolute; inset: 0; border-radius: 8px;
  border: 1px dashed rgba(255,255,255,.6); pointer-events: none; }
.crop-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px;
  background: var(--brand); border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.photo-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.photo-actions .grow { flex: 1; }

/* ---------- Moduł 0: ustawienia firmy ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: #334155; }
.form-grid input[type="text"] { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  font: inherit; font-size: 14px; font-weight: 400; }
.form-grid input[type="text"]:focus { outline: none; border-color: var(--brand); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { width: 46px; height: 42px; border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; background: #fff; cursor: pointer; }
.color-row input[type="text"] { flex: 1; font-family: ui-monospace, monospace; }
.logo-preview { max-height: 56px; max-width: 240px; object-fit: contain; }
