/* =========================================================
   SUNLIGHT HOMES – ADMIN CSS
   Alapszínek és betűtípusok a foglalási oldal stílusával
   megegyezően, de admin-specifikus komponensekkel kiegészítve.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap");

/* =========================================================
   CSS VÁLTOZÓK – az eredeti palettából
   ========================================================= */
:root {
  --main-color:        #9b6241;
  --main-color-light:  rgba(155, 98, 65, 0.12);
  --main-color-hover:  #7e4f32;
  --border-color:      #b1b4c2;
  --border-light:      #e4e6ed;
  --light-grey:        #f7f7f7;
  --medium-grey:       #9599ac;
  --darkwhite:         #f7f7f7;
  --text-dark:         #1f1f1f;
  --text-mid:          #343434;
  --text-muted:        #9599ac;

  /* Foglalás állapot-színek (a naptárból átvéve) */
  --color-booked:      #ff8395;
  --color-booked-dark: #e0607a;
  --color-locked:      #b1b4c2;
  --color-locked-dark: #7c7f8f;
  --color-available:   #bde6cb;
  --color-selected:    #75a68d;

  /* Admin specifikus */
  --navbar-height:     64px;
  --navbar-bg:         #ffffff;
  --sidebar-width:     240px;
  --radius-sm:         4px;
  --radius-md:         8px;
  --shadow-card:       0 2px 12px rgba(0,0,0,0.07);
  --shadow-elevated:   0 4px 24px rgba(0,0,0,0.12);
}

/* =========================================================
   RESET + ALAP
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text-mid);
  background: var(--light-grey);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* =========================================================
   ADMIN NAVBAR
   ========================================================= */
.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  gap: 0;
}

/* Brand / Logo */
.admin-navbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 32px;
  border-right: 1px solid var(--border-light);
  flex-shrink: 0;
}

.admin-navbar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--main-color-light);
  border-radius: var(--radius-sm);
}

.admin-navbar__title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-navbar__site-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
}

.admin-navbar__admin-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--main-color);
}

/* Nav links */
.admin-navbar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 0 20px;
}

.admin-navbar__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.admin-navbar__nav-link:hover {
  color: var(--text-dark);
  background: var(--light-grey);
}

.admin-navbar__nav-link--active {
  color: var(--main-color);
  background: var(--main-color-light);
}

.admin-navbar__nav-link svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* User area */
.admin-navbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--border-light);
  flex-shrink: 0;
}

.admin-navbar__user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.admin-navbar__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.admin-navbar__user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-navbar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--main-color);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-navbar__logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.admin-navbar__logout:hover {
  color: var(--color-booked-dark);
  background: #fff0f3;
}

/* Hamburger (mobil) */
.admin-navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  margin-left: auto;
}

.admin-navbar__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.admin-navbar__hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-navbar__hamburger.is-open span:nth-child(2) { opacity: 0; }
.admin-navbar__hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobil drawer */
.admin-mobile-drawer {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  width: 260px;
  background: #fff;
  border-right: 1px solid var(--border-color);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  padding: 16px 0;
}

.admin-mobile-drawer.is-open { transform: translateX(0); }

.admin-mobile-drawer__nav { display: flex; flex-direction: column; }

.admin-mobile-drawer__link {
  display: block;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  transition: color 0.15s, background 0.15s;
}

.admin-mobile-drawer__link:hover { color: var(--text-dark); background: var(--light-grey); }
.admin-mobile-drawer__link--active { color: var(--main-color); background: var(--main-color-light); }

.admin-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 199;
}

.admin-mobile-overlay.is-open { display: block; }

/* =========================================================
   ADMIN OLDAL ALAP LAYOUT
   ========================================================= */
.admin-page {
  min-height: calc(100vh - var(--navbar-height));
  padding: 28px 32px;
}

.admin-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.admin-page__title-group {}

.admin-page__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

.admin-page__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Gombok */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--main-color);
  color: #fff;
  border-color: var(--main-color);
}

.btn-primary:hover {
  background: var(--main-color-hover);
  border-color: var(--main-color-hover);
  box-shadow: 0 2px 8px rgba(155, 98, 65, 0.25);
}

