*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
body{font-family:'DM Sans',sans-serif;background:#f5f4f0;color:#1a1a1a}

/* ── SHARED ── */
.pill{font-size:10px;padding:2px 8px;border-radius:20px;white-space:nowrap;display:inline-block}
.pill-green{background:#EAF3DE;color:#27500A}
.pill-blue{background:#E6F1FB;color:#0C447C}
.pill-amber{background:#FAEEDA;color:#633806}
.pill-red{background:#FCEBEB;color:#791F1F}
.pill-gray{background:#F1EFE8;color:#444}
.pill-orange{background:#FFF4EC;color:#7A3800}
.pill-purple{background:#F3EFFE;color:#4A2D8A}

.toast{position:fixed;bottom:80px;left:50%;transform:translateX(-50%);background:#222;color:#fff;padding:10px 20px;border-radius:10px;font-size:13px;opacity:0;transition:opacity 0.3s;pointer-events:none;z-index:9999;white-space:nowrap}
.toast.show{opacity:1}
.spinner{display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,0.3);border-top-color:#fff;border-radius:50%;animation:spin 0.6s linear infinite;vertical-align:middle;margin-right:6px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── MOBILE LAYOUT ── */
@media (max-width:767px){
  body{padding-bottom:70px;max-width:480px;margin:0 auto}
  .dt-layout{display:none}

  .topbar{background:#fff;border-bottom:0.5px solid #e8e5de;padding:12px 16px 9px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}
  .logo-row{display:flex;align-items:center;gap:8px}
  .logo-box{width:30px;height:30px;background:#111;border-radius:8px;overflow:hidden;flex-shrink:0}
  .logo-box img{width:30px;height:30px;object-fit:contain}
  .brand-name{font-size:15px;font-weight:500}
  .brand-sub{font-size:10px;color:#999}
  .avatar{width:32px;height:32px;border-radius:50%;background:#E6F1FB;color:#0C447C;font-size:12px;font-weight:500;display:flex;align-items:center;justify-content:center}

  .page-header{background:#fff;border-bottom:0.5px solid #e8e5de;padding:11px 16px;display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:100}
  .back-btn{width:28px;height:28px;background:#f5f4f0;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;border:none}
  .page-title{font-size:16px;font-weight:500;flex:1}
  .page-action{font-size:13px;color:#E87722;font-weight:500;cursor:pointer}

  .bottom-nav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:0.5px solid #e8e5de;display:flex;max-width:480px;margin:0 auto;z-index:200}
  .nav-item{flex:1;display:flex;flex-direction:column;align-items:center;padding:9px 2px 12px;gap:3px;cursor:pointer;color:#ccc}
  .nav-item.active{color:#E87722}
  .nav-item span{font-size:9px}

  .card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;overflow:hidden;margin-bottom:8px}
  .sec-lbl{font-size:9px;font-weight:500;color:#999;text-transform:uppercase;letter-spacing:0.5px;margin:12px 0 7px}
  .sec-lbl:first-child{margin-top:0}
  .fab{position:fixed;bottom:78px;right:16px;width:50px;height:50px;background:#E87722;color:#fff;border:none;border-radius:50%;font-size:24px;cursor:pointer;z-index:150}

  /* Site tiles */
  .sites-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
  .site-tile{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px;cursor:pointer;display:flex;flex-direction:column;gap:8px}
  .st-top{display:flex;align-items:center;gap:8px}
  .st-letter{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;flex-shrink:0}
  .st-name{font-size:13px;font-weight:500}
  .st-bottom{display:flex;gap:14px}
  .st-val{font-size:17px;font-weight:500}
  .st-lbl{font-size:8px;color:#999;text-transform:uppercase;margin-top:1px}

  /* Issue cards */
  .issue-card{background:#fff;border:0.5px solid #e8e5de;border-radius:11px;padding:10px 12px;margin-bottom:7px;border-left:3px solid #ddd}
  .ic-critical{border-left-color:#E24B4A}.ic-high{border-left-color:#EF9F27}.ic-medium{border-left-color:#378ADD}
  .issue-title{font-size:13px;font-weight:500;margin-bottom:4px}
  .issue-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
  .issue-site{font-size:11px;color:#E87722}

  /* Forms */
  .form-body{padding:12px 16px 80px}
  .form-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:14px;margin-bottom:8px}
  .field{margin-bottom:10px}
  .field:last-child{margin-bottom:0}
  .field label{display:block;font-size:11px;color:#777;font-weight:500;margin-bottom:4px}
  .field input,.field select,.field textarea{width:100%;padding:10px 12px;border:0.5px solid #e0ddd6;border-radius:9px;font-size:14px;font-family:'DM Sans',sans-serif;color:#1a1a1a;background:#fafaf8;outline:none;-webkit-appearance:none}
  .field input:focus,.field select:focus,.field textarea:focus{border-color:#E87722;background:#fff}
  .field textarea{resize:none;min-height:70px;line-height:1.6}
  .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .submit-btn{width:100%;padding:14px;background:#E87722;color:#fff;border:none;border-radius:12px;font-size:15px;font-family:'DM Sans',sans-serif;font-weight:500;cursor:pointer;margin-top:12px}
  .submit-btn:active{opacity:0.88}
  .submit-btn:disabled{opacity:0.5}

  /* Contractor card */
  .ctr-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;margin-bottom:10px;overflow:hidden}
  .ctr-head{padding:10px 14px;border-bottom:0.5px solid #f0ede6;display:flex;align-items:center;gap:9px}
  .ctr-num{width:22px;height:22px;border-radius:50%;background:#E87722;color:#fff;font-size:11px;font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0}
  .ctr-select{flex:1;border:none;background:none;font-size:14px;font-weight:500;font-family:'DM Sans',sans-serif;outline:none;-webkit-appearance:none}
  .ctr-remove{font-size:20px;color:#ddd;cursor:pointer;background:none;border:none}
  .mp-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 14px;border-top:0.5px solid #f0ede6}
  .mp-field label{display:block;font-size:10px;color:#888;font-weight:500;text-transform:uppercase;margin-bottom:4px}
  .mp-field input{width:100%;padding:8px;border:0.5px solid #e0ddd6;border-radius:8px;font-size:16px;font-weight:500;text-align:center;font-family:'DM Sans',sans-serif;background:#fafaf8;outline:none}
  .mp-field input:focus{border-color:#E87722;background:#fff}
  .ctr-act{padding:12px 14px;border-top:0.5px solid #f0ede6;background:#fafaf8}
  .act-input{width:100%;padding:9px 11px;border:0.5px solid #e0ddd6;border-radius:9px;font-size:13px;font-family:'DM Sans',sans-serif;background:#fff;outline:none;margin-bottom:9px;display:block}
  .act-input:focus{border-color:#E87722}
  .stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
  .sbtn{padding:7px 2px;border-radius:8px;font-size:10px;border:0.5px solid #e0ddd6;background:#fff;color:#777;cursor:pointer;font-family:'DM Sans',sans-serif;text-align:center}
  .sbtn.s-blue{background:#E6F1FB;border-color:#85B7EB;color:#0C447C}
  .sbtn.s-green{background:#EAF3DE;border-color:#97C459;color:#27500A}
  .sbtn.s-amber{background:#FAEEDA;border-color:#FAC775;color:#633806}
  .sbtn.s-red{background:#FCEBEB;border-color:#F09595;color:#791F1F}
  .ctr-foot{padding:8px 14px;background:#FFF4EC;display:flex;justify-content:space-between;font-size:11px;color:#7A3800;font-weight:500;border-top:0.5px solid #f5dfc0}
  .add-ctr-btn{width:100%;padding:11px;background:none;border:0.5px dashed #E87722;border-radius:10px;color:#E87722;font-size:13px;font-family:'DM Sans',sans-serif;cursor:pointer;font-weight:500;margin-bottom:10px}
  .total-strip{background:#E87722;border-radius:10px;padding:10px 14px;display:flex;justify-content:space-between;font-size:13px;color:#fff;font-weight:500;margin-bottom:4px}
  .mat-header{display:grid;grid-template-columns:2.5fr 1fr 1fr;gap:4px;padding:7px 12px;background:#f4f3ef}
  .mat-header span{font-size:9px;color:#888;font-weight:500;text-transform:uppercase}
  .mat-row-input{display:grid;grid-template-columns:2.5fr 1fr 1fr;gap:6px;padding:7px 12px;border-top:0.5px solid #f0ede6}
  .mat-row-input input{width:100%;padding:6px 8px;border:0.5px solid #e0ddd6;border-radius:7px;font-size:12px;font-family:'DM Sans',sans-serif;background:#fafaf8;outline:none}
  .add-mat-btn{width:100%;padding:8px;background:none;border:none;color:#aaa;font-size:12px;font-family:'DM Sans',sans-serif;cursor:pointer;border-top:0.5px solid #f0ede6}

  /* Visit cards */
  .visit-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:13px 14px;margin-bottom:9px}
  .vc-name{font-size:14px;font-weight:500;margin-bottom:2px}
  .vc-contact{font-size:12px;color:#E87722;margin-bottom:8px}
  .vc-tags{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:7px}
  .vtag{font-size:10px;padding:2px 8px;border-radius:20px;background:#f4f3ef;color:#555}
  .vc-remark{font-size:12px;color:#555;line-height:1.5;margin-bottom:5px}
  .vc-footer{font-size:10px;color:#bbb}

  /* Calendar */
  .cal-wrap{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px;margin-bottom:10px}
  .cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
  .cal-hd{text-align:center;font-size:9px;color:#999;font-weight:500;padding:3px 0;margin-bottom:2px}
  .cal-day{text-align:center;font-size:12px;color:#555;padding:6px 2px;border-radius:7px;cursor:pointer;position:relative}
  .cal-day.today{background:#E87722;color:#fff;font-weight:500}
  .cal-day.other-month{color:#ddd}
  .cal-day.has-event::after{content:'';width:4px;height:4px;background:#E87722;border-radius:50%;position:absolute;bottom:1px;left:50%;transform:translateX(-50%)}
  .cal-day.today.has-event::after{background:#fff}

  /* Chat */
  .chat-wrap{display:flex;flex-direction:column;height:calc(100vh - 116px)}
  .chat-body{flex:1;overflow-y:auto;padding:12px 16px;display:flex;flex-direction:column;gap:10px}
  .msg{max-width:82%}
  .msg.mine{align-self:flex-end}
  .msg.theirs{align-self:flex-start}
  .msg-sender{font-size:10px;color:#888;margin-bottom:3px}
  .msg-bubble{padding:9px 12px;border-radius:12px;font-size:13px;line-height:1.5}
  .mine .msg-bubble{background:#E87722;color:#fff;border-radius:12px 12px 3px 12px}
  .theirs .msg-bubble{background:#fff;color:#1a1a1a;border:0.5px solid #e8e5de;border-radius:12px 12px 12px 3px}
  .msg-time{font-size:9px;color:#aaa;margin-top:3px}
  .mine .msg-time{text-align:right}
  .chat-input-bar{background:#fff;border-top:0.5px solid #e8e5de;padding:9px 14px;display:flex;gap:8px;align-items:center;flex-shrink:0}
  .chat-input{flex:1;padding:9px 13px;border:0.5px solid #e0ddd6;border-radius:20px;font-size:13px;font-family:'DM Sans',sans-serif;outline:none;background:#fafaf8}
  .chat-send{width:36px;height:36px;background:#E87722;border:none;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}

  /* More */
  .more-item{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:14px;margin-bottom:8px;display:flex;align-items:center;gap:12px;cursor:pointer}
  .more-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
  .more-info{flex:1}
  .more-title{font-size:14px;font-weight:500}
  .more-sub{font-size:11px;color:#888;margin-top:2px}
  .ann-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px 14px;margin-bottom:8px;border-left:3px solid #E87722}

  /* Checklist */
  .checklist-item-row{display:flex;align-items:center;gap:8px;padding:10px 14px;border-top:0.5px solid #f0ede6}
  .checklist-item-row input[type="checkbox"]{width:18px;height:18px;accent-color:#E87722;flex-shrink:0}

  .empty-state{padding:30px 0;text-align:center;color:#bbb;font-size:13px}
  .dpill{padding:5px 13px;border-radius:20px;font-size:11px;border:0.5px solid #e0ddd6;background:#fff;color:#666;cursor:pointer;font-family:'DM Sans',sans-serif}
  .dpill.active{background:#E87722;border-color:#E87722;color:#fff}
}

/* ── DESKTOP LAYOUT ── */
@media (min-width:768px){
  body{margin:0;padding:0;overflow:hidden;height:100vh}
  body.legacy-page{overflow-y:auto!important;height:auto!important;padding-bottom:0}
  .mob-layout{display:none!important}
  .bottom-nav{display:none!important}
  .toast{bottom:24px}

  .dt-layout{display:flex;height:100vh;overflow:hidden}

  /* Sidebar */
  .dt-sidebar{width:220px;background:#fff;border-right:0.5px solid #e8e5de;display:flex;flex-direction:column;flex-shrink:0;height:100vh}
  .dt-layout .dt-sidebar{position:relative;left:auto;top:auto}
  body > .dt-sidebar{position:fixed;left:0;top:0;z-index:100}
  .dt-sb-logo{padding:16px 16px 12px;border-bottom:0.5px solid #f0ede6;display:flex;align-items:center;gap:9px}
  .dt-sb-logo-box{width:30px;height:30px;background:#111;border-radius:8px;overflow:hidden;flex-shrink:0}
  .dt-sb-logo-box img{width:30px;height:30px;object-fit:contain}
  .dt-sb-brand{font-size:13px;font-weight:500}
  .dt-sb-sub{font-size:10px;color:#999}
  .dt-sb-nav{flex:1;padding:10px 8px;overflow-y:auto}
  .dt-sb-section{font-size:9px;font-weight:500;color:#bbb;text-transform:uppercase;letter-spacing:0.5px;padding:10px 8px 5px}
  .dt-sb-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:8px;cursor:pointer;color:#666;font-size:13px;margin-bottom:1px;text-decoration:none;transition:background 0.1s}
  .dt-sb-item:hover{background:#f5f4f0;color:#1a1a1a}
  .dt-sb-item.active{background:#FFF4EC;color:#E87722}
  .dt-sb-item svg{flex-shrink:0;opacity:0.7}
  .dt-sb-item.active svg{opacity:1}
  .dt-sb-footer{padding:12px;border-top:0.5px solid #f0ede6}
  .dt-sb-user{display:flex;align-items:center;gap:8px}
  .dt-sb-av{width:30px;height:30px;border-radius:50%;background:#E6F1FB;color:#0C447C;font-size:11px;font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0}
  .dt-sb-name{font-size:12px;font-weight:500}
  .dt-sb-role{font-size:10px;color:#888}

  /* Main area */
  .dt-main{flex:1;display:flex;flex-direction:column;overflow:hidden;background:#f5f4f0}
  .dt-topbar{background:#fff;border-bottom:0.5px solid #e8e5de;padding:13px 24px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
  .dt-page-title{font-size:17px;font-weight:500}
  .dt-topbar-right{display:flex;align-items:center;gap:12px}
  .dt-content{flex:1;overflow-y:auto;padding:24px}
  .dt-content-fill{flex:1;overflow:hidden;display:flex;flex-direction:column}

  /* Stat cards */
  .dt-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}
  .dt-stat{background:#fff;border-radius:10px;border:0.5px solid #e8e5de;padding:16px}
  .dt-stat-lbl{font-size:11px;color:#888;margin-bottom:6px}
  .dt-stat-val{font-size:28px;font-weight:500;line-height:1}
  .dt-stat-sub{font-size:11px;color:#E87722;margin-top:4px}

  /* Panels */
  .dt-panel{background:#fff;border-radius:10px;border:0.5px solid #e8e5de;overflow:hidden;margin-bottom:16px}
  .dt-panel-head{padding:12px 16px;border-bottom:0.5px solid #f0ede6;display:flex;align-items:center;justify-content:space-between}
  .dt-panel-title{font-size:13px;font-weight:500}
  .dt-panel-action{font-size:12px;color:#E87722;cursor:pointer;font-weight:500}

  /* Grids */
  .dt-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
  .dt-grid-3{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-bottom:16px}

  /* Site tiles in desktop */
  .dt-sites-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:12px}
  .dt-site-tile{border-radius:9px;padding:10px;cursor:pointer}

  /* Filter bar */
  .dt-filter-bar{display:flex;gap:8px;padding:12px 20px;border-bottom:0.5px solid #e8e5de;flex-wrap:wrap;align-items:center;background:#fff;flex-shrink:0}
  .dt-filter-bar input,.dt-filter-bar select{padding:7px 10px;border:0.5px solid #e0ddd6;border-radius:8px;font-size:13px;font-family:'DM Sans',sans-serif;background:#fafaf8;outline:none;-webkit-appearance:none;color:#1a1a1a}
  .dt-filter-bar input:focus,.dt-filter-bar select:focus{border-color:#E87722;background:#fff}

  /* Buttons */
  .dt-btn{padding:8px 16px;border-radius:8px;font-size:13px;font-family:'DM Sans',sans-serif;font-weight:500;cursor:pointer;border:none;white-space:nowrap}
  .dt-btn-primary{background:#E87722;color:#fff}
  .dt-btn-primary:active{opacity:0.88}
  .dt-btn-secondary{background:#fafaf8;color:#555;border:0.5px solid #e0ddd6}
  .dt-btn-export{background:#EAF3DE;color:#27500A;border:0.5px solid #97C459}

  /* Tables */
  .dt-table-wrap{overflow:auto;flex:1}
  .dt-table{width:100%;border-collapse:collapse;font-size:13px}
  .dt-table th{padding:10px 14px;text-align:left;font-size:10px;color:#888;font-weight:500;text-transform:uppercase;letter-spacing:0.4px;background:#fafaf8;border-bottom:0.5px solid #e8e5de;white-space:nowrap;position:sticky;top:0}
  .dt-table td{padding:11px 14px;border-bottom:0.5px solid #f5f4f0;vertical-align:middle}
  .dt-table tr:last-child td{border-bottom:none}
  .dt-table tr:hover td{background:#fafaf8;cursor:pointer}
  .td-bold{font-weight:500}
  .td-orange{color:#E87722}
  .td-muted{color:#888}

  /* Split view */
  .dt-split{display:grid;grid-template-columns:1fr 1fr;height:100%;overflow:hidden}
  .dt-split-left{border-right:0.5px solid #f0ede6;overflow-y:auto}
  .dt-split-right{overflow-y:auto;padding:20px;background:#fafaf8}

  /* Decision rows */
  .dt-dec-row{padding:12px 16px;border-bottom:0.5px solid #f0ede6;cursor:pointer;display:flex;align-items:flex-start;gap:10px}
  .dt-dec-row:hover{background:#fafaf8}
  .dt-dec-row.active{background:#FFF4EC;border-left:3px solid #E87722}
  .dt-dec-dot{width:8px;height:8px;border-radius:50%;background:#EF9F27;flex-shrink:0;margin-top:5px}
  .dt-dec-dot.resolved{background:#639922}

  /* Issue rows */
  .dt-issue-row{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:0.5px solid #f0ede6}
  .dt-issue-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
  .dt-ann-row{padding:10px 14px;border-top:0.5px solid #f0ede6}
  .dt-ann-title{font-size:13px;font-weight:500;margin-bottom:3px}
  .dt-ann-body{font-size:12px;color:#555;line-height:1.5}
  .dt-ann-meta{font-size:10px;color:#bbb;margin-top:3px}

  /* Forms in desktop */
  .dt-field{margin-bottom:14px}
  .dt-field label{display:block;font-size:12px;color:#666;font-weight:500;margin-bottom:5px}
  .dt-field input,.dt-field select,.dt-field textarea{width:100%;padding:9px 12px;border:0.5px solid #e0ddd6;border-radius:9px;font-size:14px;font-family:'DM Sans',sans-serif;color:#1a1a1a;background:#fafaf8;outline:none;-webkit-appearance:none}
  .dt-field input:focus,.dt-field select:focus,.dt-field textarea:focus{border-color:#E87722;background:#fff}
  .dt-field textarea{resize:vertical;min-height:80px;line-height:1.5}
  .dt-row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
  .dt-row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}

  .dt-tabs{display:flex;background:#fff;border-bottom:0.5px solid #e8e5de;flex-shrink:0}
  .dt-tab{padding:11px 20px;font-size:13px;font-weight:500;color:#aaa;cursor:pointer;border-bottom:2px solid transparent}
  .dt-tab.active{color:#E87722;border-bottom-color:#E87722}

  .empty-state{padding:40px 0;text-align:center;color:#bbb;font-size:13px}
  .dpill{padding:5px 13px;border-radius:20px;font-size:11px;border:0.5px solid #e0ddd6;background:#fff;color:#666;cursor:pointer;font-family:'DM Sans',sans-serif}
  .dpill.active{background:#E87722;border-color:#E87722;color:#fff}
}

/* ── LOADING SCREEN ── */
.loading-screen{position:fixed;inset:0;background:#f5f4f0;display:flex;align-items:center;justify-content:center;z-index:9999;flex-direction:column;gap:12px}
.loading-logo{width:64px;height:64px;background:#111;border-radius:16px;overflow:hidden}
.loading-logo img{width:64px;height:64px;object-fit:contain}


/* Legacy page desktop styles */

@media (min-width:768px){
  body.legacy-page .topbar{background:#fff;border-bottom:0.5px solid #e8e5de;padding:12px 16px 9px;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100}
  body.legacy-page .logo-row{display:flex;align-items:center;gap:8px}
  body.legacy-page .logo-box{width:30px;height:30px;background:#111;border-radius:8px;overflow:hidden;flex-shrink:0}
  body.legacy-page .brand-name{font-size:15px;font-weight:500}
  body.legacy-page .brand-sub{font-size:10px;color:#999}
  body.legacy-page .avatar{width:32px;height:32px;border-radius:50%;background:#E6F1FB;color:#0C447C;font-size:12px;font-weight:500;display:flex;align-items:center;justify-content:center}
  body.legacy-page .page-header{background:#fff;border-bottom:0.5px solid #e8e5de;padding:11px 16px;display:flex;align-items:center;gap:10px;position:sticky;top:0;z-index:100}
  body.legacy-page .back-btn{width:28px;height:28px;background:#f5f4f0;border-radius:8px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;border:none}
  body.legacy-page .page-title{font-size:16px;font-weight:500;flex:1}
  body.legacy-page .page-action{font-size:13px;color:#E87722;font-weight:500;cursor:pointer}
  body.legacy-page .nav-item.active{color:#E87722}
  body.legacy-page .card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;overflow:hidden;margin-bottom:8px}
  body.legacy-page .sec-lbl{font-size:9px;font-weight:500;color:#999;text-transform:uppercase;letter-spacing:0.5px;margin:12px 0 7px}
  body.legacy-page .sites-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
  body.legacy-page .site-tile{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px;cursor:pointer;display:flex;flex-direction:column;gap:8px}
  body.legacy-page .st-top{display:flex;align-items:center;gap:8px}
  body.legacy-page .st-letter{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;flex-shrink:0}
  body.legacy-page .st-name{font-size:13px;font-weight:500}
  body.legacy-page .st-bottom{display:flex;gap:14px}
  body.legacy-page .st-val{font-size:17px;font-weight:500}
  body.legacy-page .st-lbl{font-size:8px;color:#999;text-transform:uppercase;margin-top:1px}
  body.legacy-page .issue-card{background:#fff;border:0.5px solid #e8e5de;border-radius:11px;padding:10px 12px;margin-bottom:7px;border-left:3px solid #ddd}
  body.legacy-page .ic-critical{border-left-color:#E24B4A}
  body.legacy-page .ic-high{border-left-color:#EF9F27}
  body.legacy-page .ic-medium{border-left-color:#378ADD}
  body.legacy-page .issue-title{font-size:13px;font-weight:500;margin-bottom:4px}
  body.legacy-page .issue-meta{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
  body.legacy-page .issue-site{font-size:11px;color:#E87722}
  body.legacy-page .form-body{padding:12px 16px 80px}
  body.legacy-page .form-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:14px;margin-bottom:8px}
  body.legacy-page .field{margin-bottom:10px}
  body.legacy-page .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  body.legacy-page .submit-btn{width:100%;padding:14px;background:#E87722;color:#fff;border:none;border-radius:12px;font-size:15px;font-family:'DM Sans',sans-serif;font-weight:500;cursor:pointer;margin-top:12px}
  body.legacy-page .ctr-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;margin-bottom:10px;overflow:hidden}
  body.legacy-page .ctr-head{padding:10px 14px;border-bottom:0.5px solid #f0ede6;display:flex;align-items:center;gap:9px}
  body.legacy-page .ctr-num{width:22px;height:22px;border-radius:50%;background:#E87722;color:#fff;font-size:11px;font-weight:500;display:flex;align-items:center;justify-content:center;flex-shrink:0}
  body.legacy-page .ctr-select{flex:1;border:none;background:none;font-size:14px;font-weight:500;font-family:'DM Sans',sans-serif;outline:none;-webkit-appearance:none}
  body.legacy-page .ctr-remove{font-size:20px;color:#ddd;cursor:pointer;background:none;border:none}
  body.legacy-page .mp-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 14px;border-top:0.5px solid #f0ede6}
  body.legacy-page .ctr-act{padding:12px 14px;border-top:0.5px solid #f0ede6;background:#fafaf8}
  body.legacy-page .act-input{width:100%;padding:9px 11px;border:0.5px solid #e0ddd6;border-radius:9px;font-size:13px;font-family:'DM Sans',sans-serif;background:#fff;outline:none;margin-bottom:9px;display:block}
  body.legacy-page .stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
  body.legacy-page .sbtn{padding:7px 2px;border-radius:8px;font-size:10px;border:0.5px solid #e0ddd6;background:#fff;color:#777;cursor:pointer;font-family:'DM Sans',sans-serif;text-align:center}
  body.legacy-page .s-blue{background:#E6F1FB;border-color:#85B7EB;color:#0C447C}
  body.legacy-page .s-green{background:#EAF3DE;border-color:#97C459;color:#27500A}
  body.legacy-page .s-amber{background:#FAEEDA;border-color:#FAC775;color:#633806}
  body.legacy-page .s-red{background:#FCEBEB;border-color:#F09595;color:#791F1F}
  body.legacy-page .ctr-foot{padding:8px 14px;background:#FFF4EC;display:flex;justify-content:space-between;font-size:11px;color:#7A3800;font-weight:500;border-top:0.5px solid #f5dfc0}
  body.legacy-page .add-ctr-btn{width:100%;padding:11px;background:none;border:0.5px dashed #E87722;border-radius:10px;color:#E87722;font-size:13px;font-family:'DM Sans',sans-serif;cursor:pointer;font-weight:500;margin-bottom:10px}
  body.legacy-page .total-strip{background:#E87722;border-radius:10px;padding:10px 14px;display:flex;justify-content:space-between;font-size:13px;color:#fff;font-weight:500;margin-bottom:4px}
  body.legacy-page .mat-header{display:grid;grid-template-columns:2.5fr 1fr 1fr;gap:4px;padding:7px 12px;background:#f4f3ef}
  body.legacy-page .mat-row-input{display:grid;grid-template-columns:2.5fr 1fr 1fr;gap:6px;padding:7px 12px;border-top:0.5px solid #f0ede6}
  body.legacy-page .add-mat-btn{width:100%;padding:8px;background:none;border:none;color:#aaa;font-size:12px;font-family:'DM Sans',sans-serif;cursor:pointer;border-top:0.5px solid #f0ede6}
  body.legacy-page .visit-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:13px 14px;margin-bottom:9px}
  body.legacy-page .vc-name{font-size:14px;font-weight:500;margin-bottom:2px}
  body.legacy-page .vc-contact{font-size:12px;color:#E87722;margin-bottom:8px}
  body.legacy-page .vc-tags{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:7px}
  body.legacy-page .vtag{font-size:10px;padding:2px 8px;border-radius:20px;background:#f4f3ef;color:#555}
  body.legacy-page .vc-remark{font-size:12px;color:#555;line-height:1.5;margin-bottom:5px}
  body.legacy-page .vc-footer{font-size:10px;color:#bbb}
  body.legacy-page .cal-wrap{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px;margin-bottom:10px}
  body.legacy-page .cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
  body.legacy-page .cal-hd{text-align:center;font-size:9px;color:#999;font-weight:500;padding:3px 0;margin-bottom:2px}
  body.legacy-page .cal-day{text-align:center;font-size:12px;color:#555;padding:6px 2px;border-radius:7px;cursor:pointer;position:relative}
  body.legacy-page .today{background:#E87722;color:#fff;font-weight:500}
  body.legacy-page .other-month{color:#ddd}
  body.legacy-page .chat-wrap{display:flex;flex-direction:column;height:calc(100vh - 116px)}
  body.legacy-page .chat-body{flex:1;overflow-y:auto;padding:12px 16px;display:flex;flex-direction:column;gap:10px}
  body.legacy-page .msg{max-width:82%}
  body.legacy-page .mine{align-self:flex-end}
  body.legacy-page .theirs{align-self:flex-start}
  body.legacy-page .msg-sender{font-size:10px;color:#888;margin-bottom:3px}
  body.legacy-page .msg-bubble{padding:9px 12px;border-radius:12px;font-size:13px;line-height:1.5}
  body.legacy-page .msg-bubble{background:#E87722;color:#fff;border-radius:12px 12px 3px 12px}
  body.legacy-page .msg-bubble{background:#fff;color:#1a1a1a;border:0.5px solid #e8e5de;border-radius:12px 12px 12px 3px}
  body.legacy-page .msg-time{font-size:9px;color:#aaa;margin-top:3px}
  body.legacy-page .msg-time{text-align:right}
  body.legacy-page .chat-input-bar{background:#fff;border-top:0.5px solid #e8e5de;padding:9px 14px;display:flex;gap:8px;align-items:center;flex-shrink:0}
  body.legacy-page .chat-input{flex:1;padding:9px 13px;border:0.5px solid #e0ddd6;border-radius:20px;font-size:13px;font-family:'DM Sans',sans-serif;outline:none;background:#fafaf8}
  body.legacy-page .chat-send{width:36px;height:36px;background:#E87722;border:none;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}
  body.legacy-page .more-item{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:14px;margin-bottom:8px;display:flex;align-items:center;gap:12px;cursor:pointer}
  body.legacy-page .more-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
  body.legacy-page .more-info{flex:1}
  body.legacy-page .more-title{font-size:14px;font-weight:500}
  body.legacy-page .more-sub{font-size:11px;color:#888;margin-top:2px}
  body.legacy-page .ann-card{background:#fff;border:0.5px solid #e8e5de;border-radius:12px;padding:12px 14px;margin-bottom:8px;border-left:3px solid #E87722}
  body.legacy-page .checklist-item-row{display:flex;align-items:center;gap:8px;padding:10px 14px;border-top:0.5px solid #f0ede6}
  body.legacy-page .empty-state{padding:30px 0;text-align:center;color:#bbb;font-size:13px}
  body.legacy-page .dpill{padding:5px 13px;border-radius:20px;font-size:11px;border:0.5px solid #e0ddd6;background:#fff;color:#666;cursor:pointer;font-family:'DM Sans',sans-serif}
  body.legacy-page .dpill.active{background:#E87722;border-color:#E87722;color:#fff}
  body.legacy-page #app{overflow-y:auto;min-height:100vh}
}
  body.legacy-page .admin-tabs{display:flex;gap:4px;padding:10px 16px;background:#fff;border-bottom:0.5px solid #e8e5de;position:sticky;top:0;z-index:99}
  body.legacy-page .atab{padding:7px 16px;border-radius:8px;font-size:13px;cursor:pointer;color:#666;background:none;border:none;font-family:'DM Sans',sans-serif;font-weight:500}
  body.legacy-page .atab:hover{background:#f5f4f0}
  body.legacy-page .atab.active{background:#FFF4EC;color:#E87722}
  body.legacy-page .apane{display:none;padding:16px}
  body.legacy-page .apane.active{display:block}