/* Blodorn Strandkölcsönző — strand téma 🏖️
   Sárga homok, kék tenger, napernyő-hangulat. CSS-only, a class-nevek
   változatlanok (a JS-t nem érinti). */

:root {
  --sky: #bfeaff;
  --sky-soft: #e6f7ff;
  --sea: #20a8c8;
  --sea-deep: #0e7fa0;
  --sea-ink: #ffffff;
  --sand: #ffe39a;
  --sand-soft: #fff5d6;
  --sand-deep: #f3cf72;
  --card: #fffdf7;
  --ink: #2a4f5c;
  --muted: #7b8f93;
  --line: #efe2bd;

  --available: #2bA15a;
  --available-bg: #e3f7e9;
  --rented: #f59415;
  --rented-bg: #fff0d6;
  --broken: #e2574c;
  --broken-bg: #fde6e3;

  --coral: #ff8a5c;
  --shadow: 0 6px 16px rgba(20, 70, 90, .10);
  --shadow-sm: 0 3px 8px rgba(20, 70, 90, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  /* sun in the corner + sky → sand beach gradient */
  background:
    radial-gradient(circle at 88% 60px, rgba(255,238,150,.95) 0 46px, rgba(255,238,150,0) 70px),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-soft) 26%, var(--sand-soft) 52%, var(--sand) 100%)
    fixed;
}

#app { max-width: 1100px; margin: 0 auto; }

