/* ===== ADMIN PANEL STYLES ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: 'Nunito', sans-serif;
  background: #f0ebe2; color: #2c1a0e;
  min-height: 100vh; overflow-x: hidden;
}
.hidden { display: none !important; }

/* ── BUTTONS ── */
.btn-primary {
  background: #1e4030; color: #fff; border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.88rem;
  letter-spacing: 0.04em; box-shadow: 0 3px 0 #0d2018;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #0d2018; }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 #0d2018; }
.btn-primary.btn-sm { padding: 7px 16px; font-size: 0.8rem; }

.btn-secondary {
  background: #e8d9c0; color: #2c1a0e; border: 2px solid rgba(0,0,0,0.1);
  cursor: pointer; padding: 10px 22px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.88rem;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #d4c8a8; }

.btn-danger {
  background: #b84c3a; color: #fff; border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 0.88rem;
  letter-spacing: 0.04em; box-shadow: 0 3px 0 #7a2a1a;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #7a2a1a; }

.btn-icon {
  background: none; border: none; cursor: pointer;
  padding: 5px 7px; font-size: 1rem; border-radius: 6px;
  color: #5a3e2b; transition: background 0.15s; line-height: 1;
}
.btn-icon:hover { background: rgba(0,0,0,0.08); }
.btn-icon.del:hover { background: #fde8e6; color: #b84c3a; }
.btn-icon:disabled { opacity: 0.3; cursor: default; }

/* ── LOGIN ── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e4030 0%, #2c1a0e 100%);
  padding: 20px;
}
.login-card {
  background: #fffdf8; border-radius: 24px;
  padding: 44px 40px 36px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.38);
  text-align: center;
}
.login-logo-img {
  width: 100px; height: 100px; border-radius: 50%;
  object-fit: cover; margin: 0 auto 18px;
  display: block;
  border: 3px solid #b84c3a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.login-card h1 {
  font-family: 'Fredoka One', cursive; font-size: 1.85rem;
  color: #1e4030; line-height: 1.15; margin-bottom: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.login-card h1 span {
  font-size: 0.72rem; color: #6ba87a; font-family: 'Nunito', sans-serif;
  font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase;
}
.login-sub { font-size: 0.88rem; color: #7a5a3a; margin-bottom: 24px; font-weight: 600; }
.lf-group { margin-bottom: 14px; text-align: left; }
.lf-group label {
  display: block; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase; color: #1e4030; margin-bottom: 6px;
}
.lf-group input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 2px solid #e8d9c0; background: #f5efe3;
  font-family: 'Nunito', sans-serif; font-size: 0.92rem; font-weight: 600; color: #2c1a0e;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.lf-group input:focus { border-color: #3a6b4a; box-shadow: 0 0 0 3px rgba(58,107,74,0.15); background: #fff; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; padding: 4px;
  color: #7a5a3a; border-radius: 6px; line-height: 1;
}
.login-error { color: #b84c3a; font-size: 0.82rem; font-weight: 700; min-height: 18px; margin-bottom: 8px; text-align: left; }
.login-btn {
  width: 100%; background: #1e4030; color: #fff; border: none; cursor: pointer;
  padding: 14px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 800;
  box-shadow: 0 4px 0 #0d2018; transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 4px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #0d2018; }
.back-link {
  display: inline-block; margin-top: 18px; color: #6ba87a;
  font-size: 0.82rem; font-weight: 700; text-decoration: none;
}
.back-link:hover { color: #1e4030; text-decoration: underline; }

/* ── ADMIN LAYOUT ── */
.admin-app { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  background: #1e4030; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); flex-shrink: 0; }
.sidebar-title { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: #fff; }
.sidebar-sub { font-size: 0.6rem; font-weight: 800; color: #6ba87a; letter-spacing: 0.18em; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.snav-item {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.62); background: none; border: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px;
  font-family: 'Nunito', sans-serif; font-size: 0.88rem; font-weight: 700;
  text-align: left; width: 100%; transition: background 0.15s, color 0.15s;
}
.snav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.snav-item.active { background: rgba(255,255,255,0.15); color: #fff; }
.snav-icon { font-size: 1rem; flex-shrink: 0; }
.snav-label { flex: 1; }
.sidebar-footer { padding: 14px 10px; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px; }
.sidebar-site-link {
  display: block; text-align: center; color: rgba(255,255,255,0.48);
  font-size: 0.78rem; font-weight: 700; text-decoration: none; padding: 8px;
  border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.sidebar-site-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.logout-btn {
  width: 100%; background: rgba(184,76,58,0.18); border: 2px solid rgba(184,76,58,0.35);
  color: #f8a09a; cursor: pointer; padding: 9px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-size: 0.82rem; font-weight: 800;
  transition: background 0.15s;
}
.logout-btn:hover { background: rgba(184,76,58,0.32); }

/* ── MAIN ── */
.admin-main { overflow-y: auto; background: #f0ebe2; }
.admin-header {
  background: #fffdf8; padding: 16px 28px;
  border-bottom: 2px solid #e8d9c0;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; font-size: 1.4rem; color: #1e4030; padding: 4px; }
.admin-page-title { font-family: 'Fredoka One', cursive; font-size: 1.45rem; color: #1e4030; flex: 1; }
.admin-save-status { font-size: 0.8rem; font-weight: 800; color: #3a6b4a; }

/* ── PANELS ── */
.admin-panel { display: none; padding: 24px 28px 60px; }
.admin-panel.active { display: block; }
.panel-intro { margin-bottom: 20px; }
.panel-intro p { font-size: 0.9rem; color: #5a3e2b; font-weight: 600; line-height: 1.65; }

/* ── CARDS ── */
.admin-card {
  background: #fffdf8; border-radius: 18px;
  padding: 24px 26px; margin-bottom: 18px;
  border: 2px solid #e8d9c0;
  box-shadow: 0 3px 0 rgba(0,0,0,0.04);
}
.card-title { font-family: 'Fredoka One', cursive; font-size: 1.15rem; color: #1e4030; margin-bottom: 14px; }

.card-hint { font-size: 0.82rem; color: #7a5a3a; font-weight: 600; margin-bottom: 14px; line-height: 1.55; background: #fff8ee; padding: 10px 14px; border-radius: 10px; border-left: 4px solid #d09820; }

/* ── MONTH PICKER ── */
.month-picker { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.mp-group { display: flex; flex-direction: column; gap: 5px; }
.mp-group label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #1e4030; }
.mp-group select, .mp-group input {
  padding: 9px 13px; border-radius: 10px;
  border: 2px solid #e8d9c0; background: #f5efe3;
  font-family: 'Nunito', sans-serif; font-size: 0.9rem; font-weight: 700; color: #2c1a0e;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none; appearance: none;
}
.mp-group select { min-width: 140px; }
.mp-group select:focus, .mp-group input:focus { border-color: #3a6b4a; }

/* ── CALENDAR EVENT EDITOR ── */
.cal-event-editor { display: flex; flex-direction: column; gap: 0; }
.cal-editor-loading { color: #7a5a3a; font-size: 0.88rem; font-style: italic; padding: 20px 0; }
.cev-row {
  display: grid; grid-template-columns: 90px 1fr 170px;
  gap: 10px; align-items: center;
  padding: 8px 6px; border-bottom: 1px solid #f0e8d8;
}
.cev-row:last-child { border-bottom: none; }
.cev-row.weekend-row {
  background: linear-gradient(90deg, rgba(248,243,235,0.9) 0%, transparent 100%);
  border-radius: 8px; margin: 2px 0; padding: 8px 10px;
}
.cev-day { display: flex; flex-direction: column; gap: 1px; }
.cev-date { font-family: 'Fredoka One', cursive; font-size: 0.95rem; color: #1e4030; }
.cev-day-label { font-size: 0.65rem; color: #9a7a5a; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.cev-input {
  padding: 8px 11px; border-radius: 10px;
  border: 2px solid #e8d9c0; background: #f5efe3;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 600; color: #2c1a0e;
  outline: none; width: 100%; transition: border-color 0.2s, background 0.2s;
}
.cev-input:focus { border-color: #3a6b4a; background: #fff; }
.cev-row.weekend-row .cev-input { border-color: #d4c8a8; background: #fdf6ea; }
.cev-row.weekend-row .cev-input:focus { border-color: #c09028; background: #fff; }
.cev-type {
  padding: 8px 11px; border-radius: 10px;
  border: 2px solid #e8d9c0; background: #f5efe3;
  font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 700; color: #2c1a0e;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%233a6b4a' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 28px; cursor: pointer; width: 100%;
}
.cev-type:focus { border-color: #3a6b4a; }
.wkd-badge {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em;
  color: #c09028; background: #fdefc0; border-radius: 50px;
  padding: 2px 8px; border: 1px solid #e8c860; white-space: nowrap;
  align-self: center;
}

/* ── GALLERY EDITOR ── */
.gallery-editor { display: flex; flex-direction: column; gap: 12px; }
.ge-empty { color: #7a5a3a; font-size: 0.88rem; font-style: italic; padding: 8px 0; }

.ge-row {
  display: grid; grid-template-columns: 110px 1fr auto;
  gap: 14px; align-items: center;
  background: #f8f3ec; border-radius: 14px;
  padding: 14px; border: 2px solid #ecdcc8;
}
.ge-row:hover { border-color: #c8b8a0; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* Thumbnail preview */
.ge-thumb {
  width: 110px; height: 82px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0; position: relative;
  background: #e8e0d4; border: 2px solid #d4c8b0;
  display: flex; align-items: center; justify-content: center;
}
.ge-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.ge-no-img {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #b0a090; width: 100%; height: 100%;
}

.ge-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ge-input {
  padding: 8px 11px; border-radius: 10px;
  border: 2px solid #e8d9c0; background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 600; color: #2c1a0e;
  outline: none; width: 100%; transition: border-color 0.2s;
}
.ge-input:focus { border-color: #3a6b4a; }
.ge-url-input { font-size: 0.78rem; color: #5a3e2b; }
.ge-layout {
  padding: 7px 10px; border-radius: 10px;
  border: 2px solid #e8d9c0; background: #fff;
  font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 700; color: #2c1a0e;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%233a6b4a' fill='none' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  padding-right: 26px; cursor: pointer; width: 100%;
}
.ge-ctrl { display: flex; flex-direction: column; gap: 4px; align-items: center; flex-shrink: 0; }



/* ── ADMIN ACTIONS ── */
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

/* ── TOAST ── */
.admin-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1e4030; color: #fff;
  padding: 14px 22px; border-radius: 14px;
  border: 2px solid #3a6b4a; font-weight: 800; font-size: 0.88rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  transform: translateY(90px); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s;
  max-width: 340px;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast.error { background: #b84c3a; border-color: #d4695a; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .admin-app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: -272px; z-index: 500;
    height: 100vh; width: 258px;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.22);
  }
  .sidebar.open { transform: translateX(272px); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .admin-header { padding: 12px 18px; }
  .admin-panel { padding: 18px 14px 48px; }
  .cev-row { grid-template-columns: 80px 1fr; }
  .cev-type { grid-column: 2 / 3; }
  .wkd-badge { grid-column: 1 / -1; }
  .ge-row { grid-template-columns: 90px 1fr auto; gap: 10px; }
  .ge-thumb { width: 90px; height: 68px; }
  .month-picker { gap: 10px; }
  .admin-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}
@media (max-width: 500px) {
  .ge-row { grid-template-columns: 1fr auto; }
  .ge-thumb { grid-column: 1 / -1; width: 100%; height: 100px; }
  .cev-row { grid-template-columns: 80px 1fr; }
  .wkd-badge { display: none; }
}
