/* ────────────────────────────────────────────────
   ADMIN PANEL UNIFICADO · RakeFitLine
   admin_panel.css
──────────────────────────────────────────────── */

/* ── VARIABLES (alineadas con style.css) ──────── */
:root {
  --sage:       #7a9e7e;
  --sage-light: #b8d4bb;
  --sage-dark:  #4a6e4e;
  --beige:      #f5f0e8;
  --beige-mid:  #ede5d8;
  --beige-dark: #d4c5b0;
  --olive:      #3d4a35;
  --text:       #2c2c2c;
  --text-muted: #7a7a72;
  --white:      #ffffff;
  --danger:     #c0392b;
  --shadow:     0 4px 32px rgba(60,70,50,.08);
  --radius:     18px;
  --radius-sm:  10px;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--beige);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
em { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 300; }
a  { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* ── LAYOUT ──────────────────────────────────────── */
.admin-body   { min-height: 100vh; }
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── LOGIN ───────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--beige);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--sage-light), transparent 70%);
  top: -160px; right: -160px;
  border-radius: 50%;
  opacity: .28;
  pointer-events: none;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow), 0 24px 64px rgba(60,70,50,.08);
  animation: fadeUp .5s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--beige-mid);
}
.login-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage-light), var(--sage-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 300;
  color: var(--white);
  overflow: hidden;
}
.login-avatar img { width:100%; height:100%; object-fit:cover; }
.login-brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; font-weight: 300;
  color: var(--olive);
}
.login-brand-sub {
  font-size: .72rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-note {
  margin-top: 20px; font-size: .78rem;
  color: var(--text-muted); text-align: center;
}
.login-note a { color: var(--sage-dark); text-decoration: underline; }

/* ── SIDEBAR ─────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--olive);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-avatar-wrap {
  position: relative;
  width: 72px; height: 72px;
}
.sidebar-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.2);
  display: none; /* se muestra via JS */
}
.sidebar-avatar-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage), var(--sage-dark));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 300; color: var(--white);
}
.sidebar-name {
  font-size: .9rem; font-weight: 500; color: var(--white);
  text-align: center; line-height: 1.3;
}
.sidebar-role {
  font-size: .65rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage-light); opacity: .7;
}

.sidebar-nav {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 10px; flex: 1;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm); border: none;
  background: transparent;
  color: rgba(255,255,255,.55);
  font-family: 'DM Sans', sans-serif; font-size: .87rem;
  cursor: pointer; transition: all var(--transition); text-align: left;
}
.sidebar-item:hover  { background: rgba(255,255,255,.09); color: var(--white); }
.sidebar-item.active { background: rgba(255,255,255,.15); color: var(--white); font-weight: 500; }
.si-icon { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 10px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-reservas-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(122,158,126,.25);
  border: 1px solid rgba(122,158,126,.4);
  border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 500;
  color: var(--sage-light);
  transition: all var(--transition);
}
.sidebar-reservas-btn:hover { background: rgba(122,158,126,.4); color: var(--white); }
.ext-icon { font-size: .8rem; opacity: .7; }
.sidebar-preview-btn {
  display: block; text-align: center;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm);
  font-size: .76rem; color: rgba(255,255,255,.4);
  transition: all var(--transition);
}
.sidebar-preview-btn:hover { color: var(--white); border-color: rgba(255,255,255,.3); }
.sidebar-logout-btn {
  width: 100%; padding: 9px 14px;
  background: transparent; border: 1px solid rgba(255,80,80,.2);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: .8rem;
  color: rgba(255,120,120,.6); cursor: pointer; text-align: left;
  transition: all var(--transition);
}
.sidebar-logout-btn:hover { background: rgba(255,80,80,.15); color: #ff9999; border-color: rgba(255,80,80,.4); }

/* ── MAIN ────────────────────────────────────────── */
.admin-main {
  flex: 1; min-width: 0;
  padding: 40px 5vw;
  max-width: 900px;
}
.admin-section { display: none; animation: fadeUp .3s ease; }
.admin-section.active { display: block; }

.section-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px;
  flex-wrap: wrap; margin-bottom: 32px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 300; color: var(--olive); line-height: 1.2;
}
.section-sub { font-size: .87rem; color: var(--text-muted); margin-top: 4px; }

