/* VINAPOT – giao diện chung (giữ nguyên phong cách App xưởng cũ: chữ to, nút lớn, dễ bấm trên điện thoại) */
*{box-sizing:border-box}
body{margin:0;font-family:Arial,Helvetica,sans-serif;font-size:17px;line-height:1.4;background:#eef3ee;color:#1b1b1b}
header{position:sticky;top:0;z-index:5;background:#1e4620;color:#fff;padding:10px 14px;display:flex;align-items:center;gap:10px}
header .ttl{flex:1;min-width:0}
header b{font-size:18px}
header small{display:block;font-size:16px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
header button{flex:none;background:rgba(255,255,255,.15);color:#fff;border:1px solid rgba(255,255,255,.4);border-radius:10px;font-size:20px;min-width:46px;min-height:44px;cursor:pointer}
main{padding:10px 10px 90px;max-width:720px;margin:0 auto}
/* Menu theo vai trò */
nav.modes{display:flex;gap:8px;margin:0 0 10px}
nav.modes button{flex:1;border:2px solid #cfdccf;background:#fff;border-radius:12px;padding:9px 6px;font-size:16px;color:#333;min-height:44px;cursor:pointer}
nav.modes button.on{border-color:#1e4620;background:#1e4620;color:#fff}
@media (max-width:480px){nav.modes{gap:5px}nav.modes button{font-size:14px;padding:6px 3px}}
/* Đăng nhập */
.login{max-width:420px;margin:12vh auto 0;background:#fff;border-radius:16px;padding:24px 20px;text-align:center;box-shadow:0 2px 10px rgba(0,0,0,.08)}
.login h1{font-size:22px;color:#1e4620;margin:0 0 6px}
.login p{color:#555;margin:0 0 18px}
.gbtn{display:inline-flex;align-items:center;gap:10px;border:1px solid #c4cfc4;background:#fff;border-radius:12px;padding:12px 18px;font-size:17px;font-weight:bold;cursor:pointer;min-height:52px}
.gbtn img{width:22px;height:22px}
/* Ô thống kê trạng thái */
.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:2px 0 8px}
.tile{background:#fff;border:2px solid #dfe8df;border-radius:12px;padding:5px 3px;text-align:center;cursor:pointer;line-height:1.1;position:relative;user-select:none}
.tile b{display:block;font-size:22px;color:var(--c,#1e4620)}
.tile span{display:block;font-size:16px;color:#333}
.tile.on{border-color:var(--c,#1e4620);background:var(--bg,#e8f3e8);box-shadow:0 2px 6px rgba(0,0,0,.12)}
.tile.hot b{animation:pulse 1.6s infinite}
@keyframes pulse{50%{opacity:.45}}
.minitabs{display:flex;gap:8px;margin:0 0 8px}
.minitabs button{flex:1;border:2px solid #cfdccf;background:#fff;border-radius:10px;padding:8px 6px;font-size:16px;color:#333;min-height:44px}
.minitabs button.on{border-color:#1e4620;background:#1e4620;color:#fff}
.search{width:100%;font-size:17px;padding:11px 12px;border:1px solid #c4cfc4;border-radius:10px;margin:0 0 8px;background:#fff}
.alert{display:flex;align-items:center;gap:10px;background:#fff3e0;border:2px solid #fb8c00;color:#7a3b00;border-radius:12px;padding:10px 12px;margin:0 0 10px;font-size:16px;cursor:pointer}
.alert.late{background:#ffebee;border-color:#e53935;color:#8e0000}
.alert .go{margin-left:auto;font-weight:bold;white-space:nowrap}
.list-title{font-size:16px;color:#4a5d4a;margin:4px 2px 6px;font-weight:bold}
.card{background:#fff;border-radius:12px;padding:11px 12px;margin:8px 0;border-left:7px solid #999;box-shadow:0 1px 3px rgba(0,0,0,.12);cursor:pointer}
.card .top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.card .id{font-weight:bold;font-size:17px;word-break:break-all}
.card .sub{font-size:16px;color:#444;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.card .bot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:6px}
.card.soon{background:#fff8ef;box-shadow:0 0 0 2px #fb8c00 inset,0 1px 3px rgba(0,0,0,.12)}
.card.late{background:#fff3f3;box-shadow:0 0 0 2px #e53935 inset,0 1px 3px rgba(0,0,0,.12)}
.card.old{opacity:.7}
.due{display:inline-block;border-radius:8px;padding:3px 9px;font-size:16px;font-weight:bold;background:#e8f5e9;color:#1b5e20}
.due.soon{background:#fb8c00;color:#fff}
.due.late{background:#e53935;color:#fff}
.due.na{background:#eceff1;color:#455a64;font-weight:normal}
.info{padding:12px 14px}
.info .top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.info .id{font-size:19px;font-weight:bold;word-break:break-all}
.due-row{margin:8px 0 6px}
.kv{display:flex;flex-direction:column;padding:5px 0;border-top:1px solid #eef2ee}
.kv span{font-size:16px;color:#667}
.kv b{font-size:17px;word-break:break-word}
.meta{border-top:1px solid #eef2ee;padding-top:7px;margin-top:2px;font-size:16px;color:#555}
.meta .dot{color:#aaa;margin:0 2px}
.note{background:#fff8e1;border:2px solid #ffca28;border-radius:12px;padding:10px 12px;margin:10px 0;font-size:17px;white-space:pre-line}
.note b{display:block;color:#7a5600;margin-bottom:2px}
.sec-title{display:flex;justify-content:space-between;align-items:baseline;font-size:18px;font-weight:bold;color:#1e4620;margin:16px 2px 6px}
.sec-title span{font-size:16px;font-weight:normal;color:#5b6f5b}
.prod{background:#fff;border-radius:14px;border:2px solid #cfe0cf;padding:12px;margin:8px 0;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.prod-h{display:flex;align-items:center;gap:8px;min-height:26px}
.prod-h .stt{flex:none;width:26px;height:26px;border-radius:50%;background:#1e4620;color:#fff;font-weight:bold;display:flex;align-items:center;justify-content:center;font-size:16px}
.prod-h .nm{flex:1;min-width:0;font-size:17px;font-weight:bold;line-height:1.2}
.stsel{flex:none;margin-left:auto;-webkit-appearance:none;appearance:none;border:1.5px solid #cfdccf;border-radius:10px;padding:5px 26px 5px 9px;font-size:16px;font-weight:700;min-height:36px;max-width:52%;color:#55655a;background-color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23333' stroke-width='2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
.stsel.s-khuon{background-color:#fff3e0;border-color:#fb8c00;color:#b45309}
.stsel.s-phoi{background-color:#e3f2fd;border-color:#1e88e5;color:#0d47a1}
.stsel.s-hoanthien{background-color:#2e7d32;border-color:#2e7d32;color:#fff;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E")}
.stsel:disabled{opacity:.6}
.stro{flex:none;margin-left:auto;border:1.5px solid #cfdccf;border-radius:10px;padding:5px 9px;font-size:15px;font-weight:700;color:#55655a;background:#fff;white-space:nowrap}
.stro.s-khuon{background:#fff3e0;border-color:#fb8c00;color:#b45309}
.stro.s-phoi{background:#e3f2fd;border-color:#1e88e5;color:#0d47a1}
.stro.s-hoanthien{background:#2e7d32;border-color:#2e7d32;color:#fff}
.kt-row{display:flex;align-items:center;gap:8px;background:#eef7ee;border-radius:10px;padding:6px 6px 6px 10px;margin:7px 0 4px}
.kt-row .kt{flex:1;font-size:22px;font-weight:bold;color:#0d3b10;letter-spacing:.2px}
.kt-row .sl{flex:none;background:#1e4620;color:#fff;border-radius:8px;padding:3px 10px;font-size:20px;font-weight:bold;white-space:nowrap}
.kt-row .sl small{font-size:16px;font-weight:normal;opacity:.85;margin-right:3px}
.wsbar{display:flex;gap:6px;overflow-x:auto;margin:0 0 8px;padding-bottom:2px;-webkit-overflow-scrolling:touch}
.wsbar button{flex:0 0 auto;border:2px solid #cfdccf;background:#fff;border-radius:18px;padding:6px 12px;font-size:16px;color:#333;min-height:40px}
.tvpick{display:flex;align-items:center;gap:8px;font-weight:600;color:#1e4620;width:100%;flex-wrap:wrap}
.tvpick select{flex:1;min-width:180px;font-size:16px;padding:8px;border:2px solid #cfdccf;border-radius:12px;background:#fff;min-height:42px}
.wsbar button.on{background:#1e4620;border-color:#1e4620;color:#fff}
.edited{background:#e3f2fd;border:2px solid #1e88e5;color:#0d47a1;border-radius:10px;padding:10px 12px;margin:10px 0;font-weight:bold;font-size:16px}
.badge-ed{display:inline-block;background:#1e88e5;color:#fff;border-radius:8px;padding:1px 7px;font-size:16px;margin-left:6px}
.kv2{display:flex;justify-content:space-between;gap:10px;padding:5px 0;border-bottom:1px dashed #e3eae3;font-size:17px}
.kv2 span{color:#667}
.kv2 b{text-align:right}
.yc{margin:8px 0 2px;padding-left:22px;font-size:17px}
.yc li{margin:3px 0}
.pnote{background:#fff8e1;border-left:5px solid #ffb300;border-radius:8px;padding:8px 10px;margin-top:8px;font-size:17px;white-space:pre-line}
.draw{display:flex;align-items:center;gap:10px;background:#fff;border:2px solid #1e4620;border-radius:12px;padding:12px;margin:8px 0;text-decoration:none;color:#1b1b1b;min-height:56px;cursor:pointer;width:100%;text-align:left;font:inherit}
.draw .ic{font-size:26px;flex:none}
.draw .nm{flex:1;font-size:16px;word-break:break-word}
.draw .op{flex:none;background:#1e4620;color:#fff;border-radius:8px;padding:6px 12px;font-size:16px;font-weight:bold}
details.hist summary{cursor:pointer;list-style:none;font-size:17px}
details.hist summary::-webkit-details-marker{display:none}
details.hist summary::after{content:' ▾';color:#888}
details.hist[open] summary::after{content:' ▴'}
.chip{display:inline-block;color:#fff;border-radius:14px;padding:3px 10px;font-size:16px;font-weight:bold}
.big-btn{display:block;width:100%;border:0;border-radius:12px;padding:16px;font-size:19px;font-weight:bold;color:#fff;margin:10px 0;min-height:56px;cursor:pointer}
.big-btn:disabled{opacity:.55}
.btn-sec{display:inline-block;border:2px solid #1e4620;background:#fff;color:#1e4620;border-radius:10px;padding:10px 14px;font-size:16px;text-decoration:none;margin:4px 6px 4px 0;min-height:44px;cursor:pointer}
.banner-red{background:#c62828;color:#fff;padding:14px;border-radius:10px;font-weight:bold;font-size:18px;margin:10px 0}
.banner-yellow{background:#fff3cd;color:#6d4c00;border:2px solid #ffca28;padding:12px;border-radius:10px;margin:10px 0;font-weight:bold}
.box{background:#fff;border-radius:12px;padding:12px 14px;margin:10px 0}
.muted{color:#666;font-size:16px}
.hist div{font-size:16px;border-bottom:1px dashed #ddd;padding:5px 0}
textarea{width:100%;font-size:17px;padding:10px;border-radius:8px;border:1px solid #aaa;font-family:inherit}
.sheet{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:20;display:none;align-items:flex-end}
.sheet .in{background:#fff;width:100%;max-width:720px;margin:0 auto;max-height:92vh;overflow:auto;border-radius:16px 16px 0 0;padding:16px}
.thumbs{display:flex;flex-wrap:wrap;gap:8px}
.thumbs div{width:31%;font-size:16px;text-align:center}
.thumbs img{width:100%;height:90px;object-fit:cover;border-radius:8px;border:1px solid #ccc}
.err{background:#ffebee;color:#b71c1c;padding:12px;border-radius:10px;margin:10px 0;font-size:17px}
.center{text-align:center;padding:30px 10px;color:#555}
.soon-box{background:#fff;border-radius:12px;padding:18px;text-align:center;color:#555}
