/* =========================================================
   HOTEL NT GRAND — admin panel styles
========================================================= */

:root {
    --green-900: #0b201b;
    --green-800: #0f2a24;
    --green-700: #173d35;
    --gold: #c7a45b;
    --gold-dark: #9d7a35;
    --gold-soft: #f6efdd;
    --bg: #f4f2ec;
    --card: #ffffff;
    --ink: #1a2622;
    --muted: #6b7672;
    --line: #e6e1d5;
    --danger: #b3392d;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 42, 36, .05), 0 6px 20px rgba(15, 42, 36, .05);
}

* { box-sizing: border-box; margin: 0; }
body { font-family: "DM Sans", system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { font-weight: 700; letter-spacing: -.01em; }
code { background: var(--gold-soft); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.strong:hover { color: var(--gold-dark); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.grow { flex: 1; min-width: 0; }

.monogram {
    width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
    font-family: "Playfair Display", Georgia, serif; font-weight: 600; color: #e5cf95; background: var(--green-800); border: 2px solid var(--gold);
}

/* ---------- Buttons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: .9rem; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-light { background: var(--card); border-color: var(--line); }
.btn-light:hover { border-color: var(--gold); }
.btn-danger { background: #fbeceb; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 10px; }

/* ---------- Auth pages ---------- */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--green-700), var(--green-900) 60%); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 22px; padding: 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .monogram, .auth-logo { width: 72px; height: 72px; font-size: 1.5rem; margin: 0 auto 14px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.auth-brand h1 { font-family: "Playfair Display", Georgia, serif; font-size: 1.7rem; }
.auth-brand p { color: var(--muted); }
.auth-back { display: block; text-align: center; margin-top: 20px; color: var(--muted); font-size: .9rem; }
.auth-back:hover { color: var(--ink); }

.stack { display: grid; gap: 16px; }
.stack label, .field > label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; font-weight: 400;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199, 164, 91, .2); }
textarea { resize: vertical; }

/* ---------- Alerts ---------- */