.btn-outline {
  background: #fff;
  color: var(--main-color);
  border-color: var(--main-color);
}

.btn-outline:hover {
  background: var(--main-color-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: var(--light-grey);
  color: var(--text-dark);
}

/* =========================================================
   NAPTÁR OLDAL – TOOLBAR
   ========================================================= */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-toolbar__view-toggle {
  display: flex;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.calendar-toolbar__view-btn {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  border: none;
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.calendar-toolbar__view-btn:last-child { border-right: none; }
.calendar-toolbar__view-btn:hover { background: var(--light-grey); color: var(--text-dark); }
.calendar-toolbar__view-btn.is-active { background: var(--main-color); color: #fff; }

/* =========================================================
   NAPTÁR – NAVIGÁCIÓ
   ========================================================= */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 16px 20px;
}

.calendar-nav__month-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-nav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.calendar-nav__arrow:hover {
  border-color: var(--main-color);
  color: var(--main-color);
  background: var(--main-color-light);
}

.calendar-nav__label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  min-width: 220px;
  text-align: center;
}

.calendar-nav__today-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--main-color);
  background: var(--main-color-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.calendar-nav__today-btn:hover { background: rgba(155, 98, 65, 0.2); }

.calendar-nav__legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-dot--booked  { background: var(--color-booked); }
.legend-dot--locked  { background: var(--color-locked); }
.legend-dot--free    { background: var(--color-available); }

/* =========================================================
   NAPTÁR – TÁBLÁZAT WRAPPER
   ========================================================= */
.calendar-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* =========================================================
   NAPTÁR – FŐ GRID (heti nézet admin stílusban)
   ========================================================= */
.admin-calendar {
  width: 100%;
  border-collapse: collapse;
  font-family: "Roboto", "Poppins", sans-serif;
}

/* Fejléc: napok */
.admin-calendar__header {
  background: var(--darkwhite);
  border-bottom: 1px solid var(--border-color);
}

.admin-calendar__head-cell {
  padding: 12px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--medium-grey);
  border-right: 1px solid var(--border-light);
}

.admin-calendar__head-cell:last-child { border-right: none; }

.admin-calendar__head-cell.is-today {
  color: var(--main-color);
  background: var(--main-color-light);
}

/* Hetek / sorok */
.admin-calendar__week {}

.admin-calendar__day {
  position: relative;
  width: calc(100% / 7);
  min-height: 110px;
  padding: 8px 6px 6px;
  vertical-align: top;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: #fff;
  transition: background 0.12s;
}

.admin-calendar__day:last-child { border-right: none; }

.admin-calendar__day--other-month {
  background: var(--light-grey);
}

.admin-calendar__day--other-month .admin-calendar__day-num {
  color: #ccc;
}

.admin-calendar__day--today {
  background: #fffbf8;
}

.admin-calendar__day--today .admin-calendar__day-num {
  color: #fff;
  background: var(--main-color);
  border-radius: 50%;
}

/* Nap száma */
.admin-calendar__day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 4px;
  border-radius: 50%;
}

/* =========================================================
   FOGLALÁS / ZÁROLÁS CHIP-EK (naptárban)
   ========================================================= */
.booking-chip {
  display: block;
  width: 100%;
  padding: 3px 7px;
  margin-bottom: 3px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
  text-align: left;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.6;
}

.booking-chip:hover {
  opacity: 0.85;
  transform: translateX(1px);
}

/* Foglalás chip */
.booking-chip--booked {
  background: var(--color-booked);
  color: #fff;
}

/* Foglalás – érkezési nap (félchip, jobb oldal zöld) */
.booking-chip--booked-start {
  background: linear-gradient(90deg, var(--color-available) 50%, var(--color-booked) 50%);
  color: var(--text-dark);
}

/* Foglalás – távozási nap */
.booking-chip--booked-end {
  background: linear-gradient(90deg, var(--color-booked) 50%, var(--color-available) 50%);
  color: #fff;
}

/* Zárolás chip */
.booking-chip--locked {
  background: var(--color-locked);
  color: #fff;
}

