/* ===== Yara Glow — Admin Dashboard ===== */
.admin-body { background: var(--beige-100); }

/* hidden attribute must always win, even over display:grid/flex layouts */
[hidden] { display: none !important; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 80% 15%, rgba(233,196,196,.5), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(201,161,90,.28), transparent 45%),
    linear-gradient(160deg, var(--blush), var(--beige-50) 55%, var(--beige));
}
.login-card {
  width: min(420px, 100%); background: var(--white); border-radius: var(--radius-lg);
  padding: 38px 32px; box-shadow: var(--shadow-lg); text-align: center;
  display: flex; flex-direction: column; gap: 14px; border: 1px solid rgba(201,161,90,.14);
}
.login-card .brand { justify-content: center; font-size: 1.5rem; margin-bottom: 4px; }
.login-card h1 { font-family: var(--font-display); font-size: 1.7rem; }
.login-card p { color: var(--ink-soft); font-size: .96rem; }
.login-card .field { text-align: start; }
.login-error { color: #c0392b; font-weight: 700; font-size: .9rem; }
.login-back { color: var(--ink-soft); font-size: .92rem; margin-top: 4px; }
.login-back:hover { color: var(--gold-dark); }
.remember-row { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-soft); text-align: start; cursor: pointer; }
.remember-row input { width: auto; accent-color: var(--gold-dark); }
.login-hint { font-size: .82rem; color: var(--ink-soft); margin-top: 4px; }
.login-hint b { color: var(--gold-dark); }
.current-user { font-size: .85rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }

/* admins management */
.perms-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-row { background: var(--beige-50); border: 1px solid rgba(201,161,90,.14); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.admin-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-row-head b { font-size: 1.05rem; }
.admin-role { font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(108,122,137,.18); color: #4a5763; }
.admin-role.owner { background: rgba(201,161,90,.2); color: var(--gold-dark); }
.admin-row-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Header ---- */
.admin-header {
  background: var(--white); border-bottom: 1px solid rgba(201,161,90,.16);
  position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow-sm);
}
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.admin-header .brand { font-size: 1.3rem; }
.admin-header-actions { display: flex; align-items: center; gap: 16px; }
.admin-hello { color: var(--ink-soft); font-weight: 500; }
.cloud-status { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.admin-header-actions .btn { padding: 9px 14px; font-size: .88rem; }

/* Tabs */
.admin-tabs { display: flex; gap: 6px; background: var(--beige-100); padding: 4px; border-radius: 999px; }
.admin-tabs .tab {
  font-family: var(--font); font-weight: 700; font-size: .95rem; cursor: pointer;
  border: none; background: transparent; color: var(--ink-soft);
  padding: 8px 20px; border-radius: 999px; transition: all .18s;
}
.admin-tabs .tab.is-active { background: var(--white); color: var(--gold-dark); box-shadow: var(--shadow-sm); }

/* Services admin */
.services-admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.sa-title { font-family: var(--font-display); font-size: 1.7rem; }
.sa-sub { color: var(--ink-soft); font-size: .95rem; margin-top: 4px; max-width: 640px; }
.svc-edit {
  background: var(--white); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.12); margin-bottom: 18px;
}
.svc-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.svc-edit .field { margin-top: 14px; }
.svc-edit .field:first-child, .svc-row .field { margin-top: 0; }
.svc-row + .field, .svc-edit > .field { margin-top: 14px; }
.svc-edit .field span { font-size: .88rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; display: block; }
.svc-edit .field span em { font-weight: 400; color: var(--ink-soft); }
.svc-edit input {
  width: 100%; font-family: var(--font); font-size: .98rem; padding: 10px 12px;
  border: 1.5px solid var(--sand); border-radius: 10px; background: var(--beige-50); color: var(--ink);
}
.svc-edit input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,161,90,.16); }
/* provider chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blush); color: var(--gold-dark); border: 1.5px solid var(--gold);
  border-radius: 999px; padding: 6px 12px; font-size: .9rem; font-weight: 700;
}
.chip button { border: none; background: transparent; color: var(--gold-dark); cursor: pointer; font-size: .8rem; padding: 0; line-height: 1; }
.chip button:hover { color: #c0392b; }
.chip-add { display: flex; gap: 8px; }
.chip-add input { flex: 1; font-family: var(--font); font-size: .96rem; padding: 10px 12px; border: 1.5px solid var(--sand); border-radius: 10px; background: var(--beige-50); color: var(--ink); }
.chip-add input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,161,90,.16); }

.days-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.day-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--beige-50); border: 1.5px solid var(--sand); border-radius: 10px; padding: 7px 12px; font-size: .9rem; font-weight: 600; }
.day-check input { width: auto; accent-color: var(--gold-dark); }
.day-check:has(input:checked) { background: var(--blush); border-color: var(--gold); color: var(--gold-dark); }
.svc-img-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: end; margin-top: 14px; }
.svc-img-row .field { margin-top: 0; }
.svc-img-preview {
  width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-size: 1.6rem;
  background: linear-gradient(135deg, var(--rose), var(--gold)); border: 1.5px solid var(--sand);
}
.svc-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.svc-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-delete { color: #c0392b; border-color: rgba(192,57,43,.4); }
.btn-delete:hover { background: rgba(192,57,43,.08); border-color: #c0392b; }
.save-hint { color: #1f7a52; font-weight: 700; text-align: center; padding: 8px; }
.hint-small { color: var(--ink-soft); font-size: .88rem; margin: 6px 0 12px; }

/* bookings toolbar */
.bookings-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