.alert { padding: 13px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.alert-success { background: #e7f4ec; color: #1d6b3f; }
.alert-error { background: #fbeceb; color: var(--danger); }
.alert-info { background: var(--gold-soft); color: #6d5421; }

/* ---------- Layout ---------- */

.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--green-900); color: rgba(255, 255, 255, .75); display: flex; flex-direction: column; z-index: 40; transition: transform .3s; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-brand strong { display: block; color: #fff; font-size: .95rem; line-height: 1.2; }
.sidebar-brand small { font-size: .74rem; opacity: .6; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: grid; gap: 2px; align-content: start; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 500; transition: background .2s, color .2s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.is-active { background: var(--gold); color: var(--green-900); font-weight: 700; }
.sidebar nav .count { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 700; background: #e0574a; color: #fff; padding: 2px 8px; border-radius: 999px; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; justify-content: space-between; font-size: .88rem; }
.sidebar-foot a:hover { color: #fff; }
.sidebar-foot .logout { color: #f1a399; }

.admin-main { margin-left: 250px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 16px 32px; background: rgba(244, 242, 236, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.35rem; flex: 1; }
.topbar-user { font-weight: 600; color: var(--muted); font-size: .9rem; }
.menu-btn { display: none; border: 0; background: none; font-size: 1.5rem; cursor: pointer; }
.admin-content { padding: 28px 32px 60px; max-width: 1280px; }
.sidebar-backdrop { display: none; }

.greeting { color: var(--muted); margin-bottom: 20px; font-size: 1.02rem; }
.back { display: inline-block; margin-bottom: 18px; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--ink); }

/* ---------- Cards ---------- */

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 24px; }
.card h2 { font-size: 1.08rem; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head a { font-weight: 600; font-size: .88rem; color: var(--gold-dark); }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.empty a { color: var(--gold-dark); font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: grid; transition: transform .2s, border-color .2s; }
.stat:hover { transform: translateY(-2px); border-color: var(--gold); }
.stat small { font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat strong { font-size: 2.2rem; line-height: 1.2; margin: 6px 0 2px; }
.stat span { color: var(--muted); font-size: .86rem; }
.stat-accent { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.stat-accent small, .stat-accent span { color: rgba(255, 255, 255, .7); }
.stat-accent strong { color: #e5cf95; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.enquiry-list, .arrival-list { list-style: none; padding: 0; }
.enquiry-list li + li, .arrival-list li + li { border-top: 1px solid var(--line); }
.enquiry-list a, .arrival-list li { display: flex; align-items: center; gap: 14px; padding: 12px 4px; }
.enquiry-list a:hover strong { color: var(--gold-dark); }
.enquiry-list small, .arrival-list small { display: block; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-dark); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.date-chip { width: 48px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 4px 0; font-size: .72rem; text-transform: uppercase; color: var(--muted); flex-shrink: 0; }
.date-chip b { display: block; font-size: 1.15rem; color: var(--ink); }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.quick-links a { padding: 7px 12px; border-radius: 8px; background: var(--gold-soft); font-weight: 600; font-size: .85rem; color: #6d5421; }
.quick-links a:hover { background: var(--gold); color: var(--green-900); }

/* ---------- Badges ---------- */

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge-new { background: #fdeeda; color: #a55d0b; }
.badge-contacted { background: #e5eefb; color: #2d5a9e; }
.badge-confirmed { background: #e2f3e8; color: #1d6b3f; }
.badge-cancelled { background: #efeeea; color: #7a7a74; }

/* ---------- Tables ---------- */

.page-actions, .toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 18px; background: #faf8f3; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfbf8; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 8px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; color: var(--muted); }
.stars { color: var(--gold); letter-spacing: 2px; }
.icon-chip { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-dark); }

.switch { width: 42px; height: 24px; border-radius: 999px; background: #d9d5cb; border: 0; position: relative; cursor: pointer; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.is-on { background: #2f8a55; }
.switch.is-on span { transform: translateX(18px); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs a { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.tabs a em { font-style: normal; font-size: .76rem; background: var(--bg); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.tabs a.is-active { background: var(--green-800); color: #fff; }
.tabs a.is-active em { background: rgba(255, 255, 255, .15); }
.search { flex: 1; max-width: 320px; margin-left: auto; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pager a { min-width: 36px; padding: 7px 10px; text-align: center; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.pager a.is-active { background: var(--green-800); color: #fff; border-color: var(--green-800); }

/* ---------- Forms ---------- */

.form-card { padding: 28px; }
.form-card.narrow { max-width: 720px; }
.form-card.narrow > .muted { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > * { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field small { color: var(--muted); font-size: .8rem; }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--green-700); }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

.image-input { display: flex; gap: 16px; align-items: flex-start; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fcfbf8; }
.image-preview { width: 150px; height: 104px; border-radius: 10px; overflow: hidden; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); font-size: .82rem; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-input-fields { flex: 1; display: grid; gap: 8px; min-width: 0; }
.image-input-fields input[type=file] { font-size: .88rem; width: 100%; max-width: 100%; }

.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-picker label { cursor: pointer; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker span { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: all .15s; }
.icon-picker label:hover span { border-color: var(--gold); }
.icon-picker input:checked + span { background: var(--green-800); color: #e5cf95; border-color: var(--green-800); }
.icon-picker input:focus-visible + span { box-shadow: 0 0 0 3px rgba(199, 164, 91, .35); }

.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.settings-tabs button { border: 1px solid var(--line); background: var(--card); padding: 9px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--muted); }
.settings-tabs button.is-active { background: var(--green-800); border-color: var(--green-800); color: #fff; }
.sticky-save { position: sticky; bottom: 0; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 24px rgba(15, 42, 36, .08); }

/* ---------- Enquiry detail ---------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-list div { background: #fff; padding: 12px 16px; }
.detail-list dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail-list dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-list a { color: var(--green-700); }
.sub { font-size: .9rem; margin: 22px 0 8px; }
.message-box { background: #faf8f3; border-left: 3px solid var(--gold); padding: 14px 16px; border-radius: 8px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.status-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.status-picker label { cursor: pointer; }
.status-picker input { position: absolute; opacity: 0; }
.status-picker .badge { padding: 8px 14px; font-size: .84rem; border: 2px solid transparent; opacity: .55; transition: opacity .15s; }
.status-picker input:checked + .badge { opacity: 1; border-color: currentColor; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
    .admin-main { margin-left: 0; }
    .menu-btn { display: block; }
    .topbar { padding: 14px 16px; }
    .admin-content { padding: 20px 16px 60px; }
    .form-grid, .detail-list { grid-template-columns: minmax(0, 1fr); }
    .search { max-width: none; margin-left: 0; }
    .card, .form-card { padding: 18px; }
    .table-wrap { padding: 0; }

    .topbar-user { display: none; }
    .topbar h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-actions .btn { padding: 10px 14px; }
    .toolbar .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .toolbar .tabs a { flex-shrink: 0; }
    .toolbar .search { flex: 1; }
    .sticky-save { padding: 10px 12px; margin-inline: -4px; }
    .sticky-save .muted { display: none; }
    .sticky-save .btn { width: 100%; }
    .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
    .settings-tabs button { flex-shrink: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px 16px; }
    .stat strong { font-size: 1.7rem; }
    .stat span { font-size: .78rem; }
    .form-foot .btn { flex: 1; }

    .table thead { display: none; }
    .table, .table tbody { display: block; width: 100%; }
    .table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 16px; border-bottom: 1px solid var(--line); }
    .table td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; }
    .table td.td-full, .table td.text-right { grid-column: 1 / -1; }
    .table td.text-right { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
    .table td.text-right .btn { flex: 1; }
    .table td.text-right form { display: flex; flex: 1; }
    .table tr:hover td { background: none; }
    .clamp { max-width: none; }
    .thumb { width: 100%; height: 120px; }
    .table td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
    .table td.text-right { padding-top: 10px; }
    .table tr.is-new td:first-child { box-shadow: none; }
}

@media (max-width: 520px) {
    .image-input { flex-direction: column; }
    .image-preview { width: 100%; height: 160px; }
    .auth-card { padding: 26px; }
}
