:root {
    --em-950: #031d16; --em-900: #062a20; --em-800: #0a3b2d; --em-700: #0f4d3a;
    --gold: #c9a24b; --gold-300: #e8cf8f; --gold-grad: linear-gradient(135deg, #f3dc9b, #c9a24b 50%, #a8822f);
    --bg: #f5f2ea; --card: #fff; --ink: #1b2722; --muted: #66756d; --line: #e7e1d3;
    --danger: #b3261e; --ok: #12704a;
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='.8'%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Ccircle cx='40' cy='40' r='9'/%3E%3Cpath d='M40 0v14.5M40 80V65.5M0 40h14.5M80 40H65.5'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; font-size: 14.5px; color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--em-700); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; color: var(--em-900); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 2rem; }

.admin { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--em-900); color: #c8d5ce; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; isolation: isolate; overflow-y: auto; }
.sidebar::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 70px; opacity: .06; z-index: -1; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px; border-bottom: 1px solid rgba(201,162,75,.2); color: #fff; }
.sidebar__brand strong { font-family: 'Cinzel', serif; letter-spacing: .08em; font-size: 1.1rem; display: block; line-height: 1.1; }
.sidebar__brand span { font-size: .65rem; letter-spacing: .25em; text-transform: uppercase; color: var(--gold-300); }
.sidebar nav { padding: 16px 12px; display: grid; gap: 2px; }
.sidebar nav a, .sidebar nav button { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: #c8d5ce; font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; width: 100%; text-align: left; }
.sidebar nav a:hover, .sidebar nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(201,162,75,.16); color: var(--gold-300); }
.sidebar nav .label { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: #6f8a7d; padding: 14px 14px 6px; }
.sidebar nav .count { margin-left: auto; background: var(--gold); color: var(--em-950); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.sidebar__foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(201,162,75,.15); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 600; color: var(--em-900); }
.topbar__right { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; align-items: center; justify-content: center; }
.content { padding: 28px 32px 60px; max-width: 1280px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; line-height: 1.2; transition: .2s; white-space: nowrap; }
.btn-primary { background: var(--em-800); color: #fff; }
.btn-primary:hover { background: var(--em-700); color: var(--gold-300); }
.btn-gold { background: var(--gold-grad); color: var(--em-950); }
.btn-gold:hover { color: var(--em-950); filter: brightness(1.05); }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-light:hover { border-color: var(--gold); color: var(--ink); }
.btn-danger { background: #fff; border-color: #f0cfcb; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 1.45rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.stat::after { content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; background-image: var(--pattern); background-size: 45px; opacity: .25; }
.stat small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.stat strong { display: block; font-family: 'Cormorant Garamond', serif; font-size: 2.6rem; color: var(--em-800); line-height: 1.1; }
.stat--gold { background: var(--em-900); border-color: var(--em-900); }
.stat--gold small { color: var(--gold-300); }
.stat--gold strong { color: #fff; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); background: #faf8f2; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfbf7; }
.thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--em-800); display: block; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge-green { background: #e3f3ea; color: var(--ok); }
.badge-grey { background: #eeece6; color: #6d6a60; }
.badge-gold { background: #f8efd6; color: #85651f; }
.badge-blue { background: #e4eefb; color: #1f4f8b; }
.badge-red { background: #fbe7e5; color: var(--danger); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 6px; color: var(--em-900); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=datetime-local], .field input[type=url], .field select, .field textarea {
    width: 100%; padding: 11px 14px; border: 1px solid #dcd4c2; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,.18); }
.field textarea { min-height: 120px; resize: vertical; }
.field .error { color: var(--danger); font-size: .8rem; margin-top: 4px; display: block; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { width: 18px; height: 18px; accent-color: var(--em-800); }
.form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.form-side { position: sticky; top: 90px; }
.img-preview { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 10px; background: #eee; }
.editor { background: #fff; border-radius: 0 0 10px 10px; }
.editor .ql-editor { min-height: 280px; font-size: 15px; font-family: inherit; }
.ql-toolbar.ql-snow { border-radius: 10px 10px 0 0; border-color: #dcd4c2 !important; }
.ql-container.ql-snow { border-color: #dcd4c2 !important; border-radius: 0 0 10px 10px; }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: .76rem; }
.serp { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; background: #fcfbf7; margin-top: 6px; }
.serp__t { color: #1a0dab; font-size: 1.05rem; line-height: 1.3; }
.serp__u { color: #006621; font-size: .8rem; margin: 2px 0; word-break: break-all; }
.serp__d { color: #545454; font-size: .84rem; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; }
.alert-success { background: #e3f3ea; color: var(--ok); border: 1px solid #b6dec7; }
.alert-error { background: #fbe7e5; color: var(--danger); border: 1px solid #f0cfcb; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { padding: 9px 12px; border: 1px solid #dcd4c2; border-radius: 10px; font: inherit; background: #fff; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.muted { color: var(--muted); }
dl.details { display: grid; grid-template-columns: 160px 1fr; gap: 10px 20px; margin: 0; }
dl.details dt { color: var(--muted); font-weight: 600; font-size: .84rem; }
dl.details dd { margin: 0; }

.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 600; }
.pagination .is-active span { background: var(--em-800); color: #fff; border-color: var(--em-800); }
.pagination .is-disabled span { opacity: .4; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--em-900); position: relative; isolation: isolate; }
.login-wrap::before { content: ''; position: absolute; inset: 0; background-image: var(--pattern); background-size: 80px; opacity: .1; z-index: -1; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 200px 200px 20px 20px; padding: 70px 36px 36px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); border: 1px solid var(--gold); text-align: center; }
.login-card form { text-align: left; display: grid; gap: 16px; margin-top: 20px; }

@media (max-width: 1000px) {
    .admin { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .3s; }
    .sidebar-open .sidebar { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.3); }
    .menu-btn { display: inline-flex; }
    .stats { grid-template-columns: 1fr 1fr; }
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; }
    .content, .topbar { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 640px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .hide-sm { display: none; }
    dl.details { grid-template-columns: 1fr; }
    .topbar__right .who { display: none; }
}

/* Transport fare grid + enquiry details */
.rate-grid td input { width: 110px; padding: 8px 10px; border: 1px solid var(--line, #e3ded2); border-radius: 8px; font: inherit; }
.rate-grid th { white-space: nowrap; }
.rate-grid td:first-child { min-width: 240px; }
.detail-table { width: 100%; }
.detail-table th { width: 38%; text-align: left; font-weight: 600; text-transform: none; letter-spacing: 0; }
.nav-group { display: grid; }