/* revenue report */
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rev-card { background: var(--white); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.12); position: relative; overflow: hidden; }
.rev-card::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 0; width: 5px; background: var(--gold); }
.rev-card.total::before { background: var(--gold-dark); }
.rev-card.today::before { background: #2e9e6b; }
.rev-card.expected::before { background: #6c7a89; }
.rev-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.rev-label { color: var(--ink-soft); font-size: .88rem; margin-top: 2px; }
.rev-note { color: var(--ink-soft); font-size: .82rem; margin: 8px 0 16px; }
.rev-subhead { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 10px; color: var(--gold-dark); }

/* booking card: unseen + chevron + new flag */
.booking-card { position: relative; }
.booking-card.is-unseen { box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm); }
.new-flag {
  position: absolute; inset-block-start: -10px; inset-inline-start: 18px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #fff;
  font-weight: 800; font-size: .74rem; padding: 3px 12px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(201,161,90,.5); animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.bk-chevron { color: var(--ink-soft); font-size: 1.6rem; align-self: center; }
.stat-card.new-badge::before { background: var(--gold); }

/* booking popup */
.bk-dialog { width: min(520px, 94vw); padding: 30px 26px 24px; }
.bk-modal-title { font-family: var(--font-display); font-size: 1.5rem; text-align: center; margin-bottom: 18px; }
.bk-status-picker { margin-top: 18px; }
.bk-status-label { display: block; font-weight: 700; color: var(--ink-soft); margin-bottom: 8px; font-size: .9rem; }
.bk-status-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* toasts */
.toast-wrap { position: fixed; inset-block-start: 18px; inset-inline-start: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--white); border-radius: 14px; padding: 14px 16px; min-width: 280px; max-width: 340px;
  box-shadow: var(--shadow-lg); border-inline-start: 5px solid var(--gold);
  transform: translateX(-120%); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { font-size: 1.6rem; }
.toast-body { display: flex; flex-direction: column; flex: 1; }
.toast-body b { color: var(--gold-dark); }
.toast-body small { color: var(--ink-soft); font-size: .82rem; }
.toast-close { border: none; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: .9rem; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-card { background: var(--white); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.12); }
.settings-card.settings-wide { grid-column: 1 / -1; }
.settings-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 14px; color: var(--gold-dark); }
.settings-card .field { margin-top: 12px; }
.settings-card .field:first-of-type { margin-top: 0; }
.settings-card .field span { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 6px; }
.settings-card input[type=text], .settings-card textarea {
  width: 100%; font-family: var(--font); font-size: .96rem; padding: 10px 12px;
  border: 1.5px solid var(--sand); border-radius: 10px; background: var(--beige-50); color: var(--ink);
}
.settings-card input:focus, .settings-card textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,161,90,.16); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px,1fr)); gap: 12px; }
.color-field { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; font-weight: 700; }
.color-field input[type=color] { width: 100%; height: 42px; border: 1.5px solid var(--sand); border-radius: 10px; background: none; cursor: pointer; }
.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--rose), var(--gold)); color: #fff; font-size: 1.8rem; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.about-preview { width: 110px; height: 74px; border-radius: 12px; font-size: .8rem; }

/* users */
.user-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.user-add input { flex: 1; min-width: 120px; font-family: var(--font); padding: 10px 12px; border: 1.5px solid var(--sand); border-radius: 10px; background: var(--beige-50); }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--sand); }
.user-row small { color: var(--ink-soft); }

/* service image upload */
.svc-img-row { align-items: end; }
.svc-img-upload { display: flex; align-items: end; }
.filter-clear.active { background: var(--gold); color: #fff; border-color: var(--gold); }

@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }

