@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,400&family=Jost:wght@300;400;500;600&display=swap');

:root{
  /* Default theme = Creme (light, warm) — kept in sync with style.css so
     the admin panel matches whatever the guest site is set to. */
  --maroon-deep:#efe6d8;
  --maroon:#e3d6c1;
  --cream:#2b2015;
  --gold:#8a6a35;
  --gold-soft:#6b5439;
  --panel:#e3d6c1;
  --cream-rgb:43,32,21;
  --gold-rgb:138,106,53;
  --row-alt:rgba(43,32,21,0.03);
  --status-error:#b23b3b;
  --status-ok:#3f7d4a;
  --status-manager-bg:rgba(178,59,59,0.15);
  --status-manager-text:#8a2a2a;
  --status-recept-bg:rgba(63,125,74,0.15);
  --status-recept-text:#2f5c38;
}

/* ---------- Appearance / color themes ----------
   Admin doesn't render its own theme picker, but it shares the same
   localStorage preference as the guest site (read in an inline script
   in admin.html, applied as data-theme on <html> before first paint)
   so the dashboard always matches whatever theme is selected there. */
html[data-theme="cream"]{
  --maroon-deep:#efe6d8;
  --maroon:#e3d6c1;
  --cream:#2b2015;
  --gold:#8a6a35;
  --gold-soft:#6b5439;
  --panel:#e3d6c1;
  --cream-rgb:43,32,21;
  --gold-rgb:138,106,53;
  --row-alt:rgba(43,32,21,0.03);
  --status-error:#b23b3b;
  --status-ok:#3f7d4a;
  --status-manager-bg:rgba(178,59,59,0.15);
  --status-manager-text:#8a2a2a;
  --status-recept-bg:rgba(63,125,74,0.15);
  --status-recept-text:#2f5c38;
}
html[data-theme="light-beige"]{
  --maroon-deep:#e6d9bf;
  --maroon:#d9c7a3;
  --cream:#2b2015;
  --gold:#96702e;
  --gold-soft:#7a5c2c;
  --panel:#d9c7a3;
  --cream-rgb:43,32,21;
  --gold-rgb:150,112,46;
  --row-alt:rgba(43,32,21,0.03);
  --status-error:#b23b3b;
  --status-ok:#3f7d4a;
  --status-manager-bg:rgba(178,59,59,0.15);
  --status-manager-text:#8a2a2a;
  --status-recept-bg:rgba(63,125,74,0.15);
  --status-recept-text:#2f5c38;
}
html[data-theme="beige"]{
  --maroon-deep:#3d3324;
  --maroon:#5a4d38;
  --cream:#f6ede2;
  --gold:#c8a15c;
  --gold-soft:#e3cd9d;
  --panel:#2f2819;
  --cream-rgb:246,237,226;
  --gold-rgb:200,161,92;
  --row-alt:rgba(var(--cream-rgb),0.03);
  --status-error:#e58a8a;
  --status-ok:#9fd3a0;
  --status-manager-bg:rgba(122,34,49,0.4);
  --status-manager-text:#f2b9c4;
  --status-recept-bg:rgba(94,145,120,0.3);
  --status-recept-text:#a9dcc0;
}
html[data-theme="maroon"]{
  --maroon-deep:#3a0f14;
  --maroon:#5c1a1f;
  --cream:#f6ede2;
  --gold:#c8a15c;
  --gold-soft:#e3cd9d;
  --panel:#2c0a0e;
  --cream-rgb:246,237,226;
  --gold-rgb:200,161,92;
  --row-alt:rgba(var(--cream-rgb),0.03);
  --status-error:#e58a8a;
  --status-ok:#9fd3a0;
  --status-manager-bg:rgba(122,34,49,0.4);
  --status-manager-text:#f2b9c4;
  --status-recept-bg:rgba(94,145,120,0.3);
  --status-recept-text:#a9dcc0;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; min-height:100%; background:var(--maroon-deep); color:var(--cream); font-family:'Jost',sans-serif; }

.admin-topbar{
  display:flex; align-items:center; gap:14px;
  padding:18px 28px;
  border-bottom:1px solid rgba(var(--gold-rgb),0.2);
  background:var(--panel);
}
.admin-topbar .logo-mark{ width:38px; height:38px; border-radius:50%; overflow:hidden; flex-shrink:0; }
.admin-topbar .logo-mark img{ width:100%; height:100%; object-fit:cover; display:block; }
.admin-topbar h1{
  font-family:'Cormorant Garamond',serif; font-size:1.3rem; font-weight:600;
  color:var(--gold-soft); margin:0;
}
.admin-topbar .spacer{ flex:1; }
.admin-topbar a, .admin-topbar button{
  font-family:'Jost',sans-serif; font-size:0.82rem; color:var(--gold-soft);
  background:none; border:1px solid rgba(var(--gold-rgb),0.35); border-radius:999px;
  padding:8px 16px; text-decoration:none; cursor:pointer;
}
.admin-topbar a:hover, .admin-topbar button:hover{ background:var(--gold); color:var(--maroon-deep); }

.admin-wrap{ max-width:1100px; margin:0 auto; padding:30px 24px 60px; }

.admin-gate{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:70vh; text-align:center; gap:10px;
}
.admin-gate p{ color:rgba(var(--cream-rgb),0.6); }

.admin-card{
  background:var(--panel);
  border:1px solid rgba(var(--gold-rgb),0.2);
  border-radius:16px;
  padding:24px;
  margin-bottom:28px;
}
.admin-card h2{
  font-family:'Cormorant Garamond',serif; font-size:1.4rem; color:var(--gold-soft);
  margin:0 0 4px;
}
.admin-card .card-sub{ font-size:0.82rem; color:rgba(var(--cream-rgb),0.5); margin:0 0 20px; }

.form-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px;
  align-items:end;
}
.form-field label{
  display:block; font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--gold-soft); margin-bottom:6px;
}
.form-field input, .form-field select{
  width:100%; background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3);
  border-radius:8px; padding:10px 12px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.9rem;
}
.form-field input:focus, .form-field select:focus{ outline:none; border-color:var(--gold); }

