/* December 2026 Sales & Business Activity Plan
   Navy header, white rounded cards, pill filters.
   Colour meaning: green = secured/paid, blue = scheduled, orange = pending/follow-up,
   purple = meetings & visits, red = lost/risk. */
:root{
  --navy:#0f1f3d; --navy-2:#182c52; --navy-3:#24396a;
  --bg:#f3f5fa; --card:#ffffff; --ink:#0f172a; --muted:#5b6478; --line:#e3e7ef;
  --green:#15803d; --green-bg:#e8f6ee; --green-line:#b7e2c7;
  --blue:#1d5fd6; --blue-bg:#eaf1fd; --blue-line:#c3d6f8;
  --orange:#c2570c; --orange-bg:#fff3e6; --orange-line:#f6cfa6;
  --purple:#6d3fd1; --purple-bg:#f1ebfd; --purple-line:#d6c7f7;
  --red:#c42b2b; --red-bg:#fdecec; --red-line:#f3c1c1;
  --teal:#0e7490; --teal-bg:#e6f5f8;
  --shadow:0 1px 2px rgba(15,31,61,.06),0 4px 14px rgba(15,31,61,.06);
  --r:14px;
  color-scheme:light;
}
*{box-sizing:border-box;min-width:0}
html{scroll-padding-top:120px}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.5 Inter,"Segoe UI",system-ui,-apple-system,"Noto Sans Thai",sans-serif;overflow-x:clip}
a{color:var(--blue)}
button{font:inherit;color:inherit}
h2{font-size:22px;line-height:1.2;margin:0 0 4px}
h3{font-size:16px;margin:0 0 8px}
.muted{color:var(--muted)}
.small{font-size:13px}
.nowrap{white-space:nowrap}

