/* ================================================
   THE GENTLE GIANTS — ADMIN DASHBOARD STYLES
   ================================================ */

/* ---------- RESET & VARIABLES ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* brand colours — same as main site */
  --forest:    #2c3e2d;
  --forest-d:  #1e2b1f;
  --forest-l:  #3d5440;
  --gold:      #c8a86b;
  --gold-l:    #e2cfa0;
  --gold-d:    #a8883d;
  --cream:     #faf8f3;
  --warm:      #f3ede2;
  --text:      #2a2520;
  --muted:     #6b6258;

  /* admin-specific */
  --sidebar-w:       260px;
  --topbar-h:        60px;
  --radius:          8px;
  --radius-lg:       12px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.08);
  --shadow-md:       0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:       0 8px 30px rgba(0,0,0,.15);
  --transition:      .25s ease;
  --blue:            #3b82f6;
  --green:           #22c55e;
  --yellow:          #eab308;
  --red:             #ef4444;
  --purple:          #a855f7;

  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--cream);
}

h1, h2, h3, h4, h5 { font-family: 'Playfair Display', serif; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: .95rem; }

/* ---------- LOGIN SCREEN ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--forest-d) 0%, var(--forest) 50%, var(--forest-l) 100%);
}

.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.2rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: 2rem;
}
.login-logo-icon {
  width: 42px; height: 42px;
  background: var(--forest);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-icon svg { width: 22px; height: 22px; }
.login-brand { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: var(--forest); }
.login-brand-sub { font-size: .78rem; color: var(--muted); letter-spacing: .5px; }

.login-field { margin-bottom: 1.2rem; }
.login-field label {
  display: block; margin-bottom: .4rem;
  font-size: .82rem; font-weight: 600; color: var(--text); letter-spacing: .3px;
}
.login-field input {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid #ddd; border-radius: var(--radius);
  background: var(--cream); outline: none;
  transition: border var(--transition);
}
.login-field input:focus { border-color: var(--gold); }
.password-wrap { position: relative; }
.toggle-pass {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); padding: 4px;
}
.toggle-pass .eye-icon { width: 20px; height: 20px; }

.login-error {
  color: var(--red); font-size: .82rem; min-height: 1.2rem; margin-bottom: .4rem;
}

.login-btn {
  width: 100%; padding: .75rem;
  background: var(--forest); color: #fff;
  border: none; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: background var(--transition);
}
.login-btn:hover { background: var(--forest-d); }
.login-btn svg { width: 18px; height: 18px; }

.login-hint {
  margin-top: 1.4rem; text-align: center;
  font-size: .78rem; color: var(--muted);
}
.login-hint strong { color: var(--forest); }

/* ---------- ADMIN SHELL ---------- */
.admin-shell {
  display: flex; min-height: 100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--forest-d);
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 1.3rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo { display: flex; align-items: center; gap: .7rem; }
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 18px; height: 18px; }
.sidebar-brand { font-family: 'Playfair Display', serif; font-weight: 700; font-size: .95rem; }
.sidebar-brand-sub { font-size: .7rem; color: rgba(255,255,255,.5); letter-spacing: .5px; }

.sidebar-nav {
  flex: 1; padding: 1rem 0;
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1.2rem;
  font-size: .88rem; font-weight: 500;
  color: rgba(255,255,255,.65);
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-link.active {
  color: var(--gold-l);
  background: rgba(255,255,255,.08);
  border-left-color: var(--gold);
}
.sidebar-divider {
  height: 1px; background: rgba(255,255,255,.08);
  margin: .5rem 1.2rem;
}

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-logout {
  display: flex; align-items: center; gap: .6rem;
  background: none; border: none; color: rgba(255,255,255,.55);
  font-size: .85rem; font-weight: 500; padding: .5rem 0; width: 100%;
  transition: color var(--transition);
}
.sidebar-logout:hover { color: var(--red); }
.sidebar-logout svg { width: 18px; height: 18px; }

/* ---------- MAIN CONTENT ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---------- TOPBAR ---------- */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #eee;
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text); padding: 4px;
}
.sidebar-toggle svg { width: 24px; height: 24px; }
.topbar-title { font-size: 1.15rem; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.topbar-user { display: flex; align-items: center; gap: .5rem; }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--forest); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600;
}
.topbar-username { font-size: .88rem; font-weight: 500; }