.btn-primary{
  background:var(--gold); color:var(--maroon-deep); border:none; border-radius:8px;
  padding:11px 20px; font-family:'Jost',sans-serif; font-weight:500; font-size:0.88rem;
  cursor:pointer;
}
.btn-primary:hover{ opacity:0.9; }
.btn-primary:disabled{ opacity:0.5; cursor:not-allowed; }

.form-msg{ font-size:0.82rem; margin-top:14px; min-height:16px; }
.form-msg.error{ color:var(--status-error); }
.form-msg.ok{ color:var(--status-ok); }

.toolbar{ display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px; align-items:center; }
.toolbar input, .toolbar select{
  background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3);
  border-radius:999px; padding:9px 16px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.85rem;
}
.toolbar input{ flex:1; min-width:180px; }
.toolbar .result-count{ font-size:0.78rem; color:rgba(var(--cream-rgb),0.5); margin-left:auto; }

.users-table{ width:100%; border-collapse:collapse; font-size:0.86rem; }
.users-table th{
  text-align:left; font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--gold-soft); padding:10px 12px; border-bottom:1px solid rgba(var(--gold-rgb),0.25);
}
.users-table td{ padding:12px; border-bottom:1px solid rgba(var(--cream-rgb),0.06); vertical-align:middle; }
.users-table tr:nth-child(even){ background:var(--row-alt); }

.role-pill{
  display:inline-block; padding:4px 12px; border-radius:999px; font-size:0.72rem; letter-spacing:0.04em;
}
.role-pill.User{ background:rgba(var(--cream-rgb),0.1); color:var(--cream); }
.role-pill.Admin{ background:rgba(var(--gold-rgb),0.25); color:var(--gold-soft); }
.role-pill.Manager{ background:var(--status-manager-bg); color:var(--status-manager-text); }
.role-pill.Receptionist{ background:var(--status-recept-bg); color:var(--status-recept-text); }

.role-select{
  background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3);
  border-radius:6px; padding:5px 8px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.8rem;
}

.empty-state{ text-align:center; padding:40px 10px; color:rgba(var(--cream-rgb),0.4); font-size:0.9rem; }

@media (max-width:700px){
  .admin-topbar{ padding:14px 16px; }
  .admin-topbar h1{ font-size:1.05rem; }
  .admin-wrap{ padding:20px 14px 50px; }
  .users-table{ display:block; overflow-x:auto; white-space:nowrap; }
}

/* ---------- Tabs ---------- */
.admin-topbar .logo-mark{ display:block; }
.admin-tabs{ display:flex; gap:8px; margin-bottom:22px; flex-wrap:wrap; }
.tab-btn{
  background:none; border:1px solid rgba(var(--gold-rgb),0.3); color:rgba(var(--cream-rgb),0.7);
  font-family:'Jost',sans-serif; font-size:0.85rem; padding:9px 18px; border-radius:999px; cursor:pointer;
}
.tab-btn.active{ background:var(--gold); color:var(--maroon-deep); border-color:var(--gold); font-weight:500; }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

.form-field textarea{
  width:100%; background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3);
  border-radius:8px; padding:10px 12px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.9rem; resize:vertical;
}

