
:root{
  --navy:#102e40; --ink:#1b3444; --teal:#176f66; --soft:#e9f3f0; --paper:#fff; --bg:#f5f8fa;
  --line:#dfe7ea; --sub:#708697; --orange:#e7a85a; --danger:#b94848; --ok:#28785f; --shadow:0 12px 30px rgba(16,46,64,.09);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);font:14px/1.55 "Segoe UI",Arial,sans-serif}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:#0d6f85;text-decoration:none}
a:hover{text-decoration:underline}
.hidden{display:none !important}
.mobile-only{display:none}
.topbar{position:sticky;top:0;z-index:20;height:72px;background:var(--navy);color:#f6fbff;display:flex;align-items:center;justify-content:space-between;padding:0 22px;gap:16px}
.brand-zone{display:flex;align-items:center;gap:12px;min-width:0}
.brand-icon{height:40px;width:40px;border-radius:12px;background:#217a6d;display:grid;place-items:center;font-size:24px;font-weight:800;flex:0 0 auto}
.brand-title{font-size:24px;font-weight:700;letter-spacing:-.4px}
.brand-subtitle{font-size:12px;color:#9fc5c9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-actions{display:flex;align-items:center;gap:10px}
.compact-input,.icon-btn{border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:#fff;border-radius:10px;padding:9px 12px}
.icon-btn:hover,.compact-input:hover{background:rgba(255,255,255,.14)}
.shell{display:flex;min-height:calc(100vh - 72px)}
.sidebar{width:310px;max-height:calc(100vh - 72px);overflow:auto;background:#fff;border-right:1px solid var(--line);padding:14px 12px 24px;position:sticky;top:72px;flex-shrink:0}
.sidebar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
.sidebar-title{font-size:13px;font-weight:700;color:#496475}
.sidebar-search-wrap{padding-bottom:10px;border-bottom:1px solid var(--line);margin-bottom:12px}
.sidebar-search{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.nav-section{margin-top:14px}
.nav-section-title{font-size:11px;letter-spacing:1.2px;color:#8297a5;font-weight:800;margin:8px 8px}
.nav-group{border:1px solid var(--line);border-radius:12px;background:#fbfcfd;margin:8px 0;overflow:hidden}
.nav-group-head{width:100%;padding:11px 12px;text-align:left;border:0;background:#f5f9fa;font-weight:700;color:#2e4d5f;display:flex;justify-content:space-between;align-items:center}
.nav-group-body{padding:6px}
.nav-btn{width:100%;text-align:left;border:0;background:transparent;padding:10px 12px;border-radius:10px;color:#315261;margin:2px 0}
.nav-btn:hover{background:#f1f6f5}
.nav-btn.active{background:var(--soft);border-left:4px solid var(--teal);color:#0d665d;font-weight:700}
.content{flex:1;min-width:0;max-width:1800px;padding:18px 24px 44px}
.breadcrumb{font-size:12px;color:#7f94a3;margin:2px 0 10px}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}
.page-head h1{margin:0;font-size:28px;letter-spacing:-.6px}
.page-head p{margin:5px 0 0;color:var(--sub)}
.grid{display:grid;gap:15px}
.grid.kpi{grid-template-columns:repeat(4,minmax(170px,1fr));margin-bottom:16px}
.card,.panel{background:var(--paper);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}
.card{padding:18px}
.card small,.muted{color:var(--sub)}
.card strong{display:block;font-size:28px;margin-top:6px;color:#174c54}
.card .kpi-note{font-size:12px;color:#58717f;margin-top:6px}
.panel{padding:18px;margin:14px 0}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.panel-head h2{font-size:18px;margin:0}
.two-col{display:grid;grid-template-columns:1.35fr 1fr;gap:16px}
.three-col{display:grid;grid-template-columns:repeat(3,minmax(200px,1fr));gap:14px}
.mini-grid{display:grid;grid-template-columns:repeat(2,minmax(160px,1fr));gap:12px}
.tools{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.primary,.secondary,.danger{padding:10px 14px;border-radius:10px;border:1px solid var(--line)}
.primary{background:var(--teal);color:#fff;border-color:var(--teal);font-weight:700}
.secondary{background:#fff;color:var(--ink)}
.danger{background:#fff;color:var(--danger);border-color:#efcbcb}
.info-box{background:#eef7f5;border-left:4px solid var(--teal);padding:12px 14px;border-radius:10px;color:#53726d;margin:10px 0}
.warn-box{background:#fff6e9;border-left:4px solid var(--orange);padding:12px 14px;border-radius:10px;color:#86611b;margin:10px 0}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:12px}
table{width:100%;border-collapse:collapse;font-size:13px;background:#fff}
th{background:#eef4f6;color:#698293;font-size:11px;text-transform:uppercase;letter-spacing:.35px;text-align:left}
th,td{padding:12px;border-bottom:1px solid var(--line);vertical-align:top}
tr:hover td{background:#fbfdfc}
.badge{display:inline-block;padding:4px 9px;border-radius:999px;font-size:11px;white-space:nowrap;background:#edf3f6;color:#32687a}
.badge.ok{background:#dff3e7;color:#237658}.badge.hold{background:#fae6e6;color:#a63d3d}.badge.warn{background:#fff1d7;color:#855c12}
.search-input,.field input,.field textarea,.field select{width:100%;padding:10px;border:1px solid #cbdce0;border-radius:10px;background:#fff}
.fields{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:12px}
.field label{display:block;font-weight:700;font-size:12px;color:#456879;margin:0 0 5px}
.field small{display:block;font-size:11px;color:#8b9ca7;margin-top:4px}
.field.wide{grid-column:1/-1}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.modal{position:fixed;inset:0;background:rgba(16,43,60,.62);display:flex;align-items:center;justify-content:center;z-index:40;padding:18px}
.dialog{width:min(1000px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:18px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.24)}
.dialog-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--line)}
.toast-wrap{position:fixed;right:18px;bottom:18px;z-index:60}
.toast{background:#123f43;color:#fff;padding:12px 16px;border-radius:10px;margin-top:10px;box-shadow:0 8px 20px rgba(0,0,0,.18)}
.login-screen{min-height:calc(100vh - 130px);display:grid;place-items:center}
.login-box{width:min(460px,100%);background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:26px}
.login-box h1{margin:0 0 6px;font-size:30px}.login-box p{color:var(--sub);margin:0 0 20px}
.login-brand{display:flex;align-items:center;gap:14px;margin-bottom:14px}.login-brand .brand-icon{height:54px;width:54px;font-size:30px}
.login-help{font-size:12px;color:#66808f;background:#f6f9fa;border:1px solid var(--line);padding:11px 12px;border-radius:10px;margin-top:12px}
.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}
.timeline{display:grid;gap:10px}
.timeline-step{display:flex;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fbfcfd}
.timeline-step .dot{width:30px;height:30px;border-radius:50%;background:var(--teal);color:#fff;display:grid;place-items:center;font-weight:700;flex:0 0 auto}
.product-grid{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px}
.product-card{border:1px solid var(--line);border-radius:14px;background:#fff;overflow:hidden;box-shadow:var(--shadow)}
.product-card img{width:100%;height:160px;object-fit:cover;background:#f3f6f8}
.product-card .body{padding:14px}
.product-card h3{margin:0 0 4px;font-size:17px}
.product-meta{font-size:12px;color:var(--sub);margin-bottom:8px}
.price{font-weight:800;color:#0f6258;font-size:18px}
.price-note{font-size:11px;color:#708697}
.taglist{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.tag{font-size:11px;border:1px solid #d9e8e4;color:#295f5b;background:#f3faf8;padding:4px 8px;border-radius:999px}
.gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(200px,1fr));gap:14px}
.gallery-grid figure{margin:0}.gallery-grid img{width:100%;height:220px;object-fit:contain;border-radius:12px;background:#f6f7f6}
.gallery-grid figcaption{font-size:12px;color:#607784;margin-top:6px}
.viewer360,.viewer3d{display:grid;grid-template-columns:1fr;gap:10px;place-items:center;padding:10px}
.viewer360 img,.viewer3d .card3d{max-width:100%;border-radius:16px;box-shadow:var(--shadow)}
.viewer360 img{width:min(420px,100%);background:#f6f7f6;cursor:grab;transition:transform .08s linear}
.card3d{width:min(360px,100%);padding:20px;background:linear-gradient(135deg,#183245,#1f6c62 65%,#8dc5c2);color:#fff;transform-style:preserve-3d;transition:transform .12s ease-out}
.card3d .title{font-size:24px;font-weight:800;transform:translateZ(36px)}
.card3d .sub{transform:translateZ(24px);opacity:.9}
.card3d .chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;transform:translateZ(18px)}
.card3d .chips span{background:rgba(255,255,255,.16);padding:6px 10px;border-radius:999px;font-size:12px}
.rule-box{background:#f9fbfc;border:1px solid var(--line);border-radius:12px;padding:14px}
.kv{display:grid;grid-template-columns:160px 1fr;gap:8px;font-size:13px}
.empty{padding:34px;text-align:center;color:var(--sub)}
.sidebar-backdrop{display:none}
body.dark{--paper:#1c323b;--bg:#142630;--line:#36515e;--ink:#dbe8ec;--sub:#a6b7c0;--soft:#24463f;--shadow:none}
body.dark .sidebar,body.dark .card,body.dark .panel,body.dark .dialog,body.dark .login-box,body.dark .product-card,body.dark .nav-group{background:var(--paper)}
body.dark th{background:#27404b} body.dark input,body.dark select,body.dark textarea,body.dark .search-input{background:#263f49;color:var(--ink)}
body.dark .secondary,body.dark .nav-group-head{background:#29444c;color:var(--ink)}
body.dark .sidebar-backdrop{background:rgba(0,0,0,.35)}
@media (max-width: 1100px){.product-grid,.gallery-grid,.grid.kpi{grid-template-columns:repeat(2,minmax(180px,1fr))}.two-col,.hero{grid-template-columns:1fr}}
@media (max-width: 820px){.mobile-only{display:inline-flex}.sidebar{position:fixed;left:-330px;top:72px;height:calc(100vh - 72px);z-index:30;transition:left .2s ease}.sidebar.open{left:0}.sidebar-backdrop.open{display:block;position:fixed;inset:72px 0 0 0;z-index:25}.content{padding:16px}.grid.kpi,.product-grid,.gallery-grid,.three-col,.mini-grid{grid-template-columns:1fr}.fields{grid-template-columns:1fr}.topbar{padding:0 12px}.brand-title{font-size:18px}.brand-subtitle{display:none}.topbar-actions{gap:6px}.compact-input,.icon-btn{padding:8px 10px}}

.logged-out .topbar,.logged-out .sidebar,.logged-out .sidebar-backdrop,.logged-out .breadcrumb{display:none!important}.logged-out .shell{min-height:100vh}.logged-out .content{margin:auto;width:100%;max-width:1000px}.logged-out .login-screen{min-height:90vh}.compact-input option{color:#152f3f;background:#fff}.product-placeholder{height:165px;display:grid;place-content:center;text-align:center;background:linear-gradient(135deg,#e6f0ed,#f1f5fa);color:#235a5a;font-weight:800}.product-placeholder small{display:block;font-weight:400;color:#6b8693;font-size:11px}.dialog .field small{overflow-wrap:anywhere}@media(max-width:820px){.logged-out .content{padding:16px}.login-box{padding:20px}.topbar-actions{flex-shrink:0}.brand-title{font-size:16px}}
@media(max-width:820px){
 .topbar{height:auto;min-height:72px;flex-wrap:wrap;padding:8px 12px;gap:8px}
 .brand-zone{flex:1 1 100%;justify-content:flex-start}
 .topbar-actions{flex:1 1 100%;justify-content:space-between}
 .sidebar{top:0;height:100vh;max-height:100vh}
 .page-head{flex-direction:column;align-items:stretch}
 .page-head .tools{width:100%;justify-content:flex-start}
 .content{width:100%;overflow:hidden}
 .shell{width:100%;max-width:100%}
 .panel{max-width:100%;min-width:0}
 .panel-head{flex-wrap:wrap}
 .table-wrap{max-width:100%;overflow-x:auto}
 .page-head h1{font-size:23px;overflow-wrap:anywhere}
 .brand-icon{height:31px;width:31px}
 .sidebar-backdrop.open{inset:0}
}

/* Coffee experience visualization upgrade */
.coffee-art{height:220px;overflow:hidden;background:#edf2e9}.coffee-art svg{width:100%;height:100%;display:block}
.photo-note{padding:5px 13px;color:#607a76;background:#f6faf7;font-size:10px;min-height:30px}
.product-card .body{padding:15px}.product-card .secondary{margin:12px}
.coffee-hero{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:18px;padding:28px;background:linear-gradient(120deg,#0f3439,#237265);color:white;border-radius:18px;margin:16px 0}
.coffee-hero h2{font-size:30px;margin:5px 0}.coffee-hero p{color:#d3e7e0;line-height:1.7}.coffee-hero .eyebrow{color:#a9d4bd;font-weight:700;letter-spacing:1.2px}.coffee-hero .primary{background:#f4f8ef;color:#16594f;border:0}.hero-art{background:#fff;border-radius:15px;overflow:hidden}.hero-art svg{width:100%;height:auto;display:block}
.production-strip{display:grid;grid-template-columns:repeat(6,1fr);gap:10px;margin:18px 0}.stage-tile{background:white;border:1px solid var(--line);border-radius:13px;padding:16px 10px;text-align:center}.stage-tile span{display:grid;place-items:center;width:28px;height:28px;background:#e8f4ed;color:#126e58;border-radius:50%;margin:0 auto 8px;font-weight:700}.stage-tile b{display:block;font-size:12px}
@media(max-width:820px){.coffee-hero{grid-template-columns:1fr;padding:18px}.production-strip{grid-template-columns:repeat(2,1fr)}}

/* Login refresh based on DXS Partner spirit with Tavico branding */
.logged-out .shell{display:block;min-height:100vh}
.logged-out .content{margin:0;width:100%;max-width:none;padding:0}
.logged-out .login-screen{min-height:100vh}

.login-split{display:grid;grid-template-columns:minmax(420px,1.05fr) minmax(420px,.95fr);background:#edf4f7}
.login-hero-panel{background:linear-gradient(180deg,#0f6aa2 0%,#177fbd 45%,#1a8bca 100%);color:#fff;position:relative;overflow:hidden}
.login-hero-panel::before{content:"";position:absolute;inset:-10% auto auto -15%;width:70%;height:140%;border:1px solid rgba(255,255,255,.12);border-radius:50%}
.login-hero-panel::after{content:"";position:absolute;right:-10%;top:10%;width:55%;height:55%;border:1px solid rgba(255,255,255,.12);border-radius:50%}
.login-hero-inner{position:relative;z-index:1;padding:54px 52px;display:flex;flex-direction:column;justify-content:space-between;min-height:100vh}
.tavico-mark{display:flex;align-items:center;gap:18px}
.tavico-mark-icon{width:82px;height:82px;border-radius:18px;background:#fff;color:#0f76ad;font-size:44px;font-weight:900;display:grid;place-items:center;box-shadow:0 12px 28px rgba(0,0,0,.18)}
.tavico-mark-title{font-size:18px;font-weight:900;letter-spacing:2px}
.tavico-mark-sub{font-size:13px;color:#d7ebf7}
.login-kicker{margin-top:46px;font-size:13px;letter-spacing:3px;font-weight:800;color:#c4e6fb;text-transform:uppercase}
.login-hero-title{margin:26px 0 18px;font-size:56px;line-height:1.06;letter-spacing:-1.6px;max-width:680px}
.login-hero-desc{max-width:650px;font-size:18px;line-height:1.75;color:#e4f2fb}
.login-feature-grid{display:grid;grid-template-columns:1fr;gap:14px;margin-top:32px;max-width:700px}
.login-feature-card{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);border-radius:16px;padding:16px 18px;backdrop-filter:blur(4px)}
.login-feature-card strong{display:block;font-size:16px;margin-bottom:6px}
.login-feature-card span{font-size:13px;color:#e3f1fa;line-height:1.55}
.login-form-panel{display:grid;place-items:center;padding:34px}
.login-box.partner-style{width:min(520px,100%);padding:38px 40px;border-radius:28px;box-shadow:0 24px 64px rgba(16,46,64,.12)}
.login-box.partner-style h1{font-size:34px;letter-spacing:-.8px;margin-bottom:8px}
.login-box.partner-style p{font-size:16px;margin-bottom:22px}
.login-fields{grid-template-columns:1fr}
.login-box .field input{height:54px;font-size:18px;padding:12px 16px}
.login-actions{justify-content:flex-start;margin-top:22px}
.login-actions .primary{min-width:164px;height:52px;border-radius:14px;font-size:18px}

@media (max-width: 1100px){
  .login-split{grid-template-columns:1fr}
  .login-hero-inner{min-height:auto;padding:34px 28px}
  .login-hero-title{font-size:42px}
  .login-form-panel{padding:24px}
}
@media (max-width: 820px){
  .login-split{grid-template-columns:1fr}
  .login-hero-inner{padding:24px 18px;min-height:auto}
  .tavico-mark-icon{width:64px;height:64px;font-size:34px}
  .login-kicker{margin-top:26px;font-size:11px;letter-spacing:1.8px}
  .login-hero-title{font-size:34px;margin:18px 0 12px}
  .login-hero-desc{font-size:15px}
  .login-feature-grid{margin-top:18px}
  .login-form-panel{padding:18px}
  .login-box.partner-style{padding:24px 18px;border-radius:20px}
  .login-box.partner-style h1{font-size:28px}
  .login-box .field input{font-size:16px;height:48px}
  .login-actions .primary{width:100%}
}

/* Official Tavico logo provided by customer */
.tavico-real-logo{width:112px;height:112px;object-fit:contain;background:#fff;border-radius:18px;padding:8px;flex-shrink:0}
.login-brand-logo{width:78px;height:78px;object-fit:contain;flex-shrink:0}
.tavico-mark-title{font-size:21px;letter-spacing:.3px;text-transform:none}
.login-brand{min-width:0}.login-brand>div{min-width:0}
@media(max-width:820px){.tavico-real-logo{width:70px;height:70px}.login-brand-logo{width:58px;height:58px}.tavico-mark-title{font-size:16px}}

/* Tavico Manufacturing identity — login */
.logged-out .content{padding:0!important;max-width:none!important;width:100%!important}
.logged-out .login-screen{min-height:100vh}
.login-split{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}
.login-hero-panel{background:linear-gradient(115deg,rgba(10,52,43,.92),rgba(17,91,75,.63)),url('assets/coffee-photo.jpg') center center/cover no-repeat!important}
.login-hero-panel::before{opacity:.3}.login-hero-panel::after{opacity:.25}
.login-hero-inner{padding:44px clamp(26px,4vw,72px);min-height:100vh;gap:28px}
.tavico-mark{align-items:center}.tavico-real-logo{width:90px;height:90px}
.tavico-mark-title{font-size:22px;letter-spacing:0;color:white}
.tavico-mark-sub{color:#cbe4d7;font-size:13px}
.coffee-story{margin:auto 0;max-width:690px}
.login-kicker{margin:0 0 16px;letter-spacing:2px;color:#cbe6d0}
.login-hero-title{font-size:clamp(38px,4vw,64px);line-height:1.13;letter-spacing:-1.5px;margin:0 0 18px}
.login-hero-desc{font-size:clamp(15px,1.25vw,19px);line-height:1.7;color:#e2f1ea}
.login-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:26px}
.login-feature-card{background:rgba(9,52,43,.56);border:1px solid rgba(230,255,239,.25)}
.login-feature-card strong{font-size:15px}.login-feature-card span{font-size:12px}
.login-hero-footer{font-size:13px;color:#d5e7da}.login-hero-footer span{margin:0 10px}
.login-form-panel{background:linear-gradient(130deg,#eef5f2,#f7faf9)!important;padding:clamp(20px,4vw,56px)}
.login-box.partner-style{width:min(560px,100%);padding:clamp(22px,3vw,44px);box-sizing:border-box}
.login-box.partner-style *{box-sizing:border-box}
.login-brand{gap:20px;align-items:center}.login-brand-logo{width:84px;height:84px;object-fit:contain}
.login-company-name{font-size:16px;font-weight:800;color:#155e53}
.login-box.partner-style h1{font-size:clamp(25px,2.3vw,36px);line-height:1.15;margin-top:8px}
.login-box.partner-style p{font-size:15px}
.login-fields{grid-template-columns:minmax(0,1fr)!important;width:100%}
.login-fields .field{min-width:0;width:100%;grid-column:1/-1!important}
.login-fields input{width:100%;max-width:100%;min-width:0}
.login-actions .primary{background:#176f66;border-color:#176f66;min-width:180px}
@media(max-width:900px){.login-split{display:grid;grid-template-columns:minmax(0,1fr)!important}.login-hero-inner{min-height:auto;padding:24px 20px}.coffee-story{margin:12px 0}.login-hero-title{font-size:33px}.login-feature-grid{grid-template-columns:1fr 1fr}.login-form-panel{padding:24px 12px}.login-box.partner-style{width:min(540px,100%);margin:auto}.tavico-real-logo{width:62px;height:62px}.login-hero-footer{display:none}}
@media(max-width:450px){.login-feature-grid{grid-template-columns:1fr}.login-hero-desc{font-size:14px}.login-hero-title{font-size:30px}.login-brand-logo{width:64px;height:64px}}
