/* Theme variables + reset + global typography + scrollbar.
   Light theme jest defaultem; `html[data-theme="dark"]` przelacza. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:    #00C9A0;
  --teal-d:  #00A882;
  --teal-bg: rgba(0,201,160,0.12);
  --black:   #F5F4F0;   /* page background (warm white) */
  --white:   #14140F;   /* primary text */
  --gray1:   #FCFBF8;   /* surfaces: header, sidebar, hover */
  --gray2:   #E4E0D6;   /* borders, input background */
  --gray3:   #B0ABA0;
  --gray4:   #6E6A60;   /* muted text */
  --gray5:   #3A372F;
  --hover:   #DAD5CA;
  --radius:  6px;
  --font:    'Space Grotesk', sans-serif;
}

html[data-theme="dark"] {
  --teal-bg: rgba(0,201,160,0.08);
  --black:   #0A0A0A;
  --white:   #F5F4F0;
  --gray1:   #1C1C1C;
  --gray2:   #2E2E2E;
  --gray3:   #555;
  --gray4:   #888;
  --gray5:   #CCC;
  --hover:   #383838;
}

html, body { height: 100%; background: var(--black); color: var(--white); font-family: var(--font); font-size: 14px; }
body { transition: background 0.2s, color 0.2s; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Inputy + selecty (globalne defaulty) */
input[type="text"], select {
  width: 100%; padding: 9px 12px;
  background: var(--gray2); border: 1px solid var(--gray2);
  border-radius: var(--radius); color: var(--white); font-family: var(--font); font-size: 13px;
  outline: none; transition: border-color 0.15s;
}
input[type="text"]:focus, select:focus { border-color: var(--teal); }
input::placeholder { color: var(--gray4); }
select[multiple] { height: 120px; }
select option { padding: 4px 0; }

/* Buttony generyczne */
.btn {
  padding: 9px 16px; border-radius: var(--radius); font-family: var(--font);
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--teal); color: var(--black); width: 100%; }
.btn-primary:hover { background: var(--teal-d); }
.btn-ghost { background: transparent; color: var(--gray4); border: 1px solid var(--gray2); }
.btn-ghost:hover { color: var(--white); border-color: var(--gray3); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray2); border-radius: 3px; }

/* Form message - inline pod inputami w modalach */
.form-msg { min-height: 18px; font-size: 12px; }
.form-msg.ok { color: #16a34a; }
.form-msg.err { color: #dc2626; }

/* Chips for dział PKD */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--gray3); color: var(--gray4); cursor: pointer;
  background: transparent; transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip.active { background: var(--teal); border-color: var(--teal); color: var(--black); }
.chip.chip-none { border-style: dashed; font-style: italic; }
.chip.chip-none.active { border-style: solid; font-style: normal; }

/* Toggles (sidebar filters + admin forms) */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--gray2); border-radius: var(--radius); cursor: pointer;
}
.toggle-row:hover { background: var(--hover); }
.toggle-label { font-size: 13px; color: var(--white); }
.switch {
  position: relative; width: 36px; height: 20px;
  background: var(--gray3); border-radius: 10px; transition: background 0.2s;
  flex-shrink: 0;
}
.switch.on { background: var(--teal); }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: white;
  transition: left 0.2s;
}
.switch.on::after { left: 19px; }

/* OpenThings O-Ring brand mark */
.ot-mark { display: block; flex-shrink: 0; color: var(--white); }
.ot-mark .ot-node-live { fill: var(--teal); animation: pulse 2s ease-in-out infinite; }
