/* DMC quotation system — Andaman teal + marigold */
:root {
  --ink: #1c2b33;
  --muted: #66757d;
  --line: #d9e1e4;
  --bg: #f3f5f4;
  --panel: #ffffff;
  --teal: #0e4d64;
  --teal2: #13698a;
  --tealsoft: #e6f0f3;
  --gold: #d99a1e;
  --goldsoft: #fbf1db;
  --red: #b4412f;
  --green: #2f7a4e;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--teal2); }
a:hover { color: var(--teal); }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
code { background: var(--tealsoft); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---------- top bar ---------- */
.topbar { background: var(--teal); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 20px; min-height: 54px; position: relative; border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand img { height: 32px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }
.brand:hover { color: #fff; }
.topbar nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a { color: #d6e7ed; text-decoration: none; padding: 16px 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -3px; display: block; }
.topbar nav a:hover { color: #fff; }
.topbar nav a.on { color: #fff; border-bottom-color: #fff; }
.topbar nav a.me { margin-left: 10px; color: #fff; font-weight: 500; }
.navgroup { position: relative; }
.navgroup .sub { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 20px rgba(14, 77, 100, .15); z-index: 50; min-width: 160px; padding: 4px 0; }
.navgroup:hover .sub, .navgroup:focus-within .sub { display: block; }
.navgroup .sub a { color: var(--ink); padding: 8px 14px; border: 0; margin: 0; }
.navgroup .sub a:hover { background: var(--tealsoft); color: var(--teal); }
.navtoggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.wrap.wide { max-width: 1500px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 24px; }

.pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin-right: auto; }
.pagehead.sticky { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 10px 0; margin-top: -10px; border-bottom: 1px solid var(--line); }
.headactions { display: flex; align-items: center; gap: 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.panelhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panelhead h2 { margin: 0 auto 0 0; }
.panel.narrow { max-width: 520px; }
.prose p { margin: 0 0 8px; max-width: 80ch; }
.empty { color: var(--muted); padding: 14px 0; }

/* ---------- forms ---------- */
.form label, .builder label, .toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid #c5d0d4; border-radius: 6px; padding: 7px 9px; background: #fff; min-width: 0; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--teal2); outline: none; box-shadow: 0 0 0 3px rgba(19, 105, 138, .15); }
input[readonly], input:disabled, textarea[readonly] { background: #f5f7f7; color: var(--muted); }
textarea { resize: vertical; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--ink) !important; font-size: 13px !important; }
label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.grid2.tight { gap: 0 10px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
form.inline { display: inline; }
form.inline input.small { width: 130px; padding: 4px 7px; font-size: 12px; }
.code { background: #f5f7f7; padding: 12px; border-radius: 6px; overflow: auto; font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; padding: 7px 14px; border: 1px solid #c5d0d4; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--teal2); color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal2); color: #fff; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal2); cursor: pointer; font: inherit; text-decoration: underline; }
.linkbtn.danger { color: var(--red); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { width: 280px; }
.toolbar select { width: auto; }
.tabs { display: flex; gap: 4px; background: #e4eaec; padding: 3px; border-radius: 7px; }
.tabs a { padding: 6px 14px; border-radius: 5px; text-decoration: none; color: var(--ink); font-weight: 500; }
.tabs a.on { background: #fff; color: var(--teal); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #eaf5ee; border-color: #b8dcc5; color: #1f5a37; }
.flash.err { background: #fbecea; border-color: #ecc0b9; color: #8a2d1f; }
.flash.warn { background: var(--goldsoft); border-color: #efd497; color: #7a5410; }
.warn { color: #8a5a0c; background: var(--goldsoft); padding: 6px 10px; border-radius: 6px; font-size: 12.5px; margin: 0 0 8px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.list td { padding: 9px 10px; border-bottom: 1px solid #edf1f2; vertical-align: top; }
table.list.dense td { padding: 6px 8px; font-size: 13px; }
table.list tr:hover td { background: #fafcfc; }
table.list th.r, table.list td.r { text-align: right; }
td.expired { color: var(--red); }
tr.inactive td { opacity: .55; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #eef2f3; color: var(--muted); font-weight: 500; border: 0; }
select.tag { width: auto; padding: 3px 6px; cursor: pointer; }
.s-draft { background: #eef2f3; color: #4c5b62; }
.s-sent { background: var(--tealsoft); color: var(--teal); }
.s-confirmed { background: #e3f3e8; color: var(--green); }
.s-lost { background: #f7e7e4; color: var(--red); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stats b { display: block; font-size: 26px; font-weight: 600; color: var(--teal); line-height: 1.1; }
.stats span { color: var(--muted); font-size: 12.5px; }
.ratelinks { display: flex; gap: 10px; flex-wrap: wrap; }
.ratelinks a { flex: 1; min-width: 160px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.ratelinks a:hover { border-color: var(--teal2); }
.ratelinks b { color: var(--teal); font-size: 18px; margin-right: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }

/* ---------- auth ---------- */
.authpage { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(180deg, var(--teal) 0, var(--teal) 220px, var(--bg) 220px); }
.authcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 30px 32px; width: 100%; max-width: 380px; box-shadow: 0 10px 30px rgba(14, 77, 100, .12); border-top: 4px solid var(--gold); }
.authcard.wide { max-width: 720px; }
.authcard h1 { margin-bottom: 4px; }
.authcard .muted { margin-top: 0; }
.authlogo { max-height: 56px; margin-bottom: 10px; }

/* ---------- builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.bside { position: sticky; top: 70px; }
.paxgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0 10px; }
.hrow, .irow { border: 1px solid var(--line); border-radius: 7px; padding: 10px 12px 0; margin-bottom: 10px; background: #fcfdfd; position: relative; }
.hrow.self { background: #f6f7f7; }
.irow { border-left: 3px solid var(--teal2); }
.irow.t-transfer { border-left-color: #6a7f89; }
.irow.t-meal { border-left-color: var(--gold); }
.irow.t-custom { border-left-color: #9aa9b0; }
.rline { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: flex-end; }
.rline label { margin-bottom: 10px; }
.rline.sub { border-top: 1px dashed #e1e7e9; padding-top: 8px; }
.rline .grp { font-size: 11px; color: var(--muted); align-self: center; margin: 0 2px 10px 0; padding: 2px 7px; background: #eef3f4; border-radius: 4px; }
.w-xs { width: 78px; } .w-sm { width: 128px; } .w-md { width: 190px; } .w-lg { width: 250px; } .w-xl { flex: 1; min-width: 240px; }
label.grow { flex: 1; min-width: 200px; }
.linetotal { margin: 0 0 16px auto; font-weight: 600; color: var(--teal); white-space: nowrap; font-size: 13px; }
.x { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 20px; line-height: 1; color: #9aa9b0; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.x:hover { color: var(--red); background: #f7e7e4; }
.rline > .x { position: static; margin: 0 0 12px auto; }
.rnote { font-size: 12px; color: #7a5410; background: var(--goldsoft); margin: 0 -12px; padding: 6px 12px; border-radius: 0 0 7px 7px; }
.ttag { font-size: 11px; font-weight: 600; color: #fff; background: var(--teal2); border-radius: 4px; padding: 2px 7px; align-self: center; margin-bottom: 10px; }
.t-transfer .ttag { background: #6a7f89; } .t-meal .ttag { background: var(--gold); } .t-custom .ttag { background: #9aa9b0; }
.dayhead { font-weight: 600; color: var(--teal); margin: 14px 0 6px; font-size: 13px; }
.dayhead:first-child { margin-top: 0; }
.opthead { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--teal); margin: 14px 0 8px; }
.pricepanel h3 { margin-top: 12px; color: var(--teal); }
.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.ptable th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 3px; }
.ptable td { padding: 6px 3px; border-bottom: 1px solid #eef2f3; vertical-align: top; }
.ptable .r { text-align: right; white-space: nowrap; }
.grand { display: flex; justify-content: space-between; align-items: baseline; background: var(--goldsoft); border-radius: 6px; padding: 10px 12px; margin-top: 10px; }
.grand b { font-size: 20px; color: var(--ink); }
.netline { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.acbox { position: fixed; z-index: 100; background: #fff; border: 1px solid #c5d0d4; border-radius: 7px; box-shadow: 0 10px 28px rgba(14, 77, 100, .18); max-height: 320px; overflow-y: auto; max-width: 520px; }
.acitem { padding: 7px 12px; cursor: pointer; border-bottom: 1px solid #f0f3f4; }
.acitem small { color: var(--muted); display: block; font-size: 11.5px; }
.acitem.on, .acitem:hover { background: var(--tealsoft); }
.acitem.dis { color: var(--muted); cursor: default; }
.acempty { padding: 9px 12px; color: var(--muted); font-size: 12.5px; }

/* ---------- printable quotation ---------- */
.docbody { background: #e9eeef; }
.doctools { max-width: 900px; margin: 16px auto 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding: 0 12px; }
.doc { max-width: 900px; margin: 14px auto 30px; background: #fff; padding: 40px 48px; box-shadow: 0 2px 14px rgba(0,0,0,.08); }
.doc.costing { border: 2px dashed var(--gold); padding: 22px 26px; }
.costsum div { margin: 8px 0; }
.note { background: var(--goldsoft); padding: 8px 12px; border-radius: 6px; }
.dochead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--teal); position: relative; }
.dochead::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 120px; height: 4px; background: var(--gold); }
.dbrand { display: flex; align-items: center; gap: 14px; }
.dbrand img { max-height: 64px; max-width: 220px; }
.dname { font-size: 21px; font-weight: 700; color: var(--teal); letter-spacing: -0.01em; }
.dtag { color: var(--muted); font-size: 12.5px; }
.dcontact { text-align: right; font-size: 12.5px; color: var(--muted); }
.dtitle { margin: 26px 0 8px; }
.dtitle h1 { font-size: 26px; font-weight: 600; color: var(--ink); }
.dref { color: var(--muted); margin-top: 4px; }
.greet { margin: 14px 0 18px; max-width: 75ch; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; margin: 0 0 24px; }
.facts div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: 11.5px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.dsec { margin: 0 0 26px; break-inside: avoid-page; }
.dsec h2 { font-size: 15px; color: var(--teal); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 12px; }
.dtable { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 13px; }
.dtable th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 7px 8px; background: #f4f7f8; border-bottom: 1px solid var(--line); }
.dtable td { padding: 8px; border-bottom: 1px solid #edf1f2; vertical-align: top; }
.dtable .r { text-align: right; }
.dtable.price tfoot td { font-weight: 700; font-size: 15px; background: var(--goldsoft); border-bottom: 0; padding: 10px 8px; }
.star { color: var(--gold); letter-spacing: 1px; font-size: 12px; }
.pricenote { margin: -14px 0 24px; }
.days { list-style: none; padding: 0; margin: 0; }
.days li { display: grid; grid-template-columns: 70px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid #edf1f2; break-inside: avoid; }
.dayno { font-weight: 700; color: #fff; background: var(--teal); border-radius: 5px; text-align: center; padding: 5px 0; height: fit-content; font-size: 13px; }
.daymeta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.svc { margin: 6px 0 8px; }
.svcname { font-weight: 600; }
.mode { display: inline-block; font-size: 11px; font-weight: 500; color: var(--teal); background: var(--tealsoft); padding: 1px 7px; border-radius: 10px; margin-left: 4px; vertical-align: 1px; }
.svcdesc { color: #46565e; font-size: 13px; max-width: 80ch; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
ul.ticks, ul.crosses, ul.plain { margin: 0; padding: 0; list-style: none; }
ul.ticks li, ul.crosses li, ul.plain li { padding: 3px 0 3px 20px; position: relative; font-size: 13px; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
ul.crosses li::before { content: "✕"; position: absolute; left: 1px; color: var(--red); font-size: 11px; top: 5px; }
ul.plain li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.pre { white-space: pre-line; }
.docfoot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 20px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .builder { grid-template-columns: 1fr; }
  .bside { position: static; }
  .paxgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 0 14px; }
  .navtoggle { display: block; }
  .topbar nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
  body.navopen .topbar nav { display: flex; }
  .topbar nav a { padding: 9px 4px; border: 0; margin: 0; }
  .navgroup .sub { position: static; display: block; box-shadow: none; border: 0; background: transparent; padding-left: 14px; }
  .navgroup .sub a { color: #d6e7ed; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .twocol { grid-template-columns: 1fr; }
  .doc { padding: 24px 18px; }
  .dochead { flex-direction: column; }
  .dcontact { text-align: left; }
  .toolbar input[type=search] { width: 100%; }
  .w-lg, .w-md { width: 100%; }
}
@media (max-width: 520px) {
  .grid2, .grid3, .grid4, .paxgrid { grid-template-columns: 1fr 1fr; }
  .span2, .span3 { grid-column: span 2; }
  .wrap { padding: 14px 12px 30px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body, .docbody { background: #fff; }
  .noprint, .doctools { display: none !important; }
  .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .twocol { grid-template-columns: 1fr 1fr; }
  a { color: inherit; text-decoration: none; }
  .dayno, .dtable.price tfoot td, .dtable th, .mode, .dochead::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
