:root{
  --navy:#1f3864; --blue:#2e75b6; --blue-d:#185fa5; --ink:#1f2430; --mut:#6b7280;
  --line:#e5e7eb; --bg:#f4f6fb; --card:#fff; --green:#1d9e75; --green-bg:#e1f5ee;
  --amber:#b5790f; --amber-bg:#faeeda; --red:#cf3b3b; --red-bg:#fceaea;
  --gray-bg:#eef0f4; --blue-bg:#e6f1fb; --radius:12px; --sh:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.05);
}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);background:var(--bg);font-size:14px;line-height:1.5}
a{color:var(--blue-d);text-decoration:none}
h2{font-size:20px;margin:.2em 0}h3{font-size:15px;margin:0}

/* layout */
.app{display:flex;min-height:100vh}
.sidebar{width:230px;background:var(--navy);color:#cdd7ea;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brand{padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.08)}
.brand-mark{font-weight:800;font-size:26px;letter-spacing:2px;color:#fff}
.brand-mark.big{font-size:40px;text-align:center}
.brand-sub{font-size:11px;color:#8ea3c7;margin-top:2px}
.brand-sub.center{text-align:center;margin-bottom:12px}
nav{padding:12px 10px;flex:1}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;color:#cdd7ea;font-weight:500;margin-bottom:2px}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:var(--blue);color:#fff}
.sidebar-foot{padding:14px}
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{display:flex;justify-content:space-between;align-items:center;background:#fff;border-bottom:1px solid var(--line);padding:12px 24px;position:sticky;top:0;z-index:5}
.topbar-title{font-size:18px;font-weight:600}
.topbar-right{display:flex;align-items:center;gap:14px}
.content{padding:24px;max-width:1180px;width:100%}

/* icons (simple css glyphs) */
.ic{width:16px;height:16px;display:inline-block;opacity:.9;background:currentColor;
  -webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}
.ic-grid{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3C/svg%3E")}
.ic-box{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M21 8l-9-5-9 5v8l9 5 9-5z'/%3E%3Cpath d='M3 8l9 5 9-5'/%3E%3C/svg%3E")}
.ic-truck{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='1' y='6' width='13' height='10'/%3E%3Cpath d='M14 9h4l3 3v4h-7z'/%3E%3Ccircle cx='6' cy='18' r='1.6'/%3E%3Ccircle cx='18' cy='18' r='1.6'/%3E%3C/svg%3E")}
.ic-check{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E")}
.ic-chart{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Crect x='7' y='10' width='3' height='8'/%3E%3Crect x='13' y='6' width='3' height='12'/%3E%3C/svg%3E")}
.ic-users{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2 21c0-4 3.5-6 7-6s7 2 7 6'/%3E%3C/svg%3E")}
.ic-bell{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E")}

/* topbar user */
.bell{position:relative;color:var(--mut)}
.bell-dot{position:absolute;top:-6px;right:-8px;background:var(--red);color:#fff;font-size:10px;border-radius:9px;padding:0 5px;line-height:16px}
.user-chip{display:flex;align-items:center;gap:8px}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600}
.user-name{font-weight:600;font-size:13px}.user-role{font-size:11px;color:var(--mut)}

/* org chips */
.org-chip{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:600;background:rgba(255,255,255,.12);color:#fff}
.org-forwarder{background:var(--blue-bg);color:var(--blue-d)}
.org-buyer{background:#efeafe;color:#534ab7}
.org-supplier{background:var(--green-bg);color:#0f6e56}
.org-consignee{background:var(--amber-bg);color:#854f0b}
.sidebar .org-chip{background:rgba(255,255,255,.14);color:#fff}

/* cards & grids */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--sh);padding:16px 18px;margin-bottom:18px}
.card.narrow{max-width:520px}
.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.card-head.mt{margin-top:14px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media(max-width:900px){.grid-2{grid-template-columns:1fr}.sidebar{display:none}}

/* kpis */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--sh)}
.kpi-num{font-size:28px;font-weight:700;color:var(--navy)}
.kpi-label{font-size:12px;color:var(--mut)}
.kpi-alert .kpi-num{color:var(--red)}
@media(max-width:700px){.kpis{grid-template-columns:repeat(2,1fr)}}

/* tables */
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--mut);padding:8px 10px;border-bottom:1px solid var(--line)}
.table td{padding:10px;border-bottom:1px solid var(--line);vertical-align:top}
.table.compact td,.table.compact th{padding:7px 8px}
.table tbody tr[onclick]{cursor:pointer}
.table tbody tr[onclick]:hover{background:#f8fafc}
.table .r{text-align:right}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}
.small{font-size:11.5px}.muted{color:var(--mut)}
.empty{color:var(--mut);text-align:center;padding:16px}

/* badges */
.badge{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap}
.badge-gray{background:var(--gray-bg);color:#555}
.badge-blue{background:var(--blue-bg);color:var(--blue-d)}
.badge-amber{background:var(--amber-bg);color:var(--amber)}
.badge-green{background:var(--green-bg);color:#0f6e56}
.badge-red{background:var(--red-bg);color:var(--red)}

/* buttons */
.btn{display:inline-flex;align-items:center;gap:6px;border:1px solid transparent;border-radius:8px;padding:8px 14px;font-size:13px;font-weight:600;cursor:pointer;background:#eef1f6;color:var(--ink)}
.btn:hover{filter:brightness(.97)}
.btn-primary{background:var(--blue);color:#fff}
.btn-green{background:var(--green);color:#fff}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn-block{width:100%;justify-content:center}
.btn-sm{padding:6px 11px;font-size:12px}
.btn-xs{padding:4px 9px;font-size:11px}

/* forms */
input,select,textarea{font:inherit;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;width:100%}
input:focus,select:focus{outline:2px solid var(--blue-bg);border-color:var(--blue)}
.form-stack label{display:block;margin-bottom:10px;font-size:12px;color:var(--mut);font-weight:600}
.form-stack input,.form-stack select{margin-top:4px;color:var(--ink);font-weight:400}
.row{display:flex;gap:12px}.row label{flex:1}
.form-grid{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.form-grid input,.form-grid select{width:auto;flex:1;min-width:120px}
.inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0}
.inline-form .grow{flex:1;min-width:160px}.inline-form .grow-sm{flex:1;min-width:110px}
.inline-form+.inline-form{margin-top:8px}
.adder{margin-top:12px;border-top:1px dashed var(--line);padding-top:10px}
.adder summary{cursor:pointer;color:var(--blue-d);font-weight:600;font-size:13px}
.mt{margin-top:8px}

/* toolbar / chips */
.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;gap:12px}
.search{display:flex;gap:8px;flex:1;max-width:420px}
.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.chip{padding:6px 12px;border-radius:20px;background:#fff;border:1px solid var(--line);font-size:12px;font-weight:600;color:var(--mut)}
.chip.active{background:var(--navy);color:#fff;border-color:var(--navy)}

/* dashboard lists */
.task-list,.notif-list,.doc-list{list-style:none;margin:0;padding:0}
.task-list li{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--line);gap:10px}
.task-list li:last-child{border-bottom:none}
.task-action{color:var(--mut);font-weight:400;margin-left:8px}
.notif-list li{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--line);gap:10px}
.notif-list li.unread{font-weight:600}
.notif-list li.unread::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--blue);display:inline-block;margin-right:8px;align-self:center}
.doc-list li{padding:7px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:10px}

/* pipeline / bars */
.pipe-row,.bar-row{display:flex;align-items:center;gap:10px;margin-bottom:7px}
.pipe-label{width:130px}.pipe-bar{flex:1;background:#eef1f6;border-radius:5px;height:10px}
.pipe-bar span{display:block;height:10px;background:var(--blue);border-radius:5px}
.pipe-c{width:24px;text-align:right;font-weight:600}
.bar-label{width:130px;font-size:12px}.bar{flex:1;background:#eef1f6;border-radius:5px;height:14px}
.bar span{display:block;height:14px;background:var(--blue);border-radius:5px}
.bar span.red{background:var(--red)}.bar-c{width:24px;text-align:right;font-weight:600}

/* order detail */
.back{display:inline-block;margin-bottom:10px;color:var(--mut);font-weight:600}
.order-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:16px;flex-wrap:wrap}
.order-meta{display:flex;gap:22px;font-size:13px}
.order-meta .muted{font-size:11px}
.action-card{border-left:3px solid var(--blue)}
.cusdec{padding:8px 0;border-bottom:1px solid var(--line)}.cusdec:last-child{border-bottom:none}
.ship-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.ship-row:last-of-type{border-bottom:none}

/* tracker */
.tracker{display:flex;overflow-x:auto;gap:2px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 12px;margin-bottom:16px}
.step{display:flex;flex-direction:column;align-items:center;min-width:74px;position:relative;text-align:center}
.step .dot{width:14px;height:14px;border-radius:50%;background:#d4d8e0;border:2px solid #d4d8e0;z-index:1}
.step .step-label{font-size:10px;color:var(--mut);margin-top:6px;line-height:1.2}
.step::before{content:'';position:absolute;top:6px;left:-50%;width:100%;height:2px;background:#e3e6ec}
.step:first-child::before{display:none}
.step.done .dot{background:var(--green);border-color:var(--green)}
.step.done::before{background:var(--green)}
.step.done .step-label{color:#0f6e56}
.step.current .dot{background:#fff;border-color:var(--blue);box-shadow:0 0 0 4px var(--blue-bg)}
.step.current::before{background:var(--green)}
.step.current .step-label{color:var(--blue-d);font-weight:700}

/* timeline */
.timeline{list-style:none;margin:0;padding:0}
.timeline li{display:flex;gap:12px;padding:8px 0;position:relative}
.tl-dot{width:10px;height:10px;border-radius:50%;background:var(--blue);margin-top:5px;flex-shrink:0}
.tl-dot.red{background:var(--red)}

/* flash */
.flash{padding:11px 14px;border-radius:8px;margin-bottom:14px;font-weight:500}
.flash-ok{background:var(--green-bg);color:#0f6e56}
.flash-err{background:var(--red-bg);color:var(--red)}
.flash-warn{background:var(--amber-bg);color:var(--amber)}

/* login */
.login-body{background:linear-gradient(135deg,#1f3864,#2e75b6);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.login-wrap{display:flex;gap:22px;align-items:stretch;flex-wrap:wrap;justify-content:center}
.login-card{background:#fff;border-radius:16px;padding:30px 28px;width:360px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.login-card .brand-mark{color:var(--navy)}
.login-form label{display:block;font-size:12px;color:var(--mut);font-weight:600;margin-bottom:12px}
.login-form input{margin-top:5px;color:var(--ink);font-weight:400}
.login-demo{background:rgba(255,255,255,.96);border-radius:16px;padding:20px;width:380px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.demo-title{font-weight:700;margin-bottom:10px}.demo-title span{font-weight:400;color:var(--mut);font-size:12px}
.demo-table{width:100%;border-collapse:collapse;font-size:12px}
.demo-table td{padding:6px 4px;border-bottom:1px solid var(--line)}
.click-fill{cursor:pointer;color:var(--blue-d)}.click-fill:hover{text-decoration:underline}
.demo-hint{font-size:11px;color:var(--mut);margin-top:8px}
code{background:#f0f2f7;padding:1px 6px;border-radius:5px;font-size:12.5px}