/* ── INICIO CARDS ────────────────────────────────── */
.inicio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.inicio-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column; gap: 8px;
  border: 1.5px solid transparent;
}
.inicio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(60,70,50,.12);
  border-color: var(--sage);
}
.inicio-card--external { cursor: pointer; }
.ic-icon  { font-size: 1.8rem; }
.inicio-card strong { font-size: .95rem; color: var(--olive); }
.inicio-card p  { font-size: .82rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.ic-link { font-size: .78rem; font-weight: 600; color: var(--sage-dark); }

/* ── EVENTOS LIST ────────────────────────────────── */
.admin-events-list { display: flex; flex-direction: column; gap: 12px; }
.admin-event-row {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 2px 12px rgba(60,70,50,.06);
  animation: fadeUp .3s ease both;
}
.aer-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sage-light), var(--beige-dark));
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.aer-thumb img { width:100%; height:100%; object-fit:cover; }
.aer-info { flex:1; min-width:0; }
.aer-type  { font-size: .64rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--sage-dark); }
.aer-name  { font-family:'Cormorant Garamond',serif; font-size:1.05rem; font-weight:400; color:var(--olive); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.aer-dates { font-size:.73rem; color:var(--text-muted); margin-top:2px; }
.aer-actions { display:flex; gap:8px; flex-shrink:0; }
.aer-btn {
  background:var(--beige); border:1px solid var(--beige-dark);
  border-radius:var(--radius-sm); padding:6px 14px;
  font-family:'DM Sans',sans-serif; font-size:.78rem; font-weight:500;
  cursor:pointer; color:var(--text); transition:all var(--transition);
}
.aer-btn:hover { background:var(--beige-mid); }
.aer-btn--danger:hover { background:#fde8e8; border-color:#e07070; color:var(--danger); }

.admin-empty {
  text-align:center; padding:56px 20px;
  color:var(--text-muted); display:flex; flex-direction:column; align-items:center; gap:12px;
}

/* ── FORM ────────────────────────────────────────── */
.admin-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 22px;
}
.pw-form-wrap { max-width: 480px; }
.pw-form      { max-width: 100%; }

.form-row   { display:flex; gap:16px; flex-wrap:wrap; }
.form-group { display:flex; flex-direction:column; gap:6px; flex:1 1 180px; }
.form-group--wide { flex: 2 1 300px; }
.form-group label {
  font-size:.72rem; font-weight:600;
  letter-spacing:.1em; text-transform:uppercase; color:var(--text-muted);
}
.form-group small { font-size:.72rem; color:var(--text-muted); }
.req { color:var(--sage-dark); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--beige-mid);
  border-radius: var(--radius-sm);
  background: var(--beige);
  font-family: 'DM Sans', sans-serif; font-size: .93rem; color: var(--text);
  transition: border-color var(--transition); outline: none; resize: vertical; appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--sage); background: var(--white); }
.form-group input.error,
.form-group textarea.error { border-color: #e07070; }
.field-error { font-size:.73rem; color:var(--danger); min-height:16px; }
.form-actions { display:flex; align-items:center; gap:12px; padding-top:8px; border-top:1px solid var(--beige-mid); }

/* Password wrap */
.password-wrap { position:relative; }
.password-wrap input { width:100%; padding-right:44px; }
.toggle-pw {
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:1rem;
  opacity:.5; transition:opacity var(--transition); padding:4px;
}
.toggle-pw:hover { opacity:1; }

/* Remember */
.remember-row { margin-top:-4px; }
.remember-label {
  display:flex; align-items:center; gap:8px;
  font-size:.83rem; color:var(--text-muted); cursor:pointer; user-select:none;
}
.remember-label input[type="checkbox"] {
  width:15px; height:15px; accent-color:var(--sage-dark); cursor:pointer; flex-shrink:0;
  border:none; background:none; padding:0;
}

/* Image upload */
.img-upload-zone {
  position:relative; border:2px dashed var(--beige-dark);
  border-radius:var(--radius-sm); overflow:hidden; cursor:pointer;
  transition:border-color var(--transition); min-height:130px;
}
.img-upload-zone:hover { border-color:var(--sage); }
.img-upload-zone input[type="file"] {
  position:absolute; inset:0; opacity:0; cursor:pointer; z-index:2; width:100%; height:100%;
  border:none; background:none; padding:0;
}
.img-upload-placeholder {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:28px; text-align:center; color:var(--text-muted); pointer-events:none;
}
.img-upload-placeholder span { font-size:1.8rem; }
.img-upload-placeholder p    { font-size:.87rem; }
.img-upload-placeholder small{ font-size:.72rem; opacity:.6; }
.img-preview { width:100%; max-height:200px; object-fit:cover; display:block; }

/* Tag inputs */
.tag-input-wrap {
  border:1.5px solid var(--beige-mid); border-radius:var(--radius-sm);
  background:var(--beige); padding:8px 12px;
  display:flex; flex-wrap:wrap; gap:6px; align-items:center; min-height:50px;
  cursor:text; transition:border-color var(--transition);
}
.tag-input-wrap:focus-within { border-color:var(--sage); background:var(--white); }
.tag-list { display:contents; }
.tag-pill {
  display:inline-flex; align-items:center; gap:5px;
  background:var(--white); border:1px solid var(--beige-dark);
  border-radius:50px; padding:3px 10px;
  font-size:.78rem; color:var(--olive); white-space:nowrap;
}
.tag-remove {
  background:none; border:none; cursor:pointer; padding:0;
  color:var(--text-muted); font-size:.9rem; line-height:1; transition:color var(--transition);
}
.tag-remove:hover { color:var(--danger); }
.tag-input {
  flex:1; min-width:120px; border:none; background:transparent;
  font-family:'DM Sans',sans-serif; font-size:.88rem; color:var(--text); outline:none; padding:2px 4px;
}

/* ── FOTO PERFIL ─────────────────────────────────── */
.foto-panel {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}
.foto-current {
  width: 180px; height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--beige-dark);
  background: var(--beige-mid);
  display: flex; align-items: center; justify-content: center;
}
.foto-current img { width:100%; height:100%; object-fit:cover; }
.foto-placeholder {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  color:var(--text-muted); font-size:.8rem;
}
.foto-placeholder span { font-size:2rem; }
.foto-preview-labels { text-align:center; margin-top:10px; font-size:.75rem; color:var(--text-muted); font-weight:500; letter-spacing:.08em; text-transform:uppercase; }
.foto-upload-zone { min-height: 160px; }
.foto-actions { display:flex; align-items:center; gap:16px; margin-top:12px; flex-wrap:wrap; }
.foto-hint { font-size:.78rem; color:var(--text-muted); }