/* Header */
.top{background:var(--navy);color:#fff;position:sticky;top:0;z-index:20;box-shadow:0 2px 10px rgba(0,0,0,.15)}
.top-in{max-width:1280px;margin:0 auto;padding:14px 20px 10px;display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.brand{display:flex;gap:12px;align-items:center}
.logo{width:40px;height:40px;border-radius:10px;background:#2f6bf0;display:grid;place-items:center;font-weight:800;font-size:15px;flex:none}
.top h1{font-size:17px;margin:0;letter-spacing:.01em;line-height:1.25}
.top .sub{margin:2px 0 0;font-size:13px;color:#b9c4dc}
.top-meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.chip-dark{background:var(--navy-3);border-radius:999px;padding:6px 12px;font-size:13px;color:#d6def0}
.btn-dark{background:#fff;color:var(--navy);border-radius:10px;padding:8px 14px;font-weight:600;font-size:13px;text-decoration:none;white-space:nowrap}
.btn-dark:hover{background:#e8eefc}
.tabs{max-width:1280px;margin:0 auto;display:flex;gap:2px;overflow-x:auto;padding:0 12px;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs a{flex:none;color:#c7d0e4;text-decoration:none;font-weight:600;font-size:14px;padding:12px 14px;border-bottom:3px solid transparent;white-space:nowrap}
.tabs a:hover{color:#fff}
.tabs a.on{color:#fff;border-bottom-color:#5b8ef7}
.tabs a.tab-wfh{color:#ffd9b0}
.tabs a.tab-wfh.on{border-bottom-color:#f59e0b;color:#fff}

main{max-width:1280px;margin:0 auto;padding:22px 20px 40px}
.view{display:none}
.view.on{display:block}
.view-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.view-head p{margin:0}

/* Cards */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:18px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.mt{margin-top:16px}.mt2{margin-top:24px}
.section-title{display:flex;justify-content:space-between;align-items:baseline;gap:8px;margin:28px 0 12px;flex-wrap:wrap}
.section-title h2{font-size:19px}

/* KPI */
.kpi{position:relative;padding:18px 18px 16px;border-radius:var(--r);border:1px solid var(--line);background:#fff;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:4px}
.kpi .lbl{font-size:13px;font-weight:600;color:var(--muted);display:flex;align-items:center;gap:8px}
.kpi .val{font-size:clamp(22px,2.4vw,28px);font-weight:800;letter-spacing:-.01em;white-space:nowrap}
.kpi .note{font-size:13px;color:var(--muted)}
.kpi.green{background:var(--green-bg);border-color:var(--green-line)} .kpi.green .val{color:var(--green)}
.kpi.orange{background:var(--orange-bg);border-color:var(--orange-line)} .kpi.orange .val{color:var(--orange)}
.kpi.blue{background:var(--blue-bg);border-color:var(--blue-line)} .kpi.blue .val{color:var(--blue)}
.kpi.purple{background:var(--purple-bg);border-color:var(--purple-line)} .kpi.purple .val{color:var(--purple)}
.kpi.teal{background:var(--teal-bg);border-color:#b5e0ea} .kpi.teal .val{color:var(--teal)}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:none}

/* Badges & pills */
.badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:3px 10px;font-size:12px;font-weight:600;border:1px solid transparent;white-space:nowrap}
.b-green{background:var(--green-bg);color:var(--green);border-color:var(--green-line)}
.b-blue{background:var(--blue-bg);color:var(--blue);border-color:var(--blue-line)}
.b-orange{background:var(--orange-bg);color:var(--orange);border-color:var(--orange-line)}
.b-purple{background:var(--purple-bg);color:var(--purple);border-color:var(--purple-line)}
.b-red{background:var(--red-bg);color:var(--red);border-color:var(--red-line)}
.b-grey{background:#eef1f6;color:#475069;border-color:#dde2ec}
.b-teal{background:var(--teal-bg);color:var(--teal);border-color:#b5e0ea}
.b-dash{background:#fff;color:#64708a;border:1px dashed #b6bfd0}
.b-navy{background:var(--navy);color:#fff}
.pills{display:flex;gap:8px;flex-wrap:wrap}
.pill{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font-size:14px;font-weight:500;cursor:pointer;min-height:38px;display:inline-flex;align-items:center;gap:6px}
.pill:hover{border-color:#b7c3db}
.pill.on{background:var(--navy);color:#fff;border-color:var(--navy)}
.pill:focus-visible,.btn:focus-visible,.day:focus-visible,.opp:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #7aa5f8;outline-offset:2px}

.btn{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 14px;font-weight:600;cursor:pointer;min-height:40px;display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:var(--ink)}
.btn.primary{background:var(--navy);color:#fff;border-color:var(--navy)}
.btn.primary:hover{background:var(--navy-2)}
.btn.ghost:hover{background:#f4f6fb}
.btn.danger{background:var(--red);color:#fff;border-color:var(--red)}
.btn.big{font-size:17px;padding:14px 22px;border-radius:12px;min-height:54px}
.btn.green{background:#16a34a;color:#fff;border-color:#16a34a}
.btn.green:hover{background:#13843d}
.link-btn{background:none;border:0;color:var(--blue);cursor:pointer;text-decoration:underline;padding:6px}

/* Calendar */
.cal-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:13px;color:var(--muted);margin:10px 0 14px}
.cal-legend span{display:inline-flex;align-items:center;gap:6px}
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.cal .dow{font-size:12px;font-weight:700;color:var(--muted);text-align:center;padding:4px 0}
.day{background:#fff;border:1px solid var(--line);border-radius:12px;min-height:122px;padding:8px;text-align:left;cursor:pointer;display:flex;flex-direction:column;gap:4px;box-shadow:0 1px 2px rgba(15,31,61,.04);transition:border-color .15s,box-shadow .15s}
.day:hover{border-color:#9fb4dc;box-shadow:var(--shadow)}
.day.blank{background:transparent;border:0;box-shadow:none;cursor:default}
.day.weekend{background:#f8f9fc}
.day.holiday{background:#fbf8f1}
.day.wfh{border:2px solid var(--blue);background:#f5f9ff}
.day.today{box-shadow:0 0 0 2px #2f6bf0 inset}
.day.dim .ev{opacity:.25}
.day .dn{display:flex;justify-content:space-between;align-items:center;font-weight:700;font-size:14px}
.day .dn small{font-weight:600;font-size:11px;color:var(--muted)}
.ev{font-size:12px;line-height:1.3;border-radius:6px;padding:3px 6px;border-left:3px solid;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ev.visit{background:var(--purple-bg);border-color:var(--purple);color:#4c2a99}
.ev.online{background:var(--purple-bg);border-color:#9b7be6;color:#4c2a99}
.ev.payment{background:var(--orange-bg);border-color:#f08a2a;color:#8a3d06}
.ev.followup{background:#fff8e6;border-color:#e3a008;color:#7a5200}
.ev.wfh{background:var(--blue-bg);border-color:var(--blue);color:#173f8c;font-weight:700}
.ev.sugg{background:#fff;border:1px dashed #c2cad9;border-left:3px dashed #c2cad9;color:#64708a}
.ev.hol{background:transparent;border-left-color:#d6c9a8;color:#8a7a52}
.more{font-size:11px;color:var(--muted);font-weight:600}

/* Agenda */
.agenda-day{display:grid;grid-template-columns:120px minmax(0,1fr);gap:16px;padding:16px 0;border-top:1px solid var(--line)}
.agenda-day:first-child{border-top:0}
.agenda-date .d{font-size:28px;font-weight:800;line-height:1}
.agenda-date .w{font-size:13px;color:var(--muted);font-weight:600}
.agenda-day.is-wfh{background:#f5f9ff;border-radius:12px;padding:16px;border:1px solid var(--blue-line)}

/* Activity rows */
.act{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:8px}
.act.sugg{border-style:dashed;background:#fcfcfe}
.act .t{font-size:13px;font-weight:700;color:var(--muted);min-width:86px;white-space:nowrap}
.act .body{flex:1}
.act .title{font-weight:600}
.act ul{margin:4px 0 0;padding-left:18px;color:#39425a;font-size:14px}
.act.done .title{text-decoration:line-through;color:var(--muted)}
.chk{width:22px;height:22px;accent-color:#16a34a;flex:none;margin-top:1px;cursor:pointer}

/* Pipeline */
.board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:start}
.col{background:#eaeef6;border-radius:var(--r);padding:12px}
.col-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;gap:6px}
.col-h b{font-size:14px}
.col-sum{font-size:12px;color:var(--muted);margin:-6px 0 10px}
.opp{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:10px;cursor:pointer;width:100%;text-align:left;display:block;box-shadow:0 1px 2px rgba(15,31,61,.05)}
.opp:hover{border-color:#9fb4dc;box-shadow:var(--shadow)}
.opp .nm{font-weight:700;font-size:15px}
.opp .amt{font-weight:700;font-size:15px;margin-top:6px}
.opp .meta{font-size:12px;color:var(--muted);margin-top:4px}
.opp .tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}
.opp.off{opacity:.75;border-style:dashed}

/* Revenue */
.bucket{border-radius:var(--r);padding:16px;border:1px solid var(--line);background:#fff}
.bucket h3{display:flex;align-items:center;gap:8px}
.tbl{width:100%;border-collapse:collapse;font-size:14px}
.tbl th{text-align:left;font-size:12px;color:var(--muted);font-weight:700;padding:8px;border-bottom:1px solid var(--line)}
.tbl td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:top}
.tbl tr:last-child td{border-bottom:0}
.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.tbl th.num{text-align:right}
.tbl tr.click{cursor:pointer}
.tbl tr.click:hover td{background:#f6f8fc}
.scroll{overflow-x:auto}
.bar{height:10px;border-radius:999px;background:#e6eaf2;overflow:hidden}
.bar>i{display:block;height:100%;border-radius:999px}
.warn{background:#fff8eb;border:1px solid var(--orange-line);border-radius:12px;padding:12px 14px;font-size:14px;color:#6b3a07}
.info{background:var(--blue-bg);border:1px solid var(--blue-line);border-radius:12px;padding:12px 14px;font-size:14px;color:#173f8c}

/* WFH */
.wfh-hero{background:linear-gradient(135deg,var(--navy) 0%,#203a72 100%);color:#fff;border-radius:18px;padding:26px;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:24px;align-items:center}
.wfh-hero h2{font-size:clamp(24px,3vw,32px);margin-bottom:8px}
.wfh-hero p{color:#c9d3ea;margin:0 0 6px}
.wfh-hero .cta{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.prog{background:rgba(255,255,255,.12);border-radius:14px;padding:16px;width:100%}
.prog .bar{background:rgba(255,255,255,.2)} .prog .bar>i{background:#34d399}
.timeline{position:relative;margin-left:8px;padding-left:26px;border-left:2px solid var(--line)}
.tl{position:relative;margin-bottom:14px}
.tl::before{content:"";position:absolute;left:-34px;top:16px;width:14px;height:14px;border-radius:50%;background:#fff;border:3px solid var(--blue)}
.tl.done::before{background:#16a34a;border-color:#16a34a}
.tl .card{padding:14px 16px}
.tl-h{display:flex;justify-content:space-between;gap:10px;align-items:baseline;flex-wrap:wrap;margin-bottom:6px}
.tl-h .time{font-weight:800;color:var(--blue);white-space:nowrap}
.task{display:flex;gap:10px;align-items:center;padding:5px 0;font-size:14px;cursor:pointer}
.task.done span{text-decoration:line-through;color:var(--muted)}
.perf input,.perf textarea{width:100%;font:inherit;font-size:16px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff}
.perf textarea{min-height:90px;resize:vertical}

/* Commitment */
.commit-hero{background:#fff;border-radius:18px;border:1px solid var(--line);box-shadow:var(--shadow);padding:28px}
.commit-hero h2{font-size:clamp(24px,3vw,34px)}
.statement{background:var(--navy);color:#fff;border-radius:18px;padding:26px 28px;font-size:17px;line-height:1.65}
.statement p{margin:0 0 12px;max-width:80ch}
.statement p:last-child{margin:0}
.sign{margin-top:18px;color:#b9c4dc;font-size:14px}
.ticks{list-style:none;margin:0;padding:0}
.ticks li{padding:6px 0 6px 26px;position:relative}
.ticks li::before{content:"";position:absolute;left:4px;top:13px;width:10px;height:10px;border-radius:3px;background:var(--blue)}
.ticks.g li::before{background:var(--green)} .ticks.o li::before{background:#f08a2a} .ticks.p li::before{background:var(--purple)} .ticks.a li::before{background:#f59e0b}

/* Drawer */
.overlay{position:fixed;inset:0;background:rgba(10,20,40,.45);z-index:50;display:flex;justify-content:flex-end}
.overlay[hidden]{display:none}
.drawer{background:var(--bg);width:min(560px,100%);height:100%;overflow-y:auto;padding:24px;position:relative;box-shadow:-8px 0 30px rgba(0,0,0,.2);animation:slide .2s ease-out}
@keyframes slide{from{transform:translateX(30px);opacity:.6}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.drawer{animation:none}}
.close{position:absolute;right:14px;top:12px;width:44px;height:44px;border-radius:50%;border:0;background:#fff;font-size:26px;cursor:pointer;box-shadow:var(--shadow)}
.dl{display:grid;grid-template-columns:150px minmax(0,1fr);gap:8px 12px;font-size:14px;margin:0}
.dl dt{color:var(--muted);font-weight:600}
.dl dd{margin:0}
select,.field{font:inherit;font-size:16px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;min-height:42px;width:100%}
.switch{display:flex;gap:10px;align-items:center;cursor:pointer;font-weight:500}
.switch input{width:20px;height:20px;accent-color:var(--navy)}
.row-end{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.confirm{position:fixed;inset:0;background:rgba(10,20,40,.45);z-index:60;display:grid;place-items:center;padding:16px}
.confirm[hidden]{display:none}
.confirm-box{background:#fff;border-radius:14px;padding:20px;max-width:380px;box-shadow:var(--shadow)}

.foot{max-width:1280px;margin:0 auto;padding:10px 20px 40px;color:var(--muted);font-size:13px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}

/* Responsive */
@media (max-width:1100px){
  .g4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .board{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:860px){
  .g3,.g2{grid-template-columns:minmax(0,1fr)}
  .wfh-hero{grid-template-columns:minmax(0,1fr)}
  .day{min-height:84px}
  .day .ev{display:none}
  .day .dots{display:flex}
}
.dots{display:none;gap:3px;flex-wrap:wrap;margin-top:auto}
.dots i{width:8px;height:8px;border-radius:50%}
@media (max-width:600px){
  main{padding:16px 12px 30px}
  .top{position:static}
  .top-in{padding:12px 14px 6px}
  .chip-dark{display:none}
  .top h1{font-size:14px}
  .g4,.board{grid-template-columns:minmax(0,1fr)}
  .cal{gap:4px}
  .day{min-height:58px;padding:5px;border-radius:8px}
  .day .dn small{display:none}
  .cal .dow{font-size:11px}
  .agenda-day{grid-template-columns:minmax(0,1fr);gap:8px}
  .agenda-date{display:flex;gap:10px;align-items:baseline}
  .dl{grid-template-columns:minmax(0,1fr)}
  .dl dt{margin-top:6px}
  .act{flex-wrap:wrap}
  .act .t{min-width:0}
  .drawer{padding:18px 14px}
  .statement{font-size:16px;padding:20px}
  .stack thead{display:none}
  .stack tr{display:grid;padding:8px 0;border-bottom:1px solid var(--line)}
  .stack td{border:0;padding:3px 0;text-align:left}
  .stack td.num{text-align:left}
  .stack td::before{content:attr(data-l);display:block;font-size:11px;font-weight:700;color:var(--muted)}
}
@media print{
  .top{position:static}.tabs,.foot,.btn-dark{display:none}
  .view{display:block!important;break-before:page}
  body{background:#fff}
}
