:root {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #132018;
  --muted: #5b6b60;
  --accent: #1a5c2e;
  --accent2: #248a45;
  --line: #d5e0d8;
  --warn: #8a5a00;
  --danger: #8b1e1e;
  --input-bg: #ffffff;
  --soft: #f7fbf8;
  --soft2: #e7efe9;
  --soft3: #f3faf5;
  --status-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 8px 24px rgba(20, 40, 28, 0.06);
  --radius: 16px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  /* kolory jak https://mebloszyk.pl/login */
  --bg: #131a25;
  --card: #1c2434;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --accent: #4a90e2;
  --accent2: #3b82f6;
  --line: #2d3748;
  --warn: #eab308;
  --danger: #f87171;
  --input-bg: #151c28;
  --soft: #151c28;
  --soft2: #243044;
  --soft3: #1a2230;
  --status-bg: rgba(19, 26, 37, 0.92);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 88px;
}

.top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hello {
  width: 100%;
  text-align: center;
  margin: 2px 0 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
  color: var(--ink);
}

.brand-logo {
  display: block;
  height: 29px;
  width: auto;
  max-width: min(156px, 55vw);
}

html[data-theme="dark"] .brand-link {
  color: #ffffff;
}

h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.muted { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.hidden { display: none !important; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.grid button {
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--soft);
  color: var(--ink);
}

.grid button:active { transform: scale(0.98); }
.grid button.selected {
  border-color: var(--accent);
  background: var(--soft2);
}

.add-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.add-row input,
.big-digits,
.search-input,
.users-add input,
.modal-card input[type="password"],
.modal-card input[type="text"] {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 1.1rem;
  background: var(--input-bg);
  color: var(--ink);
}

.big-digits {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  margin-bottom: 14px;
}

button.primary,
button.secondary,
button.tiny,
.linkish,
.theme-toggle {
  cursor: pointer;
  border: none;
}

button.primary {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

button.primary:disabled {
  opacity: 0.45;
}

button.secondary {
  border-radius: 12px;
  padding: 0 16px;
  background: var(--soft2);
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.linkish,
.theme-toggle {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.theme-toggle svg {
  flex-shrink: 0;
}

.photo-block { margin-bottom: 14px; }

.btn-save-top {
  margin: 8px 0 16px;
}

.type-block {
  margin: 4px 0 14px;
}

.type-label {
  margin: 0 0 8px;
}

.type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.type-tab {
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.type-tab.active {
  border-color: var(--accent);
  background: var(--soft2);
  color: var(--accent);
}

.auto-id {
  margin: 0 0 12px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
  text-align: center;
}

.photo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 2px dashed var(--accent2);
  border-radius: 12px;
  background: var(--soft3);
  font-weight: 700;
  color: var(--accent);
}

.photo-btn input { display: none; }

.preview {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 12px;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.status-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--status-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-size: 0.85rem;
  color: var(--muted);
}

button.tiny {
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--soft2);
  color: var(--accent);
  font-weight: 700;
}

#doneMsg { line-height: 1.45; }

/* PC: mniejsza typografia jak na mebloszyk login */
@media (min-width: 700px) {
  body {
    font-size: 12px;
  }

  #app {
    max-width: 420px;
  }

  h2 {
    font-size: 1.05rem;
  }

  .grid button {
    min-height: 44px;
    font-size: 12px;
  }

  .big-digits {
    font-size: 1.6rem;
    padding: 10px;
  }

  button.primary {
    min-height: 44px;
    font-size: 12px;
  }

  .add-row input,
  .photo-btn,
  .theme-toggle {
    font-size: 12px;
  }
}