/* ---------- PAGE AREAS ---------- */
.page { padding: 1.5rem; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 1.3rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-icon-blue   { background: #dbeafe; }
.stat-icon-green  { background: #dcfce7; }
.stat-icon-yellow { background: #fef9c3; }
.stat-icon-purple { background: #f3e8ff; }
.stat-num  { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; color: var(--forest-d); }
.stat-label { font-size: .78rem; color: var(--muted); letter-spacing: .3px; }

/* ---------- CARD ---------- */
.card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  padding: 1.1rem 1.3rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f0ede8;
}
.card-title { font-size: 1.05rem; font-weight: 700; }

/* ---------- TABLE ---------- */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: .75rem 1rem;
  text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: var(--cream);
  border-bottom: 1px solid #eee;
}
.data-table td {
  padding: .7rem 1rem;
  font-size: .88rem; vertical-align: middle;
  border-bottom: 1px solid #f5f3ef;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #fdfcfa; }

.kitten-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; border: 2px solid var(--warm);
}

/* Status Badges */
.status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .7rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .2px;
}
.status-available       { background: #dcfce7; color: #166534; }
.status-reserved        { background: #dbeafe; color: #1e40af; }
.status-deposit-pending { background: #fef9c3; color: #854d0e; }
.status-sold            { background: #f3e8ff; color: #6b21a8; }

.status-dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
}
.status-available .status-dot       { background: #22c55e; }
.status-reserved .status-dot        { background: #3b82f6; }
.status-deposit-pending .status-dot { background: #eab308; }
.status-sold .status-dot            { background: #a855f7; }

/* Action Buttons */
.action-btns { display: flex; gap: .4rem; }
.action-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #e5e2dc; background: #fff;
  color: var(--muted); transition: all var(--transition);
}
.action-btn svg { width: 15px; height: 15px; }
.action-btn:hover { border-color: var(--forest); color: var(--forest); background: var(--cream); }
.action-btn.action-delete:hover { border-color: var(--red); color: var(--red); background: #fef2f2; }

.table-empty {
  padding: 3rem; text-align: center; color: var(--muted);
}
.table-empty svg { width: 48px; height: 48px; margin: 0 auto .8rem; opacity: .3; }
.table-empty p { font-size: .9rem; }

/* ---------- PAGE HEADER ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem; flex-wrap: wrap; gap: 1rem;
}
.page-heading { font-size: 1.3rem; font-weight: 700; color: var(--forest-d); }
.page-sub { font-size: .85rem; color: var(--muted); margin-top: .15rem; }

/* ---------- FILTERS BAR ---------- */
.filters-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.search-wrap {
  position: relative; flex: 1; min-width: 200px; max-width: 340px;
}
.search-wrap svg {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted);
}
.search-wrap input {
  width: 100%; padding: .6rem .8rem .6rem 2.4rem;
  border: 1.5px solid #ddd; border-radius: var(--radius);
  background: #fff; outline: none;
  transition: border var(--transition);
}
.search-wrap input:focus { border-color: var(--gold); }

.filter-group { display: flex; gap: .5rem; }
.filter-group select {
  padding: .55rem .8rem; border: 1.5px solid #ddd;
  border-radius: var(--radius); background: #fff;
  outline: none; cursor: pointer;
  transition: border var(--transition);
}
.filter-group select:focus { border-color: var(--gold); }

/* ---------- BUTTONS ---------- */
.btn-primary {
  padding: .6rem 1.2rem;
  background: var(--forest); color: #fff;
  border: none; border-radius: var(--radius);
  font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--forest-d); }
.btn-primary svg { width: 16px; height: 16px; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }

.btn-secondary {
  padding: .6rem 1.2rem;
  background: var(--warm); color: var(--text);
  border: 1px solid #ddd; border-radius: var(--radius);
  font-weight: 600; font-size: .88rem;
  transition: all var(--transition);
}
.btn-secondary:hover { background: #ebe5d9; }

.btn-danger {
  padding: .6rem 1.2rem;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--radius);
  font-weight: 600; font-size: .88rem;
  transition: background var(--transition);
}
.btn-danger:hover { background: #dc2626; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
.modal-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .3s ease;
  overflow: hidden;
}
.modal-sm { max-width: 420px; }

/* form wraps body + footer — must also flex-column so footer stays visible */
.modal > form {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 1.2rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #f0ede8;
  flex-shrink: 0;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--muted); padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body {
  padding: 1.3rem 1.4rem;
  overflow-y: auto; flex: 1; min-height: 0;
}
.modal-footer {
  padding: 1rem 1.4rem;
  display: flex; justify-content: flex-end; gap: .6rem;
  border-top: 1px solid #f0ede8;
  flex-shrink: 0;
}

/* Form inside modal */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; margin-bottom: .35rem;
  font-size: .8rem; font-weight: 600; color: var(--text); letter-spacing: .3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: .6rem .8rem;
  border: 1.5px solid #ddd; border-radius: var(--radius);
  background: var(--cream); outline: none;
  transition: border var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); }

.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid { border-color: var(--red); }

/* Image source tabs */
.img-source-tabs {
  display: flex; gap: 0; margin-bottom: .6rem;
  border: 1.5px solid #ddd; border-radius: var(--radius);
  overflow: hidden;
}
.img-tab {
  flex: 1; padding: .5rem .8rem;
  background: var(--cream); border: none;
  font-size: .82rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  transition: all var(--transition);
}
.img-tab + .img-tab { border-left: 1.5px solid #ddd; }
.img-tab.active { background: var(--forest); color: #fff; }
.img-tab:hover:not(.active) { background: var(--warm); }

.img-tab-content { }

/* Upload zone */
.upload-zone {
  position: relative;
  border: 2px dashed #ccc; border-radius: var(--radius);
  padding: 1.8rem 1rem; text-align: center;
  background: var(--cream);
  transition: all var(--transition);
  cursor: pointer;
}
.upload-zone.drag-over {
  border-color: var(--gold); background: #faf6ed;
}
.upload-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.upload-placeholder svg {
  width: 32px; height: 32px; color: var(--muted);
  margin-bottom: .4rem;
}
.upload-placeholder p {
  font-size: .85rem; color: var(--muted); margin: 0;
}
.upload-browse { color: var(--gold-d); font-weight: 600; text-decoration: underline; }
.upload-hint { font-size: .75rem !important; margin-top: .25rem !important; opacity: .7; }

/* Preview */
.img-preview-wrap { margin-top: .5rem; position: relative; display: inline-block; }
.img-preview {
  width: 100%; max-height: 140px;
  object-fit: cover; border-radius: var(--radius);
  border: 2px solid var(--warm);
}
.img-preview-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  border: none; font-size: .75rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.img-preview-remove:hover { background: var(--red); }

/* Delete Modal */
.delete-warning { text-align: center; padding: .5rem 0; }
.delete-warning svg {
  width: 48px; height: 48px; color: var(--yellow);
  margin-bottom: .8rem;
}
.delete-warning p { font-size: .95rem; }
.delete-sub { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

/* ---------- TOAST ---------- */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 2000;
}
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1.2rem; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-md);
  font-size: .88rem; font-weight: 500;
  animation: toastIn .3s ease;
  min-width: 260px;
}
.toast.toast-out { animation: toastOut .3s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

.toast-icon { font-size: 1.1rem; }
.toast-success { border-left: 4px solid var(--green); }
.toast-error   { border-left: 4px solid var(--red); }
.toast-info    { border-left: 4px solid var(--blue); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle { display: block; }

  .main-content { margin-left: 0; }

  .topbar-username { display: none; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
  .filter-group { flex-wrap: wrap; }

  .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) { display: none; }

  .login-card { padding: 1.8rem 1.4rem; }
}

/* Sidebar overlay on mobile */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 99;
}
.sidebar-backdrop.show { display: block; }
