/* CoolTrack visual system: inspired by the clarity of SmartDCTracking, not a copy. */
@font-face{font-family:'IBM Plex Sans Thai';src:url('assets/fonts/IBMPlexSansThai-400.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:'IBM Plex Sans Thai';src:url('assets/fonts/IBMPlexSansThai-500.ttf') format('truetype');font-style:normal;font-weight:500;font-display:swap}
@font-face{font-family:'IBM Plex Sans Thai';src:url('assets/fonts/IBMPlexSansThai-600.ttf') format('truetype');font-style:normal;font-weight:600;font-display:swap}
@font-face{font-family:'IBM Plex Sans Thai';src:url('assets/fonts/IBMPlexSansThai-700.ttf') format('truetype');font-style:normal;font-weight:700;font-display:swap}

:root{
  --navy:#101f39;--navy2:#213a5d;--blue:#2563eb;--ink:#15233c;
  --muted:#62748c;--line:#e2e9f2;--bg:#f4f7fb;--green:#0c9872;
  --amber:#d58a16;--red:#df5261;--violet:#7959ca;
  --surface:#fff;--shadow-card:0 8px 30px rgba(20,43,81,.055);
}
html{scroll-behavior:smooth}
body{font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:15px;line-height:1.58;letter-spacing:0;background:var(--bg);color:var(--ink);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font-family:'IBM Plex Sans Thai',Tahoma,sans-serif!important}
button,a,[role="button"]{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,[role="button"]:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(37,99,235,.27);outline-offset:2px}
main{min-width:0}

/* App frame and navigation */
.shell{grid-template-columns:258px minmax(0,1fr)}
.sidebar{background:linear-gradient(180deg,#132443 0%,#0e1d36 100%);padding:24px 15px 18px;border-right:1px solid rgba(255,255,255,.07)}
.brand{gap:12px;padding:0 10px 27px;font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:23px;letter-spacing:-.04em}
.brand-mark{width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#59a7ff,#2563eb 62%,#1746b5);box-shadow:0 8px 19px rgba(29,89,205,.3)}
.workspace{margin:0 2px 22px;padding:13px 12px;border-color:#3b5574;border-radius:14px;background:rgba(255,255,255,.065)}
.workspace b{font-size:12px}.workspace small,.brand small{font-size:10px;letter-spacing:.06em}
.menu{gap:3px}.menu-label{padding:16px 12px 7px;color:#809bb8;font-size:10px;letter-spacing:.11em}
.menu button{min-height:44px;height:auto;padding:9px 12px;border-radius:10px;color:#bccce0;font-size:13px;font-weight:500;line-height:1.3}
.menu button i{width:19px;color:#94add0;font-size:16px}.menu button:hover{background:rgba(255,255,255,.09)}
.menu button.active{background:#254976;color:#fff;box-shadow:inset 3px 0 #79b5ff,0 4px 16px #08193133}
.menu button.active i{color:#a8d2ff}.counter{background:#315b8a;color:#fff;font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:11px}
.switch-role{border-radius:12px;background:#1d3658;border-color:#395475}.hint{color:#9bb1ca;font-size:11px}
.topbar{height:76px;padding:0 clamp(20px,3vw,44px);background:rgba(255,255,255,.95);border-bottom-color:var(--line);box-shadow:0 3px 15px rgba(27,55,91,.025)}
.search{width:min(390px,42vw);height:43px;padding:0 13px;border-color:#dfe7f0;border-radius:11px;background:#f7f9fc;color:#647a96}
.search:focus-within{border-color:#8bb8f5;background:#fff;box-shadow:0 0 0 3px #2563eb14}.search input{font-size:13px;color:var(--ink)}
.bell{display:grid;place-items:center;width:41px;height:41px;border:1px solid var(--line);border-radius:11px;background:#fff;font-size:18px;cursor:pointer}
.avatar{width:37px;height:37px;font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:12px}.account b{font-size:13px}.account small{font-size:11px}

/* Layout and hierarchy */
.content{max-width:1580px;padding:32px clamp(22px,3vw,46px) 60px}
.hero,.page-head{margin-bottom:24px;gap:18px}.eyebrow{margin-bottom:9px;color:#577392;font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
h1,.hero h1,.page-head h1{font-size:clamp(25px,2.4vw,34px);line-height:1.24;font-weight:700;letter-spacing:-.035em;color:#142744}
.sub{margin-top:8px;color:var(--muted);font-size:13px;line-height:1.6}
.section-head{margin-top:28px}.section-head h2,.panel h2{font-size:17px;letter-spacing:-.015em;color:#183052}
.panel,.stat,.station-card,.asset-card,.mini,.ma-plan-card,.location-site-group,.checklist-template-card{border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-card)}
.panel header{padding:19px 22px 16px}.panel header p,.section-head p{font-size:12px}
.stats,.mini-grid,.cards-grid,.station-grid{gap:16px}.grid,.task-grid{gap:16px;margin-top:16px}.wide{margin-top:16px}
.stat{min-height:142px;padding:19px 20px;gap:14px;overflow:hidden}
.stat:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#79a9ef;opacity:.78}
.stat:nth-child(2):before{background:#e8ae47}.stat:nth-child(3):before{background:#f27982}.stat:nth-child(4):before{background:#2abb94}
.stat .icon,.report-kpis article>span{width:41px;height:41px;border-radius:12px;font-size:19px}
.stat small,.mini small{color:#62758f;font-size:11px;letter-spacing:.02em}.stat strong,.mini b,.report-kpis b{font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:31px;line-height:1.15;font-weight:700;font-variant-numeric:tabular-nums;color:#142743}
.stat p{margin-top:5px;font-size:11px}.stat a{font-size:11px}
.performance .chart{height:208px;padding-top:9px}.performance .bars{height:166px}.performance .bar{width:34px}.performance .bar i{border-radius:7px 7px 0 0;background:#b9d3fb}.performance .bar.current i{background:linear-gradient(180deg,#54a3fa,#2563eb)}
.performance footer{padding:10px 22px 18px;font-size:11px}
.attention-item{padding:15px 20px}.attention-item b{font-size:13px}.attention-item p{font-size:11px}
.station-card,.asset-card,.ma-plan-card{padding:19px}.station-title b{font-size:14px}.station-title small,.station-metrics{font-size:11px}
.asset-card h3{font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:18px;letter-spacing:-.02em}.asset-card p{font-size:12px}
.detail{border-color:#e3ebf4;border-radius:11px;background:#fcfdff}.detail small{font-size:11px}.detail b{font-size:13px}
.empty{padding:48px 22px;color:#74859a;font-size:13px}

/* Controls, forms and tables */
.btn,.text-btn{min-height:43px;border-radius:10px;font-size:13px;font-weight:600;letter-spacing:0}
.btn.primary,.primary{background:linear-gradient(135deg,#317af0,#225edb);border-color:#2563eb;box-shadow:0 7px 17px #2563eb22}
.btn.primary:hover,.primary:hover{background:linear-gradient(135deg,#438df7,#1d55c9)}
.btn.secondary,.secondary{background:#fff;border-color:#d7e2ef;color:#335777}
.btn.secondary:hover,.secondary:hover{background:#f1f6fd;border-color:#a9c6ed}
.text-btn{background:#f3f8ff!important;border-color:#cee0f6!important;color:#1e5cbd!important}
.text-btn:hover{background:#2563eb!important;border-color:#2563eb!important;color:#fff!important}
.filter-row{gap:10px}.filter-row input,.filter-row select,.select,.form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),.form select,.form textarea,.report-filters input,.report-filters select{min-height:42px;border:1px solid #d8e3ef;border-radius:10px;background:#fff;color:#1d3552;font-size:13px;box-shadow:none}
.form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,.form select:focus,.form textarea:focus,.filter-row input:focus,.filter-row select:focus,.report-filters input:focus,.report-filters select:focus{outline:none;border-color:#5798f0;box-shadow:0 0 0 3px #2563eb17}
.form label{font-size:12px;color:#445d79}.form textarea{min-height:92px}.form .two{gap:12px}
.modal{border:1px solid #e0e9f2;border-radius:18px;box-shadow:0 24px 70px #0f244b3d}.modal header{padding:20px 23px}.modal h2{font-size:18px}.form{padding:22px;gap:14px}.form-actions{padding:0 22px 22px}
.table-wrap{border:1px solid var(--line);border-radius:12px;overflow-x:auto;background:#fff}
table{border-collapse:separate;border-spacing:0}th{padding:13px 16px;background:#f7f9fd;border-top:0;border-bottom:1px solid #dfe7f1;color:#58708a;font-size:10px;font-weight:700;letter-spacing:.05em}
td{padding:15px 16px;color:#455d79;font-size:12px}td b{color:#162e4e}td small{font-size:11px}
tbody tr:hover td{background:#f7faff}.badge{border-radius:7px;font-size:10px;font-weight:600}
.friendly-note{background:#eef6ff;border-color:#c9def7;color:#295680;border-radius:13px}

/* Reports: stronger numerical hierarchy and calmer data density. */
.report-filters{padding:18px 20px;margin-bottom:17px}.report-filters label{color:#526982;font-size:12px}
.report-filters input,.report-filters select{min-height:44px;margin-top:7px;font-size:13px}
.report-kpis{gap:14px;margin-bottom:17px}.report-kpis article{grid-template-columns:44px 1fr;gap:5px 12px;min-height:116px;padding:19px;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-card)}
.report-kpis article>span{grid-row:1/3;background:#eaf2ff;color:#2563eb}.report-kpis article:nth-child(2)>span{background:#fff5e8;color:#c27a0e}.report-kpis article:nth-child(3)>span{background:#e8f8f1;color:#0b946b}.report-kpis article:nth-child(5)>span{background:#fff0f1;color:#dc5361}
.report-kpis small{align-self:end;font-size:11px;color:#6a7c91}.report-kpis b{font-size:29px}
.report-chart{padding-bottom:22px}.report-bars{gap:15px;padding:4px 22px}.report-bars>div{font-size:13px}.report-bars i{height:12px;background:#edf2f8}.report-bars i b{background:linear-gradient(90deg,#73b5fc,#2563eb)}.report-bars strong{font-family:'IBM Plex Sans Thai',Tahoma,sans-serif;font-size:16px}
.report-table{min-width:800px}

/* Location cards and checklist builder retain their interactions. */
.location-card{border-radius:16px;box-shadow:var(--shadow-card)}.location-card h3{font-size:18px}.location-card p{font-size:12px}.location-site-group>header{background:#f9fbfe}
.checklist-item-editor{border-radius:13px;background:#fcfdff}.checklist-template-card{overflow:hidden}
.asset-pager button,.pager-numbers button{border-radius:10px!important;font-family:'IBM Plex Sans Thai',Tahoma,sans-serif!important;font-size:13px!important}

/* Trial login uses the same design language. */
.login-page{background:radial-gradient(circle at 5% 0%,#e5efff 0,transparent 36%),#f4f7fb}
.login-shell{border-radius:22px;border:1px solid #dfe8f3;box-shadow:0 24px 80px #13376620}
.login-brand{background:linear-gradient(150deg,#183967,#10213d 70%)}.login-card h2{color:#142743}
.login-brand h1{color:#fff}
.login-card input{border-radius:10px;border-color:#d9e4f0;font-size:15px}
.login-card .btn{min-height:48px}

@media(max-width:1100px){.shell{grid-template-columns:226px minmax(0,1fr)}.sidebar{padding-inline:10px}.content{padding-inline:24px}.report-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
  body{font-size:14px;padding-bottom:calc(79px + env(safe-area-inset-bottom))}.shell{display:block}
  #topbar.topbar{height:62px;min-height:62px;padding:0 15px;box-shadow:0 3px 14px #162b4a0b}
  .content{padding:22px 15px 32px}.hero,.page-head{margin-bottom:19px;gap:13px}
  .hero h1,.page-head h1{font-size:26px}.sub{font-size:12px}.eyebrow{font-size:10px}
  .actions{gap:8px}.actions .btn{min-height:45px;white-space:normal;font-size:12px}
  .stats,.mini-grid,.cards-grid,.station-grid,.ma-plan-grid,.report-kpis{grid-template-columns:1fr 1fr;gap:10px}
  .stat{min-height:132px;padding:14px 12px 49px;gap:9px}.stat .icon{width:32px;height:32px;font-size:15px}.stat strong{font-size:26px}.stat small{font-size:10px;line-height:1.35}.stat p{font-size:10px}.stat a{bottom:9px;left:11px;right:11px;min-height:34px;font-size:10px}
  .panel,.station-card,.asset-card,.ma-plan-card{border-radius:14px}.panel header{padding:16px}.panel h2{font-size:16px}.panel header p{font-size:11px}
  .grid,.task-grid{gap:11px;margin-top:11px}.wide{margin-top:11px}.station-card,.asset-card,.ma-plan-card{padding:15px}
  .mobile-nav{height:calc(70px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);border-top-color:#dce7f3;box-shadow:0 -9px 24px #152d4a14}
  .mobile-nav button{font-family:'IBM Plex Sans Thai',sans-serif;font-size:10px}.mobile-nav button.active{background:#eaf2ff;color:#1f59c9}
  .mobile-drawer-panel{background:#f9fbff}.mobile-drawer button{font-family:'IBM Plex Sans Thai',sans-serif;font-size:14px}
  .mobile-menu-btn,.mobile-back-btn{font-family:'IBM Plex Sans Thai',sans-serif}
  .filter-row{grid-template-columns:1fr 1fr}.filter-row input{grid-column:1/-1}
  .report-filters{padding:14px}.report-kpis article{min-height:102px;grid-template-columns:32px 1fr;padding:12px;gap:3px 8px}.report-kpis article>span{width:31px;height:31px;border-radius:9px;font-size:16px}.report-kpis small{font-size:10px}.report-kpis b{font-size:24px}.report-kpis article:last-child{grid-column:auto}
  .report-bars{padding:3px 16px}.report-bars>div{font-size:12px}.table-wrap{border-radius:10px}.modal{border-radius:18px 18px 0 0}.form{padding:16px}.form-actions{padding:0 16px 16px}
  .location-card h3{font-size:17px}.location-card p{font-size:11px}
  .login-page{padding:0}.login-shell{border:0;border-radius:0;box-shadow:none}.login-card{padding:27px 22px}
}
@media(max-width:480px){.stats,.mini-grid,.cards-grid,.station-grid,.ma-plan-grid{grid-template-columns:1fr}.stat{min-height:112px;grid-template-columns:40px 1fr;padding:14px 14px 48px}.stat a{min-height:36px}.report-kpis{grid-template-columns:1fr 1fr}.report-kpis article:last-child{grid-column:1/-1}.report-page .actions{grid-template-columns:1fr}.report-page .actions .btn{grid-column:1/-1}.content{padding-inline:12px}}
@media print{body{background:#fff}.sidebar,.topbar,.mobile-nav,.mobile-drawer,.trial-banner,.report-page .page-head .actions,.report-filters{display:none!important}.report-page .panel,.report-kpis article{box-shadow:none!important}.report-page .report-kpis{grid-template-columns:repeat(5,1fr)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.local-loading .shell,.local-loading .login-shell{visibility:hidden}
.local-sync-error{position:fixed;z-index:10000;bottom:18px;left:50%;transform:translateX(-50%);max-width:min(92vw,680px);padding:13px 18px;border-radius:12px;background:#9f1f2b;color:#fff;box-shadow:0 12px 34px #132c4a33;font:600 13px 'IBM Plex Sans Thai',sans-serif;text-align:center}
