/* Tarcza — wspólne style stron Django (bez Bootstrapa) + fonty dla apek React.
   Kolory muszą zgadzać się z frontend_shared/tarcza/theme.js. */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-condensed-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --t-khaki: #C3B091; --t-khaki-soft: #EDE6D6; --t-khaki-ink: #5E4E2E;
  --t-olive: #4A5634; --t-olive-dark: #37402A; --t-olive-soft: #E1E6D3;
  /* kolor główny = khaki (nawigacja, przyciski); tekst/obrysy w kolorze głównym = khaki-dark */
  --t-primary: #C3B091; --t-primary-hover: #B09C78; --t-primary-dark: #6E5B36;
  --t-ink: #1C2117; --t-muted: #5B6152; --t-ground: #F1F2EC; --t-surface: #FFFFFF;
  --t-sunk: #E8EADF; --t-line: #D6D8CC;
  --t-red: #B42318; --t-red-soft: #FBE4E1;
  --t-amber: #8A5A00; --t-amber-soft: #F8ECCF;
  --t-green: #2F6B30; --t-green-soft: #DDEEDB;
  --t-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --t-body: Barlow, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --t-radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.tarcza {
  margin: 0; background: var(--t-ground); color: var(--t-ink);
  font-family: var(--t-body); font-size: 16px; line-height: 1.5;
}
.tarcza h1, .tarcza h2, .tarcza h3, .tarcza h4 { font-family: var(--t-display); line-height: 1.1; margin: 0 0 .5em; text-wrap: balance; }
.tarcza h1 { font-size: 2.25rem; font-weight: 700; }
.tarcza h2 { font-size: 1.75rem; font-weight: 700; }
.tarcza h3 { font-size: 1.4rem; font-weight: 600; }
.tarcza h4 { font-size: 1.15rem; font-weight: 600; }
.tarcza a { color: var(--t-primary-dark); }
.tarcza a:hover { color: var(--t-ink); }
.tarcza :focus-visible { outline: 3px solid var(--t-primary-dark); outline-offset: 2px; }
.tarcza p { margin: 0 0 .8em; }
.tarcza .muted { color: var(--t-muted); }
.tarcza code { font-size: .9em; background: var(--t-sunk); padding: .05em .3em; border-radius: 4px; }

/* Stopka main_base */
.t-footer { border-top: 1px solid var(--t-line); margin-top: 48px; padding-block: 20px 28px; padding-inline: 16px; color: var(--t-muted); font-size: .9rem; }
.t-footer-inner { max-width: 1200px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }
.t-footer a { color: var(--t-primary-dark); }

/* Układ stron treści */
.t-page { max-width: 1200px; margin-inline: auto; padding-inline: 16px; padding-block: 24px 40px; }
.t-page-narrow { max-width: 460px; margin-inline: auto; padding-inline: 16px; padding-block: 40px; }
.t-page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.t-page-head h1 { margin: 0; }

.t-card { background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; padding: 24px; }
.t-card + .t-card { margin-top: 16px; }
.t-stack { display: grid; gap: 14px; }
.t-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.t-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }

/* Nagłówek kart logowania */
.t-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.t-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 50%; background: var(--t-khaki-soft); }
.t-brand-disc { width: 44px; height: 44px; border-radius: 50%; background: var(--t-khaki); display: grid; place-items: center; font-family: var(--t-display); font-weight: 700; color: var(--t-ink); }
.t-brand strong { font-family: var(--t-display); font-size: 1.3rem; font-weight: 600; }

/* Formularze */
.t-field { display: grid; gap: 6px; }
.t-field label, .t-label { font-weight: 600; font-size: .92rem; }
.t-help { color: var(--t-muted); font-size: .85rem; }
.t-help ul { margin: 4px 0 0; padding-left: 18px; }
.t-error, .errorlist { color: var(--t-red); font-size: .88rem; margin: 0; padding: 0; list-style: none; }
.tarcza input[type=text], .tarcza input[type=email], .tarcza input[type=password], .tarcza input[type=number],
.tarcza input[type=search], .tarcza input[type=date], .tarcza input[type=tel], .tarcza input[type=url],
.tarcza select, .tarcza textarea, .t-input {
  font: inherit; color: var(--t-ink); background: var(--t-surface); width: 100%;
  border: 1px solid #B9BCAE; border-radius: var(--t-radius); padding: 10px 12px; min-height: 44px;
}
.tarcza input:focus, .tarcza select:focus, .tarcza textarea:focus { outline: none; border-color: var(--t-primary-dark); box-shadow: 0 0 0 3px var(--t-khaki-soft); }
.tarcza input[type=checkbox], .tarcza input[type=radio] { width: 18px; height: 18px; accent-color: var(--t-primary-dark); vertical-align: middle; }
.t-check { display: flex; gap: 10px; align-items: flex-start; }

