/* A. Royal Assistant — owner admin panel styles */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --primary: #3b1d5e;
  --accent: #c9a227;
  --ink: #241a33;
  --cream: #faf7f0;
  --primary-dark: color-mix(in srgb, var(--primary) 78%, black);
  --primary-soft: color-mix(in srgb, var(--primary) 8%, #fff);
  --accent-dark: color-mix(in srgb, var(--accent) 72%, black);
  --line: #e4dfd4;
  --bg: #f4f1ea;
  --radius: 12px;
  --shadow: 0 12px 34px -22px rgba(40,20,60,.5);
}

body { margin: 0; font-family: 'Jost', Arial, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; }
h1,h2,h3 { font-family: 'Cormorant Garamond', Georgia, serif; color: var(--primary); }
a { color: var(--primary); text-decoration: none; }

/* ---- Auth (login / password) ---- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: linear-gradient(150deg, var(--primary-dark), var(--primary)); }
.auth-card { background: #fff; border-radius: 16px; padding: 2.6rem 2.2rem; width: min(400px, 100%); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); text-align: center; }
.auth-crest { font-size: 3rem; color: var(--accent); line-height: 1; }
.auth-card h1 { font-size: 2rem; margin: .3rem 0 0; }
.auth-sub { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--accent-dark); margin: .2rem 0 1.6rem; }
.auth-card label { display: block; text-align: left; margin-bottom: 1rem; font-size: .85rem; font-weight: 500; color: var(--primary); }
.auth-card input { width: 100%; margin-top: .3rem; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 9px; font-size: 1rem; }
.auth-back { display: inline-block; margin-top: 1.4rem; font-size: .85rem; color: var(--accent-dark); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-family: inherit; font-weight: 500; font-size: .9rem; padding: .7rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; transition: transform .15s, box-shadow .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: .85rem 1.9rem; }
.btn-block { width: 100%; }
.btn-gold { background: linear-gradient(180deg, var(--accent), var(--accent-dark)); color: #2a2011; box-shadow: 0 8px 20px -10px var(--accent-dark); }
.btn-outline { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { display: inline-flex; align-items: center; padding: .35rem .8rem; border-radius: 7px; border: 1.5px solid var(--line); background: #fff; color: var(--primary); font-size: .78rem; font-weight: 500; cursor: pointer; font-family: inherit; }
.btn-sm:hover { border-color: var(--primary); }
.btn-sm.danger { color: #a02722; border-color: #ecc7c4; }
.btn-sm.danger:hover { background: #a02722; color: #fff; border-color: #a02722; }

/* ---- Shell layout ---- */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-sidebar { background: linear-gradient(180deg, var(--primary-dark), var(--primary)); color: #fff; display: flex; flex-direction: column; padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: flex; align-items: center; gap: .7rem; padding: 0 .5rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.14); }
.admin-brand .crown { font-size: 1.8rem; color: var(--accent); }
.admin-brand strong { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; color: #fff; }
.admin-brand span { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.6); }
.admin-nav { display: flex; flex-direction: column; gap: .2rem; margin-top: 1.2rem; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 9px; color: rgba(255,255,255,.82); font-size: .92rem; transition: background .2s, color .2s; }
.admin-nav a .ni { width: 20px; text-align: center; opacity: .9; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--accent); color: #2a2011; font-weight: 500; }
.admin-sidebar-foot { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.admin-sidebar-foot a { color: rgba(255,255,255,.72); font-size: .82rem; }
.admin-sidebar-foot a:hover { color: var(--accent); }
.logout-btn { background: rgba(255,255,255,.1); border: none; color: #fff; padding: .6rem; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: .82rem; width: 100%; }
.logout-btn:hover { background: rgba(255,255,255,.2); }

.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.admin-page-title { font-size: 1.6rem; margin: 0; flex: 1; }
.admin-user { font-size: .85rem; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.admin-menu-btn { display: none; background: none; border: none; font-size: 1.4rem; color: var(--primary); cursor: pointer; }
.admin-content { padding: 1.8rem 2rem 4rem; max-width: 1000px; width: 100%; }

.page-intro { color: color-mix(in srgb, var(--ink) 70%, transparent); margin-top: 0; max-width: 70ch; }

/* ---- Stat cards ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow); transition: transform .15s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-num { font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); }
.stat-card.ghost { background: var(--primary-soft); }

/* ---- Panels ---- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; margin-bottom: 1.6rem; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 1.1rem; font-size: 1.5rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.panel-head.standalone { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.6rem; box-shadow: var(--shadow); }
.panel-head h2 { margin: 0; }
.link-arrow { font-size: .85rem; font-weight: 500; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .05em; }
.empty { color: color-mix(in srgb, var(--ink) 50%, transparent); font-style: italic; padding: 1rem 0; text-align: center; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); padding: .6rem .7rem; border-bottom: 2px solid var(--line); }
.data-table td { padding: .7rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.row-dim { opacity: .5; }
.row-actions { display: flex; gap: .4rem; align-items: center; }
.row-actions form { margin: 0; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: .16rem .6rem; border-radius: 999px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.badge-pending { background: #fdf0d6; color: #8a6212; }
.badge-confirmed { background: #dff0e2; color: #226b39; }
.badge-completed { background: #e2e7f5; color: #33427e; }
.badge-declined, .badge-cancelled { background: #f6dedc; color: #8f2320; }

/* ---- Mini list ---- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .92rem; }
.mini-list li:last-child { border-bottom: none; }
.mini-date, .mi-date { margin-left: auto; font-size: .78rem; color: color-mix(in srgb, var(--ink) 45%, transparent); }
.muted { color: color-mix(in srgb, var(--ink) 55%, transparent); }

/* ---- Forms ---- */
.field { display: block; margin-bottom: 1.1rem; }
.field-label { display: block; font-size: .85rem; font-weight: 500; color: var(--primary); margin-bottom: .35rem; }
.field-help { display: block; font-size: .8rem; color: color-mix(in srgb, var(--ink) 50%, transparent); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1.5px solid var(--line); border-radius: 9px; font-family: inherit; font-size: .95rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
textarea { resize: vertical; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-panel { max-width: 720px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(0deg, var(--bg) 70%, transparent); padding: 1rem 0; margin-top: 1rem; }
.back-link { display: inline-block; margin-bottom: 1rem; font-size: .9rem; color: var(--accent-dark); }

/* ---- Theme editor ---- */
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.4rem; }
.color-input { display: flex; gap: .5rem; align-items: center; }
.color-input input[type=color] { width: 48px; height: 42px; padding: 2px; border-radius: 8px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; }
.color-hex { flex: 1; text-transform: uppercase; }
.image-field { display: flex; gap: 1.5rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.image-field > div:first-child { flex: 1; min-width: 240px; }
.image-preview { width: 200px; height: 110px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; background: var(--primary-soft); }
.image-preview.small { width: 90px; height: 90px; border-radius: 50%; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--accent); font-size: 1.6rem; }
.remove-check { display: flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: .85rem; }
.remove-check input, .switch input { width: auto; }
.reset-form { margin-top: -.5rem; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0; }

/* ---- Icon picker ---- */
.icon-picker { display: flex; flex-wrap: wrap; gap: .6rem; }
.icon-option input { display: none; }
.icon-swatch { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; border: 2px solid var(--line); color: var(--primary); cursor: pointer; transition: all .15s; }
.icon-swatch svg { width: 24px; height: 24px; }
.icon-option input:checked + .icon-swatch { border-color: var(--accent); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--accent); }
.check-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0 1.6rem; }
.switch { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 500; color: var(--primary); }

/* ---- Inline forms ---- */
.inline-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.inline-form select, .inline-form input { width: auto; }
.inline-form input[type=text] { flex: 1; min-width: 160px; }

/* ---- Filter bar ---- */
.filter-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.filter-tab { padding: .45rem 1rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Booking cards ---- */
.booking-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1rem; }
.booking-card { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 1.1rem; background: #fff; }
.badge-border-pending { border-left-color: #e0a92a; }
.badge-border-confirmed { border-left-color: #2e8b52; }
.badge-border-completed { border-left-color: #4256a8; }
.badge-border-declined, .badge-border-cancelled { border-left-color: #b64039; }
.bc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .6rem; }
.bc-date { display: block; font-weight: 600; color: var(--primary); margin-bottom: .3rem; }
.bc-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-dark); background: var(--primary-soft); padding: .2rem .5rem; border-radius: 6px; }
.bc-body { font-size: .9rem; }
.bc-body p { margin: .2rem 0; }
.bc-notes { font-style: italic; color: color-mix(in srgb, var(--ink) 65%, transparent); margin-top: .5rem !important; }
.bc-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.bc-actions form { margin: 0; }

/* ---- Messages ---- */
.message-list { display: flex; flex-direction: column; gap: .9rem; }
.message-item { border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem; background: #fff; }
.message-item.unread { border-color: var(--accent); background: #fffdf6; }
.mi-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.mi-subject { color: color-mix(in srgb, var(--ink) 60%, transparent); margin-left: .4rem; }
.mi-contact { font-size: .85rem; margin: .3rem 0; }
.mi-body { margin: .6rem 0; white-space: pre-wrap; }
.mi-actions { display: flex; gap: .4rem; flex-wrap: wrap; padding-top: .7rem; border-top: 1px solid var(--line); }
.mi-actions form { margin: 0; }

/* ---- Flash ---- */
.flash { padding: .85rem 1.1rem; border-radius: 10px; margin-bottom: 1.4rem; font-size: .92rem; }
.flash-success { background: #eaf6ec; color: #1f6b34; border: 1px solid #bfe3c6; }
.flash-error { background: #fbeceb; color: #8f2320; border: 1px solid #f2c4c1; }

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: -260px; top: 0; width: 250px; z-index: 60; transition: left .25s; }
  body.sidebar-open .admin-sidebar { left: 0; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .admin-menu-btn { display: block; }
  .form-two { grid-template-columns: 1fr; }
}