.booking-chip--locked-start {
  background: linear-gradient(90deg, var(--color-available) 50%, var(--color-locked) 50%);
  color: var(--text-dark);
}

/* =========================================================
   TÖBB HÓNAPOS NÉZET (hónapok egymás alatt / mellett)
   ========================================================= */
.multi-month-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.month-block {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.month-block__header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  background: var(--darkwhite);
  border-bottom: 1px solid var(--border-color);
}

.month-block__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.month-block__year {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 300;
}

/* Mini naptár táblázat a hónap-nézethez */
.mini-cal {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.mini-cal__weekday {
  padding: 8px 4px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--medium-grey);
  letter-spacing: 0.04em;
}

.mini-cal__cell {
  position: relative;
  padding: 6px 4px 4px;
  vertical-align: top;
  border: 1px solid var(--border-light);
  min-height: 64px;
  cursor: default;
}

.mini-cal__cell--other { background: var(--light-grey); }
.mini-cal__cell--today { background: #fffbf8; }

.mini-cal__day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  border-radius: 50%;
  margin-bottom: 2px;
}

.mini-cal__cell--today .mini-cal__day-num {
  background: var(--main-color);
  color: #fff;
}

.mini-cal__cell--other .mini-cal__day-num { color: #ccc; }

/* =========================================================
   FOGLALÁS CHIP MINI VERZIÓ (kis naptárhoz)
   ========================================================= */
.mini-chip {
  display: block;
  width: 100%;
  padding: 2px 5px;
  margin-bottom: 2px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: none;
  text-align: left;
  font-family: inherit;
  line-height: 1.5;
  transition: opacity 0.15s;
}

.mini-chip:hover { opacity: 0.8; }
.mini-chip--booked { background: var(--color-booked); color: #fff; }
.mini-chip--locked { background: var(--color-locked); color: #fff; }

/* Booked full-span cellák (folytonos sáv) */
.mini-cal__cell--booked {
  background: rgba(255, 131, 149, 0.15);
}

.mini-cal__cell--locked-bg {
  background: rgba(177, 180, 194, 0.15);
}

/* =========================================================
   ÖSSZESÍTŐ STATISZTIKA KÁRTYÁK (oldal tetején)
   ========================================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.stat-card__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card__sub {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-card--accent .stat-card__value { color: var(--main-color); }
.stat-card--booked .stat-card__value  { color: var(--color-booked-dark); }
.stat-card--free .stat-card__value    { color: var(--color-selected); }

/* =========================================================
   MODAL (foglalás részletek)
   ========================================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}

.modal__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.modal__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.modal__status-badge--booked {
  background: rgba(255, 131, 149, 0.15);
  color: var(--color-booked-dark);
}

.modal__status-badge--locked {
  background: rgba(177, 180, 194, 0.2);
  color: var(--color-locked-dark);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 18px;
  line-height: 1;
}

.modal__close:hover { background: var(--light-grey); color: var(--text-dark); }

.modal__body {
  padding: 20px 24px;
}

.modal__section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.modal__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.modal__row:last-child { border-bottom: none; }

.modal__label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal__value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  text-align: right;
}

.modal__value--accent { color: var(--main-color); }

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* =========================================================
   RESZPONZÍV
   ========================================================= */
@media (max-width: 900px) {
  .admin-navbar__nav { display: none; }
  .admin-navbar__user-info { display: none; }
  .admin-navbar__hamburger { display: flex; }
  .admin-navbar__user { border-left: none; padding-left: 8px; }
  .admin-page { padding: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-calendar__day { min-height: 80px; }
  .calendar-nav { flex-wrap: wrap; gap: 12px; }
  .calendar-nav__legend { display: none; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .admin-page__header { flex-direction: column; }
  .calendar-toolbar { flex-wrap: wrap; }
  .booking-chip { font-size: 9px; padding: 2px 4px; }
  .admin-calendar__day-num { width: 20px; height: 20px; font-size: 10px; }
  .admin-calendar__head-cell { font-size: 9px; padding: 8px 2px; }
}
