*{box-sizing:border-box}body{margin:0;background:#f5f7fb;color:#17304d;font-family:Arial,sans-serif}header{height:74px;background:#fff;border-bottom:1px solid #e1e6ef;display:flex;align-items:center;padding:0 28px;gap:18px;position:sticky;top:0;z-index:5}.logo{font-size:25px;font-weight:800;color:#ed3030;font-style:italic}.title{font-size:21px;font-weight:700;color:#ef2f2f}.search{flex:1;max-width:500px;margin-left:20px}.search input,input,select{width:100%;padding:11px 13px;border:1px solid #cbd6e5;border-radius:8px;background:#fff;color:#17304d}button{border:0;border-radius:8px;padding:10px 15px;background:#1967e8;color:#fff;cursor:pointer;font-size:14px}button:hover{filter:brightness(.96)}button.ghost{background:#eef3fa;color:#17304d}aside{position:fixed;left:0;top:74px;bottom:0;width:220px;background:#fff;border-right:1px solid #e1e6ef;padding:25px 14px}aside button{display:block;width:100%;text-align:left;background:transparent;color:#42607d;margin:5px 0}aside button:hover{background:#edf4ff;color:#1260dc}.section{font-size:11px;color:#8a9aac;margin:0 10px 10px}.adminOnly{display:none}main{margin-left:220px;padding:28px;max-width:1500px}.cards{display:grid;grid-template-columns:repeat(4,1fr) 2fr;gap:14px}.card,.storage,.tablebox,.uploadtarget,.drop{background:#fff;border:1px solid #dce4ef;border-radius:10px}.card{padding:20px}.card span{display:block;color:#68809a;font-size:13px}.card b{display:block;margin-top:9px;font-size:20px}.storage{padding:20px}.storage div:first-child{display:flex;justify-content:space-between}.bar{height:9px;background:#e9eef5;border-radius:8px;margin-top:13px;overflow:hidden}.bar i{display:block;height:100%;width:0;background:#1d6ee8}.storage small{display:block;color:#70849a;margin-top:8px}.toolbar{display:flex;align-items:center;gap:10px;margin:20px 0 10px}.crumb{margin-left:auto;color:#58708a}.uploadtarget{padding:10px 14px;margin-bottom:8px;color:#55708b}.drop{padding:24px;text-align:center;border:2px dashed #bfd0e8;color:#55708b;margin-bottom:15px}.drop small{line-height:2}.tablebox{overflow:auto}.tablebox table{width:100%;border-collapse:collapse}.tablebox th,.tablebox td{padding:13px;border-bottom:1px solid #edf1f6;text-align:left;white-space:nowrap}.tablebox th{color:#61758b;font-size:12px}.name{color:#1260dc;cursor:pointer}.action{background:#eef3fa;color:#29445e;margin-right:5px;padding:7px 10px}.danger{color:#c52b35}.loginbody{min-height:100vh;display:grid;place-items:center}.loginbox{width:440px;background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:32px}.loginbox h1{color:#ef3030;margin:8px 0}.loginbox label{display:block;margin:18px 0 7px;font-weight:600}.loginbox button{width:100%;margin-top:22px}.brand{font-size:27px;font-weight:800;color:#ed3030;font-style:italic}.muted,.hint{color:#71869e;font-size:13px}.error{background:#fff0f1;color:#c32832;padding:12px;border-radius:8px;margin-top:15px}.panel{margin-top:20px}.modal{position:fixed;inset:0;background:#0005;display:grid;place-items:center;z-index:10}.modalbox{background:#fff;border-radius:12px;padding:25px;width:min(900px,92vw);max-height:88vh;overflow:auto}.row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}.badge{padding:5px 9px;border-radius:12px;background:#eef3fa;font-size:12px}.success{color:#18733b}.dangertext{color:#c32832}@media(max-width:1000px){aside{width:180px}main{margin-left:180px}.cards{grid-template-columns:repeat(2,1fr)}.title{font-size:16px}}.usercard{border:1px solid #dce4ef;border-radius:10px;padding:16px;margin-top:14px;background:#fbfcfe}.userhead{display:flex;gap:10px;align-items:center;margin-bottom:12px}.permblock{margin-top:12px;padding:12px;border:1px solid #e5eaf1;border-radius:8px}.permgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}.permgrid label{font-size:13px;color:#49647e}.permgrid input{width:auto;padding:0}.success{color:#18733b}.dangertext{color:#c32832}@media(max-width:700px){.permgrid{grid-template-columns:1fr}}

/* V3.7.10 compact language + editable branding */
.lang-select{width:110px;min-width:110px;max-width:110px;padding:8px 10px;border:1px solid #cbd6e5;border-radius:8px;background:#fff;color:#17304d}
.footer-brand{position:absolute;left:var(--brand-left,10px);bottom:var(--brand-bottom,24px);width:var(--brand-width,190px);font-size:var(--brand-font,12px);line-height:1.45;color:#42607d;white-space:pre-line}
.footer-brand .ftitle{font-weight:700;color:#274d73}.footer-brand .fsub{margin-top:2px}.footer-brand .fline{margin-top:2px}
@media(max-width:1000px){.lang-select{width:100px;min-width:100px;max-width:100px}.search{max-width:360px}}

.login-lang{text-align:right;margin-bottom:8px}.login-lang select{width:110px;max-width:110px;padding:7px 9px}

/* V3.8.0 Order Management */
.order-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:10px 0 14px}.order-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;background:#fff;border:1px solid #dce4ef;border-radius:10px;padding:12px;margin-bottom:12px}.order-toolbar input{width:240px}.order-toolbar select{width:180px}.orders-table th,.orders-table td{vertical-align:middle}.itemcell{min-width:220px;white-space:normal}.progressbox{min-width:110px;display:flex;align-items:center;gap:6px}.progressbar{width:80px;height:8px;background:#e9eef5;border-radius:8px;overflow:hidden}.progressbar i{display:block;height:100%;background:#1967e8}.statuspill{display:inline-block;padding:5px 9px;border-radius:12px;min-width:110px;text-align:center;white-space:normal}.order-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.order-grid label{font-size:13px;color:#49647e}.order-grid input,.order-grid textarea,.order-grid select{display:block;margin-top:6px}.order-grid .wide{grid-column:1/-1}.timeline{margin-top:16px;border-left:3px solid #d9e4f2;padding-left:14px}.timeline-item{padding:8px 0 14px;border-bottom:1px solid #edf1f6}.status-head,.status-edit{display:grid;grid-template-columns:1.2fr 1.2fr 1.2fr 80px 80px auto;gap:7px;align-items:center;margin-bottom:8px}.status-edit input[type=color]{width:50px;height:36px;padding:2px}.dangertext{color:#c32832!important}@media(max-width:900px){.order-cards{grid-template-columns:repeat(2,1fr)}.order-grid{grid-template-columns:1fr}.order-grid .wide{grid-column:auto}.status-head,.status-edit{grid-template-columns:1fr}.order-toolbar input,.order-toolbar select{width:100%}}
.po-preview-area{margin-top:14px}.po-meta{display:flex;gap:20px;flex-wrap:wrap;padding:10px 12px;background:#f7f9fc;border:1px solid #e3e9f2;border-radius:8px;color:#5d748d;font-size:13px}.po-preview-area .error{margin:10px 0}.po-preview-area h3{margin:16px 0 10px}.order-toolbar button{white-space:nowrap}

.quick-status{border:1px solid #d3deeb;border-radius:10px;padding:5px 8px;font-size:12px;min-width:135px;color:#17304d}.orders-table td:last-child{white-space:nowrap}.orders-table .quick-status:disabled{opacity:.7}
/* V3.9.3 configurable order columns + note action */
.order-actions{white-space:normal!important;min-width:210px}.order-actions .action{margin-bottom:4px}.field-head,.field-edit{display:grid;grid-template-columns:120px 1fr 1fr 1fr 80px;gap:8px;align-items:center;margin-bottom:8px}.field-edit input[type=checkbox]{width:auto}.field-edit{padding:7px 0;border-bottom:1px solid #edf1f6}.field-head{font-size:12px;color:#60758c;padding-bottom:5px;border-bottom:1px solid #dfe7f0}.quick-status{cursor:pointer}.orders-table th,.orders-table td{min-width:70px}

/* V3.9.8 Home SUM / Order status */
.home-summary{max-width:1100px}.sum-title{font-size:22px;font-weight:800;margin:8px 0 14px}.sum-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:14px}.sum-card{background:#fff;border:1px solid #dce4ef;border-radius:10px;padding:24px}.sum-card span{display:block;color:#68809a;font-size:13px}.sum-card b{display:block;margin-top:8px;font-size:28px}.sum-panel{background:#fff;border:1px solid #dce4ef;border-radius:10px;padding:18px;margin-top:14px}.sum-panel h3{margin:0 0 12px}.sum-status-list{display:flex;flex-wrap:wrap;gap:10px}.sum-status{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid #e1e7ef;border-radius:9px;padding:10px 14px;min-width:210px}.sum-status b{font-size:18px}.order-sum{margin-bottom:12px}.quick-status{font-weight:600}.quick-status option{font-weight:600}.pending-days{display:inline-block;padding:5px 9px;border-radius:10px;background:#fff3cd;font-weight:700}.pending-days.done{background:#e6f6ea;color:#18733b}.status-head,.status-edit{grid-template-columns:1.2fr 1.2fr 1.2fr 70px 80px 70px auto}
@media(max-width:900px){.sum-grid{grid-template-columns:1fr}.sum-status{min-width:100%}}

/* V3.9.9 status selector + compact SUM */
.sum-grid-3{grid-template-columns:repeat(3,minmax(220px,1fr))}.sum-money{font-size:22px!important;line-height:1.25}.status-select-wrap{position:relative;display:inline-block;min-width:150px}.status-button{width:150px;min-height:36px;padding:7px 10px;border:1px solid #cbd6e5;color:#17304d;font-weight:700;text-align:left;white-space:normal}.status-menu{display:none;position:absolute;left:0;top:calc(100% + 4px);z-index:30;width:220px;max-height:320px;overflow:auto;background:#fff;border:1px solid #cbd6e5;border-radius:9px;box-shadow:0 8px 24px #17304d26;padding:5px}.status-menu.open{display:block}.status-option{display:block;width:100%;margin:2px 0;padding:9px 10px;color:#17304d;text-align:left;font-weight:700;border:1px solid #d7e0ea;white-space:normal}.status-option:hover{filter:brightness(.96)}.statuspill{min-width:150px;font-weight:700}.orders-table td[data-field="status"]{overflow:visible}.orders-table tr{overflow:visible}.home-summary .sum-panel{max-width:1100px}@media(max-width:1100px){.sum-grid-3{grid-template-columns:1fr}.order-cards{grid-template-columns:repeat(2,1fr)}}

.status-option{display:flex;align-items:center;gap:8px}.status-color-dot{display:inline-block;width:12px;height:12px;border-radius:50%;border:1px solid #8da0b5;flex:0 0 12px}.status-button{display:flex;align-items:center;gap:7px}.status-button:after{content:""}

/* V3.9.11: status dropdown = configured color + configured name */
.status-button{display:flex!important;align-items:center!important;gap:8px!important;background:#fff!important;color:#17304d!important;overflow:hidden!important}
.status-button-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;color:#17304d!important;visibility:visible!important}
.status-arrow{flex:0 0 auto;color:#17304d!important}
.status-menu{background:#fff!important;z-index:9999!important}
.status-option{display:flex!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:38px!important;background:#fff!important;color:#17304d!important;font-size:13px!important;font-weight:700!important;visibility:visible!important;opacity:1!important}
.status-option-label{display:block!important;visibility:visible!important;opacity:1!important;color:#17304d!important;white-space:normal!important;overflow:visible!important}
.status-color-swatch{display:inline-block!important;width:28px!important;height:22px!important;border-radius:5px!important;border:1px solid #9aaabd!important;flex:0 0 28px!important}
.statuspill{display:inline-flex!important;align-items:center!important;gap:7px!important;padding:5px 9px!important;background:#fff!important;color:#17304d!important}

/* V3.9.12 order received-date filter */
.date-filter{display:flex;align-items:center;gap:5px;color:#49647e;font-size:12px;font-weight:600;white-space:nowrap}.date-filter input{width:145px!important;height:36px!important;padding:6px 8px!important}.order-toolbar .ghost{white-space:nowrap}@media(max-width:1100px){.date-filter{width:100%}.date-filter input{flex:1;width:auto!important}}


/* V3.9.14 - order UI optimization */
.orders-table{table-layout:auto;min-width:1600px}
.orders-table th{position:sticky;top:0;z-index:3;background:#fff;white-space:nowrap}
.orders-table td{height:64px;box-sizing:border-box}
.orders-table td[data-field="company"]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:280px}
.orders-table td[data-field="po"]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.orders-table td[data-field="item"]{white-space:normal;vertical-align:middle}
.itemcell{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;line-height:1.35;max-width:320px;word-break:break-word}
.order-card-clickable{border:1px solid #dce4ef;cursor:pointer;text-align:left;display:block;color:inherit;font:inherit}
.order-card-clickable:hover{box-shadow:0 4px 14px #17304d18;transform:translateY(-1px)}
.order-card-clickable small{display:block;margin-top:12px;color:#a56700;font-size:11px}
.overdue-table table{min-width:1100px}.overdue-table th{background:#fff}.overdue-table td{padding:10px;border-bottom:1px solid #edf1f6}
.field-head,.field-edit{grid-template-columns:100px 1.2fr 1.2fr 1.2fr 80px 70px}
.field-edit input[type=number]{width:70px}
.manual-order-btn{font-weight:700}.import-po-btn{font-weight:700}
.source-hint{font-weight:400;color:#8a6d1d;margin-left:4px}
.po-preview-area .order-grid label{min-width:0}
.po-preview-area .order-grid input,.po-preview-area .order-grid textarea{box-sizing:border-box;width:100%}
@media(max-width:1200px){.orders-table{min-width:1450px}.itemcell{max-width:260px}}


/* V3.9.15 - order toolbar and readable columns */
.order-filter-toolbar{display:block;padding:12px 14px}.order-filter-row,.order-action-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.order-filter-row>input{width:245px}.order-filter-row>select{width:175px}.order-filter-row .date-filter{display:flex;align-items:center;gap:6px;width:auto}.order-filter-row .date-filter span{font-size:12px;color:#49647e;white-space:nowrap}.order-filter-row .date-filter input{width:142px!important}.order-action-row{margin-top:10px;padding-top:10px;border-top:1px solid #edf1f6}.orders-tablebox{max-height:calc(100vh - 350px);min-height:180px}.orders-table{min-width:1450px;table-layout:fixed}.orders-table th,.orders-table td{overflow:hidden}.orders-table td[data-field="company"]{max-width:none}.cell-ellipsis{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.itemcell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;white-space:normal;line-height:1.35;word-break:break-word;max-width:100%}.status-select-wrap{min-width:180px}.status-button{width:180px;min-height:40px}.status-menu{width:300px;max-height:420px}.status-option{min-height:42px;padding:9px 11px}.status-option-label{white-space:normal;line-height:1.25}.overdue-card{cursor:pointer}.overdue-card:hover{box-shadow:0 4px 14px #17304d18;transform:translateY(-1px)}@media(max-width:1200px){.order-filter-row>input{width:220px}.order-filter-row>select{width:155px}.order-filter-row .date-filter input{width:130px!important}.orders-table{min-width:1400px}}@media(max-width:800px){.order-filter-row>input,.order-filter-row>select,.order-filter-row .date-filter,.order-filter-row .date-filter input{width:100%!important}.order-action-row button{flex:1}.orders-tablebox{max-height:none}}


/* V3.9.16 - file navigation: parent back button + clickable breadcrumb */
.back-folder-btn{display:none;align-items:center;gap:5px;white-space:nowrap}.crumb{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap;margin-left:auto;min-width:0}.crumb-link{border:0;background:transparent;padding:4px 3px;color:#2b5f98;cursor:pointer;font:inherit;font-weight:600}.crumb-link:hover{text-decoration:underline}.crumb-root{font-weight:700}.crumb-sep{color:#8ca0b5}.toolbar{align-items:center}.toolbar .back-folder-btn{margin-right:2px}@media(max-width:800px){.crumb{width:100%;margin-left:0}.toolbar .back-folder-btn{display:inline-flex}}


/* V3.9.21 - Settings Center */
.settings-page{max-width:1100px}.settings-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:14px}.settings-head h2{margin:0 0 6px}.settings-card{background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:18px;margin:12px 0}.settings-card h3{margin:0 0 10px;font-size:16px}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:12px}.settings-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#49647e;font-weight:600}.settings-grid input,.settings-grid select{box-sizing:border-box}.settings-card button{margin-top:4px}@media(max-width:800px){.settings-grid{grid-template-columns:1fr}.settings-head{flex-direction:column}}
/* Price masking */.price-masked{letter-spacing:2px;font-weight:800}

:root{--order-min-width:1400px}.orders-table{min-width:var(--order-min-width)}body[data-density="comfortable"] .orders-table td{padding-top:16px;padding-bottom:16px}body[data-density="compact"] .orders-table td{padding-top:9px;padding-bottom:9px}body[data-theme="dark"]{background:#101722;color:#e7edf5}body[data-theme="dark"] header,body[data-theme="dark"] aside,body[data-theme="dark"] .card,body[data-theme="dark"] .storage,body[data-theme="dark"] .tablebox,body[data-theme="dark"] .uploadtarget,body[data-theme="dark"] .drop,body[data-theme="dark"] .sum-panel,body[data-theme="dark"] .sum-card,body[data-theme="dark"] .settings-card{background:#182230;color:#e7edf5;border-color:#334154}body[data-theme="dark"] input,body[data-theme="dark"] select{background:#111a25;color:#e7edf5;border-color:#3a4b61}body[data-theme="dark"] .settings-card .hint,body[data-theme="dark"] .card span{color:#aebed0}

/* V3.9.22 - Governance pages: each admin item is a dedicated full workspace view */
.admin-page{margin-top:0;min-height:calc(100vh - 130px);background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:22px 24px;box-shadow:0 1px 2px #17304d0a}
.admin-page-top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:16px;border-bottom:1px solid #e8edf4}
.admin-page-top h1{margin:4px 0 0;font-size:24px;color:#17304d}
.admin-kicker{font-size:11px;font-weight:700;color:#8a9aac;letter-spacing:.5px}
.admin-page-nav{display:flex;gap:8px;flex-wrap:wrap;padding:14px 0;border-bottom:1px solid #edf1f6}
.admin-page-nav button{margin:0}.admin-page-nav button.active{background:#1967e8;color:#fff}
.admin-page-content{padding-top:4px}.admin-page-content>.panel{margin-top:0}.admin-page-content .settings-page{max-width:none}
.admin-page-content table{width:100%;border-collapse:collapse}.admin-page-content th,.admin-page-content td{padding:11px 12px;border-bottom:1px solid #edf1f6;text-align:left;vertical-align:top}
@media(max-width:800px){.admin-page{padding:18px 14px}.admin-page-top{align-items:flex-start}.admin-page-top h1{font-size:20px}.admin-page-nav button{flex:1;min-width:145px}}
body[data-theme="dark"] .admin-page{background:#182230;color:#e7edf5;border-color:#334154}body[data-theme="dark"] .admin-page-top h1{color:#e7edf5}

/* V3.9.23 - Mobile / responsive workspace optimization
   All existing functions are preserved; this layer only changes presentation and touch layout. */
@media (max-width: 700px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  body{font-size:14px;padding-bottom:112px}
  header{height:auto;min-height:58px;padding:9px 10px;gap:8px;flex-wrap:wrap;position:sticky;top:0}
  .logo{font-size:21px;line-height:32px;flex:0 0 auto}
  .title{display:none}
  header .search{order:10;flex:1 0 100%;max-width:none;margin:0}
  header .search input{height:40px;font-size:14px}
  #me{margin-left:auto;font-size:12px;white-space:nowrap;max-width:92px;overflow:hidden;text-overflow:ellipsis}
  .lang-select{width:82px!important;min-width:82px!important;max-width:82px!important;height:38px;padding:7px 5px}
  header>button{height:38px;width:40px;padding:8px 0}

  aside{left:0;right:0;top:auto;bottom:0;width:100%;height:104px;padding:5px 6px 7px;background:#fff;border-right:0;border-top:1px solid #dce4ef;z-index:20;display:flex;flex-direction:column;gap:2px;overflow-x:auto;overflow-y:hidden;box-shadow:0 -3px 14px #17304d12}
  aside .section{display:none!important}
  aside button{display:block!important;flex:0 0 auto;width:auto;text-align:center;margin:0;padding:8px 10px;border-radius:8px;font-size:12px;white-space:nowrap}
  aside button:nth-of-type(-n+4){ }
  aside .adminOnly{ }
  aside #footerBrand{display:none!important}
  aside:before{content:"";display:block;flex:0 0 0}
  main{margin-left:0;padding:10px 10px 18px;max-width:none;width:100%}

  .cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}
  .card{padding:12px;border-radius:9px;min-width:0}
  .card span{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .card b{font-size:18px;margin-top:5px;overflow:hidden;text-overflow:ellipsis}
  .storage{grid-column:1/-1;padding:12px}

  .toolbar{margin:10px 0 8px;gap:7px;flex-wrap:wrap}
  .toolbar>button{min-height:40px;padding:9px 11px;flex:1 1 calc(50% - 7px)}
  .toolbar .back-folder-btn{flex:1 1 calc(50% - 7px)}
  .crumb{width:100%;margin-left:0;overflow-x:auto;white-space:nowrap;padding:3px 0;font-size:13px}
  .uploadtarget{padding:9px 11px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .drop{padding:18px 10px;margin-bottom:10px;min-height:78px}
  .drop small{line-height:1.5}

  /* File list becomes touch-friendly cards instead of a wide desktop table. */
  #fileTable{overflow:visible;border:0;background:transparent}
  #fileTable table,#fileTable tbody{display:block;width:100%}
  #fileTable thead{display:none}
  #fileTable tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 10px;background:#fff;border:1px solid #dce4ef;border-radius:10px;margin-bottom:8px;padding:10px}
  #fileTable td{display:none;border:0;padding:0;min-width:0;white-space:normal;overflow:visible}
  #fileTable td:nth-child(1){display:block;grid-column:1/-1;font-weight:600;min-width:0;overflow:hidden}
  #fileTable td:nth-child(2),#fileTable td:nth-child(3),#fileTable td:nth-child(4){display:block;font-size:11px;color:#71869e}
  #fileTable td:nth-child(2):before{content:'Type: ';font-weight:700}
  #fileTable td:nth-child(3):before{content:'Size: ';font-weight:700}
  #fileTable td:nth-child(4):before{content:'Modified: ';font-weight:700}
  #fileTable td:nth-child(2){grid-column:1}
  #fileTable td:nth-child(3){grid-column:1}
  #fileTable td:nth-child(4){grid-column:1}
  #fileTable td:nth-child(5){display:flex;grid-column:2;grid-row:2/5;align-items:center;justify-content:flex-end;gap:5px;white-space:normal}
  #fileTable .action{margin:2px 0;padding:9px 10px;min-width:38px;min-height:38px}

  .home-summary{max-width:none}
  .sum-title{font-size:19px;margin:4px 0 10px}
  .sum-grid,.sum-grid-3{grid-template-columns:1fr 1fr;gap:8px}
  .sum-card{padding:14px;min-width:0}
  .sum-card b{font-size:23px}
  .sum-grid .sum-card:last-child{grid-column:1/-1}
  .sum-panel{padding:12px;margin-top:9px}
  .sum-status-list{gap:6px}
  .sum-status{min-width:calc(50% - 3px);padding:8px 10px}

  .order-cards{grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}
  .order-cards .card{padding:11px}
  .order-cards .card:last-child{grid-column:1/-1}
  .order-toolbar{padding:9px;border-radius:9px}
  .order-filter-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;width:100%}
  .order-filter-row>input,.order-filter-row>select,.order-filter-row .date-filter,.order-filter-row .date-filter input{width:100%!important;min-width:0!important}
  .order-filter-row>input{grid-column:1/-1}
  .order-filter-row .date-filter{display:flex;flex-direction:column;align-items:stretch;gap:3px}
  .order-filter-row .date-filter span{font-size:10px}
  .order-filter-row button{grid-column:1/-1;min-height:40px}
  .order-action-row{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .order-action-row button{width:100%;min-height:42px;margin:0}
  .orders-tablebox{max-height:none;overflow:auto;-webkit-overflow-scrolling:touch;border-radius:9px}
  .orders-table{min-width:1050px!important}
  .orders-table th,.orders-table td{padding:10px 8px;font-size:12px}
  .orders-table th:first-child,.orders-table td:first-child{position:sticky;left:0;z-index:2;background:#fff}
  .orders-table th:first-child{z-index:4}
  .order-actions{min-width:170px!important}
  .status-select-wrap{min-width:150px}
  .status-button{width:150px;min-height:40px}
  .status-menu{position:fixed;left:10px;right:10px;bottom:115px;top:auto;width:auto;max-height:50vh;z-index:50}
  .status-option{min-height:44px}

  .admin-page{min-height:calc(100vh - 180px);padding:13px 11px;border-radius:10px;margin:0}
  .admin-page-top{gap:8px;padding-bottom:10px}
  .admin-page-top h1{font-size:18px;margin:2px 0 0}
  .admin-page-top .ghost{min-height:38px;padding:8px 10px}
  .admin-page-nav{display:flex;overflow-x:auto;flex-wrap:nowrap;gap:6px;padding:9px 0;-webkit-overflow-scrolling:touch}
  .admin-page-nav button{flex:0 0 auto;min-width:auto!important;min-height:40px;padding:8px 10px;font-size:12px}
  .admin-page-content{padding-top:3px}
  .admin-page-content table{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
  .admin-page-content table tr{ }
  .usercard{padding:11px;margin-top:9px}
  .userhead{flex-wrap:wrap;margin-bottom:9px}
  .row,.order-grid{grid-template-columns:1fr;gap:9px}
  .order-grid .wide{grid-column:auto}
  .permgrid{grid-template-columns:1fr;gap:7px}
  .actions{flex-wrap:wrap;justify-content:stretch}
  .actions button{flex:1 1 calc(50% - 5px);min-height:42px}
  .settings-page{max-width:none}
  .settings-head{gap:8px;margin-bottom:8px}
  .settings-card{padding:12px;margin:8px 0;border-radius:9px}
  .settings-card h3{font-size:15px}
  .settings-grid{grid-template-columns:1fr;gap:9px}
  .settings-card button{min-height:42px}

  .modal{align-items:flex-end}
  .modalbox{width:100%;max-width:none;max-height:92vh;border-radius:14px 14px 0 0;padding:16px 12px;overflow:auto}
  .modalbox h2{font-size:18px;margin:2px 0 8px}
  .po-meta{gap:7px;padding:9px;font-size:11px;display:block}
  .po-meta span{display:block;margin:3px 0}
  .timeline{padding-left:10px}

  input,select,button{font-size:14px}
  input,select{min-height:40px}
  button{min-height:40px}
  .hint{line-height:1.45}
}

@media (min-width:701px) and (max-width:1000px){
  header{padding:0 15px}.title{font-size:17px}.search{max-width:340px;margin-left:8px}
  main{padding:18px}.cards{grid-template-columns:repeat(2,1fr)}
}


/* V3.9.24: Dedicated mobile order cards. Desktop table remains unchanged. */
.mobile-order-cards{display:none}
@media (max-width:700px){
  .orders-tablebox{display:none!important}
  .mobile-order-cards{display:block;margin-top:10px}
  .mobile-order-card{display:block;background:#fff;border:1px solid #d7e1ec;border-radius:12px;padding:12px;margin:0 0 9px;box-shadow:0 2px 8px #17304d0b;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mobile-order-card:active{transform:scale(.995)}
  .mobile-order-head{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;border-bottom:1px solid #edf1f6;padding-bottom:8px}
  .mobile-order-company{font-size:11px;color:#5d7690;font-weight:700;text-transform:uppercase;letter-spacing:.2px}
  .mobile-order-head h3{margin:2px 0 0;font-size:16px;line-height:1.25;color:#17304d;overflow-wrap:anywhere}
  .mobile-order-chevron{font-size:27px;line-height:24px;color:#8ca0b5;padding-left:4px}
  .mobile-order-item{font-weight:600;color:#254a70;line-height:1.35;margin:9px 0 8px;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
  .mobile-order-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;background:#f7f9fc;border-radius:9px;padding:9px}
  .mobile-order-grid>div{min-width:0}
  .mobile-order-grid small{display:block;font-size:10px;color:#71869e;margin-bottom:2px}
  .mobile-order-grid b{display:block;font-size:12px;color:#17304d;overflow-wrap:anywhere;line-height:1.3}
  .mobile-order-progress{margin:9px 0 0}
  .mobile-progress-top{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#5d7690;margin-bottom:4px}
  .mobile-progress-top b{color:#17304d}
  .mobile-order-progress .progressbar{height:7px;margin:0}
  .mobile-order-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;padding-top:9px;border-top:1px solid #edf1f6}
  .mobile-order-bottom>div:first-child{min-width:0;flex:1}
  .mobile-status-wrap{min-width:0!important;width:100%}
  .mobile-status-wrap .status-button{width:100%;max-width:100%;min-height:40px}
  .mobile-order-actions{display:flex;gap:4px;flex:0 0 auto}
  .mobile-order-actions .action{min-width:38px;min-height:38px;padding:8px 9px;margin:0}
  .mobile-order-hint{font-size:10px;color:#8ca0b5;text-align:right;margin-top:6px}
  .mobile-order-card .status-menu{position:fixed;left:10px;right:10px;bottom:112px;top:auto;width:auto;max-height:52vh;z-index:80}
  .mobile-order-card .status-option{min-height:44px}
  .order-action-row button{min-height:44px}
}

/* V3.10.0: user administration polish */
.admin-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px}
.admin-stat{background:#f7f9fc;border:1px solid #dce4ef;border-radius:10px;padding:12px 14px}
.admin-stat span{display:block;color:#71869e;font-size:12px}.admin-stat b{display:block;font-size:22px;color:#17304d;margin-top:4px}
.users-toolbar{display:flex;gap:8px;align-items:center;margin-bottom:8px}.users-toolbar input{flex:1;min-width:180px}
.user-meta{font-size:11px;color:#8ca0b5;margin-top:3px}.toggle-label{display:flex;align-items:flex-start;gap:5px}
@media(max-width:700px){.admin-stat-grid{grid-template-columns:1fr 1fr}.admin-stat:last-child{grid-column:1/-1}.users-toolbar{display:grid;grid-template-columns:1fr;gap:7px}.users-toolbar input{min-width:0;width:100%}}

/* V3.10.2 - Backup & Recovery */
.backup-manager{max-width:1100px}.backup-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#f7f9fc;border:1px solid #dce4ef;border-radius:10px;padding:12px;margin:12px 0}.backup-actions label{display:flex;align-items:center;gap:7px;font-size:13px;color:#49647e;margin-right:auto}.backup-actions input{width:auto}.backup-manager table{width:100%;border-collapse:collapse}.backup-manager th,.backup-manager td{padding:11px 10px;border-bottom:1px solid #edf1f6;text-align:left;vertical-align:middle}.backup-manager small{color:#71869e}.backup-manager .action{display:inline-block;text-decoration:none;border:0}.backup-manager .danger{color:#c32832}@media(max-width:700px){.backup-actions{display:grid;grid-template-columns:1fr}.backup-actions label{margin:0}.backup-actions button{width:100%;min-height:42px}.backup-manager .tablebox{overflow-x:auto}.backup-manager table{min-width:720px}}
body[data-theme="dark"] .backup-actions{background:#111a25;border-color:#334154}

/* V3.10.3.1 - Management Dashboard visual/layout optimization */
.management-dashboard{width:100%;max-width:1500px;margin:0 auto;padding:4px 0 28px}
.dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:4px 0 18px}
.dashboard-head h1{font-size:28px;line-height:1.2;margin:3px 0 7px;color:#17304d}
.dashboard-head p{margin:0;color:#71869e;font-size:13px}
.dash-kicker{font-size:11px;font-weight:800;letter-spacing:.8px;color:#ef3030}
.dashboard-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.dashboard-head-actions button{white-space:nowrap}
.analytics-toggle-btn{background:#eef3fa;color:#17304d;border:1px solid #d6e0ec}.analytics-toggle-btn.active{background:#1967e8;color:#fff;border-color:#1967e8}.analytics-toggle-btn:focus-visible{outline:2px solid #1967e8;outline-offset:2px}
.dash-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.dash-kpi{background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:16px 17px;min-width:0;box-shadow:0 1px 2px #17304d08}
.dash-kpi span{display:block;font-size:12px;color:#71869e;font-weight:700}
.dash-kpi b{display:block;font-size:28px;line-height:1.15;margin:7px 0 5px;color:#17304d;overflow-wrap:anywhere}
.dash-kpi small{display:block;color:#8a9aac;font-size:11px;line-height:1.35}
.dash-kpi.danger{border-left:4px solid #d94b4b}
.dash-kpi.danger b{color:#c32832}
.dash-kpi.money{grid-column:span 2}
.dash-kpi.money b{font-size:22px}
.dash-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.9fr);gap:14px;align-items:start}
.dash-panel{background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:16px;min-width:0;box-shadow:0 1px 2px #17304d08}
.dash-panel.dash-wide{grid-column:span 1}
.dash-panel-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:12px}
.dash-panel-head h2{font-size:17px;margin:0;color:#17304d}
.dash-panel-head span{font-size:11px;color:#8a9aac;text-align:right}
.dash-chart{height:220px;display:flex;align-items:flex-end;gap:8px;padding:12px 4px 0;border-top:1px solid #edf1f6;overflow-x:auto}
.dash-month{height:100%;min-width:42px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px}
.dash-month b{font-size:11px;color:#49647e;min-height:14px}
.dash-month small{font-size:10px;color:#8a9aac}
.dash-month-bar{height:155px;width:24px;background:#f0f4f9;border-radius:7px 7px 3px 3px;display:flex;align-items:flex-end;overflow:hidden}
.dash-month-bar i{display:block;width:100%;min-height:4px;background:#1967e8;border-radius:7px 7px 2px 2px}
.dash-status-list{display:flex;flex-direction:column;gap:8px}
.dash-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 11px;background:#f7f9fc;border:1px solid #edf1f6;border-radius:8px}
.dash-status span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#49647e}
.dash-status b{font-size:15px;color:#17304d}
.dash-company-list{display:flex;flex-direction:column;gap:7px}
.dash-company{display:grid;grid-template-columns:28px minmax(0,1fr) 32px;align-items:center;gap:8px;padding:9px 10px;border:1px solid #edf1f6;border-radius:8px}
.dash-company .rank{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#eef3fa;color:#49647e;font-size:11px;font-weight:800}
.dash-company div{min-width:0}
.dash-company b{display:block;font-size:12px;color:#17304d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-company small{display:block;color:#8a9aac;font-size:10px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-company strong{text-align:right;font-size:15px;color:#17304d}
.dash-list{display:flex;flex-direction:column;gap:7px}
.dash-order-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 11px;border:1px solid #edf1f6;border-radius:8px;cursor:pointer;transition:background .15s ease,transform .15s ease}
.dash-order-row:hover{background:#f7f9fc;transform:translateY(-1px)}
.dash-order-row>div{min-width:0;flex:1}
.dash-order-row b{display:block;font-size:12px;color:#17304d;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-order-row>div span{display:block;font-size:10px;color:#71869e;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-order-row>.statuspill{flex:0 0 auto;min-width:120px;font-size:11px}
.overdue-row{border-left:3px solid #d94b4b;background:#fffafb}
.overdue-row>span{font-size:12px;font-weight:800;color:#c32832;flex:0 0 auto}
.dash-alert{border-color:#efd1d1}
.success-note{padding:12px;background:#f1faf4;border:1px solid #d7efdf;border-radius:8px;color:#18733b;font-size:12px}
.report-actions{display:flex;gap:8px;flex-wrap:wrap}
.report-actions button{min-width:150px}
body[data-theme="dark"] .management-dashboard .dash-kpi,body[data-theme="dark"] .management-dashboard .dash-panel{background:#182230;border-color:#334154}
body[data-theme="dark"] .dashboard-head h1,body[data-theme="dark"] .dash-kpi b,body[data-theme="dark"] .dash-panel-head h2,body[data-theme="dark"] .dash-company b,body[data-theme="dark"] .dash-company strong,body[data-theme="dark"] .dash-order-row b,body[data-theme="dark"] .dash-status b{color:#e7edf5}
body[data-theme="dark"] .dash-status,body[data-theme="dark"] .dash-company,body[data-theme="dark"] .dash-order-row,body[data-theme="dark"] .dash-month-bar{background:#111a25;border-color:#334154}
body[data-theme="dark"] .dash-chart{border-color:#334154}
@media(max-width:1200px){.dash-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-kpi.money{grid-column:span 1}.dash-grid{grid-template-columns:1fr}.dash-panel{grid-column:span 1!important}}
@media(max-width:700px){
  .management-dashboard{padding:2px 0 18px}
  .dashboard-head{align-items:stretch;flex-direction:column;gap:10px;margin-bottom:12px}
  .dashboard-head h1{font-size:21px;margin:2px 0 5px}
  .dashboard-head-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .dashboard-head-actions button{width:100%;min-height:42px;padding:9px 8px}
  .dash-kpis{grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
  .dash-kpi{padding:12px;border-radius:10px}
  .dash-kpi b{font-size:22px;margin:5px 0 3px}
  .dash-kpi.money{grid-column:1/-1}
  .dash-kpi.money b{font-size:19px}
  .dash-grid{display:flex;flex-direction:column;gap:9px}
  .dash-panel{width:100%;padding:12px;border-radius:10px}
  .dash-panel-head{margin-bottom:9px}
  .dash-panel-head h2{font-size:15px}
  .dash-panel-head span{font-size:10px}
  .dash-chart{height:190px;gap:5px;padding-top:8px}
  .dash-month{min-width:34px}
  .dash-month-bar{height:125px;width:20px}
  .dash-order-row{padding:9px;gap:7px}
  .dash-order-row>.statuspill{min-width:92px;max-width:120px;font-size:10px}
  .dash-company{grid-template-columns:25px minmax(0,1fr) 28px;padding:8px}
  .dash-company .rank{width:22px;height:22px}
  .report-actions{display:grid;grid-template-columns:1fr}
  .report-actions button{width:100%}
}


/* V3.10.3.3 - Management Dashboard information hierarchy / desktop readability
   Presentation-only layer. Existing functions and data APIs are unchanged. */

/* Desktop: use the available workspace more effectively. */
@media (min-width: 1201px) {
  main {
    max-width: none !important;
    padding: 22px 24px 30px !important;
  }

  .management-dashboard {
    width: 100% !important;
    max-width: 1680px !important;
    margin: 0 auto !important;
    padding: 8px 0 34px !important;
  }

  .dashboard-head {
    gap: 28px !important;
    margin: 2px 0 20px !important;
    align-items: center !important;
  }

  .dash-kicker {
    font-size: 12px !important;
    letter-spacing: 1px !important;
  }

  .dashboard-head h1 {
    font-size: 32px !important;
    line-height: 1.15 !important;
    margin: 5px 0 8px !important;
    letter-spacing: -.35px;
  }

  .dashboard-head p {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  .dashboard-head-actions {
    gap: 10px !important;
  }

  .dashboard-head-actions button {
    min-height: 42px !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  /* KPI: five meaningful metrics in one clean row. */
  .management-dashboard .dash-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(240px, 1.25fr) !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
  }

  .management-dashboard .dash-kpi {
    min-height: 124px !important;
    padding: 18px 19px !important;
    border-radius: 13px !important;
  }

  .management-dashboard .dash-kpi span {
    font-size: 13px !important;
  }

  .management-dashboard .dash-kpi b {
    font-size: 32px !important;
    line-height: 1.1 !important;
    margin: 9px 0 7px !important;
  }

  .management-dashboard .dash-kpi small {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .management-dashboard .dash-kpi.money {
    grid-column: auto !important;
  }

  .management-dashboard .dash-kpi.money b {
    font-size: 23px !important;
    line-height: 1.25 !important;
  }

  /* Two-column management workspace. */
  .management-dashboard .dash-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, .95fr) !important;
    gap: 16px !important;
  }

  .management-dashboard .dash-panel {
    padding: 18px !important;
    border-radius: 13px !important;
  }

  .management-dashboard .dash-panel-head {
    margin-bottom: 13px !important;
  }

  .management-dashboard .dash-panel-head h2 {
    font-size: 18px !important;
    line-height: 1.3 !important;
  }

  .management-dashboard .dash-panel-head span {
    font-size: 12px !important;
  }

  /* Chart: stronger visual scale and readable labels. */
  .management-dashboard .dash-chart {
    height: 245px !important;
    gap: 10px !important;
    padding: 14px 8px 0 !important;
  }

  .management-dashboard .dash-month {
    min-width: 46px !important;
    gap: 6px !important;
  }

  .management-dashboard .dash-month b {
    font-size: 12px !important;
  }

  .management-dashboard .dash-month small {
    font-size: 11px !important;
  }

  .management-dashboard .dash-month-bar {
    height: 172px !important;
    width: 28px !important;
    border-radius: 8px 8px 3px 3px !important;
  }

  /* Status and customer information should read as management summaries. */
  .management-dashboard .dash-status-list,
  .management-dashboard .dash-company-list,
  .management-dashboard .dash-list {
    gap: 9px !important;
  }

  .management-dashboard .dash-status {
    padding: 12px 13px !important;
    min-height: 44px !important;
  }

  .management-dashboard .dash-status span {
    font-size: 13px !important;
  }

  .management-dashboard .dash-status b {
    font-size: 16px !important;
  }

  .management-dashboard .dash-company {
    grid-template-columns: 32px minmax(0, 1fr) 42px !important;
    gap: 10px !important;
    padding: 11px 12px !important;
    min-height: 54px !important;
  }

  .management-dashboard .dash-company .rank {
    width: 27px !important;
    height: 27px !important;
    font-size: 12px !important;
  }

  .management-dashboard .dash-company b {
    font-size: 13px !important;
  }

  .management-dashboard .dash-company small {
    font-size: 11px !important;
  }

  .management-dashboard .dash-company strong {
    font-size: 17px !important;
  }

  .management-dashboard .dash-order-row {
    padding: 11px 12px !important;
    gap: 14px !important;
    min-height: 52px !important;
  }

  .management-dashboard .dash-order-row b {
    font-size: 13px !important;
  }

  .management-dashboard .dash-order-row > div span {
    font-size: 11px !important;
    margin-top: 4px !important;
  }

  .management-dashboard .dash-order-row > .statuspill {
    min-width: 132px !important;
    font-size: 11px !important;
  }

  .management-dashboard .overdue-row > span {
    font-size: 13px !important;
  }

  .management-dashboard .success-note {
    padding: 13px !important;
    font-size: 13px !important;
  }

  .management-dashboard .report-actions {
    gap: 10px !important;
  }

  .management-dashboard .report-actions button {
    min-height: 40px !important;
    font-size: 13px !important;
  }
}

/* Mid-size laptop: keep information readable without forcing horizontal scroll. */
@media (min-width: 901px) and (max-width: 1200px) {
  main {
    padding: 18px 20px !important;
  }

  .management-dashboard {
    max-width: 100% !important;
  }

  .dashboard-head h1 {
    font-size: 28px !important;
  }

  .management-dashboard .dash-kpis {
    gap: 12px !important;
  }

  .management-dashboard .dash-kpi {
    min-height: 112px !important;
    padding: 15px !important;
  }

  .management-dashboard .dash-kpi b {
    font-size: 28px !important;
  }

  .management-dashboard .dash-kpi.money b {
    font-size: 21px !important;
  }

  .management-dashboard .dash-panel {
    padding: 15px !important;
  }

  .management-dashboard .dash-panel-head h2 {
    font-size: 17px !important;
  }
}

/* Prevent dashboard text from becoming visually tiny when the app is opened
   on a high-DPI desktop. */
@media (min-width: 901px) {
  .management-dashboard {
    font-size: 14px;
  }
  .management-dashboard button {
    font-size: 13px;
  }
}

/* V3.10.3.4 - Dashboard annual trend controls */
.dash-trend-controls{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.dash-trend-controls select{height:34px;min-width:132px;padding:6px 28px 6px 9px;border:1px solid #dce4ef;border-radius:8px;background:#fff;color:#17304d;font-size:12px;font-weight:700}
.dash-trend-controls select:focus{outline:2px solid #1967e822;border-color:#1967e8}
.dash-chart-subtitle{display:block!important;margin-top:3px!important;text-align:left!important}
@media(max-width:700px){
  .dash-panel-head{align-items:flex-start!important;flex-wrap:wrap}
  .dash-trend-controls{width:100%;justify-content:stretch}
  .dash-trend-controls select{flex:1;min-width:0;height:40px;font-size:12px}
}
body[data-theme="dark"] .dash-trend-controls select{background:#111a25;border-color:#334154;color:#e7edf5}


/* V3.10.3.5 - FINAL management dashboard polish
   Presentation only. No API, database, PO, permission, backup or CSRF behavior changes. */
.management-dashboard{font-family:Arial,sans-serif;color:#17304d}
@media (min-width:1201px){
  main{padding:24px 30px 36px!important}
  .management-dashboard{max-width:1600px!important;padding:6px 0 40px!important}
  .dashboard-head{min-height:72px;margin-bottom:18px!important}
  .dashboard-head h1{font-size:34px!important;letter-spacing:-.5px!important}
  .dashboard-head p{font-size:14px!important}
  .dash-kpis{grid-template-columns:repeat(4,minmax(0,1fr)) minmax(270px,1.25fr)!important;gap:16px!important}
  .dash-kpi{min-height:132px!important;padding:20px 21px!important;border-radius:14px!important}
  .dash-kpi span{font-size:14px!important}
  .dash-kpi b{font-size:34px!important;margin:10px 0 7px!important}
  .dash-kpi.money b{font-size:24px!important}
  .dash-kpi small{font-size:12px!important}
  .dash-grid{grid-template-columns:minmax(0,1.65fr) minmax(330px,.85fr)!important;gap:16px!important}
  .dash-panel{padding:18px 19px!important;border-radius:14px!important}
  .dash-panel-head{margin-bottom:14px!important;align-items:center!important}
  .dash-panel-head h2{font-size:18px!important}
  .dash-panel-head span{font-size:12px!important}
  .dash-chart{height:250px!important;gap:10px!important;padding:16px 8px 0!important}
  .dash-month{min-width:48px!important;gap:7px!important}
  .dash-month-bar{height:178px!important;width:28px!important;border-radius:8px 8px 4px 4px!important}
  .dash-month b{font-size:12px!important}
  .dash-month small{font-size:11px!important}
  .dash-trend-controls{flex-wrap:nowrap!important;gap:8px!important}
  .dash-trend-controls select{height:38px!important;min-width:142px!important;font-size:13px!important}
  .dash-trend-controls select[aria-label="Năm"]{min-width:92px!important}
  .dash-trend-controls select[aria-label="Chỉ tiêu"]{min-width:150px!important}
  .dash-status{padding:12px 13px!important}
  .dash-status span{font-size:13px!important}.dash-status b{font-size:16px!important}
  .dash-company{grid-template-columns:30px minmax(0,1fr) 38px!important;padding:11px 12px!important}
  .dash-company b{font-size:13px!important}.dash-company small{font-size:11px!important}.dash-company strong{font-size:16px!important}
  .dash-order-row{padding:12px 13px!important}.dash-order-row b{font-size:13px!important}.dash-order-row>div span{font-size:11px!important}.dash-order-row>.statuspill{font-size:12px!important;min-width:132px!important}
  .report-actions button{min-height:40px!important;font-size:13px!important}
}

/* Laptop: prevent the desktop dashboard from collapsing into a narrow text column. */
@media (min-width:901px) and (max-width:1200px){
  main{margin-left:220px!important;padding:20px 22px 32px!important;max-width:none!important}
  .management-dashboard{width:100%!important;max-width:none!important}
  .dashboard-head{display:flex!important;flex-direction:row!important;align-items:center!important}
  .dashboard-head h1{font-size:29px!important}.dashboard-head p{font-size:13px!important}
  .dash-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important}
  .dash-kpi{min-height:112px!important;padding:14px!important}.dash-kpi b{font-size:27px!important}.dash-kpi.money{grid-column:1/-1!important}.dash-kpi.money b{font-size:22px!important}
  .dash-grid{grid-template-columns:minmax(0,1.5fr) minmax(270px,.9fr)!important;gap:12px!important}
  .dash-panel{padding:14px!important}.dash-chart{height:210px!important}.dash-month-bar{height:145px!important;width:24px!important}
  .dash-trend-controls select{height:36px!important;font-size:12px!important;min-width:125px!important}
}

/* Phone: dedicated touch-first dashboard. */
@media (max-width:700px){
  .management-dashboard{width:100%!important;padding:4px 0 20px!important}
  .dashboard-head{gap:10px!important;margin:0 0 12px!important}
  .dashboard-head h1{font-size:25px!important;line-height:1.15!important;margin:3px 0 5px!important}
  .dashboard-head p{font-size:14px!important;line-height:1.45!important}
  .dashboard-head-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  .dashboard-head-actions button{min-height:44px!important;font-size:14px!important}
  .dash-kpis{grid-template-columns:1fr 1fr!important;gap:9px!important;margin-bottom:10px!important}
  .dash-kpi{min-height:118px!important;padding:14px!important;border-radius:12px!important}
  .dash-kpi span{font-size:13px!important}.dash-kpi b{font-size:25px!important;margin:8px 0 5px!important}.dash-kpi small{font-size:12px!important}
  .dash-kpi.money{grid-column:1/-1!important;min-height:104px!important}.dash-kpi.money b{font-size:21px!important}
  .dash-grid{display:flex!important;flex-direction:column!important;gap:10px!important}
  .dash-panel{width:100%!important;padding:14px!important;border-radius:12px!important}
  .dash-panel-head{display:flex!important;align-items:flex-start!important;flex-direction:column!important;gap:9px!important;margin-bottom:11px!important}
  .dash-panel-head h2{font-size:18px!important}.dash-panel-head span{font-size:12px!important;text-align:left!important}
  .dash-trend-controls{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:7px!important}
  .dash-trend-controls select{width:100%!important;min-width:0!important;height:42px!important;font-size:13px!important;padding-left:10px!important;padding-right:24px!important}
  .dash-trend-controls select:last-child{grid-column:1/-1}
  .dash-chart{height:235px!important;gap:4px!important;padding:12px 2px 0!important;overflow-x:hidden!important}
  .dash-month{min-width:0!important;flex:1!important;gap:6px!important}.dash-month-bar{height:158px!important;width:20px!important}.dash-month b{font-size:12px!important}.dash-month small{font-size:11px!important}
  .dash-status{padding:11px 12px!important}.dash-status span{font-size:13px!important}.dash-status b{font-size:16px!important}
  .dash-company{grid-template-columns:28px minmax(0,1fr) 34px!important;padding:10px 11px!important}.dash-company b{font-size:13px!important}.dash-company small{font-size:11px!important}.dash-company strong{font-size:16px!important}
  .dash-order-row{padding:11px!important;gap:8px!important}.dash-order-row b{font-size:13px!important}.dash-order-row>div span{font-size:11px!important}.dash-order-row>.statuspill{min-width:98px!important;max-width:125px!important;font-size:10px!important}
  .report-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}.report-actions button{width:100%!important;min-height:42px!important;font-size:13px!important}
}

@media (max-width:380px){
  .dashboard-head h1{font-size:22px!important}.dashboard-head p{font-size:13px!important}
  .dash-kpi{min-height:108px!important;padding:12px!important}.dash-kpi b{font-size:22px!important}.dash-kpi.money b{font-size:19px!important}
  .dash-trend-controls{grid-template-columns:1fr!important}.dash-trend-controls select:last-child{grid-column:auto}
  .dash-chart{height:220px!important}.dash-month-bar{height:145px!important;width:18px!important}
}


/* V3.10.3.6 - Desktop/Laptop readability refinement
   Presentation-only. Existing dashboard data, APIs and functions are unchanged. */
@media (min-width: 1201px){
  main{max-width:none!important;padding:26px 32px 40px!important}
  .management-dashboard{width:100%!important;max-width:none!important;margin:0!important;padding:8px 0 44px!important}
  .dashboard-head{margin:4px 0 22px!important;gap:30px!important}
  .dash-kicker{font-size:13px!important;letter-spacing:1.1px!important}
  .dashboard-head h1{font-size:38px!important;line-height:1.12!important;margin:5px 0 9px!important;letter-spacing:-.6px!important}
  .dashboard-head p{font-size:15px!important;line-height:1.5!important}
  .dashboard-head-actions{gap:10px!important}
  .dashboard-head-actions button{min-height:46px!important;padding:11px 18px!important;font-size:14px!important}
  .dash-kpis{grid-template-columns:repeat(4,minmax(0,1fr)) minmax(300px,1.3fr)!important;gap:18px!important;margin-bottom:18px!important}
  .management-dashboard .dash-kpi{min-height:145px!important;padding:22px 23px!important;border-radius:15px!important}
  .management-dashboard .dash-kpi span{font-size:15px!important}
  .management-dashboard .dash-kpi b{font-size:38px!important;line-height:1.08!important;margin:11px 0 8px!important}
  .management-dashboard .dash-kpi small{font-size:13px!important;line-height:1.4!important}
  .management-dashboard .dash-kpi.money b{font-size:27px!important}
  .dash-grid{grid-template-columns:minmax(0,1.7fr) minmax(360px,.8fr)!important;gap:18px!important}
  .dash-panel{padding:21px 22px!important;border-radius:15px!important}
  .dash-panel-head{margin-bottom:16px!important;gap:18px!important}
  .dash-panel-head h2{font-size:20px!important}
  .dash-panel-head span{font-size:13px!important}
  .dash-trend-controls{gap:9px!important}
  .dash-trend-controls select{height:42px!important;min-width:155px!important;font-size:14px!important;padding:7px 30px 7px 11px!important}
  .dash-trend-controls select[aria-label="Năm"]{min-width:105px!important}
  .dash-trend-controls select[aria-label="Chỉ tiêu"]{min-width:165px!important}
  .dash-chart{height:285px!important;gap:13px!important;padding:18px 10px 0!important}
  .dash-month{min-width:54px!important;gap:8px!important}
  .dash-month-bar{height:205px!important;width:32px!important;border-radius:9px 9px 4px 4px!important}
  .dash-month b{font-size:13px!important;min-height:16px!important}
  .dash-month small{font-size:12px!important}
  .dash-status{padding:14px 15px!important;border-radius:9px!important}
  .dash-status span{font-size:14px!important}
  .dash-status b{font-size:17px!important}
  .dash-company{grid-template-columns:32px minmax(0,1fr) 42px!important;padding:13px 14px!important;border-radius:9px!important}
  .dash-company .rank{width:27px;height:27px;font-size:12px!important}
  .dash-company b{font-size:14px!important}
  .dash-company small{font-size:12px!important;margin-top:3px!important}
  .dash-company strong{font-size:17px!important}
  .dash-order-row{padding:14px 15px!important;min-height:58px!important;border-radius:9px!important}
  .dash-order-row b{font-size:14px!important}
  .dash-order-row>div span{font-size:12px!important;margin-top:4px!important}
  .dash-order-row>.statuspill{min-width:145px!important;font-size:12px!important}
  .management-dashboard .overdue-row>span{font-size:14px!important}
  .management-dashboard .success-note{padding:14px!important;font-size:13px!important}
  .report-actions{gap:10px!important}
  .report-actions button{min-height:44px!important;font-size:14px!important}
}

/* Laptop widths: larger type without creating a horizontal dashboard. */
@media (min-width: 901px) and (max-width: 1200px){
  main{margin-left:220px!important;max-width:none!important;padding:22px 24px 36px!important}
  .management-dashboard{width:100%!important;max-width:none!important;padding:6px 0 36px!important}
  .dashboard-head{margin-bottom:18px!important}
  .dashboard-head h1{font-size:32px!important}
  .dashboard-head p{font-size:14px!important}
  .dashboard-head-actions button{min-height:44px!important;font-size:14px!important}
  .dash-kpis{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important}
  .management-dashboard .dash-kpi{min-height:124px!important;padding:17px 18px!important}
  .management-dashboard .dash-kpi span{font-size:14px!important}
  .management-dashboard .dash-kpi b{font-size:31px!important;margin:9px 0 6px!important}
  .management-dashboard .dash-kpi small{font-size:12px!important}
  .management-dashboard .dash-kpi.money{grid-column:1/-1!important;min-height:108px!important}
  .management-dashboard .dash-kpi.money b{font-size:24px!important}
  .dash-grid{grid-template-columns:minmax(0,1.65fr) minmax(300px,.85fr)!important;gap:14px!important}
  .dash-panel{padding:17px 18px!important}
  .dash-panel-head h2{font-size:19px!important}
  .dash-panel-head span{font-size:12px!important}
  .dash-trend-controls select{height:40px!important;min-width:138px!important;font-size:13px!important}
  .dash-chart{height:245px!important;gap:9px!important;padding:15px 7px 0!important}
  .dash-month{min-width:44px!important}
  .dash-month-bar{height:178px!important;width:27px!important}
  .dash-month b{font-size:12px!important}.dash-month small{font-size:11px!important}
  .dash-status{padding:12px 13px!important}.dash-status span{font-size:13px!important}.dash-status b{font-size:16px!important}
  .dash-company{padding:11px 12px!important}.dash-company b{font-size:13px!important}.dash-company small{font-size:11px!important}.dash-company strong{font-size:16px!important}
  .dash-order-row{padding:12px 13px!important}.dash-order-row b{font-size:13px!important}.dash-order-row>div span{font-size:11px!important}
}

/* Keep phone layout stable and touch-friendly. */
@media (max-width:700px){
  .management-dashboard{max-width:none!important}
}
\n\n/* V4.0.1 - PO dossier / branding version presentation */\n.fversion{margin-top:7px;font-size:11px;color:#8a9aac;font-weight:700;letter-spacing:.25px}\n.po-dossier-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px}\n.po-dossier-head h2{margin:3px 0 0}\n@media(max-width:700px){.po-dossier-head h2{font-size:20px}.fversion{font-size:10px}}\n

/* V4.0.2 - PO Actions click reliability fix.
   Keep Actions reachable on wide tables and prevent cell overflow from
   swallowing the action buttons. Event delegation in app.js handles clicks. */
.orders-table th:last-child,.orders-table td.order-actions{
  position:sticky!important;right:0;z-index:6;background:#fff;
}
.orders-table th:last-child{z-index:8;box-shadow:-5px 0 10px rgba(23,48,77,.06)}
.orders-table td.order-actions{overflow:visible!important;min-width:220px!important;width:220px!important;
  box-shadow:-5px 0 10px rgba(23,48,77,.04);}
.order-actions .action{position:relative;z-index:9;pointer-events:auto!important;cursor:pointer!important;
  min-width:34px;min-height:34px;display:inline-flex;align-items:center;justify-content:center;}
@media(max-width:700px){
  .mobile-order-actions{position:relative;z-index:10}
  .mobile-order-actions .action{pointer-events:auto!important;cursor:pointer!important}
}

/* V4.0.3 - Clickable PO number opens PO dossier/detail. */
.po-link{color:#1260dc;cursor:pointer;text-decoration:none;position:relative;z-index:2;}
.po-link:hover{text-decoration:underline;}
.po-link:focus{outline:2px solid #8ab4f8;outline-offset:2px;border-radius:3px;}

/* V4.1 - PO Dossier */
.po-dossier-head .hint{margin-top:4px}.dossier-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}.dossier-kpis>div{border:1px solid #dce4ef;border-radius:10px;padding:13px;background:#fbfcfe}.dossier-kpis small,.dossier-info span{display:block;color:#70859b;font-size:12px}.dossier-kpis b{display:block;margin-top:5px;font-size:17px;color:#17304d}.dossier-kpis .progressbar{margin-top:8px;width:100%;height:9px}.dossier-section{border:1px solid #dce4ef;border-radius:11px;padding:15px;margin-top:12px;background:#fff}.dossier-section h3{margin:0}.dossier-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.dossier-info{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.dossier-info>div{border-bottom:1px solid #edf1f6;padding:8px 4px}.dossier-info b{display:block;margin-top:4px;color:#17304d;overflow-wrap:anywhere}.dossier-source{margin-top:12px;padding:10px 12px;border-radius:9px;display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;border:1px solid #dce4ef}.dossier-source.ok{background:#f2fbf5}.dossier-source.warn{background:#fff8e8;border-color:#f1d58b}.dossier-source span,.dossier-source small{color:#64798e}.dossier-doc-list{display:flex;flex-direction:column;gap:7px}.dossier-doc{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #e1e7ef;border-radius:9px;padding:10px 12px;background:#fbfcfe}.dossier-doc>div:first-child{display:flex;flex-direction:column;min-width:0}.dossier-doc small{color:#70859b;margin-top:3px;overflow-wrap:anywhere}.dossier-doc-actions{display:flex;gap:6px;flex:0 0 auto}.dossier-note{margin-top:9px}.dossier-actions{margin:0}.dossier-actions button{margin:0}.po-link{cursor:pointer;text-decoration:underline;text-underline-offset:2px}.po-link:hover{filter:brightness(.8)}
body[data-theme="dark"] .dossier-kpis>div,body[data-theme="dark"] .dossier-section,body[data-theme="dark"] .dossier-doc{background:#182230;border-color:#334154}body[data-theme="dark"] .dossier-kpis b,body[data-theme="dark"] .dossier-info b{color:#e7edf5}
@media(max-width:900px){.dossier-info{grid-template-columns:repeat(2,minmax(0,1fr))}.dossier-kpis{grid-template-columns:1fr}.dossier-section-head{align-items:flex-start;flex-direction:column}.dossier-actions{width:100%;display:flex;flex-wrap:wrap}}
@media(max-width:520px){.dossier-info{grid-template-columns:1fr}.dossier-doc{align-items:flex-start;flex-direction:column}.dossier-doc-actions{width:100%}}

/* V4.1.1 - Employee Management */
.employee-page{width:100%;max-width:1600px;margin:0 auto;padding:8px 0 28px}
.employee-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px}
.employee-head h1{margin:2px 0 6px;font-size:30px;color:#0d2f57}
.employee-head p{margin:0;color:#6b7d92}
.employee-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}
.employee-stats>div{background:#fff;border:1px solid #d7e1ee;border-radius:12px;padding:16px 18px;box-shadow:0 1px 2px rgba(15,44,75,.04)}
.employee-stats span{display:block;color:#71839a;font-size:13px;margin-bottom:5px}.employee-stats b{font-size:26px;color:#0b315d}
.employee-toolbar{display:flex;gap:10px;align-items:center;background:#fff;border:1px solid #d7e1ee;border-radius:12px;padding:12px;margin-bottom:12px}.employee-toolbar input{min-width:320px;flex:1}.employee-toolbar select{min-width:150px}
.employee-table{overflow:auto;background:#fff;border:1px solid #d7e1ee;border-radius:12px}.employee-table table{min-width:1250px}.employee-table th{white-space:nowrap}.employee-table td{vertical-align:middle}.employee-status{display:inline-flex;padding:5px 10px;border-radius:999px;font-weight:700;font-size:12px}.employee-status.active{background:#d8f3dc;color:#17643a}.employee-status.inactive{background:#e9edf2;color:#667587}
.employee-table .action{margin-right:5px}
/* Dashboard status colors come from PO Status Settings */
.dash-status{border:1px solid rgba(20,50,90,.08);border-radius:9px;padding:11px 13px;display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
@media (max-width:900px){.employee-head{align-items:flex-start;flex-direction:column}.employee-head h1{font-size:25px}.employee-stats{grid-template-columns:1fr}.employee-toolbar{flex-direction:column;align-items:stretch}.employee-toolbar input,.employee-toolbar select{min-width:0;width:100%}}


/* V4.1.2 - Employee dossier upgrade */
.employee-head-actions{display:flex;gap:8px;flex-wrap:wrap}.employee-table table{min-width:1500px}.employee-table th,.employee-table td{padding:10px 12px}.employee-person{display:flex;align-items:center;gap:9px;min-width:190px}.employee-thumb{width:38px;height:38px;border-radius:50%;border:1px solid #d7e1ee;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#f5f7fb;flex:0 0 auto}.employee-thumb img{width:100%;height:100%;object-fit:cover}.employee-sensitive-note{font-size:12px;color:#6c7d90;margin:7px 0 10px}.employee-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.employee-form-grid label{display:flex;flex-direction:column;gap:5px;font-weight:600;color:#38506a}.employee-form-grid .wide{grid-column:1/-1}.employee-form-grid small{font-weight:400;color:#7a8da2}.employee-photo-preview{display:flex;align-items:center;gap:10px;margin-top:7px}.employee-photo-preview img{width:100px;height:90px;object-fit:cover;border:1px solid #d7e1ee;border-radius:8px}.employee-check{width:18px;height:18px;accent-color:#1967e8}.employee-toolbar button{white-space:nowrap}
@media(max-width:900px){.employee-form-grid{grid-template-columns:1fr}.employee-form-grid .wide{grid-column:auto}.employee-head-actions{width:100%}.employee-head-actions button{flex:1}.employee-toolbar button{width:100%}}


/* V4.2.0 - Advanced management analytics */
.v42-analytics{grid-column:1/-1}.analytics-filterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:11px 12px;margin:4px 0 14px;background:#f7f9fc;border:1px solid #e1e7ef;border-radius:10px}.analytics-filterbar input,.analytics-filterbar select{min-width:145px;height:38px}.analytics-filter-label{font-weight:700;color:#496078;margin-right:2px}.analytics-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.analytics-kpis>div{border:1px solid #dce4ef;border-radius:10px;padding:12px 14px;background:#fff}.analytics-kpis span,.analytics-kpis small{display:block;color:#71859a;font-size:12px}.analytics-kpis b{display:block;color:#17304d;font-size:20px;margin:6px 0}.analytics-kpis .progressbar{width:100%;height:8px}.analytics-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.analytics-box{border:1px solid #dce4ef;border-radius:10px;padding:13px 14px;background:#fff}.analytics-box h3{margin:0 0 11px;color:#17304d;font-size:15px}.analytics-wide{grid-column:1/-1}.analytics-row{display:grid;grid-template-columns:75px 1fr 32px;gap:8px;align-items:center;margin:9px 0}.analytics-row>span{font-size:12px;color:#536b82}.analytics-row>b{text-align:right;font-size:12px}.analytics-bar{height:9px;border-radius:999px;background:#e8edf4;overflow:hidden}.analytics-bar i{display:block;height:100%;border-radius:999px;background:#2670e8}.risk-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.risk-card{border:1px solid #e0e6ee;border-radius:9px;padding:11px;background:#f9fbfd}.risk-card span{display:block;color:#687d92;font-size:12px}.risk-card b{font-size:20px;color:#17304d}.risk-card.danger{border-color:#f0c4c4;background:#fff6f6}.risk-card.danger b{color:#c62828}.risk-card.warn{border-color:#efd99a;background:#fffaf0}.analytics-company-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.analytics-company{display:flex;gap:9px;align-items:center;border:1px solid #e5eaf1;border-radius:8px;padding:9px 10px}.analytics-company>span{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#edf3fb;color:#35618f;font-weight:700;font-size:11px}.analytics-company div{min-width:0}.analytics-company b,.analytics-company small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.analytics-company b{font-size:13px;color:#17304d}.analytics-company small{font-size:11px;color:#71859a;margin-top:2px}
body[data-theme="dark"] .analytics-filterbar,body[data-theme="dark"] .analytics-kpis>div,body[data-theme="dark"] .analytics-box,body[data-theme="dark"] .risk-card,body[data-theme="dark"] .analytics-company{background:#182230;border-color:#334154}body[data-theme="dark"] .analytics-kpis b,body[data-theme="dark"] .analytics-box h3,body[data-theme="dark"] .analytics-company b,body[data-theme="dark"] .risk-card b{color:#e7edf5}
@media(max-width:900px){.analytics-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-grid{grid-template-columns:1fr}.analytics-wide{grid-column:auto}.analytics-company-list{grid-template-columns:1fr}.analytics-filterbar{align-items:stretch}.analytics-filterbar input,.analytics-filterbar select,.analytics-filterbar button{width:100%}}
@media(max-width:520px){.analytics-kpis{grid-template-columns:1fr}.risk-grid{grid-template-columns:1fr}}

/* V4.2.2 - Advanced Analytics top placement */
.analytics-top-panel{margin-bottom:14px;border-width:1px}
.analytics-top-panel.analytics-open{animation:analyticsReveal .16s ease-out}
@keyframes analyticsReveal{from{opacity:.72;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}

/* V4.3.0 - Service / Sales */
.business-type-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}
.business-type-badge.service{background:#e8f1ff}
.business-type-badge.sales{background:#fff0bf}
.po-type-choice{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:18px}
.po-type-choice button{min-height:88px;font-size:16px;font-weight:700}
.business-split-panel{margin:14px 0}
.business-split-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.business-split-card{border:1px solid #d7e2f0;border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.business-split-card.service{background:#f1f7ff}.business-split-card.sales{background:#fff9e8}
.business-split-card span{font-weight:700}.business-split-card b{font-size:20px}.business-split-card small{opacity:.75}
@media(max-width:700px){.po-type-choice,.business-split-grid{grid-template-columns:1fr}}

/* V4.3.1 PATCH - preserve V4.3.0 functionality and restore quick-action modal UX */
.quick-modalbox{position:relative;max-height:88vh;overflow:auto}
.quick-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.quick-modal-head h2{margin:0 0 6px}.quick-modal-head .hint{margin:0}
.business-type-badge{min-width:92px;justify-content:center}
@media(max-width:700px){.quick-modalbox{max-height:92vh}.quick-modal-head{position:sticky;top:-16px;background:#fff;padding-top:2px;z-index:2}}

/* V4.4.0 - Sales / Equipment Dossier */
.sales-equipment-fields{border:1px solid #dce4ef;border-radius:10px;padding:12px;background:#f8fafc}.sales-equipment-fields h3{margin:0 0 10px;color:#17304d}.equipment-images{margin-top:14px}.equipment-image-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.equipment-image-card{position:relative;border:1px solid #dce4ef;border-radius:10px;overflow:hidden;background:#fff}.equipment-image-card img{width:100%;height:150px;object-fit:cover;display:block}.equipment-image-card>div{padding:7px 9px}.equipment-image-card small{display:block;color:#71859a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.equipment-image-card .action{position:absolute;right:7px;top:7px}.business-split-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.business-split-card.total{background:#f4f7fb}
@media(max-width:1000px){.equipment-image-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.business-split-grid{grid-template-columns:1fr}.equipment-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sales-equipment-fields .order-grid{grid-template-columns:1fr}}
.equipment-lifecycle-list{display:grid;gap:12px;margin-top:10px}.lifecycle-card{display:grid;grid-template-columns:1.2fr repeat(4,minmax(130px,1fr)) auto;gap:10px;align-items:end;padding:14px;border:1px solid #dfe6ef;border-radius:12px;background:#fbfcfe}.lifecycle-card>div{display:flex;flex-direction:column;gap:4px}.lifecycle-card>div span{font-size:12px;color:#667085}.lifecycle-card label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:600}.lifecycle-card input,.lifecycle-card select{min-height:38px}.equipment-lifecycle-list .badge{display:inline-flex}.tablebox table td,.tablebox table th{vertical-align:middle}@media(max-width:1100px){.lifecycle-card{grid-template-columns:1fr 1fr}.lifecycle-card>div{grid-column:1/-1}}@media(max-width:700px){.lifecycle-card{grid-template-columns:1fr}.lifecycle-card>div{grid-column:auto}}

/* V4.5.1 - Warranty alerts and management */
.warranty-dashboard-panel{grid-column:1/-1}.warranty-alert-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.warranty-alert-card{border:1px solid #dce4ef;border-radius:10px;padding:12px 14px;background:#f8fafc;cursor:pointer}.warranty-alert-card span{display:block;color:#63788f;font-size:12px}.warranty-alert-card b{display:block;margin-top:5px;font-size:22px;color:#17304d}.warranty-alert-card.danger{border-color:#f1c5c5;background:#fff6f6}.warranty-alert-card.danger b{color:#c62828}.warranty-alert-card.warn{border-color:#efd99a;background:#fffaf0}.warranty-alert-card.caution{border-color:#e6d5a8;background:#fffdf3}.warranty-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:14px 0}.warranty-kpi{border:1px solid #dce4ef;border-radius:10px;padding:12px 14px;text-align:left;background:#fff;cursor:pointer}.warranty-kpi.active{outline:2px solid #2670e8;outline-offset:-2px}.warranty-kpi span{display:block;color:#667b90;font-size:12px}.warranty-kpi b{display:block;margin-top:4px;font-size:22px;color:#17304d}.warranty-status{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}.warranty-status.expired{background:#fde2e2;color:#b42318}.warranty-status.due_7{background:#fff0d6;color:#9a6700}.warranty-status.due_30{background:#fff8df;color:#806500}.warranty-status.active{background:#dff4e5;color:#167044}.warranty-status.missing{background:#edf1f5;color:#5f6b78}.warranty-page .tablebox{overflow:auto}.warranty-page table{min-width:1250px}.warranty-page .admin-page-top .actions{display:flex;gap:8px}
body[data-theme="dark"] .warranty-alert-card,body[data-theme="dark"] .warranty-kpi{background:#182230;border-color:#334154}body[data-theme="dark"] .warranty-alert-card b,body[data-theme="dark"] .warranty-kpi b{color:#e7edf5}
@media(max-width:1000px){.warranty-alert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.warranty-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.warranty-alert-grid,.warranty-kpis{grid-template-columns:1fr}}

/* V4.6.0 - automatic warranty workflow */
.warranty-auto-note{display:block;margin-top:4px;font-size:11px;color:#6a7c90}.order-grid label input[readonly]{background:#f3f6fa;color:#17304d;font-weight:600}

.notification-wrap{position:relative;display:flex;align-items:center}.notification-bell{position:relative;width:42px;height:42px;padding:8px 0!important;font-size:19px;display:grid;place-items:center}.bell-icon{line-height:1}.bell-badge{position:absolute;top:2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:10px;background:#e52f3a;color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;border:2px solid #fff}.notification-menu{position:absolute;right:0;top:50px;width:330px;background:#fff;border:1px solid #dce4ef;border-radius:10px;box-shadow:0 12px 30px rgba(20,45,80,.16);padding:8px;display:none;z-index:30}.notification-menu.open{display:block}.notification-title{font-weight:700;padding:8px 10px;border-bottom:1px solid #edf1f6;margin-bottom:4px}.notification-item{width:100%;display:grid;grid-template-columns:10px 1fr auto;gap:10px;align-items:center;text-align:left;background:#fff;color:#17304d;padding:10px;border-radius:8px}.notification-item:hover{background:#f4f7fb}.notification-item small{display:block;color:#71869e;margin-top:3px;font-size:12px}.notification-item strong{font-size:16px}.notification-dot{width:8px;height:8px;border-radius:50%;background:#e5a900}.notification-item.deadline .notification-dot{background:#d52c36}.notification-empty{padding:18px 10px;color:#71869e;text-align:center}.service-repair-fields{border:1px solid #dce4ef;border-radius:10px;padding:14px;background:#fbfcfe}.service-repair-fields h3{margin:0 0 6px}.edit-focus{animation:editFocus 1.8s ease}@keyframes editFocus{0%,100%{box-shadow:0 0 0 0 rgba(25,103,232,0)}20%,70%{box-shadow:0 0 0 4px rgba(25,103,232,.16)}}
@media(max-width:700px){.notification-menu{right:-70px;width:min(320px,calc(100vw - 30px))}}

.finance-summary-panel{margin-top:12px}.dossier-financial-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.dossier-financial-grid>div{border:1px solid #dbe4ef;border-radius:10px;padding:12px;background:#f8fafc;display:flex;flex-direction:column;gap:5px}.dossier-financial-grid .profit{background:#eefbf3}.dossier-financial-grid span{font-size:12px;color:#60748b}.dossier-financial-grid b{font-size:16px}.dossier-cost-list{margin-top:10px;display:grid;gap:6px}.dossier-cost-list>div{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;border-top:1px solid #edf1f6;padding:8px}.dossier-cost-list .action{padding:4px 8px}@media(max-width:800px){.dossier-financial-grid{grid-template-columns:1fr 1fr}}

/* V4.7.2 PO dossier: open as fixed modal so clicking a PO never scrolls the page. */
#panel .quick-modalbox{width:min(1100px,94vw);max-height:92vh;overflow:auto;padding:24px;}
#panel .po-dossier-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;position:sticky;top:-24px;background:#fff;padding:4px 0 14px;z-index:2;border-bottom:1px solid #e5eaf1;margin-bottom:14px;}
#panel .po-dossier-head-actions{display:flex;align-items:center;gap:8px;}
#panel .po-dossier-head-actions button{padding:8px 11px;}
#panel .dossier-section{scroll-margin-top:80px;}


/* V4.7.4 MOBILE RECOVERY FIX - PC/Laptop layout is unchanged. */
.mobile-menu-btn,.mobile-nav-overlay{display:none}
@media(max-width:700px){
  body{overflow-x:hidden}
  header{height:auto;min-height:116px;padding:10px 12px 12px;display:grid;grid-template-columns:auto 1fr auto auto auto;grid-template-rows:44px 44px;gap:8px;position:sticky;top:0;z-index:50}
  .mobile-menu-btn{display:grid!important;place-items:center;width:40px;height:40px;padding:0;font-size:20px;grid-column:1;grid-row:1}
  .logo{font-size:22px;align-self:center;grid-column:2;grid-row:1;white-space:nowrap}
  .title{display:none}
  header>#me{grid-column:3;grid-row:1;align-self:center;font-size:12px;white-space:nowrap;max-width:78px;overflow:hidden;text-overflow:ellipsis}
  .notification-wrap{grid-column:4;grid-row:1}
  .notification-bell{width:40px;height:40px}
  header>.lang-select{grid-column:5;grid-row:1;width:42px;min-width:42px;max-width:42px;height:40px;padding:7px 3px;font-size:0}
  header>.lang-select option{font-size:14px}
  header>button.ghost:last-child{position:absolute;right:12px;top:56px;width:40px;height:40px;padding:0;font-size:18px}
  .search{grid-column:1/-1;grid-row:2;width:100%;max-width:none;margin:0}
  .search input{height:42px;font-size:14px}
  aside{top:0;bottom:0;left:0;width:min(280px,82vw);padding:18px 14px;z-index:60;overflow-y:auto;overflow-x:hidden;transform:translateX(-105%);transition:transform .22s ease;box-shadow:8px 0 28px rgba(20,45,80,.18)}
  body.mobile-nav-open aside{transform:translateX(0)}
  .mobile-nav-overlay{position:fixed;inset:0;background:rgba(12,29,48,.42);z-index:55}
  body.mobile-nav-open .mobile-nav-overlay{display:block}
  .footer-brand{position:relative;left:auto!important;bottom:auto!important;width:auto!important;margin:30px 4px 10px;font-size:11px}
  main{margin-left:0;padding:16px 12px 28px;max-width:none;width:100%;overflow:hidden}
  .cards{grid-template-columns:1fr;gap:10px}
  .card{padding:15px 16px}
  .card b{font-size:22px}
  .storage{padding:15px 16px}
  .toolbar{gap:7px;flex-wrap:wrap;margin:12px 0 10px}
  .toolbar button{flex:1 1 auto;min-width:0}
  .crumb{width:100%;margin-left:0;order:5}
  .drop{padding:18px 12px}
  .tablebox{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .tablebox table{min-width:720px}
  .order-cards{grid-template-columns:1fr}
  .order-toolbar{padding:10px}
  .order-filter-row,.order-action-row{width:100%}
  .order-filter-row>input,.order-filter-row>select,.order-filter-row .date-filter,.order-filter-row .date-filter input{width:100%!important;min-width:0}
  .order-action-row button{flex:1 1 46%;min-width:120px}
  .orders-tablebox{max-height:none;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .orders-table{min-width:1400px}
  .modal{padding:10px}
  .modalbox{width:100%;max-width:none;max-height:calc(100vh - 20px);padding:16px}
  .quick-modalbox{max-height:calc(100vh - 20px);overflow:auto}
  .row,.order-grid{grid-template-columns:1fr}
  .business-split-grid,.dossier-financial-grid{grid-template-columns:1fr}
  .equipment-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .warranty-alert-grid,.warranty-kpis{grid-template-columns:1fr}
  .analytics-kpis{grid-template-columns:1fr}
  .analytics-filterbar input,.analytics-filterbar select,.analytics-filterbar button{width:100%}
  .notification-menu{position:fixed;right:10px;top:58px;width:min(330px,calc(100vw - 20px));max-height:70vh;overflow:auto}
}
@media(max-width:420px){
  header{grid-template-columns:40px 1fr 40px 42px;grid-template-rows:42px 44px}
  .logo{grid-column:2;font-size:20px}
  header>#me{display:none}
  .notification-wrap{grid-column:3}
  header>.lang-select{grid-column:4}
  main h1{font-size:27px}
  main h2{font-size:21px}
}
@media(min-width:701px){.mobile-menu-btn{display:none!important}}

.finance-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:16px 0}.finance-kpi{background:#fff;border:1px solid #e4e9f0;border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:8px}.finance-kpi span{font-size:13px;color:#6b7280}.finance-kpi b{font-size:20px}.finance-kpi.profit b{font-size:22px}.finance-filterbar{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:16px 0;padding:14px;background:#fff;border:1px solid #e4e9f0;border-radius:14px}.finance-filterbar label{display:flex;flex-direction:column;gap:5px;font-size:12px}.finance-filterbar input,.finance-filterbar select{min-height:38px;padding:7px 10px;border:1px solid #d8dee8;border-radius:8px}.finance-breakdown{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.finance-breakdown>div{padding:14px;border:1px solid #e7ebf0;border-radius:10px;display:flex;justify-content:space-between}.finance-breakdown span{color:#667085}@media(max-width:700px){.finance-kpis{grid-template-columns:1fr 1fr}.finance-breakdown{grid-template-columns:1fr}.finance-filterbar{align-items:stretch}.finance-filterbar label,.finance-filterbar input,.finance-filterbar select{width:100%}}

/* V4.7.13 - PO equipment image viewer/download */
.equipment-image-preview{display:block;width:100%;padding:0;background:#f7f9fc;border-radius:0;color:inherit;overflow:hidden}
.equipment-image-preview:hover{filter:none;background:#eef4fb}
.equipment-image-preview img{cursor:zoom-in;transition:transform .16s ease}
.equipment-image-preview:hover img{transform:scale(1.025)}
.equipment-image-actions{display:flex;gap:6px;align-items:center;margin-top:7px;flex-wrap:wrap}
.equipment-image-actions .action{display:inline-flex;align-items:center;text-decoration:none;font-size:12px;margin:0;padding:6px 8px}
.equipment-image-delete{z-index:3}
.image-viewer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.image-viewer-head h2{margin:0 0 5px}
.image-viewer-head .hint{margin:0;word-break:break-all}
.image-viewer-stage{display:flex;align-items:center;justify-content:center;min-height:260px;max-height:68vh;padding:12px;background:#101820;border-radius:10px;overflow:auto}
.image-viewer-stage img{display:block;max-width:100%;max-height:64vh;width:auto;height:auto;object-fit:contain;border-radius:6px}
.image-viewer-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:12px}
.image-viewer-actions a{display:inline-flex;align-items:center;text-decoration:none}
@media(max-width:700px){.image-viewer-stage{min-height:220px;max-height:64vh}.image-viewer-stage img{max-height:58vh}.equipment-image-actions .action{font-size:11px;padding:6px 7px}}


/* V4.7.13 IMAGE VIEWER MODAL FIX: viewer is a child overlay and must not replace/close the PO dossier */
.image-viewer-overlay{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.72)}
.image-viewer-dialog{width:min(1100px,96vw);max-height:94vh;overflow:auto;background:#fff;border-radius:14px;padding:20px;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.image-viewer-overlay .image-viewer-stage{max-height:72vh;min-height:260px}
.image-viewer-overlay .image-viewer-stage img{max-height:68vh;max-width:100%}
.image-viewer-overlay .image-viewer-head{position:sticky;top:0;background:#fff;z-index:2;padding-bottom:8px}
body.image-viewer-open{overflow:hidden}
@media(max-width:700px){.image-viewer-overlay{padding:8px}.image-viewer-dialog{width:100%;max-height:96vh;padding:12px;border-radius:10px}.image-viewer-overlay .image-viewer-stage{min-height:220px;max-height:70vh}.image-viewer-overlay .image-viewer-stage img{max-height:64vh}}

/* V4.7.13 MOBILE WORKSPACE FINAL - Android/iOS only.
   PC/Laptop layout remains unchanged because every rule is mobile-scoped. */
@media (max-width:700px){
  /* Mobile workspace is a compact left drawer, not a full-width panel. */
  aside{
    top:0 !important;
    bottom:0 !important;
    left:0 !important;
    right:auto !important;
    width:min(250px,78vw) !important;
    height:100vh !important;
    min-height:100vh !important;
    padding:16px 10px 20px !important;
    display:block !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch;
    transform:translateX(-105%);
    transition:transform .22s ease;
    z-index:60 !important;
    box-shadow:8px 0 28px rgba(20,45,80,.20);
  }
  body.mobile-nav-open aside{transform:translateX(0) !important}
  aside .section{
    display:block !important;
    margin:4px 8px 8px !important;
    font-size:11px;
    font-weight:700;
    letter-spacing:.4px;
  }
  aside button{
    display:block !important;
    width:100% !important;
    min-height:42px;
    margin:2px 0 !important;
    padding:9px 10px !important;
    text-align:left !important;
    white-space:normal !important;
    font-size:14px !important;
    line-height:1.25;
    border-radius:8px;
  }
  aside .adminOnly.section{margin-top:16px !important}
  aside #footerBrand{
    display:block !important;
    position:relative !important;
    left:auto !important;
    bottom:auto !important;
    width:auto !important;
    margin:18px 6px 6px !important;
    font-size:10px;
  }
  .mobile-nav-overlay{z-index:55 !important}
  body.mobile-nav-open{overflow:hidden}

  /* Keep the PO dossier usable on narrow Android/iOS screens. */
  #panel .quick-modalbox{
    width:100% !important;
    max-width:none !important;
    max-height:calc(100vh - 12px) !important;
    padding:12px !important;
  }
  #panel .po-dossier-head{
    gap:8px !important;
    top:-12px !important;
    padding:2px 0 10px !important;
  }
  #panel .po-dossier-head h2{font-size:20px;word-break:break-word}
  #panel .po-dossier-head-actions{flex:0 0 auto}

  /* Image cards: touch-friendly and fully visible on mobile. */
  .equipment-image-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:8px !important}
  .equipment-image-card{min-width:0 !important;overflow:hidden}
  .equipment-image-preview{width:100%;min-width:0;padding:0;background:#fff;display:block}
  .equipment-image-preview img{display:block;width:100%;height:150px;object-fit:cover}
  .equipment-image-actions{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
  .equipment-image-actions .action{margin:0;flex:1 1 100px;min-height:38px;text-align:center}
  .equipment-image-card>div small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Viewer stays above the dossier and closing it never touches #panel. */
  .image-viewer-overlay{padding:8px !important}
  .image-viewer-dialog{width:100% !important;max-width:none !important;max-height:96vh !important;padding:10px !important}
  .image-viewer-overlay .image-viewer-stage{min-height:180px !important;max-height:72vh !important}
  .image-viewer-overlay .image-viewer-stage img{max-width:100% !important;max-height:68vh !important;object-fit:contain}
  .image-viewer-actions{display:flex;flex-wrap:wrap;gap:6px}
  .image-viewer-actions .action,.image-viewer-actions button{flex:1 1 110px;min-height:40px;text-align:center}
}
@media (max-width:420px){
  aside{width:min(238px,82vw) !important}
  .equipment-image-grid{grid-template-columns:1fr 1fr !important}
  .equipment-image-preview img{height:128px}
}


/* V4.8.1 - Live server status indicator */
.server-status{display:inline-flex;align-items:center;gap:7px;min-width:88px;padding:7px 11px;border:1px solid #dce4ef;border-radius:999px;background:#f7f9fc;color:#536b84;font-size:12px;font-weight:700;white-space:nowrap;cursor:default;user-select:none}
.server-status-dot{width:9px;height:9px;border-radius:50%;background:#9aa8b7;box-shadow:0 0 0 3px rgba(154,168,183,.12);flex:0 0 auto}
.server-status.status-checking .server-status-dot{background:#9aa8b7;animation:serverStatusPulse 1.2s ease-in-out infinite}
.server-status.status-online{border-color:#bfe4cc;background:#f0fbf3;color:#176b35}
.server-status.status-online .server-status-dot{background:#22a447;box-shadow:0 0 0 3px rgba(34,164,71,.13)}
.server-status.status-warning{border-color:#ead7a4;background:#fff9e9;color:#8a6500}
.server-status.status-warning .server-status-dot{background:#e2a400;box-shadow:0 0 0 3px rgba(226,164,0,.13)}
.server-status.status-offline{border-color:#efc1c6;background:#fff2f3;color:#b4232f}
.server-status.status-offline .server-status-dot{background:#d92d3f;box-shadow:0 0 0 3px rgba(217,45,63,.13)}
@keyframes serverStatusPulse{0%,100%{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1.08)}}
@media(max-width:700px){
  .server-status{position:absolute;left:135px;top:15px;min-width:78px;padding:6px 9px;font-size:11px;gap:5px}
  .server-status-dot{width:8px;height:8px}
}
@media(max-width:360px){
  .server-status{left:128px;min-width:72px;padding:6px 8px}
  .server-status-text{max-width:46px;overflow:hidden;text-overflow:ellipsis}
}


/* V4.8.2 - Server Monitor */
.server-status{cursor:pointer;transition:.15s}.server-status:hover{filter:brightness(.98);transform:translateY(-1px)}
.server-monitor-overlay{position:fixed;inset:0;z-index:10000;background:rgba(15,28,45,.48);display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(2px)}
.server-monitor-dialog{width:min(760px,96vw);max-height:min(88vh,760px);overflow:auto;background:#fff;border-radius:18px;box-shadow:0 24px 70px rgba(15,28,45,.28);padding:18px}.server-monitor-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.server-monitor-head h2{margin:0;font-size:20px}.server-monitor-head small{color:#6b7b8e}.server-monitor-state{display:flex;align-items:center;gap:9px;margin:16px 0;padding:12px 14px;border-radius:12px}.server-monitor-state.online{background:#eefaf1;color:#176b35}.server-monitor-state.warning{background:#fff8e7;color:#8a6500}.server-monitor-state.offline{background:#fff0f2;color:#b4232f}.server-monitor-state small{margin-left:auto}.server-monitor-dot{width:11px;height:11px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px rgba(0,0,0,.05)}.server-monitor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.server-monitor-metric{border:1px solid #e5eaf1;border-radius:12px;padding:12px 13px;background:#fafbfd;display:flex;flex-direction:column;gap:6px}.server-monitor-metric span:first-child{font-size:12px;color:#718096}.server-monitor-metric b{font-size:15px;color:#243b53}.monitor-ok{font-size:13px;color:#176b35}.monitor-bad{font-size:13px;color:#b4232f}.server-monitor-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px;color:#718096;font-size:12px}.server-monitor-foot .action{min-height:36px}
@media(max-width:700px){.server-monitor-overlay{padding:10px}.server-monitor-dialog{width:100%;max-height:92vh;border-radius:15px;padding:13px}.server-monitor-grid{grid-template-columns:1fr 1fr;gap:8px}.server-monitor-metric{padding:10px}.server-monitor-state{flex-wrap:wrap}.server-monitor-state small{margin-left:20px;width:100%}.server-monitor-foot{flex-wrap:wrap}}@media(max-width:380px){.server-monitor-grid{grid-template-columns:1fr}.server-monitor-head h2{font-size:18px}}


/* V4.8.9 Daily Report + Service Case UI */
.daily-report-form-panel{padding:18px 20px}
.daily-report-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.daily-report-grid label{display:flex;flex-direction:column;gap:7px;min-width:0;color:#17304d;font-weight:600}
.daily-report-grid label.wide{grid-column:1/-1}
.daily-report-grid input,.daily-report-grid textarea{width:100%;box-sizing:border-box;border:1px solid #cfd9e7;border-radius:10px;padding:11px 12px;font:inherit;font-weight:400;background:#fff;color:#17304d}
.daily-report-grid textarea{min-height:130px;resize:vertical;line-height:1.45}
.daily-engineer-field{background:#f5f9ff;border:1px solid #d6e3f2;border-radius:12px;padding:14px}
.daily-engineer-field input{font-size:16px;font-weight:600}
.daily-po-field{margin-top:2px}
.daily-report-actions{justify-content:flex-end;margin-top:18px}
.daily-report-actions button{min-width:190px}
.service-case-card{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border:1px solid #dce4ef;border-radius:10px;padding:12px 14px;margin-top:8px;background:#fbfcfe}
.service-case-card b{color:#17304d}
.service-case-note{margin-top:7px;color:#5e7389;white-space:pre-wrap;line-height:1.4;max-height:150px;overflow:auto}
.service-case-meta{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.service-case-meta .badge.open{background:#e8f8ee;color:#157347}
.service-case-meta .badge.in_progress{background:#fff3cd;color:#856404}
.service-case-meta .badge.completed{background:#e8eef8;color:#315d9b}
.service-case-meta .badge.cancelled{background:#f1f3f5;color:#6c757d}
@media(max-width:900px){
  .daily-report-grid{grid-template-columns:1fr;gap:12px}
  .daily-report-grid label.wide{grid-column:auto}
  .daily-report-form-panel{padding:13px}
  .daily-report-grid textarea{min-height:115px}
  .daily-report-actions button{width:100%;min-width:0}
  .service-case-card{flex-direction:column}
  .service-case-meta{width:100%;justify-content:space-between}
  .daily-summary-table{overflow-x:auto}
  .daily-summary-table table{min-width:720px}
}

/* V4.8.10 - Daily Report management summary */
.daily-dashboard-summary .dash-panel-head{align-items:flex-start}
.daily-dashboard-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0}
.daily-dashboard-kpis>div{border:1px solid #dfe7f1;border-radius:10px;padding:10px 12px;background:#f8fbff;display:flex;justify-content:space-between;gap:10px}
.daily-dashboard-kpis span{color:#6b7b8e;font-size:13px}.daily-dashboard-kpis b{font-size:18px;color:#17304d}
.daily-dashboard-list{display:flex;flex-direction:column;gap:8px}
.daily-dashboard-row{display:flex;justify-content:space-between;align-items:center;gap:14px;border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px;background:#fff}
.daily-dashboard-row>div:first-child{min-width:0;display:flex;flex-direction:column;gap:4px}.daily-dashboard-row b{color:#17304d}.daily-dashboard-row span{color:#5e7389;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:700px}.daily-dashboard-row>div:last-child{display:flex;align-items:center;gap:10px;flex:0 0 auto}.daily-dashboard-row small{color:#6b7b8e}
@media(max-width:700px){.daily-dashboard-kpis{grid-template-columns:1fr}.daily-dashboard-row{align-items:flex-start;flex-direction:column}.daily-dashboard-row>div:last-child{width:100%;justify-content:space-between}.daily-dashboard-row span{max-width:100%}.daily-dashboard-summary .dash-panel-head{flex-direction:column}.daily-dashboard-summary .report-actions{width:100%;flex-wrap:wrap}.daily-dashboard-summary .report-actions button{flex:1;min-width:120px}}

/* V4.8.12 - health endpoint + robust frontend error handling */
/* V4.8.11 - full-size equipment image viewer */
.equipment-image-card img{cursor:zoom-in}
.equipment-image-full-wrap{display:flex;align-items:center;justify-content:center;min-height:300px;max-height:70vh;overflow:auto;background:#111827;border-radius:12px;padding:12px}
.equipment-image-full{display:block;max-width:100%;max-height:68vh;width:auto;height:auto;object-fit:contain;cursor:zoom-in;border-radius:6px}
@media(max-width:700px){.equipment-image-full-wrap{min-height:220px;max-height:72vh;padding:6px}.equipment-image-full{max-height:70vh;max-width:100%}}

/* V4.8.13 - Daily Report polish + true original-image zoom */
.daily-work-field{min-width:0}
.daily-work-field .daily-date-hint{font-size:12px;font-weight:500;color:#6b7b8e;margin-top:-2px}
.daily-report-grid .daily-work-field textarea{min-height:150px}
@media(min-width:901px){.daily-report-form-panel{max-width:1180px;margin:0 auto}.daily-report-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.daily-report-grid .daily-engineer-field,.daily-report-grid .daily-po-field{grid-column:1/-1}.daily-report-grid textarea{min-height:155px}.daily-report-actions{justify-content:flex-end}.daily-report-actions button{min-width:220px}}
@media(max-width:700px){.daily-report-grid{gap:10px}.daily-report-grid .daily-work-field textarea{min-height:120px}.daily-report-actions{position:sticky;bottom:8px;z-index:5;background:rgba(255,255,255,.94);padding-top:8px}.daily-report-actions button{min-height:48px;font-size:16px}}
.image-viewer-stage.zoomed{align-items:flex-start;justify-content:flex-start;overflow:auto;cursor:zoom-out}
.image-viewer-stage.zoomed img{max-width:none!important;max-height:none!important;width:auto!important;height:auto!important;object-fit:initial;cursor:zoom-out}
.image-viewer-overlay .image-viewer-stage{scrollbar-width:thin}

/* V4.8.16 Daily Report responsive polish */
.daily-report-page{width:100%;box-sizing:border-box}
.daily-report-form-panel{width:100%;box-sizing:border-box}
.daily-report-grid .daily-work-field{min-width:0}
.daily-work-field>span{font-size:15px;font-weight:800}
.daily-date-hint{display:inline-block;width:max-content;max-width:100%;padding:3px 8px;border-radius:999px;background:#eef5ff;color:#41627f;font-size:12px;font-weight:700}
.daily-report-grid textarea{min-width:0;box-sizing:border-box}
@media(min-width:1101px){.daily-report-form-panel{max-width:1320px}.daily-report-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.daily-report-grid textarea{min-height:170px}.daily-report-actions{justify-content:flex-end}.daily-report-actions button{min-width:230px}}
@media(min-width:701px) and (max-width:1100px){.daily-report-form-panel{max-width:100%;padding:16px}.daily-report-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.daily-report-grid textarea{min-height:150px}}
@media(max-width:700px){.daily-report-page{padding:0 2px}.daily-report-form-panel{padding:12px;border-radius:12px}.daily-report-grid{grid-template-columns:1fr;gap:10px}.daily-report-grid label.wide{grid-column:auto}.daily-report-grid input,.daily-report-grid textarea{font-size:16px;padding:12px}.daily-report-grid textarea{min-height:120px}.daily-engineer-field{padding:12px}.daily-report-actions{position:sticky;bottom:8px;z-index:20;margin:12px -2px 0;padding:8px 0;background:rgba(255,255,255,.96);backdrop-filter:blur(6px)}.daily-report-actions button{width:100%;min-width:0;min-height:50px;font-size:16px}.daily-summary-table{overflow-x:auto}.daily-summary-table table{min-width:700px}}

/* V4.8.18 Daily Report + notification history */
.daily-report-summary-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-top:22px}.daily-report-summary-toolbar .actions{display:flex;gap:8px;flex-wrap:wrap}.daily-report-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.daily-report-grid label{display:flex;flex-direction:column;gap:6px}.daily-report-grid .wide{grid-column:1/-1}.daily-report-grid textarea{min-height:120px;resize:vertical}.daily-report-grid input,.daily-report-grid textarea{width:100%;box-sizing:border-box}.daily-date-hint{font-size:12px;color:#71869e}.notification-toolbar{display:flex;gap:6px;padding:6px 4px;border-bottom:1px solid #edf1f6;margin-bottom:4px}.notification-toolbar button{font-size:11px;padding:6px 8px}.notification-history-table{max-height:70vh;overflow:auto}.service-case-section{margin-top:16px}.service-case-card{display:flex;justify-content:space-between;gap:12px;padding:12px;border:1px solid #dce4ef;border-radius:10px;background:#fbfcfe;margin:8px 0}.service-case-note{margin-top:6px;white-space:pre-wrap;color:#4d6178;font-size:13px}.service-case-meta{display:flex;gap:8px;align-items:flex-start;white-space:nowrap}@media(max-width:1000px){.daily-report-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.daily-report-grid{grid-template-columns:1fr}.daily-report-grid .wide{grid-column:auto}.daily-report-summary-toolbar{align-items:flex-start}.daily-report-summary-toolbar .actions{width:100%}.daily-report-summary-toolbar button{flex:1}.service-case-card{flex-direction:column}.notification-toolbar{flex-wrap:wrap}}

/* V4.8.20 Daily Report: compact service-report style */
.daily-report-form-panel{background:#fff;border:1px solid #dfe7f1;border-radius:14px}
.daily-report-grid .daily-engineer-field{grid-column:1/-1}
.daily-report-grid .daily-engineer-field input{font-size:17px;font-weight:600}
.daily-report-grid label span{font-weight:600}
.daily-report-grid .daily-work-field textarea{background:#fbfcfe}
.daily-summary-table th{white-space:nowrap}
@media(max-width:700px){
  .daily-report-page{padding:0 8px}
  .daily-report-grid{grid-template-columns:1fr 1fr;gap:8px}
  .daily-report-grid .daily-engineer-field,.daily-report-grid .daily-work-field,.daily-report-grid .daily-po-field{grid-column:1/-1}
  .daily-report-grid input{min-height:46px;font-size:16px}
  .daily-report-grid textarea{min-height:115px;font-size:16px}
  .daily-report-grid label:nth-child(2),.daily-report-grid label:nth-child(3){grid-column:span 1}
  .daily-report-summary-toolbar{position:sticky;top:0;background:#f7f9fc;z-index:4;padding:8px 0}
}

/* V4.8.23 - Home dashboard navigation/layout only. Existing functions/data unchanged. */
.nav-group{margin:0 0 8px}.nav-group-toggle{display:flex!important;align-items:center;justify-content:space-between;width:100%;padding:9px 10px!important;margin:0!important;border-radius:8px;background:transparent!important;color:#7a8da3!important;font-size:11px!important;font-weight:800!important;letter-spacing:.2px}.nav-group-toggle:hover{background:#f3f7fc!important;color:#2a5d93!important}.nav-chevron{font-size:14px;line-height:1;transition:transform .18s ease}.nav-group:not(.open) .nav-chevron{transform:rotate(0deg)}.nav-group.open .nav-chevron{transform:rotate(0deg)}.nav-group-items{display:none;padding:2px 0 3px}.nav-group.open .nav-group-items{display:block}.nav-group-items button{margin:2px 0!important;padding:9px 10px!important;border-radius:8px}.nav-group-items button:hover{background:#edf4ff;color:#1260dc}.nav-group-items button[style*="display:none"]{display:none!important}
.dash-top-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(300px,.9fr);gap:14px;align-items:stretch;margin-bottom:14px}.dash-top-left{min-width:0;display:flex;flex-direction:column;gap:14px}.dash-top-left .dash-panel{width:100%}.dash-status-top{min-width:0}.business-split-panel{background:#fff;border:1px solid #dce4ef;border-radius:12px;padding:12px 14px;box-shadow:0 1px 2px #17304d08}.business-split-panel .dash-panel-head{margin-bottom:8px}.business-split-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.business-split-card{border:1px solid #dce4ef;border-radius:10px;padding:12px 14px;min-height:78px;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto;column-gap:12px;align-items:center}.business-split-card span{font-size:13px;font-weight:800;color:#17304d}.business-split-card b{font-size:21px;color:#17304d}.business-split-card small{font-size:10px;color:#71869e}.business-split-card.service{background:#f4f8ff;border-color:#cfe0fb}.business-split-card.sales{background:#fff9e9;border-color:#f3df9f}.dash-status-top .dash-status-list{gap:7px}.dash-status-top .dash-status{padding:9px 11px}.dash-status-top .dash-panel-head{margin-bottom:10px}.dash-grid{margin-top:0}
@media(max-width:1100px){.dash-top-grid{grid-template-columns:1fr}.dash-status-top{order:2}.business-split-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.business-split-grid{grid-template-columns:1fr}.business-split-card{min-height:70px}.nav-group-toggle{min-height:40px}}

/* V4.8.24 Daily Report desktop optimization */
.daily-report-page{max-width:1280px;margin:0 auto;padding:18px 20px 40px}
.daily-report-page .daily-report-form-panel{padding:20px 22px;border-radius:14px}
.daily-report-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px 16px;align-items:start}
.daily-report-grid>label{grid-column:span 4;min-width:0}
.daily-report-grid>.daily-engineer-field{grid-column:span 12}
.daily-report-grid>.daily-work-field{grid-column:span 6}
.daily-report-grid>.daily-po-field{grid-column:span 12}
.daily-report-grid label span{font-weight:650}
.daily-report-grid textarea{min-height:120px;resize:vertical}
.daily-report-actions{justify-content:flex-end;margin-top:4px}
.daily-report-actions button{min-width:180px}
.daily-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0}
.daily-kpi{background:var(--panel,#fff);border:1px solid var(--border,#dbe3ef);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:4px}
.daily-kpi b{font-size:22px}
.daily-summary-table{overflow:auto}
.daily-summary-table table{min-width:920px}
.daily-report-field-settings label{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border,#dbe3ef);border-radius:9px;background:var(--panel,#fff)}
@media(max-width:900px){.daily-report-grid>label,.daily-report-grid>.daily-work-field,.daily-report-grid>.daily-engineer-field,.daily-report-grid>.daily-po-field{grid-column:span 12}.daily-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.daily-report-page{padding:12px}}
@media(max-width:560px){.daily-summary{grid-template-columns:1fr}}


/* V4.8.25 - Daily Report final responsive layout and protected OT UI */
.daily-report-page{max-width:1320px;margin:0 auto;padding:14px 18px 42px}
.daily-report-form-panel{width:100%;background:#fff;border:1px solid #dfe7f1;border-radius:14px;padding:20px 22px;box-shadow:0 2px 8px rgba(23,48,77,.04)}
.daily-report-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px 16px;align-items:start}
.daily-report-grid>.daily-engineer-field{grid-column:span 12}
.daily-report-grid>label{grid-column:span 3;min-width:0}
.daily-report-grid>.daily-work-field{grid-column:span 6}
.daily-report-grid>.daily-po-field{grid-column:span 12}
.daily-report-grid label{min-width:0;display:flex;flex-direction:column;gap:6px;color:#294661;font-size:13px;font-weight:600}
.daily-report-grid label span{font-weight:700;color:#17304d}
.daily-report-grid input,.daily-report-grid textarea{width:100%;box-sizing:border-box;border:1px solid #cfd9e7;border-radius:9px;background:#fff;color:#17304d;padding:10px 12px;font:inherit;font-weight:400}
.daily-report-grid input{min-height:42px}
.daily-report-grid textarea{min-height:145px;resize:vertical;line-height:1.45}
.daily-report-grid .daily-engineer-field{padding:12px 14px;border:1px solid #d7e3f2;border-radius:10px;background:#f7fbff}
.daily-report-grid .daily-engineer-field input{font-size:16px;font-weight:700;background:#fff}
.daily-report-actions{justify-content:flex-end;margin-top:16px;padding-top:14px;border-top:1px solid #edf1f6}
.daily-report-actions button{min-width:210px;min-height:44px;font-weight:700}
.daily-report-summary-toolbar{margin-top:22px}
.daily-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
.daily-summary-table{width:100%;overflow:auto;border-radius:10px}
.daily-summary-table table{min-width:980px}
.daily-summary-table td{vertical-align:top;white-space:normal;line-height:1.35}
.daily-report-page .hint{line-height:1.4}
@media (max-width:1050px){
  .daily-report-page{padding:12px 12px 36px}
  .daily-report-form-panel{padding:16px}
  .daily-report-grid>label{grid-column:span 6}
  .daily-report-grid>.daily-engineer-field,.daily-report-grid>.daily-work-field,.daily-report-grid>.daily-po-field{grid-column:span 12}
  .daily-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:700px){
  body{padding-bottom:108px}
  .daily-report-page{padding:8px 6px 120px}
  .daily-report-form-panel{padding:12px;border-radius:12px}
  .daily-report-grid{grid-template-columns:1fr;gap:10px}
  .daily-report-grid>label,.daily-report-grid>.daily-engineer-field,.daily-report-grid>.daily-work-field,.daily-report-grid>.daily-po-field{grid-column:1/-1}
  .daily-report-grid input,.daily-report-grid textarea{font-size:16px;min-height:44px;padding:11px 12px}
  .daily-report-grid textarea{min-height:120px}
  .daily-report-actions{position:sticky;bottom:8px;z-index:21;margin:12px -4px 0;padding:10px 4px;background:rgba(255,255,255,.96);backdrop-filter:blur(7px);border-top:1px solid #dfe7f1}
  .daily-report-actions button{width:100%;min-width:0;min-height:50px;font-size:16px}
  .daily-summary{grid-template-columns:1fr 1fr;gap:8px}
  .daily-kpi{padding:10px}
  .daily-kpi b{font-size:19px}
  .daily-report-summary-toolbar{position:static;display:flex;flex-direction:column;align-items:stretch;gap:8px}
  .daily-report-summary-toolbar .actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .daily-report-summary-toolbar .actions button{min-height:42px}
  .daily-summary-table{margin-left:-1px;margin-right:-1px}
}
@media (max-width:420px){.daily-summary{grid-template-columns:1fr}.daily-report-summary-toolbar .actions{grid-template-columns:1fr}}

/* V4.8.27 — Daily Report console layout.  Additive only; legacy selectors remain intact. */
.daily-form-console{max-width:1320px;margin:0 auto;padding:0;overflow:hidden}
.daily-form-title{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;border-bottom:1px solid #dfe7f1;background:#f7f9fc;color:#17304d;font-weight:800;letter-spacing:.1px}
.daily-form-title small{font-weight:600;color:#71869e}
.daily-report-grid-v2{display:grid!important;grid-template-columns:1fr 1fr!important;gap:0!important;align-items:stretch!important}
.daily-section{min-width:0;border-bottom:1px solid #dfe7f1}
.daily-section-common{border-right:1px solid #dfe7f1}
.daily-section-title{padding:13px 16px 8px;font-weight:800;color:#17304d}
.daily-section-body{padding:0 16px 15px;display:grid;grid-template-columns:1fr;gap:10px}
.daily-section-body label{grid-column:1/-1!important}
.daily-content-title{grid-column:1/-1!important;padding:13px 16px 8px;border-bottom:1px solid #dfe7f1;color:#17304d;font-weight:800;background:#fbfcfe}
.daily-report-grid-v2>.daily-work-field{grid-column:span 1!important;border-bottom:1px solid #dfe7f1;padding:0 16px 16px}
.daily-report-grid-v2>.daily-work-completed,.daily-report-grid-v2>.daily-work-unfinished{border-right:1px solid #dfe7f1}
.daily-report-grid-v2>.daily-work-field span{font-weight:800;color:#17304d}
.daily-report-grid-v2>.daily-work-field textarea{min-height:150px;background:#fff}
.daily-report-grid-v2 .daily-engineer-field{padding:0!important;border:0!important;background:transparent!important}
.daily-report-grid-v2 input,.daily-report-grid-v2 textarea{border-radius:9px}
.daily-ot-hint{font-size:11px;color:#71869e;font-weight:500;line-height:1.35}
.daily-report-actions{padding:14px 16px!important;margin:0!important;border-top:0!important;background:#fff}
.daily-report-actions button{min-width:220px}
@media(max-width:900px){
  .daily-report-grid-v2{grid-template-columns:1fr!important}
  .daily-section-common{border-right:0}
  .daily-report-grid-v2>.daily-work-field{grid-column:1/-1!important;border-right:0!important}
  .daily-content-title{border-top:1px solid #dfe7f1}
}
@media(max-width:600px){
  .daily-form-title{padding:11px 13px;font-size:14px}
  .daily-form-title small{font-size:11px}
  .daily-section-title{padding:11px 13px 7px}
  .daily-section-body{padding:0 13px 12px}
  .daily-report-grid-v2>.daily-work-field{padding:0 13px 12px}
  .daily-report-grid-v2>.daily-work-field textarea{min-height:120px}
  .daily-report-actions{padding:10px 13px!important}
}

/* V4.8.29 - Mobile Daily Report optimization only. PC/Laptop layout intentionally unchanged. */
@media (max-width:700px){
  .daily-report-page{padding:8px 8px 84px;max-width:none}
  .daily-report-page .employee-head{padding:10px 2px 8px;gap:8px}
  .daily-report-page .employee-head h1{font-size:22px;line-height:1.2;margin:2px 0 3px}
  .daily-report-page .employee-head p{font-size:12px;margin:0}
  .daily-report-page .employee-head-actions{display:none}

  .daily-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:8px 0 10px}
  .daily-kpi{padding:9px 10px;border-radius:10px;min-height:58px}
  .daily-kpi span{font-size:11px;line-height:1.25}
  .daily-kpi b{font-size:18px}

  .daily-report-form-panel{padding:10px!important;border-radius:12px!important;margin-top:8px}
  .daily-form-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 2px 10px;font-size:15px}
  .daily-form-title small{font-size:11px;white-space:nowrap}

  .daily-report-grid{display:grid;grid-template-columns:1fr 1fr!important;gap:9px!important}
  .daily-report-grid .daily-section{grid-column:1/-1;border:1px solid #e1e8f1;border-radius:10px;background:#fbfcfe;overflow:hidden}
  .daily-report-grid .daily-section-title{padding:9px 10px;font-size:13px;font-weight:800;background:#f4f8fd;border-bottom:1px solid #e1e8f1}
  .daily-report-grid .daily-section-body{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:9px}
  .daily-report-grid .daily-section-body label{min-width:0}
  .daily-report-grid .daily-section-body .daily-engineer-field{grid-column:1/-1}
  .daily-report-grid .daily-section-body label span{font-size:12px}
  .daily-report-grid .daily-section-body input{min-height:42px;padding:9px 10px;font-size:15px}
  .daily-report-grid .daily-section-body .daily-ot-hint{font-size:10px;line-height:1.25;margin-top:3px;display:block}
  .daily-report-grid .daily-section-body .hint{font-size:10px;line-height:1.25;display:block;margin-top:3px}

  .daily-content-title{grid-column:1/-1!important;padding:8px 2px 2px;font-size:14px;font-weight:800}
  .daily-report-grid .daily-work-field{grid-column:1/-1!important;padding:9px;border:1px solid #e1e8f1;border-radius:10px;background:#fff}
  .daily-report-grid .daily-work-field span{font-size:13px}
  .daily-report-grid .daily-date-hint{font-size:10px;margin-top:0}
  .daily-report-grid .daily-work-field textarea{min-height:105px!important;height:105px;padding:10px!important;font-size:15px;line-height:1.4;border-radius:8px}

  .daily-report-actions{position:sticky!important;bottom:0!important;z-index:30;margin:10px -10px -10px!important;padding:8px 10px!important;background:rgba(255,255,255,.97);border-top:1px solid #e1e8f1;backdrop-filter:blur(7px)}
  .daily-report-actions button{width:100%!important;min-width:0!important;min-height:48px;font-size:16px;border-radius:10px}

  .daily-report-summary-toolbar{margin-top:16px!important;padding:8px 0!important;position:static!important;display:flex;align-items:flex-start;gap:8px}
  .daily-report-summary-toolbar h2{font-size:17px;margin:0;line-height:1.3}
  .daily-report-summary-toolbar .actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .daily-report-summary-toolbar button{flex:none!important;width:100%;min-height:38px;font-size:12px;padding:8px 6px}
  .daily-summary-table{border-radius:9px;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .daily-summary-table table{min-width:850px}
}
@media (max-width:380px){
  .daily-report-page{padding-left:6px;padding-right:6px}
  .daily-report-grid .daily-section-body{grid-template-columns:1fr}
  .daily-report-grid .daily-section-body .daily-engineer-field{grid-column:auto}
  .daily-kpi b{font-size:17px}
  .daily-form-title{font-size:14px}
}
