/* ============================================================
   style.css – Kapcsolat Terápia – Főstíluslap
   
   Design: meleg, professzionális terápiás hangulat
   Tipográfia: Cormorant Garamond (fejlécek) + DM Sans (szövegtörzs)
   Szín paletta: mélyeszöld + meleg arany + krémfehér
   ============================================================ */

/* -------------------------------------------------------
   CSS változók (design tokenek)
------------------------------------------------------- */
:root {
  /* Fő színek */
  --color-bg:         #F8F5F0;       /* Meleg krémfehér oldalhát */
  --color-bg-card:    #FFFFFF;       /* Kártyák háttere */
  --color-sidebar:    #1A2E24;       /* Mély erdőzöld oldalsáv */
  --color-sidebar-hover: #243D30;   /* Hover állapot */
  --color-accent:     #C4973A;       /* Meleg arany kiemelő szín */
  --color-accent-light: #F0E6D0;    /* Halvány arany háttér */
  --color-text:       #1A1A1A;       /* Fő szövegszín */
  --color-text-muted: #6B6B6B;       /* Másodlagos szöveg */
  --color-text-sidebar: #C8D5CF;    /* Oldalsáv szöveg */
  --color-border:     #E8E3DB;       /* Elválasztók */
  --color-error:      #C0392B;       /* Hibaüzenet szín */
  --color-success:    #27AE60;       /* Sikeres művelet */

  /* Tipográfia */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Méretek */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 6px;

  /* Árnyékok */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.15);
}

/* -------------------------------------------------------
   Alap reset és body
------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* -------------------------------------------------------
   BEJELENTKEZÉSI OLDAL
------------------------------------------------------- */
.login-page {
  background: var(--color-bg);
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Bal dekorációs panel */
.login-visual {
  flex: 1;
  background: var(--color-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 60px 40px;
}

.login-visual__inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

.login-logo {
  margin-bottom: 32px;
}

.login-logo__mark {
  width: 72px;
  height: 72px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--color-accent);
  letter-spacing: 1px;
}

.login-visual__title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 300;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 16px;
}

.login-visual__title em {
  font-style: italic;
  color: var(--color-accent);
}

.login-visual__sub {
  font-size: 13px;
  color: var(--color-text-sidebar);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Dekorációs háttérelem */
.login-visual__deco {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(196, 151, 58, 0.15);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-visual__deco::before {
  content: '';
  position: absolute;
  inset: 40px;
  border: 1px solid rgba(196, 151, 58, 0.08);
  border-radius: 50%;
}

/* Jobb oldali bejelentkezési panel */
.login-form-panel {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: var(--color-bg-card);
}

.login-form-inner {
  width: 100%;
  max-width: 360px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--color-text);
}

.login-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 36px;
  line-height: 1.7;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--color-error);
  margin-bottom: 20px;
}

/* Google bejelentkezési gomb */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.btn-google:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.btn-google__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-note {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.7;
  text-align: center;
}

/* -------------------------------------------------------
   OLDALSÁV (Sidebar)
------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar__header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar__logo-mark {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.sidebar__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar__logo-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: #FFFFFF;
}

.sidebar__logo-sub {
  font-size: 11px;
  color: var(--color-text-sidebar);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Navigációs lista */
.sidebar__nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-sidebar);
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: #FFFFFF;
}

.nav-link.active {
  background: rgba(196, 151, 58, 0.15);
  color: var(--color-accent);
}

.nav-link--disabled {
  opacity: 0.35;
  pointer-events: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Oldalsáv alján felhasználói info */
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar__user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar__user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__user-info {
  flex: 1;
  min-width: 0;
}

.sidebar__user-name {
  display: block;
  font-size: 13px;
  color: #FFFFFF;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  display: block;
  font-size: 11px;
  color: var(--color-text-sidebar);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar__logout {
  padding: 6px;
  color: var(--color-text-sidebar);
  border-radius: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.sidebar__logout:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.08);
}

.sidebar__logout svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Mobil overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* -------------------------------------------------------
   FŐ TARTALOM
------------------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin 0.3s ease;
}

/* Felső fejléc sáv */
.topbar {
  height: var(--topbar-height);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  display: none; /* Mobilon jelenik meg */
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.2s;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.topbar__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text);
  flex: 1;
}

.topbar__user-mini {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------
   OLDAL TARTALOM
------------------------------------------------------- */
.page {
  display: none;
  padding: 36px 32px;
  animation: fadeIn 0.2s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
}

.page-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Hónap választó */
.month-picker {
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg-card);
  cursor: pointer;
}

.month-picker:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* -------------------------------------------------------
   ÖSSZESÍTŐ KÁRTYÁK
------------------------------------------------------- */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
}

.card--stat {
  padding: 24px 28px;
}

.card__label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.card__value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text);
}

/* -------------------------------------------------------
   TÁBLÁZAT KÁRTYA
------------------------------------------------------- */
.card--table {
  overflow: hidden;
}

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

.card__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  text-align: left;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: var(--color-bg);
}

.table-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 48px 20px !important;
  font-style: italic;
}

/* Szerepkör badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.badge--admin {
  background: var(--color-accent-light);
  color: #8B6914;
}

.badge--berlo {
  background: #EEF2EE;
  color: #2D5A2D;
}

/* Összeg formázás */
.amount {
  font-weight: 500;
  color: var(--color-text);
}

/* -------------------------------------------------------
   GOMBOK
------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.btn--primary {
  background: var(--color-sidebar);
  color: #FFFFFF;
}

.btn--primary:hover {
  background: var(--color-accent);
}

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

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

.btn--danger {
  color: var(--color-error);
  background: transparent;
  padding: 4px 10px;
  font-size: 13px;
}

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

/* -------------------------------------------------------
   MODÁLIS ABLAK
------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--color-bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 440px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 14px;
  transition: all 0.15s;
}

.modal__close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.modal__body {
  padding: 24px 28px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 28px 24px;
}

.modal__error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-error);
  margin-top: 16px;
}

/* -------------------------------------------------------
   FORM ELEMEK
------------------------------------------------------- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg-card);
}

/* -------------------------------------------------------
   BETÖLTŐ ANIMÁCIÓ
------------------------------------------------------- */
.loader {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------------------
   RESZPONZÍV – MOBILOS MEGJELENÍTÉS
------------------------------------------------------- */
@media (max-width: 768px) {

  /* Oldalsáv alapban rejtett mobilon */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  /* Hamburger gomb megjelenik */
  .hamburger {
    display: flex;
  }

  /* Főtartalom teljes szélességű */
  .main-content {
    margin-left: 0;
  }

  /* Topbar kisebb padding */
  .topbar {
    padding: 0 16px;
  }

  /* Oldal padding csökkentés */
  .page {
    padding: 24px 16px;
  }

  /* Összesítő kártyák egymás alatt */
  .summary-cards {
    grid-template-columns: 1fr;
  }

  /* Oldal fejléc egymás alatt */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Bejelentkezési oldal */
  .login-visual {
    display: none; /* Mobilon a dekoráció elrejtve */
  }

  .login-form-panel {
    width: 100%;
    padding: 40px 24px;
  }
}

@media (max-width: 480px) {
  .data-table th,
  .data-table td {
    padding: 10px 14px;
  }
}