/* ── BUTTONS ─────────────────────────────────────── */
.btn-primary {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--olive); color:var(--white);
  font-family:'DM Sans',sans-serif; font-size:.9rem; font-weight:500;
  padding:13px 24px; border-radius:50px; border:none; cursor:pointer;
  transition:all var(--transition); width:100%;
}
.btn-primary:hover { background:var(--sage-dark); transform:translateY(-1px); box-shadow:0 8px 20px rgba(60,80,50,.18); }
.btn-primary.loading { opacity:.65; pointer-events:none; }
.btn-danger { background:var(--danger); }
.btn-danger:hover { background:#96281b; }
.btn-ghost {
  background:transparent; border:none;
  font-family:'DM Sans',sans-serif; font-size:.82rem;
  color:var(--text-muted); cursor:pointer; padding:4px; transition:color var(--transition);
}
.btn-ghost:hover { color:var(--text); }

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position:fixed; bottom:28px; left:50%;
  transform:translateX(-50%);
  background:var(--olive); color:var(--white);
  font-size:.87rem; font-weight:500;
  padding:12px 24px; border-radius:50px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  z-index:999; white-space:nowrap;
  animation:toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(12px); }
  to   { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* ── CONFIRM ─────────────────────────────────────── */
.confirm-overlay {
  position:fixed; inset:0;
  background:rgba(30,38,26,.5); backdrop-filter:blur(4px);
  z-index:300; display:flex; align-items:center; justify-content:center;
  animation:fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.confirm-box {
  background:var(--white); border-radius:var(--radius);
  padding:32px 36px; max-width:340px; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.16); animation:fadeUp .25s ease;
}
.confirm-box p { font-family:'Cormorant Garamond',serif; font-size:1.25rem; color:var(--olive); margin-bottom:22px; }
.confirm-actions { display:flex; gap:10px; justify-content:center; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 760px) {
  .admin-wrapper { flex-direction: column; }
  .admin-sidebar {
    width:100%; height:auto; position:static;
    flex-direction:row; flex-wrap:wrap;
    align-items:center; padding:12px 16px; gap:8px;
  }
  .sidebar-profile { flex-direction:row; border:none; padding:0; gap:10px; }
  .sidebar-avatar-wrap,.sidebar-avatar,.sidebar-avatar-placeholder { width:40px; height:40px; font-size:1rem; }
  .sidebar-nav { flex-direction:row; flex-wrap:wrap; padding:0; }
  .sidebar-footer { flex-direction:row; flex-wrap:wrap; border:none; padding:0; }
  .admin-main { padding:24px 16px; }
  .foto-panel { grid-template-columns:1fr; }
  .foto-current { margin:0 auto; }
  .foto-preview-wrap { display:flex; flex-direction:column; align-items:center; }
}
