* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:#16a34a; --primary-d:#15803d; --primary-bg:#f0fdf4; --primary-line:#bbf7d0;
  --bg:#f8fafc; --card:#fff;
  --text:#0f172a; --text2:#334155; --muted:#64748b; --muted2:#94a3b8;
  --line:#e2e8f0; --line2:#f1f5f9;
  --het:#b91c1c; --do:#dc2626; --cam:#d97706; --ok:#16a34a;
  --het-bg:#fee2e2; --do-bg:#fee2e2; --cam-bg:#fef3c7; --ok-bg:#dcfce7;
  --r:14px; --r-sm:10px;
  --sh:0 1px 2px rgba(15,23,42,.04),0 1px 3px rgba(15,23,42,.06);
  --sh2:0 10px 30px -12px rgba(15,23,42,.18);
  --ring:0 0 0 3px rgba(22,163,74,.14);
}
html{ -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
body { font-family:Inter,'Segoe UI',system-ui,-apple-system,Roboto,Arial,sans-serif; background:var(--bg); color:var(--text); line-height:1.5; font-size:14px; }
a{ color:var(--primary-d); }

/* ===== Header — nav trắng, pill mềm ===== */
.topbar { background:#fff; color:var(--text); padding:0 24px; display:flex; align-items:center; gap:20px; border-bottom:1px solid var(--line); box-shadow:0 1px 3px rgba(15,23,42,.04); position:sticky; top:0; z-index:300; min-height:58px; }
.brand { font-size:20px; font-weight:800; padding:10px 0; white-space:nowrap; color:var(--primary); line-height:1.1; letter-spacing:-.01em; }
.brand .accent { color:#f59e0b; }
.brand{ display:inline-flex; flex-direction:column; justify-content:center; }
.brand-img{ height:34px; display:block; object-fit:contain; }
.brand small { display:block; font-size:10.5px; font-weight:500; color:var(--muted); }
.nav { display:flex; gap:1px; flex:1; flex-wrap:nowrap; align-items:center; min-width:0; }
.nav a { color:var(--text2); text-decoration:none; padding:7px 11px; font-size:13.5px; font-weight:500; border-radius:999px; transition:background .15s,color .15s; white-space:nowrap; }
@media(max-width:1280px){ .nav a{ padding:7px 9px; font-size:13px; } }
/* user chip (avatar + tên) */
.user-chip{ display:inline-flex !important; align-items:center; gap:8px; padding:4px 10px 4px 4px !important; border:1px solid var(--line); border-radius:999px !important; background:#fff; color:var(--text) !important; font-weight:600 !important; }
.user-chip:hover,.user-chip.on{ border-color:var(--primary); background:var(--primary-bg) !important; }
.user-chip .avatar{ width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,var(--primary),#0d9488); color:#fff; font-size:12px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; letter-spacing:.02em; }
.user-chip .uname{ max-width:150px; overflow:hidden; text-overflow:ellipsis; font-size:13px; }
.user-chip .caret{ font-size:10px; color:var(--muted); }
.user-dd .nav-dd-menu{ min-width:230px; }
.bell{ position:relative; font-size:17px; padding:6px 8px !important; border-radius:999px !important; line-height:1; }
.bell-n{ position:absolute; top:-2px; right:-2px; min-width:17px; height:17px; padding:0 4px; border-radius:999px; background:#ef4444; color:#fff; font-size:10.5px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; border:2px solid #fff; animation:bellpop .6s ease; }
@keyframes bellpop{ 0%{transform:scale(.4)} 70%{transform:scale(1.25)} 100%{transform:scale(1)} }
.bell-menu{ min-width:280px; max-width:340px; } .bell-menu a{ white-space:normal; line-height:1.4; }
.userbox .nav-dd-menu a{ color:var(--text); padding:9px 12px; }
.userbox .nav-dd-menu a:hover{ background:var(--primary-bg); color:var(--primary-d); }
.user-dd-head{ padding:8px 12px 10px; border-bottom:1px solid var(--line); margin-bottom:4px; }
.user-dd-head b{ display:block; font-size:14px; } .user-dd-head small{ display:block; color:var(--muted); font-size:12px; margin-top:2px; }
@media(max-width:1100px){ .user-chip .uname{ display:none; } .user-chip{ padding-right:8px !important; } }
.nav a:hover { background:var(--line2); color:var(--text); }
.nav a.active { background:var(--primary-bg); color:var(--primary-d); font-weight:700; }
.nav-dd { position:relative; display:flex; align-items:center; }
.nav-dd-toggle { cursor:pointer; }
.nav-dd-menu { position:absolute; top:100%; left:0; min-width:200px; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:0 16px 40px -8px rgba(15,23,42,.22); z-index:200; padding:6px; margin-top:6px;
  display:block; opacity:0; visibility:hidden; transform:translateY(-4px); transition:opacity .12s ease, transform .12s ease, visibility 0s linear .18s; } /* ẩn có độ trễ → rê chuột không bị tắt đột ngột */
.nav-dd-menu::before{ content:""; position:absolute; top:-12px; left:0; right:0; height:12px; } /* cầu nối hover phủ khe giữa nút cha và menu */
.nav-dd:hover .nav-dd-menu, .nav-dd.open .nav-dd-menu { opacity:1; visibility:visible; transform:translateY(0); transition-delay:0s; }
.nav-dd-sec{ font-size:10.5px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; color:#94a3b8; padding:10px 12px 4px; }
.nav-dd-sec:first-child{ padding-top:4px; } .nav-dd-menu .nav-dd-sec:not(:first-child){ border-top:1px solid var(--line); margin-top:4px; }
.nav-dd-menu a.on{ background:var(--primary-bg); color:var(--primary-d); font-weight:700; }
.nav-dd-menu a { display:block; color:var(--text); padding:9px 12px; font-size:13.5px; border:0; border-radius:8px; font-weight:500; }
.nav-dd-menu a:hover { background:var(--primary-bg); color:var(--primary-d); }
.nav-dd-sep{ height:1px; background:var(--line); margin:5px 6px; }
.userbox { font-size:13px; display:flex; align-items:center; gap:12px; white-space:nowrap; color:var(--muted); }
.userbox > span { color:var(--text); font-weight:600; }
.userbox a { color:var(--do); text-decoration:none; font-weight:600; padding:6px 10px; border-radius:8px; }
.userbox a:hover{ background:var(--do-bg); }
.branch-select { width:auto; background-color:#fff; color:var(--text); border:1px solid var(--line); padding:0 30px 0 10px; height:34px; border-radius:10px; font-size:13px; font-weight:600; box-shadow:var(--sh); }
.branch-select option { color:var(--text); }
.branch-fixed { font-size:13px; background:var(--primary-bg); color:var(--primary-d); border:1px solid var(--primary-line); padding:7px 12px; border-radius:999px; white-space:nowrap; font-weight:700; }

/* ===== Menu mobile (drawer) ===== */
.nav-burger{ display:none; }
.nav-drawer{ position:fixed; top:0; right:0; bottom:0; width:min(84vw,320px); background:#fff; z-index:400; transform:translateX(105%); transition:transform .22s ease; box-shadow:-20px 0 50px -20px rgba(15,23,42,.35); display:flex; flex-direction:column; }
.nav-drawer.on{ transform:none; }
.nav-drawer-bg{ position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:399; opacity:0; visibility:hidden; transition:opacity .2s; }
.nav-drawer-bg.on{ opacity:1; visibility:visible; }
.nav-drawer{ width:min(86vw,340px); background:#f8fafc; }
.nav-drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:14px 14px 12px; background:#fff; border-bottom:1px solid var(--line); }
.nd-user{ display:flex; align-items:center; gap:10px; min-width:0; }
.nd-user .avatar{ width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,var(--primary),#0d9488); color:#fff; font-weight:800; font-size:14px; display:inline-flex; align-items:center; justify-content:center; flex:none; }
.nd-user b{ display:block; font-size:14.5px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:190px; }
.nd-user small{ display:block; color:var(--muted); font-size:11.5px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:190px; }
.nav-drawer-head button{ width:34px; height:34px; border-radius:50%; border:1px solid var(--line); background:#fff; font-size:15px; cursor:pointer; color:var(--muted); flex:none; }
.nav-drawer-body{ flex:1; overflow:auto; padding:12px 12px 16px; }
.nd-tiles{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:12px; }
.nd-tile{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px; color:var(--text); text-decoration:none; font-weight:700; font-size:13.5px; }
.nd-tile .ti{ width:30px; height:30px; border-radius:9px; background:var(--primary-bg); display:inline-flex; align-items:center; justify-content:center; font-size:16px; }
.nd-tile.active{ border-color:var(--primary); background:var(--primary-bg); color:var(--primary-d); } .nd-tile.active .ti{ background:#fff; }
.nd-g{ background:#fff; border:1px solid var(--line); border-radius:14px; margin-bottom:8px; overflow:hidden; }
.nd-g summary{ list-style:none; display:flex; align-items:center; gap:10px; padding:12px 14px; font-weight:700; font-size:14.5px; cursor:pointer; color:var(--text); }
.nd-g summary::-webkit-details-marker{ display:none; }
.nd-g summary .gi{ width:30px; height:30px; border-radius:9px; background:var(--bg,#f1f5f9); display:inline-flex; align-items:center; justify-content:center; font-size:15px; flex:none; }
.nd-g summary small{ margin-left:auto; font-size:11px; color:var(--muted); font-weight:700; background:var(--bg,#f1f5f9); border-radius:999px; padding:1px 8px; }
.nd-g summary i{ font-style:normal; color:var(--muted2); font-size:18px; transition:transform .18s; line-height:1; }
.nd-g[open] summary{ border-bottom:1px solid var(--line2,#f1f5f9); } .nd-g[open] summary i{ transform:rotate(90deg); }
.nd-gi{ padding:6px 8px 8px; }
.nd-item{ display:flex; align-items:center; gap:10px; padding:10px 10px; border-radius:10px; color:var(--text); text-decoration:none; font-size:14px; font-weight:500; }
.nd-item .ii{ width:24px; text-align:center; font-size:14px; opacity:.9; }
.nd-item:active{ background:var(--line2); }
.nd-item.active{ background:var(--primary-bg); color:var(--primary-d); font-weight:700; }
.nav-drawer-foot{ padding:10px 14px calc(10px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:#fff; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.container { max-width:1200px; margin:24px auto; padding:0 20px; }
h1 { font-size:26px; margin-bottom:4px; color:var(--text); font-weight:800; letter-spacing:-.02em; }
h1 .muted{ font-weight:500; letter-spacing:0; }
.subtitle { color:var(--muted); margin-bottom:18px; font-size:13.5px; }

/* ===== Cards / stats ===== */
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:22px; }
.stat { background:var(--card); border-radius:var(--r); padding:18px 20px; border:1px solid var(--line); box-shadow:var(--sh); position:relative; overflow:hidden; }
.stat::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--line); }
.stat .num { font-size:30px; font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.15; }
.stat .lbl { font-size:12.5px; color:var(--muted); margin-top:4px; font-weight:500; }
.stat.het::before{ background:var(--het);} .stat.het .num{color:var(--het);}
.stat.do::before { background:var(--do);}  .stat.do .num{color:var(--do);}
.stat.cam::before{ background:var(--cam);} .stat.cam .num{color:var(--cam);}
.stat.ok::before { background:var(--ok);}  .stat.ok .num{color:var(--ok);}

/* ===== KPI cards (Dashboard) ===== */
.kpis{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:22px; }
.kpi{ display:block; background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:16px 18px 14px; box-shadow:var(--sh); text-decoration:none; color:var(--text); position:relative; overflow:hidden; min-width:0; transition:transform .15s,box-shadow .15s; }
a.kpi:hover{ transform:translateY(-2px); box-shadow:var(--sh2); }
.kpi::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--line); }
.kpi-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.kpi-lbl{ font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kpi-ic{ width:30px; height:30px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; font-size:15px; background:var(--bg); flex:none; }
.kpi-num{ font-size:28px; font-weight:800; letter-spacing:-.02em; line-height:1.1; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kpi-num small{ font-size:13px; font-weight:600; color:var(--muted); letter-spacing:0; margin-left:2px; }
.kpi-sub{ font-size:12.5px; color:var(--muted); margin-top:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kpi-sub b{ color:var(--text2); font-weight:700; }
.kpi.het::before{background:var(--het);} .kpi.het .kpi-num{color:var(--het);} .kpi.het .kpi-ic{background:var(--het-bg);}
.kpi.do::before {background:var(--do);}  .kpi.do .kpi-num{color:var(--do);}   .kpi.do .kpi-ic{background:var(--do-bg);}
.kpi.cam::before{background:var(--cam);} .kpi.cam .kpi-num{color:var(--cam);} .kpi.cam .kpi-ic{background:var(--cam-bg);}
.kpi.ok::before {background:var(--ok);}  .kpi.ok .kpi-num{color:var(--ok);}   .kpi.ok .kpi-ic{background:var(--ok-bg);}
@media(max-width:1000px){ .kpis{ grid-template-columns:1fr 1fr; } }
@media(max-width:480px){ .kpis{ grid-template-columns:1fr; } .kpi-num{ font-size:24px; } }

.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:20px; margin-bottom:18px; box-shadow:var(--sh); }
.card h2 { font-size:15.5px; margin-bottom:14px; color:var(--text); font-weight:700; letter-spacing:-.01em; }

/* ===== Table ===== */
table { width:100%; border-collapse:separate; border-spacing:0; background:var(--card); border-radius:var(--r-sm); overflow:hidden; border:1px solid var(--line); }
.card > table, .card > form > table, .card > div > table{ border:none; border-radius:0; }
th,td { padding:12px 13px; text-align:left; font-size:13.5px; border-bottom:1px solid var(--line2); }
th { background:var(--bg); color:var(--muted); font-weight:700; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; white-space:nowrap; border-bottom:1px solid var(--line); }
tbody tr:last-child td{ border-bottom:none; }
tr:hover td { background:rgba(15,23,42,.025); }
.badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; line-height:1.5; }
.b-het{background:var(--het-bg);color:var(--het);} .b-do{background:var(--do-bg);color:var(--do);}
.b-cam{background:var(--cam-bg);color:#92400e;} .b-ok{background:var(--ok-bg);color:#166534;}
.b-none{background:var(--line2);color:var(--muted);}
.b-empty{background:var(--line2);color:var(--muted);}
.badge.hist{cursor:help;}
.sess-row{ cursor:help; }
.nowrap{white-space:nowrap;}

/* Phương án đẩy date */
.plan-wrap{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; white-space:normal; min-width:150px; }
.plan-label{ font-size:12.5px; font-weight:600; color:var(--primary-d); background:var(--primary-bg); border:1px solid var(--primary-line); padding:3px 10px; border-radius:999px; max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; }
.plan-wrap .btn{ flex:0 0 auto; }

/* Thanh dòng đời */
.life-bar{ width:120px; height:7px; background:var(--line); border-radius:6px; overflow:hidden; margin-bottom:4px; }
.life-bar span{ display:block; height:100%; border-radius:6px; }
.life-txt{ font-size:12px; color:var(--muted); white-space:nowrap; }
.modal-overlay{ position:fixed; inset:0; background:rgba(15,23,42,.5); backdrop-filter:blur(2px); z-index:9999; display:none; align-items:flex-start; justify-content:center; padding:16px; overflow-y:auto; overscroll-behavior:contain; }
.modal-overlay>.modal-box{ margin:auto 0; flex:none; }   /* popup cao hơn màn hình: cuộn được, không bị cắt đầu */
.modal-box{ background:#fff; border-radius:16px; padding:24px; width:440px; max-width:100%; box-shadow:0 24px 64px -12px rgba(15,23,42,.35); border:1px solid var(--line); }
.modal-box h3{ font-size:18px; font-weight:800; letter-spacing:-.01em; margin-bottom:10px; }

/* Bảng check kho — gọn, không rớt dòng */
.check-table td{ padding:8px 9px; white-space:nowrap; vertical-align:middle; }
.check-table th{ padding:9px; white-space:nowrap; }
.check-table td:nth-child(3){ white-space:normal; min-width:220px; }
.check-table input[type=date]{ width:138px; padding:0 8px; height:32px; }
.check-table input[type=number]{ width:64px; padding:0 8px; height:32px; }
.check-table .st-badge{ display:inline-block; }
.check-table .pct-txt{ white-space:nowrap; }
.check-table .btn.sm{ padding:5px 9px; }
.row-het td{background:#fff5f5 !important;} .row-do td{background:#fff5f5 !important;}
.days-neg{color:var(--het);font-weight:700;} .days-do{color:var(--do);font-weight:700;} .days-cam{color:var(--cam);font-weight:600;}

/* ===== Buttons / forms ===== */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; background:var(--primary); color:#fff; border:1px solid var(--primary); padding:0 16px; height:38px; border-radius:var(--r-sm); font-size:13.5px; font-weight:600; cursor:pointer; text-decoration:none; line-height:1; font-family:inherit; box-shadow:0 4px 12px -4px rgba(22,163,74,.45); transition:all .15s; white-space:nowrap; vertical-align:middle; }
.btn:hover { background:var(--primary-d); border-color:var(--primary-d); transform:translateY(-1px); }
.btn:active{ transform:translateY(0); }
.btn.sm { padding:0 11px; height:31px; font-size:12.5px; border-radius:8px; }
.btn.gray { background:#fff; color:var(--text2); border-color:var(--line); box-shadow:var(--sh); }
.btn.gray:hover{ background:var(--bg); border-color:#cbd5e1; color:var(--text); }
.btn.green { background:var(--ok); border-color:var(--ok); }
.btn.danger{ background:var(--do); border-color:var(--do); box-shadow:0 4px 12px -4px rgba(220,38,38,.45); } .btn.danger:hover{ background:var(--het); border-color:var(--het); }
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }
.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
.toolbar .grow { flex:1; }
input,select,textarea { font-family:inherit; font-size:13.5px; padding:0 12px; height:38px; border:1px solid var(--line); border-radius:var(--r-sm); width:100%; background:#fff; color:var(--text); transition:border-color .15s,box-shadow .15s; }
textarea{ height:auto; padding:10px 12px; line-height:1.5; }
input[type=checkbox],input[type=radio]{ width:auto; height:auto; accent-color:var(--primary); }
input[type=file]{ height:auto; padding:8px 10px; }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--primary); box-shadow:var(--ring); }
select{ appearance:none; -webkit-appearance:none; padding-right:30px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 10px center; }
select[multiple]{ background-image:none; height:auto; padding:8px; }
.field { margin-bottom:14px; } .field label{ display:block; font-size:12px; font-weight:600; margin-bottom:6px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.field label .muted{ text-transform:none; letter-spacing:0; font-weight:500; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.flash { padding:12px 16px; border-radius:12px; margin-bottom:16px; font-size:13.5px; border:1px solid; }
.flash.ok{background:var(--ok-bg);color:#166534;border-color:#bbf7d0;} .flash.err{background:var(--het-bg);color:#991b1b;border-color:#fecaca;}
.flash.info{background:var(--cam-bg);color:#92400e;border-color:#fde68a;}
.card-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.card-head h2{ margin:0; }
.grid3{ display:grid; grid-template-columns:1fr 1fr 1.6fr; gap:14px; }
@media(max-width:820px){ .grid3{ grid-template-columns:1fr; } }
.search-lg{ width:100%; font-size:15px; height:46px; padding:0 16px; border-radius:12px; }
.tabs{ display:flex; gap:2px; flex-wrap:wrap; margin-bottom:16px; border-bottom:1px solid var(--line); }
.tab-btn{ background:transparent; color:var(--muted); border:none; border-bottom:2px solid transparent; margin-bottom:-1px; padding:10px 14px; border-radius:0; font-size:13.5px; font-weight:600; cursor:pointer; font-family:inherit; transition:color .15s; }
.tab-btn:hover{ color:var(--text); }
.tab-btn.active{ color:var(--primary-d); border-bottom-color:var(--primary); background:transparent; }
.tab-panel{ display:none; }
/* Bảng có style riêng (trang Đơn hàng) không nhận viền chung */
.dh-table{ border:none !important; border-radius:0 !important; }
/* Cấu hình: nội dung form giữ độ rộng dễ đọc; tab WooCommerce trải rộng để xếp 2 cột */
.settings-form .tab-panel{ max-width:820px; }
.settings-form .tab-panel[data-tab="woo"],.settings-form .tab-panel[data-tab="lichlam"]{ max-width:none; }
.set-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
@media(max-width:900px){ .set-grid2{ grid-template-columns:1fr; } }
.set-sub{ border:1px solid var(--line); border-radius:12px; padding:16px; background:var(--bg); }
.set-sub h3{ margin:0 0 12px; font-size:14.5px; color:var(--text); display:flex; align-items:center; gap:6px; }
/* ---- Poster khuyến mãi (Sale Offline) — theo mẫu poster cửa hàng ---- */
.po{ background:#fbf6ea; border-radius:10px; padding:2px; }
.po-head{ text-align:center; padding:14px 10px 14px; border-bottom:4px solid var(--primary); }
.po-logo{ height:42px; margin-bottom:4px; }
.po-brand{ font-size:20px; font-weight:800; color:var(--primary); }
.po-title{ font-size:22px; font-weight:800; color:var(--primary); letter-spacing:.5px; }
.po-time{ display:inline-block; margin-top:8px; background:#f0fdf4; border:1.5px solid #bbf7d0; color:var(--primary-d); padding:6px 18px; border-radius:20px; font-weight:800; font-size:14px; }
.po-promo{ border:1.5px dashed #e6c79b; border-radius:14px; margin:14px; padding:12px 16px; background:#fffdf7; }
.po-p-title{ font-size:16px; font-weight:800; color:var(--primary-d); margin-bottom:4px; }
.po-p-sub{ font-size:12.5px; color:var(--muted); font-style:italic; margin-bottom:8px; }
.po-line{ display:flex; gap:14px; align-items:flex-start; margin-top:10px; }
.po-tag{ flex:0 0 auto; min-width:92px; padding:11px 12px; border-radius:10px; color:#fff; font-weight:800; font-size:13px; text-align:center; line-height:1.2; box-shadow:0 2px 5px rgba(0,0,0,.12); }
.po-tag.green{ background:linear-gradient(135deg,#34d058,#16a34a); }
.po-tag.orange{ background:linear-gradient(135deg,#fbbf24,#ea9209); }
.po-p-grid{ flex:1; display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:12px; }
.po-item{ text-align:center; }
.po-item img{ width:70px; height:70px; object-fit:cover; border-radius:10px; border:1px solid var(--line); background:#fff; }
.po-noimg{ display:inline-flex; width:70px; height:70px; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:10px; background:#fff; font-size:26px; opacity:.5; }
.po-item-name{ font-size:11px; color:#374151; margin-top:4px; line-height:1.3; font-weight:600; }
.po-n{ color:#f59e0b; }
.po-price{ display:flex; align-items:center; gap:12px; margin-top:12px; }
.po-price-tag{ background:#e11d63; color:#fff; font-weight:800; padding:8px 16px; border-radius:8px; font-size:14px; box-shadow:0 2px 5px rgba(0,0,0,.12); }
.po-price-val{ font-size:26px; font-weight:800; color:#1f2a22; }
.po-foot{ margin:14px; border:1.5px dashed #e6c79b; border-radius:14px; background:#fffdf7; padding:12px 16px; text-align:center; }
.po-foot div{ font-weight:700; color:#4b5563; font-size:13.5px; line-height:1.8; }
.po-foot .warn{ color:#b45309; }
.po-note{ text-align:center; color:var(--muted); font-style:italic; font-size:12.5px; margin:10px 14px 6px; }

/* ---- Hoàn tiền: danh sách dạng thẻ (gọn) ---- */
.rf-filter{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.rf-filter button{ background:#fff; color:var(--text2); border:1px solid var(--line); padding:6px 13px; border-radius:999px; font-size:12.5px; font-weight:600; cursor:pointer; font-family:inherit; box-shadow:var(--sh); }
.rf-filter button:hover{ background:var(--bg); border-color:#cbd5e1; }
.rf-filter button.active{ background:var(--text); color:#fff; border-color:var(--text); }
.rf-list{ display:flex; flex-direction:column; gap:9px; }
.rf-card{ display:flex; gap:12px; border:1px solid var(--line); border-left:4px solid var(--line); border-radius:12px; padding:12px 16px; background:var(--card); box-shadow:var(--sh); }
.rf-card.pending{ border-color:var(--cam); border-left-color:var(--cam); background:#fff8ec; }
.rf-card.done{ border-color:var(--ok); border-left-color:var(--ok); background:#f1fbf4; }
.rf-card.rejected{ border-color:var(--het); border-left-color:var(--het); background:#fdf1f1; }
.rf-check{ padding-top:1px; }
.rf-main{ flex:1; min-width:0; }
.rf-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.rf-headline{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.rf-order{ font-weight:700; font-size:14px; color:var(--text); }
.rf-amount{ font-weight:800; font-size:15px; color:var(--primary-d); }
.rf-statuswrap{ display:flex; align-items:center; gap:4px; white-space:nowrap; }
.rf-meta{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; color:var(--muted); font-size:12px; margin:4px 0 8px; }
.rf-branch{ font-size:14.5px; font-weight:800; color:#166534; background:#dcfce7; padding:3px 12px; border-radius:20px; }
.rf-grid{ display:grid; grid-template-columns:1fr auto; gap:14px; align-items:start; }
.rf-fields{ font-size:12.5px; line-height:1.55; min-width:0; }
.rf-fields b{ color:var(--muted); font-weight:600; margin-right:2px; }
.rf-reason{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rf-imgs{ display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end; max-width:170px; }
.rf-imgs img{ width:42px; height:42px; object-fit:cover; border-radius:6px; border:1px solid var(--line); display:block; }
.rf-foot{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap; }
.rf-foot:empty{ display:none; }
.rf-receipt-link{ display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--primary); text-decoration:none; font-weight:600; }
.rf-receipt-link img{ width:30px; height:30px; object-fit:cover; border-radius:5px; border:1px solid var(--line); }
.rf-actions{ display:flex; gap:7px; flex-wrap:wrap; margin-left:auto; }
@media(max-width:720px){ .rf-grid{ grid-template-columns:1fr; } .rf-imgs{ justify-content:flex-start; max-width:100%; } .rf-reason{ white-space:normal; } }

/* ---- Check kho: bố cục theo bước ---- */
.step{ background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:18px 20px; margin-bottom:16px; box-shadow:var(--sh); }
.step-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.step-head h2{ margin:0; font-size:15.5px; color:var(--text); font-weight:700; }
.step-num{ flex:0 0 auto; width:26px; height:26px; border-radius:50%; background:var(--primary); color:#fff; font-size:14px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.step-head .step-act{ margin-left:auto; }
.step-hint{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:8px; font-size:12.5px; color:var(--muted); }
.action-bar{ position:sticky; bottom:0; background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:14px 18px; margin-top:4px; box-shadow:0 -8px 24px -8px rgba(15,23,42,.12); }
.action-btns{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.btn.outline-ok{ background:#fff; color:var(--ok); border:1px solid var(--ok); box-shadow:var(--sh); }
.btn.outline-ok:hover{ background:var(--ok-bg); }
@media(max-width:820px){ .step{ padding:14px; } .action-btns .btn{ flex:1 1 100%; text-align:center; } }

/* ---- Khối cấu hình (settings) ---- */
.cfg-box{ border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-top:16px; }
.cfg-box-h{ font-weight:700; color:var(--text); margin-bottom:8px; font-size:14.5px; }
.cfg-mini{ border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--bg); }
.cfg-mini-h{ font-weight:700; font-size:14px; margin-bottom:10px; color:var(--text); }
.cfg-chk{ display:flex; align-items:center; gap:8px; font-size:13.5px; cursor:pointer; }
.cfg-chk input{ width:auto; }
.cfg-t{ margin:8px 0 0; max-width:180px; } .cfg-t label{ font-size:12px; }

.note-btn{ background:#fff; color:var(--text2); border-color:var(--line); box-shadow:var(--sh); }
.note-btn.has-note{ background:var(--cam); }
.note-btn.has-note::after{ content:"•"; }
.muted{color:var(--muted);} .right{text-align:right;} .center{text-align:center;}
.actions{ white-space:nowrap; }
.actions a{ margin-left:6px; }
.actions a:first-child{ margin-left:0; }
td{ vertical-align:middle; }
.thumb{ width:44px; height:44px; object-fit:cover; border-radius:9px; border:1px solid var(--line); vertical-align:middle; display:inline-block; background:#f3f4f6; }
.thumb-empty{ display:inline-flex; align-items:center; justify-content:center; font-size:18px; opacity:.4; }

/* Login */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:radial-gradient(1200px 600px at 10% 0%,#dcfce7 0%,transparent 60%),radial-gradient(900px 500px at 100% 100%,#fef3c7 0%,transparent 55%),var(--bg); }
.login-box{ background:#fff; padding:36px; border-radius:18px; width:380px; border:1px solid var(--line); box-shadow:0 24px 64px -16px rgba(15,23,42,.25); }
.login-box h1{ text-align:center; margin-bottom:4px; }
.login-box .sub{ text-align:center; color:var(--muted); margin-bottom:24px; font-size:14px; }
.hint{ font-size:12px; color:var(--muted); text-align:center; margin-top:16px; line-height:1.7; }
/* ---------- Mobile / responsive ---------- */
@media(max-width:820px){
  .topbar{ flex-wrap:wrap; gap:0 14px; padding:0 12px; }
  .brand{ padding:11px 0; font-size:18px; }
  .nav{ display:none; }                                   /* mobile: dùng menu ☰ dạng ngăn kéo */
  .nav-burger{ display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:10px; border:1px solid var(--line); background:#fff; font-size:17px; cursor:pointer; color:var(--text); }
  .userbox a[href="logout.php"]{ display:none; }          /* đăng xuất nằm trong ngăn kéo */
  .userbox .user-dd{ display:none; }
  .userbox .bell-dd .nav-dd-menu{ display:none; }
  .topbar{ min-height:54px; padding:0 12px; flex-wrap:nowrap; }
  .nav a{ padding:9px 12px; white-space:nowrap; }
  .userbox{ margin-left:auto; padding:6px 0; gap:6px; font-size:12px; }
  .userbox > span{ display:none; }                 /* ẩn họ tên cho gọn, còn chi nhánh + đăng xuất */
  .branch-select{ max-width:150px; font-size:12px; height:30px; padding:0 24px 0 8px; background-size:12px; }
  .branch-fixed{ font-size:12px; padding:5px 10px; max-width:160px; overflow:hidden; text-overflow:ellipsis; }
  .userbox a{ padding:5px 8px; }
  .brand-img{ height:26px; }
  .nav{ gap:2px; padding-bottom:6px; }
  .nav a{ font-size:13px; padding:7px 11px; border-radius:999px; }
  .container{ padding:0 12px; margin:16px auto; }
  h1{ font-size:20px; }
  .subtitle{ font-size:13px; }
  .card{ padding:14px; overflow-x:auto; }         /* bảng rộng sẽ cuộn ngang trong card */
  .stats{ grid-template-columns:1fr 1fr; gap:10px; }
  .stat{ padding:14px; } .stat .num{ font-size:24px; }
  .grid2{ grid-template-columns:1fr; }
  .toolbar .grow{ flex:1 1 100%; max-width:100% !important; }
  .modal-box{ width:100%; padding:18px; }
  .login-wrap{ padding:16px; } .login-box{ width:360px; max-width:100%; padding:26px; }
  table{ min-width:640px; }                        /* giữ cột đọc được, cuộn ngang thay vì bể layout */
}
@media(max-width:440px){
  .stats{ grid-template-columns:1fr; }
  .brand small{ display:inline; margin-left:6px; }
}