/* ---- Top nav: striped beach-parasol canopy with a scalloped valance ---- */
.topnav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--sea-ink);
  padding: 14px 18px 18px;
  background: repeating-linear-gradient(
    -45deg,
    var(--sea) 0 26px,
    var(--sea-deep) 26px 52px
  );
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 14px rgba(14, 127, 160, .28);
}
/* scalloped umbrella edge hanging under the nav */
.topnav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -12px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='14'%3E%3Cpath d='M0 0 H44 V2 Q22 20 0 2 Z' fill='%230e7fa0'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 44px 14px;
  filter: drop-shadow(0 3px 2px rgba(14,127,160,.2));
}
.brand {
  font-weight: 800; font-size: 1.1rem; letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.brand::before { content: "⛱️"; margin-right: 8px; }
.navlinks { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.navright { display: flex; gap: 8px; align-items: center; }
.role-badge {
  background: rgba(255,255,255,.28);
  padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700;
}
.navbtn {
  background: rgba(255,255,255,.18);
  color: var(--sea-ink);
  border: 0; border-radius: 999px;
  padding: 10px 16px; font-size: .95rem; font-weight: 700; cursor: pointer;
  min-height: 44px; transition: transform .12s, background .12s;
}
.navbtn:hover { transform: translateY(-1px); background: rgba(255,255,255,.3); }
.navbtn.active { background: #fff; color: var(--sea-deep); box-shadow: var(--shadow-sm); }

.view { padding: 22px 16px 40px; }
h2 {
  margin: 22px 0 12px; color: var(--sea-deep); font-size: 1.4rem;
}
h2::before { margin-right: 8px; }
h3 { margin: 18px 0 10px; color: var(--sea-deep); }

/* ---- Login ---- */
.login { text-align: center; padding: 36px 16px 48px; }
.login::before {
  content: "⛱️";
  display: block; font-size: 72px; line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 8px 6px rgba(14,127,160,.18));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.login h1 { color: var(--sea-deep); font-size: 2rem; margin: 4px 0; }
.login-sub { color: var(--muted); margin-top: 4px; font-size: 1.05rem; }
.role-buttons {
  display: flex; gap: 18px; justify-content: center;
  flex-wrap: wrap; margin-top: 30px;
}
.role-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  background: var(--card); border: 3px solid var(--sand-deep);
  border-radius: 22px; padding: 28px 38px 26px; cursor: pointer;
  min-width: 220px; min-height: 140px; box-shadow: var(--shadow);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}
.role-card::before { font-size: 40px; line-height: 1; }
.role-buttons .role-card:first-child::before { content: "🏖️"; }
.role-buttons .role-card:last-child::before { content: "📈"; }
.role-card:hover {
  transform: translateY(-4px) rotate(-1deg);
  border-color: var(--sea); box-shadow: 0 12px 24px rgba(14,127,160,.18);
}
.role-title { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.role-desc { color: var(--muted); }

/* ---- Sunbed tiles ---- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; border: 2px solid var(--line); border-radius: 18px;
  padding: 16px 6px; min-height: 86px; cursor: pointer;
  background: var(--card); font: inherit;
  box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-num { font-size: 1.6rem; font-weight: 800; }
.tile-status { font-size: .75rem; font-weight: 700; }
.tile-available { background: var(--available-bg); border-color: var(--available); }
.tile-available .tile-status { color: var(--available); }
.tile-available::after {
  content: "☀️"; position: absolute; top: 5px; left: 7px; font-size: .85rem; opacity: .85;
}
.tile-rented { background: var(--rented-bg); border-color: var(--rented); }
.tile-rented .tile-status { color: #b56b00; }
.tile-rented::after {
  content: "🧑‍🦰"; position: absolute; top: 5px; left: 7px; font-size: .85rem; opacity: .85;
}
.tile-broken { background: var(--broken-bg); border-color: var(--broken); }
.tile-broken .tile-status { color: var(--broken); }
.tile-gear {
  position: absolute; top: 5px; right: 7px; font-size: .9rem; opacity: .7;
}

/* ---- Water list ---- */
.wlist { display: flex; flex-direction: column; gap: 12px; }
.wrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-left: 7px solid var(--sea);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.wrow::before { content: "🌊"; font-size: 1.4rem; }
.wrow-available { border-left-color: var(--available); }
.wrow-rented { border-left-color: var(--rented); }
.wrow-broken { border-left-color: var(--broken); }
.wrow-info { display: flex; flex-direction: column; min-width: 140px; flex: 1; }
.wrow-name { font-weight: 800; }
.wrow-meta { color: var(--muted); font-size: .85rem; }
.wrow-mid { min-width: 92px; text-align: center; }
.countdown {
  font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 800;
  color: var(--rented);
}
.countdown.expired { color: var(--broken); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.wrow-status { color: var(--muted); font-weight: 700; }
.wrow-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
  font: inherit; font-weight: 700; min-height: 44px;
  transition: transform .12s, filter .12s; box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-rent { background: linear-gradient(180deg, var(--sea), var(--sea-deep)); color: #fff; }
.btn-return { background: linear-gradient(180deg, #ffb04d, var(--rented)); color: #fff; }
.btn-ghost { background: var(--sand-soft); color: var(--ink); box-shadow: none; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .85rem; margin-right: 4px; }
.btn-danger { background: linear-gradient(180deg, #ff7468, var(--broken)); color: #fff; }

/* ---- Equipment admin ---- */
.eq-layout { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.eq-form {
  background: var(--card); border: 2px solid var(--sand-deep); border-radius: 18px;
  padding: 18px; min-width: 260px; flex: 0 0 280px; box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field span { font-size: .85rem; color: var(--muted); font-weight: 700; }
.field input, .field select {
  padding: 10px; border: 2px solid var(--line); border-radius: 12px;
  font: inherit; min-height: 44px; background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--sea); }
.form-actions { display: flex; gap: 8px; }
.eq-table {
  flex: 1; border-collapse: separate; border-spacing: 0; min-width: 320px;
  background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.eq-table th, .eq-table td {
  text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.eq-table th { color: var(--sea-deep); font-weight: 800; background: var(--sand-soft); }
.eq-table tr:last-child td { border-bottom: 0; }

/* ---- Finance ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px;
}
.stat-card {
  background: var(--card); border: 2px solid var(--sand-deep); border-radius: 18px;
  padding: 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--sea-deep); }
.stat-label { color: var(--muted); font-size: .9rem; font-weight: 700; }

.chart {
  display: flex; align-items: flex-end; gap: 10px; height: 210px;
  background: var(--card); border: 2px solid var(--sand-deep); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.chart-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 4px; height: 100%;
}
.chart-bar {
  width: 100%; max-width: 48px;
  background: linear-gradient(180deg, var(--sea), var(--sea-deep));
  border-radius: 10px 10px 0 0; min-height: 3px; transition: height .25s;
}
.chart-val { font-size: .75rem; color: var(--muted); font-weight: 700; }
.chart-lbl { font-size: .75rem; color: var(--muted); }

@media (max-width: 600px) {
  .navlinks { order: 3; width: 100%; }
  .eq-layout { flex-direction: column; }
  .eq-form { flex: 1 1 auto; width: 100%; }
}

/* ---- Napágy timetable ---- */
.tt-wrap { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; }
.tt-axis, .tt-row { display: flex; align-items: stretch; gap: 0; min-width: 640px; }
.tt-rowhead {
  flex: 0 0 132px; display: flex; flex-direction: column; justify-content: center;
  gap: 2px; padding: 6px 10px;
}
.tt-bed { font-weight: 800; color: var(--ink); }
.tt-rate { font-size: .72rem; color: var(--muted); }
.tt-broken-btn {
  margin-top: 4px; align-self: flex-start; border: 0; cursor: pointer;
  background: var(--sand-soft); color: var(--ink); border-radius: 999px;
  padding: 4px 8px; font: inherit; font-size: .72rem;
}
.tt-axis-spacer { flex: 0 0 132px; }
.tt-track {
  position: relative; flex: 1; display: grid;
  grid-template-columns: repeat(12, 1fr);
  background: var(--card); border-radius: 10px; min-height: 52px;
  touch-action: none; /* drags must not scroll the page on touch */
}
.tt-axis-track { background: transparent; min-height: 24px; }
.tt-cell { border-right: 1px dashed var(--line); }
.tt-cell:last-child { border-right: 0; }
.tt-axis-cell {
  border: 0; font-size: .7rem; color: var(--muted); text-align: left; padding-left: 2px;
}
.tt-row { border-radius: 12px; }
.tt-row-broken .tt-track {
  background: repeating-linear-gradient(45deg, var(--broken-bg) 0 8px, #fff 8px 16px);
  opacity: .7;
}
.tt-block {
  position: absolute; top: 5px; bottom: 5px;
  background: linear-gradient(180deg, var(--sea), var(--sea-deep)); color: #fff;
  border-radius: 8px; box-shadow: var(--shadow-sm); cursor: grab;
  display: flex; align-items: center; overflow: hidden; user-select: none;
  padding-right: 26px;
}
.tt-block-label { padding: 0 8px; font-size: .74rem; font-weight: 700; white-space: nowrap; pointer-events: none; }
.tt-ghost { opacity: .55; cursor: grabbing; }
.tt-del {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.28); color: #fff; cursor: pointer;
  font-size: .8rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.tt-del:hover { background: rgba(255,255,255,.5); }
.tt-dragging { opacity: .55; }
.tt-hint { color: var(--muted); font-size: .8rem; margin-top: 6px; }

/* --- Napágy csempenézet --- */
.bed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  margin: 12px 0;
}
.bed-tile {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.bed-free { background: #2e9e5b; }
.bed-booked { background: #d23b3b; }
.bed-broken { background: #9aa0a6; }
.bed-tile:hover { filter: brightness(1.08); }
.bed-hint { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }

/* --- Vízi timetable --- */
.wt-wrap { margin: 12px 0 16px; overflow-x: auto; }
.wt-axis, .wt-row { display: flex; align-items: stretch; }
.wt-rowhead {
  flex: 0 0 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 8px;
  font-size: 13px;
}
.wt-name { font-weight: 600; }
.wt-rate { color: var(--muted); font-size: 12px; }
.wt-track {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  min-width: 1152px; /* 24 sáv × 48px, hogy a félórás cellák olvashatók legyenek */
  border-left: 1px solid #ddd;
}
.wt-cell {
  flex: 1 1 0;
  min-width: 0;
  border-right: 1px solid #eee;
  min-height: 42px;
}
.wt-axis-track { min-height: 22px; }
.wt-axis-cell { font-size: 11px; color: var(--muted); }
.wt-axis-spacer { flex: 0 0 150px; }
.wt-row-broken { opacity: 0.5; }
.wt-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  background: #2b6cb0;
  color: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 0 9px 0 3px; /* jobb oldali hely az átméretező fogantyúnak */
  font-size: 10px;
  overflow: hidden;
}
.wt-resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 4px 4px 0;
  touch-action: none;
}
.wt-resize:hover { background: rgba(255, 255, 255, 0.65); }
.wt-block-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wt-del {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
}
.wt-hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* --- Visszajelzés modul --- */
.feedback { max-width: 760px; margin: 0 auto; }
.fb-namegate { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 40px auto; }
.fb-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fb-header h2 { margin: 0; flex: 0 0 auto; }
.fb-who { color: var(--muted); font-size: 0.9rem; }
.fb-header .btn-ghost { margin-left: auto; }
.fb-newtask { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 16px; }
.fb-title-input, .fb-body-input { width: 100%; padding: 8px; box-sizing: border-box; font: inherit; }
.fb-body-input { min-height: 60px; resize: vertical; }
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-card { border: 1px solid #ddd; border-radius: 8px; padding: 12px; }
.fb-card-top { display: flex; align-items: center; gap: 8px; }
.fb-card-top h3 { margin: 0; font-size: 1.05rem; flex: 1 1 auto; }
.fb-badge { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fb-badge-new { background: #e5e7eb; color: #374151; }
.fb-badge-in_progress { background: #fef3c7; color: #92400e; }
.fb-badge-done { background: #d1fae5; color: #065f46; }
.fb-meta, .fb-comment-meta { color: var(--muted); font-size: 0.8rem; }
.fb-card-body { margin: 6px 0; white-space: pre-wrap; }
.fb-statusrow { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.fb-statusrow select { font: inherit; padding: 4px 6px; }
.fb-thread { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; padding-left: 8px; border-left: 3px solid #eee; }
.fb-comment-body { margin: 2px 0 0; white-space: pre-wrap; }
.fb-commentform { display: flex; gap: 8px; align-items: flex-start; }
.fb-commentform input { flex: 1 1 auto; padding: 6px; font: inherit; }
.fb-empty { color: var(--muted); }
.fb-status { color: var(--muted); font-size: 0.85rem; min-height: 1em; }
.fb-error { color: #b91c1c; font-size: 0.85rem; margin: 2px 0 0; min-height: 1em; }
