/* ============================================================
   YŪ Nails Admin — Dark sidebar, clean cards
   ============================================================ */

:root {
  --a-sidebar:      #2C1A22;
  --a-sidebar-alt:  #3A2030;
  --a-sidebar-text: rgba(242, 221, 213, 0.6);
  --a-sidebar-act:  #FAF7F4;
  --a-gold:         #C4973E;
  --a-gold-light:   #E3CE90;
  --a-bg:           #F8F5F2;
  --a-surface:      #FFFFFF;
  --a-rose:         #E8A090;
  --a-border:       #EDE0D8;
  --a-text:         #3E2B22;
  --a-muted:        #8A7268;

  --sidebar-w:      260px;
  --topbar-h:       60px;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--a-text);
  background: var(--a-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }

/* ── Layout ──────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #2C1A22 0%, #3A2030 60%, #2C1A22 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(196, 151, 62, 0.2);
  margin-bottom: 0.5rem;
  position: relative;
}
.sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 1.5rem; right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(196,151,62,0.4), rgba(196,151,62,0.15) 70%, transparent);
}
.sidebar-logo-text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1;
}
.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1;
}
.sidebar-logo-text .you   { color: var(--a-gold); font-style: italic; line-height: 0.95; }
.sidebar-logo-text .nails {
  font-family: 'Great Vibes', 'Palatino Linotype', cursive;
  font-size: 1.2rem;
  color: rgba(220, 162, 172, 0.9);
  line-height: 1.15;
}
.sidebar-logo-sub {
  font-size: 0.6875rem;
  color: var(--a-sidebar-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.sidebar-nav { flex: 1; padding: 0.75rem 0; }
.sidebar-section-label {
  padding: 0.75rem 1.5rem 0.25rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(196, 151, 62, 0.35);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--a-sidebar-text);
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 200ms ease;
  border-left: 2px solid transparent;
  margin: 1px 0;
}
.sidebar-link .icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-link:hover {
  background: rgba(196, 151, 62, 0.07);
  color: rgba(242, 221, 213, 0.9);
}
.sidebar-link.active {
  background: rgba(196, 151, 62, 0.13);
  color: var(--a-gold-light);
  border-left-color: var(--a-gold);
  font-weight: 500;
}
.sidebar-link.active .icon { opacity: 1; }
.sidebar-badge {
  margin-left: auto;
  background: rgba(212, 144, 154, 0.85);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(196, 151, 62, 0.15);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a-gold), #E3CE90);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--a-sidebar);
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; color: var(--a-sidebar-act); font-weight: 500; }
.sidebar-user-role { font-size: 0.7rem; color: var(--a-sidebar-text); }
.sidebar-logout {
  margin-left: auto;
  color: var(--a-sidebar-text);
  transition: color 200ms;
}
.sidebar-logout:hover { color: #ff8888; }

/* Main area */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--a-surface);
  border-bottom: 1px solid var(--a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--a-text);
}
.topbar-breadcrumb {
  font-size: 0.8rem;
  color: var(--a-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-date { font-size: 0.8rem; color: var(--a-muted); }

/* Page content */
.page-content {
  padding: 1.75rem;
  flex: 1;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.page-header-title { font-family: 'Fraunces', serif; font-size: 1.75rem; font-weight: 400; color: var(--a-text); }
.page-header-sub   { font-size: 0.85rem; color: var(--a-muted); margin-top: 0.2rem; }

/* ── Stats cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 14px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.07;
}
.stat-card.rose::before  { background: var(--a-rose); }
.stat-card.gold::before  { background: var(--a-gold); }
.stat-card.green::before { background: #4ADE80; }
.stat-card.nude::before  { background: #C9B3A2; }
.stat-label   { font-size: 0.75rem; color: var(--a-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.stat-value   { font-family: 'Fraunces', serif; font-size: 2.25rem; font-weight: 400; line-height: 1; color: var(--a-text); }
.stat-change  { font-size: 0.75rem; color: var(--a-muted); margin-top: 0.4rem; }
.stat-icon    { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; opacity: 0.5; }

/* ── Tables ──────────────────────────────────────────────── */
.table-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 14px;
  overflow: hidden;
}
.table-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.table-card-title { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 400; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--a-border); }
th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--a-muted);
  white-space: nowrap;
}
td {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(237,224,216,0.5);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 150ms ease; }
tbody tr:hover { background: rgba(248,245,242,0.8); }
.td-name   { font-weight: 500; color: var(--a-text); }
.td-muted  { color: var(--a-muted); font-size: 0.8rem; }
.td-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Badges (status) ─────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-badge::before { content: '●'; font-size: 0.55rem; }
.status-pending        { background: #FEF3C7; color: #92400E; }
.status-accepted       { background: #DBEAFE; color: #1E40AF; }
.status-deposit_pending { background: #FEF3C7; color: #92400E; }
.status-confirmed      { background: #DCFCE7; color: #166534; }
.status-cancelled      { background: #FEE2E2; color: #991B1B; }
.status-completed      { background: #F3F4F6; color: #374151; }

/* ── Buttons (admin) ─────────────────────────────────────── */
.a-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms ease;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}
.a-btn-primary  { background: var(--a-rose); color: #fff; }
.a-btn-primary:hover { background: #d47868; }
.a-btn-gold     { background: var(--a-gold); color: #fff; }
.a-btn-gold:hover { background: #a87830; }
.a-btn-success  { background: #4ADE80; color: #14532D; }
.a-btn-success:hover { background: #22C55E; }
.a-btn-danger   { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.a-btn-danger:hover { background: #FCA5A5; }
.a-btn-ghost    { background: var(--a-bg); border-color: var(--a-border); color: var(--a-muted); }
.a-btn-ghost:hover { border-color: var(--a-rose); color: var(--a-text); }
.a-btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
.a-btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

/* ── Forms (admin) ───────────────────────────────────────── */
.a-form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.a-label { font-size: 0.8125rem; font-weight: 500; color: var(--a-text); }
.a-input,
.a-select,
.a-textarea {
  padding: 0.65rem 0.875rem;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  background: var(--a-surface);
  color: var(--a-text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  width: 100%;
}
.a-input:focus,
.a-select:focus,
.a-textarea:focus {
  outline: none;
  border-color: var(--a-rose);
  box-shadow: 0 0 0 3px rgba(232,160,144,0.15);
}
.a-textarea { resize: vertical; min-height: 100px; }
.a-hint { font-size: 0.75rem; color: var(--a-muted); }

/* ── Cards (admin) ───────────────────────────────────────── */
.a-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 14px;
  overflow: hidden;
}
.a-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.a-card-title { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 400; }
.a-card-body  { padding: 1.5rem; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(35,26,22,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--a-surface);
  border-radius: 16px;
  width: min(100%, 560px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(35,26,22,0.25);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--a-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 400; }
.modal-close { color: var(--a-muted); transition: color 150ms; font-size: 1.25rem; }
.modal-close:hover { color: var(--a-text); }
.modal-body    { padding: 1.5rem; }
.modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--a-border); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Booking detail ──────────────────────────────────────── */
.booking-detail-grid {
  display: grid;
  gap: 1.5rem;
}
.detail-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(237,224,216,0.5);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--a-muted); min-width: 140px; flex-shrink: 0; }
.detail-val { color: var(--a-text); font-weight: 500; word-break: break-word; }
.inspo-img  { max-width: 100%; border-radius: 8px; margin-top: 0.5rem; }

/* Countdown */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
}
.countdown.urgent   { background: #FEE2E2; color: #991B1B; animation: pulse 1.5s infinite; }
.countdown.warning  { background: #FEF3C7; color: #92400E; }
.countdown.normal   { background: #F3F4F6; color: #374151; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }

/* ── Calendar (agenda) ───────────────────────────────────── */
.agenda-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.agenda-nav-btn {
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--a-muted);
  transition: all 180ms;
}
.agenda-nav-btn:hover { border-color: var(--a-rose); color: var(--a-text); }
.agenda-month-label {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 400;
  min-width: 180px;
  text-align: center;
  text-transform: capitalize;
}
.agenda-view-toggle { display: flex; border: 1.5px solid var(--a-border); border-radius: 8px; overflow: hidden; margin-left: auto; }
.agenda-view-btn {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--a-muted);
  transition: all 180ms;
  border-right: 1.5px solid var(--a-border);
}
.agenda-view-btn:last-child { border-right: none; }
.agenda-view-btn.active { background: var(--a-rose); color: #fff; border-color: var(--a-rose); }

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-month-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--a-muted);
  padding: 0.6rem 0;
}
.cal-month-day {
  min-height: 80px;
  border: 1px solid var(--a-border);
  border-radius: 8px;
  padding: 0.4rem;
  background: var(--a-surface);
  vertical-align: top;
  transition: background 150ms;
}
.cal-month-day:empty { background: rgba(237,224,216,0.2); border-color: rgba(237,224,216,0.4); }
.cal-month-day.today { border-color: var(--a-rose); background: rgba(232,160,144,0.04); }
.cal-month-day.blocked { background: rgba(237,224,216,0.35); }
.cal-day-num { font-size: 0.75rem; font-weight: 600; color: var(--a-muted); margin-bottom: 0.3rem; }
.cal-month-day.today .cal-day-num { color: var(--a-rose); }
.cal-event {
  display: block;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event.pending   { background: #FEF3C7; color: #92400E; }
.cal-event.confirmed { background: #DCFCE7; color: #166534; }
.cal-event.deposit   { background: #DBEAFE; color: #1E40AF; }
.cal-event.completed { background: #F3F4F6; color: #374151; }

/* ── Blocked days calendar ───────────────────────────────── */
.blocked-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.blocked-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 180ms;
  border: 1.5px solid transparent;
  font-weight: 400;
}
.blocked-cal-day.empty   { pointer-events: none; }
.blocked-cal-day:not(.empty):not(.past):hover { border-color: var(--a-rose); color: var(--a-rose); }
.blocked-cal-day.past    { color: rgba(138,114,104,0.4); cursor: default; }
.blocked-cal-day.blocked { background: var(--a-rose); color: #fff; }
.blocked-cal-day.today   { font-weight: 700; color: var(--a-rose); border-color: var(--a-rose); }

/* ── Gallery upload ──────────────────────────────────────── */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.gallery-admin-item {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--a-border);
  transition: all 180ms;
  position: relative;
  background: var(--a-bg);
}
.gallery-admin-item:hover { border-color: var(--a-rose); }
.gallery-admin-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.gallery-admin-item-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 180ms;
}
.gallery-admin-item:hover .gallery-admin-item-actions { opacity: 1; }
.gallery-admin-item-meta {
  padding: 0.6rem;
  font-size: 0.75rem;
  color: var(--a-muted);
  border-top: 1px solid var(--a-border);
}
.gallery-admin-item.hidden { opacity: 0.4; }

/* ── Filters bar ─────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--a-border);
  background: var(--a-bg);
}
.filter-select {
  padding: 0.45rem 0.875rem;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--a-text);
  background: var(--a-surface);
  cursor: pointer;
  font-family: inherit;
}
.filter-search {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.875rem;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: inherit;
  background: var(--a-surface);
  color: var(--a-text);
}
.filter-search:focus,
.filter-select:focus { outline: none; border-color: var(--a-rose); }

/* ── Settings ────────────────────────────────────────────── */
.settings-section {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.settings-section-header {
  padding: 1.1rem 1.5rem;
  background: var(--a-bg);
  border-bottom: 1px solid var(--a-border);
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--a-text);
}
.settings-section-body { padding: 1.5rem; }

/* ── Responsive (mobile sidebar toggle) ─────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1.5px solid var(--a-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--a-muted);
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-content { padding: 1rem; }
}
@media (min-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Tabs ─────────────────────────────────────────────────── */
.cfg-tabs { display:flex; gap:0; border-bottom:2px solid var(--a-border); margin-bottom:1.5rem; }
.cfg-tab { padding:0.75rem 1.25rem; font-size:0.875rem; color:var(--a-muted); border-bottom:2px solid transparent; margin-bottom:-2px; transition:all 180ms ease; }
.cfg-tab:hover { color:var(--a-text); }
.cfg-tab.active { color:var(--a-gold); border-bottom-color:var(--a-gold); font-weight:500; }
