:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --accent: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { background-color: var(--light); color: var(--dark); line-height: 1.6; }

/* Navigation */
header { background: #ffffff; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); position: sticky; top: 0; z-index: 1000; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); text-decoration: none; cursor: pointer; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.2rem; list-style: none; align-items: center; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }

/* Buttons */
.btn { background: var(--primary); color: #fff; padding: 0.6rem 1.4rem; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; text-decoration: none; transition: background 0.2s; display: inline-block; }
.btn:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d97706; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Hero */
.hero { background: linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.65)), url('https://encrypted-tbn2.gstatic.com/licensed-image?q=tbn:ANd9GcSPhH-I4fRZsupUtwP_0Y5fIolMJ-z8ytN-TBSEqwvX8tcSPWeiLHb1Y0XPXvatEwSEE3kJO2txprlZ-9s') center/cover; color: #fff; text-align: center; padding: 6rem 1rem; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; }
.hero p { max-width: 650px; margin: 0 auto 2rem auto; font-size: 1.15rem; color: #f1f5f9; }

/* Container */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }
.section-header { margin-bottom: 2rem; }
.section-title { font-size: 2rem; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; }
.section-desc { color: var(--gray); font-size: 1rem; margin-top: 0.25rem; }

/* Destination Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.75rem; }
.card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border: 1px solid var(--border); transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); }
.card img { width: 100%; height: 210px; object-fit: cover; display: block; }
.card-body { padding: 1.25rem; }
.card-body h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--dark); }
.card-body p { color: var(--gray); font-size: 0.9rem; }

/* Service Cards */
.service-card { background: #fff; border-radius: 12px; border: 1px solid var(--border); padding: 1.5rem; display: flex; gap: 1.25rem; align-items: center; }
.service-card img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }
.service-info { flex: 1; }
.service-info h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.service-info p { color: var(--gray); font-size: 0.85rem; margin-bottom: 0.25rem; }

/* Modules */
.module { display: none; background: #fff; padding: 2rem; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.module.active { display: block; }

/* Forms */
form { display: grid; gap: 1.25rem; max-width: 650px; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select { padding: 0.75rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; }

/* Chat */
.chat-box { border: 1px solid var(--border); height: 320px; overflow-y: auto; padding: 1rem; background: #f8fafc; border-radius: 8px; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.msg { max-width: 75%; padding: 0.75rem 1rem; border-radius: 12px; font-size: 0.9rem; }
.msg.sent { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.msg.received { background: #e2e8f0; color: var(--dark); align-self: flex-start; border-bottom-left-radius: 2px; }

/* Modal Security Box */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px); z-index: 2000; align-items: center; justify-content: center; }
.modal-content { background: #fff; padding: 2.5rem; border-radius: 12px; max-width: 420px; width: 90%; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }

.gateway-portal { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 1.5rem; border-radius: 8px; margin-top: 1.5rem; }
.bank-card { background: #ffffff; border: 1px solid #a7f3d0; padding: 1rem; border-radius: 6px; margin: 1rem 0; font-size: 0.88rem; }

footer { background: var(--dark); color: #94a3b8; text-align: center; padding: 2.5rem 1rem; margin-top: 4rem; font-size: 0.9rem; }
/* The commission gateway shortcut is drawn only for a signed-in guide or transport provider. */
.provider-only { display: none; }

/* The gateway's entry point inside a provider's own account (their message box). */
.account-gateway { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-left: 4px solid var(--accent); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.account-gateway h3 { font-size: 1.02rem; margin-bottom: 0.15rem; }
.account-gateway p { font-size: 0.86rem; color: var(--gray); }
/* The message box link only appears once a member is signed in. */
.member-only { display: none; }

/* Status pills */
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pill-pending { background: #fef3c7; color: #92400e; }
.pill-approved { background: #dcfce7; color: #166534; }
.pill-rejected { background: #fee2e2; color: #991b1b; }
.pill-removed { background: #e2e8f0; color: #334155; }

/* Feedback banners */
.notice { padding: 0.9rem 1.1rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; display: none; }
.notice.show { display: block; }
.notice-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.notice-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

.empty-state { text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--border); border-radius: 12px; color: var(--gray); background: #fff; }
.empty-state strong { display: block; color: var(--dark); margin-bottom: 0.35rem; font-size: 1.05rem; }

/* Admin console */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; padding-bottom: 0.75rem; }
.admin-tab { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--gray); }
.admin-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.admin-tab .count { font-weight: 700; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.25rem; }
.filter-chip { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--gray); }
.filter-chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }

.record { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gray); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.record[data-status="pending"] { border-left-color: var(--accent); }
.record[data-status="approved"] { border-left-color: #16a34a; }
.record[data-status="rejected"] { border-left-color: var(--danger); }
.record[data-status="removed"] { border-left-color: #475569; }
.record-head { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; align-items: flex-start; margin-bottom: 0.9rem; }
.record-head h4 { font-size: 1.1rem; }
.record-meta { font-size: 0.78rem; color: var(--gray); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0.75rem 1.5rem; margin-bottom: 1rem; }
.field { font-size: 0.88rem; }
.field span { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); font-weight: 700; margin-bottom: 0.1rem; }
.field div { word-break: break-word; white-space: pre-wrap; }
.docs { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.doc { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; width: 132px; font-size: 0.7rem; color: var(--gray); text-align: center; background: #f8fafc; }
.doc img { width: 100%; height: 84px; object-fit: cover; border-radius: 4px; margin-bottom: 0.35rem; display: block; cursor: pointer; }
.doc .doc-label { font-weight: 700; color: var(--dark); text-transform: capitalize; display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-muted { background: #e2e8f0; color: var(--dark); }
.btn-muted:hover { background: #cbd5e1; }
.violation-note { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 0.6rem 0.85rem; border-radius: 6px; font-size: 0.82rem; margin-bottom: 0.9rem; }

.log-entry { font-size: 0.82rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); color: var(--gray); }
.log-entry strong { color: var(--dark); }

/* Message box */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1.25rem; align-items: start; }
.msg-sidebar { border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; max-height: 640px; overflow-y: auto; }
.msg-sidebar h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); padding: 0.9rem 1rem 0.4rem; }
.contact { display: flex; gap: 0.65rem; align-items: center; width: 100%; text-align: left; background: transparent; border: none; border-top: 1px solid var(--border); padding: 0.7rem 1rem; cursor: pointer; font-family: inherit; }
.contact:hover { background: #f1f5f9; }
.contact.active { background: #e0f2fe; }
.contact-avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; background: var(--primary); }
.contact-avatar.guide { background: #0f766e; }
.contact-avatar.transport { background: #b45309; }
.contact-avatar.admin { background: var(--dark); }
.contact-body { flex: 1; min-width: 0; }
.contact-name { font-weight: 600; font-size: 0.9rem; }
.contact-sub { font-size: 0.75rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { background: var(--danger); color: #fff; border-radius: 999px; font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.45rem; }
.msg-main { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 1.25rem; }
/* A file carried by a message — fetched with a token, so it is a button. */
.msg-attachment { display: block; margin-top: 0.5rem; width: 100%; text-align: left; font-family: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 6px; border: 1px solid rgba(15, 23, 42, 0.18); background: rgba(255, 255, 255, 0.85); color: var(--primary-dark); }
.msg.sent .msg-attachment { border-color: rgba(255, 255, 255, 0.55); background: rgba(255, 255, 255, 0.16); color: #fff; }
.msg-attachment:disabled { opacity: 0.6; cursor: progress; }

/* Claude's answers arrive as prose plus short bullet lists. */
.msg p { margin: 0 0 0.5rem; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.msg ul:last-child { margin-bottom: 0; }
.msg li { margin-bottom: 0.25rem; }
.msg.received.ai-thinking { opacity: 0.7; font-style: italic; }

/* One-tap starter questions for the travel assistant. */
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.ai-suggestions button { font-family: inherit; font-size: 0.78rem; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--gray); border-radius: 999px; padding: 0.35rem 0.8rem; }
.ai-suggestions button:hover { border-color: var(--primary); color: var(--primary-dark); background: #e0f2fe; }

.msg time { display: block; font-size: 0.65rem; opacity: 0.75; margin-top: 0.3rem; }
.msg-empty { color: var(--gray); font-size: 0.9rem; text-align: center; margin: auto; }

/* Agent settlement reports */
.deal-card { background: #f8fafc; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; padding: 1rem 1.15rem; margin-bottom: 1rem; font-size: 0.88rem; }
.deal-card h5 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); margin-bottom: 0.4rem; }
.deal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.7rem 1.4rem; margin-top: 0.8rem; }
.deal-grid span { display: block; font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); font-weight: 700; }
.deal-grid div { font-weight: 600; }
.deal-money { font-size: 1.05rem; color: var(--primary-dark); }
.pill-received, .pill-agreed { background: #dcfce7; color: #166534; }
.pill-waived, .pill-no_deal { background: #e2e8f0; color: #334155; }
.pill-in_progress, .pill-draft { background: #fef3c7; color: #92400e; }
.pill-final { background: #dbeafe; color: #1e40af; }
.transcript { border-top: 1px solid var(--border); margin-top: 0.9rem; padding-top: 0.7rem; font-size: 0.82rem; max-height: 260px; overflow-y: auto; }
.transcript p { margin-bottom: 0.4rem; }
.transcript strong { color: var(--dark); }
.ledger { display: flex; flex-wrap: wrap; gap: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.ledger div span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); font-weight: 700; }
.ledger div strong { font-size: 1.15rem; }

/* Admin broadcast composer */
.broadcast-box { background: #f8fafc; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 10px; padding: 1.15rem 1.25rem; }
.broadcast-box h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); margin-bottom: 0.75rem; }
.broadcast-entry { border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 0.7rem; background: #fff; font-size: 0.88rem; }
.broadcast-entry p { white-space: pre-wrap; margin-top: 0.35rem; }
.msg.admin { background: var(--dark); color: #fff; align-self: flex-start; border-bottom-left-radius: 2px; }

@media (max-width: 820px) { .msg-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .service-card { flex-direction: column; text-align: center; }
    .nav-container { flex-direction: column; gap: 0.75rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
}

/* ------------------------------------------------------------------ */
/* Admin payment gateway                                              */
/* ------------------------------------------------------------------ */
/* The account a depositor pays into is revealed on demand, not always on show. */
.bank-reveal { margin-bottom: 1.25rem; }
.bank-reveal .bank-card { margin: 0.75rem 0 0; }

.pay-method { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.pay-method button { flex: 1; min-width: 180px; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 0.7rem 1rem; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.9rem; color: var(--gray); text-align: left; }
.pay-method button.active { border-color: var(--primary); background: #e0f2fe; color: var(--primary-dark); }
.pay-method button small { display: block; font-weight: 500; font-size: 0.75rem; margin-top: 0.15rem; }
.tour-due { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 0.9rem 1.1rem; margin-bottom: 0.75rem; background: #fff; font-size: 0.88rem; }
.tour-due.settled { border-left-color: #16a34a; }
.tour-due-head { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: baseline; }
.tour-due-head strong { font-size: 0.98rem; }
.tour-due .amount { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); }
.pill-submitted { background: #fef3c7; color: #92400e; }
.pill-confirmed, .pill-sent, .pill-answered { background: #dcfce7; color: #166534; }
.pill-new { background: #dbeafe; color: #1e40af; }
.pill-in_progress { background: #fef3c7; color: #92400e; }
.pill-closed, .pill-failed { background: #e2e8f0; color: #334155; }
.pill-card { background: #ede9fe; color: #5b21b6; }
.pill-bank_transfer { background: #cffafe; color: #155e75; }
.secure-note { font-size: 0.78rem; color: var(--gray); background: #f8fafc; border: 1px dashed var(--border); border-radius: 6px; padding: 0.6rem 0.8rem; margin-top: 0.5rem; }

/* Direct tour plan enquiries */
.contact-hero { background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.7)), url('https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Arugam_bay_beach.jpg/1280px-Arugam_bay_beach.jpg') center/cover; color: #fff; text-align: center; padding: 4.5rem 1rem; }
.contact-hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.75rem; }
.contact-hero p { max-width: 640px; margin: 0 auto; color: #e2e8f0; }
.contact-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.75rem; align-items: start; }
.contact-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 2rem; }
.contact-aside { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; font-size: 0.88rem; }
.contact-aside h3 { font-size: 1rem; margin-bottom: 0.6rem; }
.contact-aside p { color: var(--gray); margin-bottom: 0.9rem; }
.contact-panel form { max-width: none; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }
