/* MMH Admin CSS v4 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --black: #0b0b0b; --white: #ffffff; --off-white: #f7f5f1; --cream: #eeebe3;
  --gold: #c8a84b; --gold-lt: #e6d08e; --gray: #6a6a6a; --gray-lt: #e2dfd7;
  --fd: 'Cormorant Garamond', Georgia, serif; --fb: 'DM Sans', system-ui, sans-serif;
  --sidebar-w: 240px; --radius: 2px;
  --green-bg: #e8f5e9; --green-tx: #1b5e20;
  --amber-bg: #fff8e1; --amber-tx: #e65100;
  --red-bg:   #ffebee; --red-tx:   #b71c1c;
  --blue-bg:  #e3f2fd; --blue-tx:  #0d47a1;
  --purple-bg:#f3e5f5; --purple-tx:#4a148c;
}
html, body { font-family: var(--fb); background: #f4f1ec; color: var(--black); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--fb); cursor: pointer; border: none; }
input, select, textarea { font-family: var(--fb); }
.hidden { display: none !important; }

/* LOGIN */
#loginScreen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); }
.login-card { background: var(--off-white); padding: 3rem 2.5rem; max-width: 400px; width: 100%; border-radius: var(--radius); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-monogram { font-family: var(--fd); font-size: 2.4rem; font-weight: 600; width: 60px; height: 60px; border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; margin: 0 auto 0.7rem; }
.login-logo p { font-size: 10px; letter-spacing: 0.24em; color: var(--gold); text-transform: uppercase; }
.login-card h2 { font-family: var(--fd); font-size: 1.7rem; font-weight: 400; text-align: center; margin-bottom: 0.3rem; }
.login-card .sub { font-size: 12px; color: var(--gray); text-align: center; margin-bottom: 1.7rem; }
.lf-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem; }
.lf-group label { font-size: 10px; letter-spacing: 0.2em; color: var(--gray); text-transform: uppercase; }
.lf-group input { font-size: 14px; color: var(--black); background: var(--cream); border: 1px solid var(--gray-lt); border-radius: var(--radius); padding: 11px 13px; outline: none; transition: border-color 0.2s; }
.lf-group input:focus { border-color: var(--gold); }
.btn-login { width: 100%; background: var(--black); color: var(--white); padding: 13px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; border-radius: var(--radius); margin-top: 0.5rem; transition: background 0.2s; }
.btn-login:hover { background: #222; }
.demo-hint { font-size: 11px; color: var(--gray); text-align: center; margin-top: 0.9rem; }
.login-error { display: none; font-size: 12px; color: var(--red-tx); text-align: center; padding: 8px; margin-bottom: 0.5rem; }
.login-error.show { display: block; }

/* ADMIN LAYOUT */
#adminDash { display: flex; min-height: 100vh; }
.a-sidebar { width: var(--sidebar-w); background: var(--black); position: fixed; top: 0; left: 0; height: 100vh; display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.a-sb-logo { display: flex; align-items: center; gap: 11px; padding: 1.4rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.a-sb-m { font-family: var(--fd); font-size: 17px; font-weight: 600; color: var(--white); border: 1px solid var(--gold); padding: 4px 7px; line-height: 1; flex-shrink: 0; }
.a-sb-name { display: block; font-size: 12px; font-weight: 500; color: var(--white); }
.a-sb-sub  { display: block; font-size: 9px; color: rgba(255,255,255,0.28); letter-spacing: 0.07em; margin-top: 2px; }
.a-sb-nav { flex: 1; padding: 1.4rem 0; }
.a-sb-link { display: flex; align-items: center; gap: 10px; padding: 0.72rem 1.2rem; font-size: 13px; color: rgba(255,255,255,0.42); border-left: 2px solid transparent; cursor: pointer; transition: all 0.2s; position: relative; }
.a-sb-link:hover { color: var(--white); background: rgba(255,255,255,0.04); }
.a-sb-link.on { color: var(--white); border-left-color: var(--gold); background: rgba(200,168,75,0.08); }
.a-badge { background: var(--gold); color: var(--black); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.a-sb-foot { padding: 1.2rem; border-top: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; }
.a-sb-foot span { font-size: 12px; color: rgba(255,255,255,0.38); }
#logoutBtn { background: none; font-size: 11px; color: rgba(255,255,255,0.28); cursor: pointer; letter-spacing: 0.05em; transition: color 0.2s; }
#logoutBtn:hover { color: var(--white); }

.a-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.a-topbar { background: var(--white); border-bottom: 1px solid var(--gray-lt); padding: 1.2rem 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 50; }
.a-page-title { font-family: var(--fd); font-size: 1.55rem; font-weight: 400; }
.a-page-date  { font-size: 12px; color: var(--gray); margin-top: 2px; }
.topbar-actions { display: flex; gap: 0.7rem; align-items: center; }
.btn-a { background: var(--black); color: var(--white); padding: 10px 18px; font-size: 11px; letter-spacing: 0.1em; font-weight: 500; cursor: pointer; border-radius: var(--radius); text-transform: uppercase; transition: background 0.2s; }
.btn-a:hover { background: #1a1a1a; }
.btn-view-site { background: none; border: 1px solid var(--gray-lt); padding: 9px 15px; font-size: 11px; letter-spacing: 0.06em; cursor: pointer; border-radius: var(--radius); color: var(--gray); transition: all 0.2s; }
.btn-view-site:hover { border-color: var(--black); color: var(--black); }
.btn-danger { background: var(--red-bg); color: var(--red-tx); border: 1px solid #ffcdd2; padding: 10px 16px; font-size: 11px; cursor: pointer; border-radius: var(--radius); transition: all 0.2s; }
.btn-danger:hover { background: var(--red-tx); color: var(--white); }

/* PAGES */
.a-page { padding: 2rem; display: none; }
.a-page.on { display: block; }

/* KPI GRID */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi { background: var(--white); border: 1px solid var(--gray-lt); padding: 1.4rem; border-radius: var(--radius); }
.kpi-label { font-size: 10px; letter-spacing: 0.17em; color: var(--gray); text-transform: uppercase; display: block; }
.kpi-num   { font-family: var(--fd); font-size: 2rem; font-weight: 400; line-height: 1; display: block; margin: 0.3rem 0 0.2rem; }
.kpi-delta { font-size: 11px; }
.d-pos { color: #1b5e20; } .d-neg { color: #b71c1c; } .d-neu { color: var(--gray); }

/* PANELS */
.panel { background: var(--white); border: 1px solid var(--gray-lt); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--gray-lt); }
.panel-head h3 { font-family: var(--fd); font-size: 1.1rem; font-weight: 500; }
.panel-head button { background: none; font-size: 12px; color: var(--gold); cursor: pointer; }
.dash-two-col { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }

/* TABLES */
.table-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable.wide { min-width: 900px; }
.dtable th { background: #f5f2ec; text-align: left; padding: 10px 14px; font-size: 10px; letter-spacing: 0.12em; color: var(--gray); text-transform: uppercase; font-weight: 500; border-bottom: 1px solid var(--gray-lt); white-space: nowrap; }
.dtable td { padding: 12px 14px; border-bottom: 1px solid #f0ede6; vertical-align: middle; }
.dtable tr:last-child td { border-bottom: none; }
.dtable tbody tr:hover td { background: #fafaf8; cursor: pointer; }
.status-badge { font-size: 10px; letter-spacing: 0.05em; padding: 3px 9px; border-radius: 20px; font-weight: 500; white-space: nowrap; }
.s-confirmed  { background: var(--green-bg);  color: var(--green-tx); }
.s-pending    { background: var(--amber-bg);  color: var(--amber-tx); }
.s-cancelled  { background: var(--red-bg);    color: var(--red-tx); }
.s-checked-in { background: var(--blue-bg);   color: var(--blue-tx); }
.s-completed  { background: var(--purple-bg); color: var(--purple-tx); }
.pay-badge    { font-size: 10px; padding: 2px 7px; border-radius: 20px; background: #f0ede6; color: var(--gray); }

/* TOOLBAR */
.toolbar { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.a-search, .a-select {
  font-size: 13px; color: var(--black); background: var(--white);
  border: 1px solid var(--gray-lt); border-radius: var(--radius);
  padding: 9px 13px; outline: none; transition: border-color 0.2s;
}
.a-search:focus, .a-select:focus { border-color: var(--gold); }
.a-search { min-width: 210px; }

/* ROOM STATUS LIST */
.rs-row { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--gray-lt); font-size: 13px; cursor: pointer; transition: background 0.2s; }
.rs-row:last-child { border-bottom: none; }
.rs-row:hover { background: var(--cream); }
.rs-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.rs-dot.avail { background: #4caf50; } .rs-dot.occ { background: #ef5350; }

/* ROOMS ADMIN GRID */
.rooms-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.ra-card { background: var(--white); border: 1px solid var(--gray-lt); border-radius: var(--radius); overflow: hidden; }
.ra-img { height: 155px; overflow: hidden; position: relative; }
.ra-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.ra-card:hover .ra-img img { transform: scale(1.05); }
.ra-body { padding: 1.2rem; }
.ra-name  { font-family: var(--fd); font-size: 1.05rem; font-weight: 500; margin-bottom: 3px; }
.ra-price { font-size: 13px; color: var(--gold); font-weight: 500; margin-bottom: 0.35rem; }
.ra-meta  { font-size: 11px; color: var(--gray); margin-bottom: 0.7rem; }
.ra-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-edit { background: none; border: 1px solid var(--gray-lt); padding: 5px 11px; font-size: 11px; cursor: pointer; border-radius: var(--radius); transition: all 0.2s; }
.btn-edit:hover { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-toggle-avail { padding: 5px 11px; font-size: 11px; cursor: pointer; border-radius: var(--radius); transition: opacity 0.2s; }
.btn-toggle-avail.avail { background: var(--green-bg); color: var(--green-tx); border: 1px solid #c8e6c9; }
.btn-toggle-avail.occ   { background: var(--red-bg);   color: var(--red-tx);   border: 1px solid #ffcdd2; }
.btn-toggle-avail:hover { opacity: 0.8; }

/* MESSAGES */
.msg-layout { display: grid; grid-template-columns: 350px 1fr; gap: 1.5rem; height: calc(100vh - 230px); min-height: 420px; }
.msg-list { background: var(--white); border: 1px solid var(--gray-lt); border-radius: var(--radius); overflow-y: auto; }
.msg-item { padding: 1.2rem; border-bottom: 1px solid var(--gray-lt); cursor: pointer; transition: background 0.2s; position: relative; }
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: var(--cream); }
.msg-item.active { background: #fdf8ec; border-left: 3px solid var(--gold); }
.msg-item.unread .mi-sender { font-weight: 500; }
.mi-sender { font-size: 13px; color: var(--black); margin-bottom: 3px; }
.mi-subject { font-size: 12px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-date  { font-size: 10px; color: var(--gray); margin-top: 4px; }
.mi-unread-dot { position: absolute; top: 1.2rem; right: 1.2rem; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.msg-detail { background: var(--white); border: 1px solid var(--gray-lt); border-radius: var(--radius); overflow-y: auto; }
.md-head { padding: 1.5rem 1.8rem; border-bottom: 1px solid var(--gray-lt); }
.md-subject { font-family: var(--fd); font-size: 1.3rem; font-weight: 500; margin-bottom: 0.5rem; }
.md-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 12px; color: var(--gray); }
.md-body { padding: 1.8rem; font-size: 14px; line-height: 1.9; color: #333; }
.md-actions { padding: 1.2rem 1.8rem; border-top: 1px solid var(--gray-lt); display: flex; gap: 0.7rem; }
.md-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--gray); gap: 0.5rem; }
.md-placeholder-icon { font-size: 3rem; opacity: 0.12; }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.s-form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.s-group { display: flex; flex-direction: column; gap: 5px; }
.s-group label { font-size: 10px; letter-spacing: 0.18em; color: var(--gray); text-transform: uppercase; }
.s-group input, .s-group select, .s-group textarea { font-size: 13px; color: var(--black); background: var(--cream); border: 1px solid var(--gray-lt); border-radius: var(--radius); padding: 10px 12px; outline: none; transition: border-color 0.2s; }
.s-group input:focus, .s-group select:focus { border-color: var(--gold); }
.s-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.s-toggle { flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--gray-lt); padding-bottom: 0.7rem; }
.s-toggle label { font-size: 13px; color: var(--black); letter-spacing: 0; text-transform: none; }
.s-toggle input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }

/* ADMIN MODAL */
.a-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 400; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(4px); }
.a-overlay.open { display: flex; }
.a-modal-box { background: var(--white); max-width: 640px; width: 100%; border-radius: var(--radius); overflow: hidden; max-height: 90vh; overflow-y: auto; }
.a-modal-head { background: var(--black); padding: 1.4rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.a-modal-head h3 { font-family: var(--fd); font-size: 1.4rem; font-weight: 300; color: var(--white); }
.a-modal-close { background: none; color: rgba(255,255,255,0.5); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; }
.a-modal-close:hover { color: var(--white); }
.a-modal-body { padding: 2rem; }
.af { display: flex; flex-direction: column; gap: 1rem; }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.af-group { display: flex; flex-direction: column; gap: 5px; }
.af-label { font-size: 10px; letter-spacing: 0.18em; color: var(--gray); text-transform: uppercase; }
.af-input { font-size: 13px; color: var(--black); background: var(--cream); border: 1px solid var(--gray-lt); border-radius: var(--radius); padding: 10px 12px; outline: none; transition: border-color 0.2s; width: 100%; font-family: var(--fb); }
.af-input:focus { border-color: var(--gold); }
textarea.af-input { resize: vertical; }
.a-link-btn { background: none; font-size: 12px; color: var(--gold); cursor: pointer; text-decoration: underline; }

/* TOAST */
.toast { position: fixed; bottom: 2rem; right: 2rem; z-index: 999; background: var(--black); color: var(--white); padding: 13px 22px; border-radius: var(--radius); font-size: 13px; opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none; border-left: 3px solid var(--gold); }
.toast.show { opacity: 1; transform: translateY(0); }

/* REPLY MODAL */
.reply-modal { max-width: 540px; }

/* GUEST TIER BADGES */
.tier-vip { background: var(--amber-bg); color: var(--amber-tx); font-size: 10px; padding: 3px 9px; border-radius: 20px; }
.tier-ret { background: var(--green-bg); color: var(--green-tx); font-size: 10px; padding: 3px 9px; border-radius: 20px; }
.tier-new { background: var(--blue-bg);  color: var(--blue-tx);  font-size: 10px; padding: 3px 9px; border-radius: 20px; }

@media (max-width: 1100px) {
  .dash-two-col, .settings-grid { grid-template-columns: 1fr; }
  .msg-layout { grid-template-columns: 1fr; height: auto; }
  .msg-list { height: 320px; }
}
@media (max-width: 768px) {
  .a-sidebar { transform: translateX(-100%); }
  .a-main { margin-left: 0; }
}