/* Przyciski */
.t-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  min-height: 44px; padding: 10px 18px; border-radius: var(--t-radius); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--t-primary); color: var(--t-ink);
}
.t-btn:hover { background: var(--t-primary-hover); color: var(--t-ink); }
.t-btn-secondary { background: transparent; color: var(--t-ink); border-color: var(--t-line); }
.t-btn-secondary:hover { background: var(--t-sunk); color: var(--t-ink); }
.t-btn-danger { background: var(--t-red); color: #fff; }
.t-btn-danger:hover { background: #8F1C13; color: #fff; }
.t-btn-sm { min-height: 34px; padding: 5px 12px; font-size: .9rem; }
.t-btn-block { width: 100%; }

/* Komunikaty */
.t-alert { border-radius: var(--t-radius); padding: 12px 14px; background: var(--t-olive-soft); color: var(--t-ink); }
.t-alert-success { background: var(--t-green-soft); color: #1F4A20; }
.t-alert-warning { background: var(--t-amber-soft); color: #5C3C00; }
.t-alert-error, .t-alert-danger { background: var(--t-red-soft); color: #7A1A12; }
.t-alert-info { background: var(--t-khaki-soft); color: #3F3420; }
.t-messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }

/* Etykiety stanu */
.t-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--t-sunk); color: var(--t-muted); white-space: nowrap; }
.t-pill-ok { background: var(--t-green-soft); color: var(--t-green); }
.t-pill-warn { background: var(--t-amber-soft); color: var(--t-amber); }
.t-pill-error { background: var(--t-red-soft); color: var(--t-red); }
.t-pill-brand { background: var(--t-khaki-soft); color: var(--t-khaki-ink); }

/* Tabele */
.t-table-wrap { overflow-x: auto; background: var(--t-surface); border: 1px solid var(--t-line); border-radius: 12px; }
.t-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.t-table th, .t-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--t-line); vertical-align: top; }
.t-table th { background: var(--t-sunk); color: var(--t-muted); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.t-table tbody tr:last-child td { border-bottom: 0; }
.t-table tbody tr:hover td { background: #F7F8F3; }
.t-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.t-table-compact th, .t-table-compact td { padding: 5px 8px; font-size: .88rem; }

/* Menu stron biura bez Reacta */
.t-subnav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--t-line); margin-bottom: 20px; }
.t-subnav a { padding: 8px 14px; color: var(--t-muted); text-decoration: none; font-weight: 600; }
.t-subnav a[aria-current=page] { color: var(--t-ink); border-bottom: 3px solid var(--t-primary-dark); }

@media print {
  .t-footer, .t-subnav, .no-print { display: none !important; }
  body.tarcza { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== Dodatki: strony konta, profilu i biura (Django bez Reacta) ===== */
.t-page-medium { max-width: 760px; margin-inline: auto; padding-inline: 16px; padding-block: 32px 40px; }
.t-links { display: grid; gap: 4px; margin-top: 18px; text-align: center; font-size: .92rem; color: var(--t-muted); }
.t-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.t-actions-stack { display: grid; gap: 10px; }
.t-alert ul { margin: 6px 0 0; padding-left: 18px; }
.t-alert p:last-child { margin-bottom: 0; }
.t-mt { margin-top: 16px; }
.tarcza .t-subtitle { color: var(--t-muted); margin: 4px 0 0; }
.t-lead { color: var(--t-muted); margin: 4px 0 20px; }
.t-check label { font-weight: 400; font-size: 1rem; }
.t-check input[type=checkbox] { margin-top: 3px; flex: none; }
.t-table tbody tr.t-group-sep td { background: var(--t-sunk); padding: 3px; }
.t-table-caption { margin: 28px 0 8px; }
.t-link-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.t-link-list > li { margin: 0; }
.tarcza a.t-link-card { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; justify-content: space-between; padding: 16px 20px; text-decoration: none; color: var(--t-ink); }
.tarcza a.t-link-card:hover { border-color: var(--t-primary); background: #FAFBF7; color: var(--t-ink); }
.t-link-card strong { font-weight: 600; }
.t-pre { white-space: pre-wrap; margin: 0; font-size: .9rem; }