.nearby-row{ display:grid; grid-template-columns:2fr 1fr auto; gap:10px; margin-bottom:8px; align-items:center; }
.nearby-row input{
  background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3); border-radius:8px;
  padding:9px 12px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.85rem;
}
.nearby-row button{
  background:none; border:1px solid rgba(var(--gold-rgb),0.3); color:var(--status-error); border-radius:8px; padding:9px 12px; cursor:pointer;
}

.media-queue{ display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.media-queue:empty{ margin-top:0; }
.media-queue-row{
  display:grid; grid-template-columns:56px 1fr auto; align-items:center; gap:12px;
  border:1px solid rgba(var(--gold-rgb),0.22); border-radius:10px; padding:8px 10px; background:var(--maroon-deep);
}
.media-queue-row .queue-thumb{
  width:56px; height:56px; border-radius:7px; overflow:hidden; background:rgba(0,0,0,0.25);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.media-queue-row .queue-thumb img, .media-queue-row .queue-thumb video{ width:100%; height:100%; object-fit:cover; display:block; }
.media-queue-row .queue-thumb .queue-file-icon{ font-size:1.4rem; color:rgba(var(--cream-rgb),0.5); }
.media-queue-row .queue-info{ min-width:0; display:flex; flex-direction:column; gap:5px; }
.media-queue-row .queue-filename{
  font-size:0.75rem; color:rgba(var(--cream-rgb),0.6); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.media-queue-row .queue-caption-input{
  width:100%; background:rgba(0,0,0,0.2); border:1px solid rgba(var(--gold-rgb),0.25); border-radius:6px;
  padding:6px 8px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.82rem;
}
.media-queue-row .queue-caption-input:focus{ outline:none; border-color:var(--gold); }
.media-queue-row .queue-remove{
  background:none; border:1px solid rgba(var(--gold-rgb),0.3); color:var(--status-error); border-radius:8px;
  padding:6px 10px; cursor:pointer; font-size:0.72rem; white-space:nowrap;
}
.media-queue-status{ font-size:0.7rem; color:rgba(var(--cream-rgb),0.5); }
.media-queue-status.done{ color:var(--status-ok); }
.media-queue-status.error{ color:var(--status-error); }

.media-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
.media-tile{ border:1px solid rgba(var(--gold-rgb),0.25); border-radius:10px; overflow:hidden; background:var(--maroon-deep); }
.media-tile .thumb-wrap{ aspect-ratio:4/3; overflow:hidden; }
.media-tile img, .media-tile video{ width:100%; height:100%; object-fit:cover; display:block; }
.media-tile .meta{ padding:8px 10px; display:flex; justify-content:space-between; align-items:center; gap:6px; }
.media-tile .cat-label{ font-size:0.68rem; color:rgba(var(--cream-rgb),0.55); }
.media-tile button{
  background:none; border:none; color:var(--status-error); font-size:0.72rem; cursor:pointer; padding:2px 4px;
}

.room-row{
  display:flex; align-items:center; gap:14px; padding:12px; border-bottom:1px solid rgba(var(--cream-rgb),0.06);
}
.room-row .thumb{ width:56px; height:56px; border-radius:8px; overflow:hidden; flex-shrink:0; background:var(--maroon-deep); }
.room-row .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.room-row .info{ flex:1; }
.room-row .info .name{ font-size:0.92rem; color:var(--cream); }
.room-row .info .rate{ font-size:0.78rem; color:var(--gold-soft); }
.room-row .actions{ display:flex; gap:8px; }
.room-row .actions button{
  background:none; border:1px solid rgba(var(--gold-rgb),0.3); color:var(--gold-soft);
  border-radius:8px; padding:7px 12px; font-size:0.78rem; cursor:pointer;
}
.room-row .actions button.danger{ color:var(--status-error); }

/* ---------- Publish status ---------- */
.publish-status-row{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.publish-status-pill{
  display:inline-block; padding:6px 14px; border-radius:999px; font-size:0.8rem; letter-spacing:0.03em;
  background:rgba(var(--cream-rgb),0.08); color:rgba(var(--cream-rgb),0.6);
}
.publish-status-pill.live{ background:var(--status-recept-bg); color:var(--status-recept-text); }
.publish-status-pill.soon{ background:rgba(var(--gold-rgb),0.22); color:var(--gold-soft); }

/* ---------- Permissions ---------- */
.perm-group{ margin-bottom:18px; }
.perm-group h4{
  font-family:'Jost',sans-serif; font-size:0.72rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--gold-soft); margin:0 0 10px;
}
.perm-role-block{
  border:1px solid rgba(var(--gold-rgb),0.2); border-radius:12px; padding:18px; margin-bottom:16px;
}
.perm-role-block .role-title{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.perm-role-block .role-title h3{ font-family:'Cormorant Garamond',serif; color:var(--gold-soft); margin:0; font-size:1.15rem; }
.perm-checklist{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:8px 16px; }
.perm-checklist label{
  display:flex; align-items:flex-start; gap:8px; font-size:0.85rem; color:rgba(var(--cream-rgb),0.8); cursor:pointer;
}
.perm-checklist input{ width:auto; margin-top:3px; }
.perm-save-btn{ margin-top:10px; }

/* ---------- Room drag-reorder ---------- */
.room-row{ cursor:default; }
.room-row.draggable{ cursor:grab; }
.room-row.dragging{ opacity:0.4; }
.room-row .drag-handle{
  cursor:grab; color:rgba(var(--cream-rgb),0.4); font-size:1.1rem; padding:0 4px; user-select:none; flex-shrink:0;
}
.room-row.drag-over{ border-top:2px solid var(--gold); }

.media-tile.draggable{ cursor:grab; position:relative; }
.media-tile.dragging{ opacity:0.4; }
.media-tile.drag-over{ outline:2px solid var(--gold); outline-offset:-2px; }
.media-tile .cover-badge{
  position:absolute; top:6px; left:6px; z-index:1;
  background:var(--gold); color:var(--maroon-deep);
  font-size:0.65rem; font-weight:600; letter-spacing:.03em;
  padding:2px 8px; border-radius:20px; text-transform:uppercase;
}
.media-tile .drag-handle{
  position:absolute; top:6px; right:6px; z-index:1;
  background:rgba(35,10,15,0.65); color:var(--gold-soft);
  border-radius:6px; padding:1px 6px; font-size:0.9rem; cursor:grab;
}
.about-photo-preview{
  width:160px; aspect-ratio:4/3; border-radius:10px; overflow:hidden;
  border:1px solid rgba(var(--gold-rgb),0.25); background:var(--maroon-deep);
  display:flex; align-items:center; justify-content:center;
  font-size:0.7rem; color:rgba(var(--cream-rgb),0.5); text-align:center; padding:6px;
}
.about-photo-preview img{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- Modal (permission override dialog) ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(30,23,15,0.7); display:flex; align-items:center; justify-content:center;
  padding:20px; z-index:300; opacity:0; pointer-events:none; transition:opacity 0.2s ease;
}
.modal-overlay.open{ opacity:1; pointer-events:auto; }
.modal-card{
  background:var(--panel); border:1px solid rgba(var(--gold-rgb),0.3); border-radius:16px;
  padding:28px; max-width:480px; width:100%; max-height:85vh; overflow-y:auto; position:relative;
}
.modal-close{
  position:absolute; top:14px; right:16px; background:none; border:none; color:rgba(var(--cream-rgb),0.6);
  font-size:1.4rem; cursor:pointer; line-height:1;
}
.modal-title{ font-family:'Cormorant Garamond',serif; color:var(--gold-soft); font-size:1.3rem; margin:0 0 8px; }
.modal-sub{ font-size:0.82rem; color:rgba(var(--cream-rgb),0.6); margin:0 0 16px; line-height:1.5; }
.modal-msg{ font-size:0.82rem; margin-top:12px; min-height:16px; }
.modal-msg.error{ color:var(--status-error); }
.modal-msg.ok{ color:var(--status-ok); }
.modal-btn{
  width:100%; background:var(--gold); color:var(--maroon-deep); border:none; border-radius:8px;
  padding:12px; font-family:'Jost',sans-serif; font-weight:500; font-size:0.9rem; cursor:pointer; margin-top:14px;
}
.modal-btn:hover{ opacity:0.9; }
.modal-btn-ghost{
  background:none; border:1px solid rgba(var(--gold-rgb),0.4); color:var(--gold-soft);
}
.modal-btn-ghost:hover{ opacity:1; background:rgba(var(--gold-rgb),0.1); }
.field-label{
  display:block; font-size:0.68rem; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--gold-soft); margin-bottom:6px;
}
.field-textarea{
  width:100%; background:rgba(var(--cream-rgb),0.06); border:1px solid rgba(var(--gold-rgb),0.3);
  border-radius:8px; padding:10px 12px; color:var(--cream); font-family:'Jost',sans-serif; font-size:0.9rem; resize:vertical;
}
.detail-row{ display:flex; justify-content:space-between; gap:14px; padding:8px 0; border-bottom:1px solid rgba(var(--cream-rgb),0.08); }
.detail-row:last-child{ border-bottom:none; }
.detail-row .k{ color:rgba(var(--cream-rgb),0.55); font-size:0.78rem; letter-spacing:0.04em; text-transform:uppercase; white-space:nowrap; }
.detail-row .v{ text-align:right; }
.room-row.clickable{ cursor:pointer; }
.room-row.clickable:hover{ background:rgba(var(--cream-rgb),0.04); }