/* gallery admin */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.gal-item { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 4/3; background: var(--sand); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; }
.gal-actions { position: absolute; inset-block-end: 0; inset-inline: 0; display: flex; gap: 6px; justify-content: center; padding: 8px; background: linear-gradient(to top, rgba(74,59,48,.7), transparent); }
.gal-actions button { width: 32px; height: 32px; border-radius: 8px; border: none; cursor: pointer; background: rgba(255,255,255,.9); color: var(--ink); font-size: 1rem; font-weight: 700; }
.gal-actions button:hover:not([disabled]) { background: #fff; }
.gal-actions button[disabled] { opacity: .4; cursor: not-allowed; }
.gal-actions .gal-del { background: rgba(192,57,43,.9); color: #fff; }

@media (max-width: 560px) {
  .svc-row { grid-template-columns: 1fr; }
  .admin-tabs .tab { padding: 8px 14px; }
}
.admin-main { padding-block: 30px 60px; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.1);
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: 0; width: 5px; background: var(--gold); }
.stat-card.today::before { background: var(--gold-dark); }
.stat-card.confirmed::before { background: #2e9e6b; }
.stat-card.completed::before { background: #6c7a89; }
.stat-card.cancelled::before { background: #c0392b; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--ink); }
.stat-label { color: var(--ink-soft); font-size: .95rem; }

/* ---- Filters ---- */
.filters {
  background: var(--white); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.1);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 26px;
}
.filter { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.filter label { font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.filter input, .filter select {
  font-family: var(--font); font-size: .98rem; padding: 10px 12px;
  border: 1.5px solid var(--sand); border-radius: 12px; background: var(--beige-50); color: var(--ink);
}
.filter input:focus, .filter select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,161,90,.16); }
.filter-clear { flex: 0 0 auto; }

/* ---- Bookings ---- */
.bookings { display: grid; gap: 16px; }
.booking-card {
  background: var(--white); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(201,161,90,.1);
  border-inline-start: 6px solid var(--sand);
  display: grid; grid-template-columns: 1fr auto; gap: 16px 20px; align-items: center;
  transition: box-shadow .2s;
}
.booking-card:hover { box-shadow: var(--shadow-md); }
.booking-card.st-new       { border-inline-start-color: var(--gold); }
.booking-card.st-confirmed { border-inline-start-color: #2e9e6b; }
.booking-card.st-completed { border-inline-start-color: #6c7a89; }
.booking-card.st-cancelled { border-inline-start-color: #c0392b; opacity: .72; }

.bk-main { display: flex; flex-direction: column; gap: 8px; }
.bk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bk-time {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink);
  background: var(--beige-50); padding: 4px 12px; border-radius: 10px;
}
.bk-date { color: var(--ink-soft); font-weight: 600; }
.bk-service { font-size: 1.12rem; font-weight: 700; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-soft); font-size: .94rem; }
.bk-meta b { color: var(--ink); font-weight: 700; }

.badge-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: .82rem; padding: 4px 12px; border-radius: 999px;
}
.badge-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-status.st-new       { color: var(--gold-dark); background: rgba(201,161,90,.16); }
.badge-status.st-confirmed { color: #1f7a52; background: rgba(46,158,107,.16); }
.badge-status.st-completed { color: #4a5763; background: rgba(108,122,137,.18); }
.badge-status.st-cancelled { color: #a93226; background: rgba(192,57,43,.14); }

.bk-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.status-btn {
  font-family: var(--font); font-weight: 700; font-size: .86rem; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--sand);
  background: var(--white); color: var(--ink-soft); transition: all .16s;
}
.status-btn:hover { border-color: var(--gold); color: var(--ink); }
.status-btn.active[data-status="new"]       { background: var(--gold); border-color: var(--gold); color: #fff; }
.status-btn.active[data-status="confirmed"] { background: #2e9e6b; border-color: #2e9e6b; color: #fff; }
.status-btn.active[data-status="completed"] { background: #6c7a89; border-color: #6c7a89; color: #fff; }
.status-btn.active[data-status="cancelled"] { background: #c0392b; border-color: #c0392b; color: #fff; }

/* ---- Empty ---- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state span { font-size: 3rem; display: block; margin-bottom: 12px; }
.empty-state .es-icon { color: var(--gold); }
.empty-state .es-icon svg { width: 54px; height: 54px; }
.toast-icon svg { width: 26px; height: 26px; }
.ul-icon { display: inline-flex; vertical-align: -3px; }
.ul-icon svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .booking-card { grid-template-columns: 1fr; }
  .bk-actions { justify-content: stretch; }
  .status-btn { flex: 1; text-align: center; }
}
