@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,600,700&display=swap');

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

:root {
  --mint:       #3DB89A;
  --mint-dark:  #2a9070;
  --mint-light: #e6f7f3;
  --bg:         #f7fdfb;
  --white:      #ffffff;
  --border:     #d0ece6;
  --text:       #1a2b28;
  --muted:      #4a6b64;
  --sidebar-w:  220px;
}

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Views ── */
.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ── Login ── */
.login-wrap {
  max-width: 400px;
  margin: 10vh auto;
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}
.login-logo b { color: var(--mint); }
.login-wrap h1 { font-size: 1.4rem; }
.login-error {
  background: #fdecea;
  color: #c0392b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.form-group input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus { border-color: var(--mint); }

/* ── Buttons ── */
.btn-primary {
  background: var(--mint);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s;
}
.btn-primary:hover { background: var(--mint-dark); }
.btn-secondary {
  background: var(--mint-light);
  color: var(--mint-dark);
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-back-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}
.btn-back-list:hover { color: var(--text); }

/* ── Panel layout ── */
#view-panel {
  display: flex;
  min-height: 100vh;
}
#view-panel.hidden { display: none !important; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding-left: 0.25rem;
}
.sidebar-logo b { color: var(--mint); }
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: left;
}
.nav-item:hover { background: var(--mint-light); color: var(--text); }
.nav-item.active { background: var(--mint-light); color: var(--mint-dark); font-weight: 600; }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
}
.btn-logout:hover { color: #c0392b; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.5rem; }
.badge {
  background: var(--mint-light);
  color: var(--mint-dark);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* ── Filters ── */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-input, .filter-select {
  padding: 0.6rem 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  outline: none;
}
.filter-input { min-width: 200px; }
.filter-input:focus, .filter-select:focus { border-color: var(--mint); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.data-table thead { background: var(--mint-light); }
.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mint-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.loading-row { text-align: center; color: var(--muted); padding: 2rem !important; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-nowa       { background: #e8f4fd; color: #1a6fa0; }
.status-w_trakcie  { background: #fff3cd; color: #856404; }
.status-zamknieta  { background: #d1edda; color: #155724; }

.btn-detail {
  background: none;
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
}
.btn-detail:hover { border-color: var(--mint); color: var(--mint-dark); }

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: flex-end;
}
.page-btn {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
}
.page-btn.active { background: var(--mint); color: #fff; border-color: var(--mint); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Detail ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.detail-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.detail-card h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--muted); }
.detail-val { font-weight: 600; }
.status-select {
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}
.status-select:focus { border-color: var(--mint); outline: none; }

.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.answer-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}
.answer-key { color: var(--muted); font-size: 0.75rem; }
.answer-val { font-weight: 600; }

.meal-day-block { margin-bottom: 1rem; }
.meal-day-name {
  font-weight: 700;
  color: var(--mint-dark);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.meal-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.meal-item:last-child { border: none; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1rem; }
  .detail-grid { grid-template-columns: 1fr; }
}
