:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #1f2a2e;
  --muted: #5e6a6f;
  --accent: #1e7a66;
  --accent-dark: #145344;
  --line: #dbe1dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top right, #eaf5ef 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.6;
}

.hero {
  padding: 1.25rem 1.25rem 3.5rem;
}

.panel-hero {
  padding-bottom: 1.5rem;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-content {
  max-width: 1100px;
  margin: 3rem auto 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.82rem;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  margin: 0.4rem 0 0.7rem;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  margin: 0 0 1rem;
}

.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.2rem 1.25rem;
}

.section-alt {
  background: #eef3ef;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 100%;
}

.section-alt h2,
.section-alt .features {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(31, 42, 46, 0.06);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.features {
  list-style: none;
  padding: 0 1.25rem;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  transition: transform 0.15s ease, background 0.2s ease;
  cursor: pointer;
}

.btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--accent);
}

.appointment-form {
  display: grid;
  gap: 0.55rem;
  max-width: 640px;
  margin-top: 1rem;
}

.appointment-form input,
.appointment-form select,
.appointment-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}

.appointment-form input:focus,
.appointment-form select:focus,
.appointment-form textarea:focus {
  outline: 2px solid #92cdbf;
  outline-offset: 1px;
}

.appointment-msg {
  min-height: 1.6em;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 0.7rem;
}

.panel-section {
  border-top: 1px solid var(--line);
}

.login-form {
  display: grid;
  gap: 0.55rem;
  max-width: 420px;
  margin-top: 1rem;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}

.login-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}

.login-form input:focus {
  outline: 2px solid #92cdbf;
  outline-offset: 1px;
}

.login-form select:focus {
  outline: 2px solid #92cdbf;
  outline-offset: 1px;
}

.login-help {
  color: var(--muted);
  margin: 0.6rem 0 0;
}

.mini-title {
  margin: 0.4rem 0 0.1rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

.dashboard {
  margin-top: 1.2rem;
}

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

.user-badge {
  font-weight: 700;
  margin: 0;
}

.owner-box {
  margin: 1.1rem 0 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fcfa;
}

.owner-box h3 {
  margin: 0.4rem 0;
}

.owner-stats {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 1rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  font-size: 1.4rem;
}

.ticket-list {
  display: grid;
  gap: 0.8rem;
}

.ticket-filters {
  display: grid;
  gap: 0.35rem;
  max-width: 320px;
  margin-bottom: 0.8rem;
}

.ticket-filters select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  background: #fff;
}

.ticket-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
}

.ticket-card p {
  margin: 0.3rem 0;
}

.ticket-card details {
  margin-top: 0.35rem;
}

.ticket-card summary {
  cursor: pointer;
  font-weight: 600;
}

.ticket-card label {
  display: block;
  margin-top: 0.35rem;
}

.ticket-card input[type="checkbox"] {
  margin-right: 0.35rem;
}

.appointment-edit-form {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 0.5rem;
}

.appointment-edit-form.hidden {
  display: none;
}

.appointment-edit-form label {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
}

.appointment-edit-form input,
.appointment-edit-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: #fff;
  font-weight: 400;
}

.appointment-edit-form input:focus,
.appointment-edit-form textarea:focus {
  outline: 2px solid #92cdbf;
  outline-offset: 1px;
}

.ticket-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ticket-actions select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.ticket-actions input,
.ticket-actions textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  background: #fff;
}

.login-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
}

.appointment-extra {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}

.protocol-form {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.protocol-form label {
  display: grid;
  gap: 0.25rem;
  font-weight: 600;
}

.protocol-form input,
.protocol-form select,
.protocol-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  background: #fff;
  font-weight: 400;
}

.ocr-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 24, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.ocr-modal.hidden {
  display: none;
}

.ocr-modal-content {
  width: min(900px, 96vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 1rem;
}

#ocrVideo {
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #111;
}

.checklist-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.checklist-row input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}

.cost-row {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 0.9fr 1.3fr 1.2fr 0.7fr 0.8fr 0.8fr auto auto;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cost-row input,
.cost-row select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  background: #fff;
}

.schedule-board {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.station-column {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.station-header {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.station-dropzone {
  padding: 0.55rem;
  display: grid;
  gap: 0.5rem;
  flex: 1;
}

.schedule-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf8;
  padding: 0.45rem 0.55rem;
  cursor: grab;
}

.schedule-item:active {
  cursor: grabbing;
}

.low-stock-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.12rem 0.4rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: #b03838;
}

.btn-danger {
  background: #b03838;
}

.btn-danger:hover {
  background: #852727;
}

.empty-list {
  color: var(--muted);
}

.contact a {
  color: var(--accent-dark);
}

.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.tv-body {
  background: #0d1418;
  color: #eaf2ef;
}

.tv-main {
  padding: 1rem;
}

.tv-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.tv-top h1 {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
}

.tv-top p {
  margin: 0.2rem 0 0;
  color: #b7c8c1;
}

.tv-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.tv-actions input {
  border: 1px solid #2a3b41;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  background: #101d22;
  color: #eaf2ef;
}

.tv-board {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}

.tv-col {
  border: 1px solid #28424a;
  border-radius: 10px;
  background: #102129;
  min-height: 340px;
}

.tv-col-header {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #28424a;
  border-left: 4px solid #1e7a66;
}

.tv-col-body {
  padding: 0.6rem;
  display: grid;
  gap: 0.6rem;
}

.tv-card {
  border: 1px solid #355760;
  border-radius: 9px;
  background: #16303a;
  padding: 0.5rem 0.55rem;
}

.tv-card p {
  margin: 0.18rem 0;
  line-height: 1.35;
}

.tv-card.status-nowe {
  border-color: #597d89;
}

.tv-card.status-w-trakcie {
  border-color: #d08c2a;
}

.tv-card.status-zakonczone {
  border-color: #2b8a5f;
}

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .cost-row {
    grid-template-columns: 1fr;
  }

  .checklist-row {
    grid-template-columns: auto 1fr;
  }
}
