:root{
  --bg:#eaf1fb;
  --card:#ffffff;
  --line:#dbe4f0;
  --text:#0f172a;
  --muted:#64748b;
  --blue:#2563eb;
  --blue2:#1d4ed8;
  --green:#16a34a;
  --orange:#f97316;
  --danger:#dc2626;
  --shadow:0 12px 30px rgba(15,23,42,.10);
  --radius:22px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:linear-gradient(180deg,#eef4ff 0%,#e7eef9 100%);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,sans-serif}
button,input,select{font:inherit}
.phone-wrap{min-height:100vh;display:flex;align-items:flex-start;justify-content:center;padding:14px}
.app-shell{width:100%;max-width:414px;min-height:820px;background:transparent}
.topbar{padding:10px 4px 14px}
.topbar h1{margin:0;font-size:34px;font-weight:900;letter-spacing:-0.02em;line-height:1.05}
.topbar p{margin:6px 0 0;color:var(--muted);font-size:15px}
.master-badge{margin-top:12px;padding:10px 14px;border:none;border-radius:999px;background:#e8f5e9;color:#157f38;font-weight:800;font-size:13px;box-shadow:var(--shadow)}
.search-card,.order-card,.empty-card,.master-toolbar,.media-box,.sheet-panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.search-card{padding:16px;margin-bottom:14px}
.search-card label{display:block;font-size:18px;font-weight:900;margin-bottom:10px}
.search-row{display:flex;gap:10px}.search-row input{flex:1;min-width:0;border:1px solid var(--line);border-radius:16px;padding:15px 14px;font-size:18px;outline:none;background:#fff}.search-row input:focus,.field-block input:focus,.field-block select:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
.search-row button,.primary-btn,.danger-btn,.tab-btn,.icon-btn{border:none;cursor:pointer}
.search-row button,.primary-btn{border-radius:16px;background:var(--blue);color:#fff;font-weight:900;font-size:16px;padding:0 18px;min-width:88px}.search-row button:hover,.primary-btn:hover{background:var(--blue2)}
.help-text,.media-note{margin:10px 2px 0;color:var(--muted);font-size:13px;line-height:1.45}
.result-info{padding:2px 4px 12px;color:var(--muted);font-size:14px}
.master-toolbar{padding:12px;margin-bottom:14px}
.tab-row{display:flex;gap:8px;margin-bottom:10px}.tab-btn{flex:1;border-radius:14px;padding:12px 10px;background:#eef2ff;color:#334155;font-weight:800}.tab-btn.active{background:var(--blue);color:#fff}.full-btn{width:100%;min-height:50px}
.orders-list{display:flex;flex-direction:column;gap:14px;padding-bottom:22px}
.order-card{padding:16px;cursor:pointer}.order-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}.order-name{font-size:23px;font-weight:900;line-height:1.12}.order-id{font-size:12px;color:var(--muted);margin-top:6px;word-break:break-word}.status-pill{padding:8px 12px;border-radius:999px;font-size:12px;font-weight:900;white-space:nowrap}.status-pill.pending{background:#fff7ed;color:#c2410c}.status-pill.done{background:#ecfdf5;color:#15803d}
.info-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.info-item{background:#f8fbff;border:1px solid #edf2f8;border-radius:16px;padding:10px 12px}.info-item span{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}.info-item strong{display:block;font-size:15px;word-break:break-word}
.media-section{margin-top:14px}.media-title{font-size:15px;font-weight:900;margin-bottom:10px}.media-grid,.media-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.media-item{position:relative;background:#f8fafc;border:1px solid var(--line);border-radius:16px;overflow:hidden;min-height:140px;cursor:pointer;display:flex;align-items:center;justify-content:center}.media-item img,.media-item video{width:100%;height:140px;object-fit:cover;display:block;background:#f1f5f9}.media-overlay{position:absolute;inset:0;display:grid;place-items:center;font-size:42px;color:#fff;text-shadow:0 4px 16px rgba(0,0,0,.45);pointer-events:none}
.upload-tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;height:140px;border:2px dashed #cbd5e1;border-radius:16px;background:#f8fafc;color:#64748b;cursor:pointer;text-align:center;padding:8px}.upload-plus{font-size:44px;font-weight:700;line-height:1;color:#94a3b8;margin-bottom:4px}.upload-label{font-size:13px;line-height:1.3}
.media-thumb{position:relative;background:#f8fafc;border:1px solid var(--line);border-radius:16px;overflow:hidden;min-height:140px}.media-thumb img,.media-thumb video{width:100%;height:140px;object-fit:cover;display:block;background:#f1f5f9}.thumb-close{position:absolute;top:6px;right:6px;width:28px;height:28px;border-radius:8px;border:none;background:rgba(15,23,42,.92);color:#fff;font-weight:900;cursor:pointer;z-index:3}.thumb-badge{position:absolute;left:8px;bottom:8px;background:rgba(15,23,42,.82);color:#fff;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:700}.uploading-mask{position:absolute;inset:0;background:rgba(255,255,255,.85);display:flex;align-items:center;justify-content:center;text-align:center;padding:12px;color:#334155;font-size:13px;font-weight:700}
.empty-card{padding:24px 16px;text-align:center;color:var(--muted);font-size:15px}
.hidden{display:none !important}.hidden-input{display:none}
.viewer{position:fixed;inset:0;background:rgba(0,0,0,.86);z-index:20000;display:grid;place-items:center;padding:16px}.viewer-close{position:fixed;top:14px;right:14px;width:46px;height:46px;border:none;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;font-size:30px;line-height:1}.viewer-content{max-width:100%;max-height:88vh}.viewer-content img,.viewer-content video{max-width:100%;max-height:88vh;border-radius:18px;background:#000;display:block}
.sheet{position:fixed;inset:0;z-index:10000}.sheet-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.52)}.sheet-panel{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(414px, calc(100% - 16px));max-height:92vh;display:flex;flex-direction:column;overflow:hidden}.sheet-header{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:16px 16px 12px;border-bottom:1px solid #eef2f7}.sheet-header h2{margin:0;font-size:24px}.sheet-header p{margin:6px 0 0;color:var(--muted);font-size:13px}.icon-btn{width:38px;height:38px;border-radius:12px;background:#eef2ff;color:#1e293b;font-size:24px}.sheet-body{padding:14px 16px;overflow:auto}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px}.field-block{display:block}.field-block span{display:block;font-size:13px;font-weight:800;margin-bottom:6px}.field-block input,.field-block select{width:100%;border:1px solid var(--line);border-radius:14px;padding:12px 12px;background:#fff;outline:none}.checkbox-row{display:flex;align-items:center;gap:8px;padding-top:24px}.checkbox-row input{width:auto;transform:scale(1.2)}.media-box{padding:12px;margin-top:12px}.sheet-footer{display:flex;gap:10px;padding:14px 16px 16px;border-top:1px solid #eef2f7}.sheet-footer .primary-btn,.sheet-footer .danger-btn{flex:1;min-height:48px}.danger-btn{border-radius:16px;background:var(--danger);color:#fff;font-weight:900;font-size:16px}.danger-btn:hover{background:#b91c1c}
@media (max-width:390px){.app-shell{max-width:100%}.search-row{flex-direction:column}.search-row button{width:100%;min-height:52px}.info-grid,.form-grid,.media-grid,.media-edit-grid{grid-template-columns:1fr}.sheet-panel{width:calc(100% - 12px)}}


/* VO v5: initial list shows compact order rows only */
.order-row-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  box-shadow:var(--shadow);
  cursor:pointer;
}
.row-main{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.row-name{
  font-size:20px;
  font-weight:900;
  line-height:1.15;
}
.row-sub{
  color:var(--muted);
  font-size:13px;
  margin-top:5px;
}
.row-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
  font-size:12px;
  margin-top:10px;
  border-top:1px solid #eef2f7;
  padding-top:10px;
}
.empty-mini{
  min-height:90px;
  border:1px dashed #cbd5e1;
  border-radius:16px;
  display:grid;
  place-items:center;
  color:var(--muted);
  font-size:13px;
  background:#f8fafc;
}
.field-block input[readonly],
.field-block select:disabled{
  background:#f8fafc;
  color:#475569;
}


/* VO v9 fix: media viewer must appear above order detail modal */
.viewer {
  z-index: 30000 !important;
}

.viewer-close {
  z-index: 30001 !important;
}


/* VO v16 */
.cleanup-warning{
  color:#dc2626;
  font-weight:900;
}

/* VO client self-order extension */
.client-order-main-btn{margin:-2px 0 14px;min-height:52px}
.tab-row{flex-wrap:wrap}.tab-row .tab-btn{min-width:calc(50% - 4px)}
.status-pill.review{background:#fef3c7;color:#92400e}.status-pill.reply{background:#fce7f3;color:#be185d}
.reply-btn{border:none;border-radius:16px;background:#db2777;color:#fff;font-weight:900;font-size:16px;min-height:48px;padding:0 14px;cursor:pointer;flex:1}.reply-btn:hover{background:#be185d}
.client-meta-box{background:#f8fbff;border:1px solid #dbeafe;border-radius:18px;padding:12px;margin:0 0 14px}.client-meta-title{font-size:15px;font-weight:900;margin-bottom:10px}.client-meta-line,.client-meta-total{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-top:1px solid #e8f0fb;font-size:13px}.client-meta-line:first-of-type{border-top:none}.client-meta-total{font-size:16px;font-weight:900}.client-meta-total strong{color:var(--blue)}.client-meta-small{font-size:13px;color:#475569;line-height:1.5;margin-top:8px;word-break:break-word}.client-meta-small a{color:var(--blue);font-weight:900}.client-note{margin-top:10px;border-radius:14px;background:#fff1f2;border:1px solid #fecdd3;color:#9f1239;padding:10px;font-size:13px;line-height:1.4}
.client-section-title{font-size:15px;font-weight:900;margin:12px 0 8px}.client-items-wrap{display:flex;flex-direction:column;gap:8px}.client-item-row{display:grid;grid-template-columns:1.2fr .65fr 1fr auto 32px;gap:6px;align-items:center;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:8px}.client-item-row select,.client-item-row input{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 8px;background:#fff;outline:none}.client-back-wrap{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:800;color:#334155}.client-line-total{font-size:12px;font-weight:900;color:var(--blue);white-space:nowrap;text-align:right}.remove-line-btn{width:30px;height:30px;border:none;border-radius:10px;background:#fee2e2;color:#b91c1c;font-size:20px;font-weight:900;line-height:1;cursor:pointer}.add-line-btn,.upload-bill-btn{width:100%;border:none;border-radius:15px;background:#eef2ff;color:#1d4ed8;font-weight:900;min-height:44px;margin-top:8px;cursor:pointer}.client-link-field{margin-top:14px}.client-link-field small{color:var(--muted);font-weight:700}.client-link-field textarea{width:100%;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff;outline:none;resize:vertical;font:inherit}.client-total-box{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#ecfdf5;border:1px solid #bbf7d0;border-radius:18px;padding:14px;margin-top:14px}.client-total-box span{font-weight:900;color:#166534}.client-total-box strong{font-size:22px;color:#15803d}.qr-box{background:#fff;border:1px solid var(--line);border-radius:18px;padding:12px;text-align:center}.qr-box img{width:230px;max-width:100%;height:auto;border-radius:14px;background:#fff}.qr-info{font-size:13px;line-height:1.55;color:#334155;margin-top:8px}.client-bill-box{box-shadow:none}.client-bill-preview{margin-top:10px;text-align:center;color:var(--muted);font-size:13px}.client-bill-preview img{width:160px;max-width:100%;border-radius:14px;border:1px solid var(--line);display:block;margin:0 auto 6px}.uploading-inline{border:1px dashed #cbd5e1;border-radius:14px;padding:14px;background:#f8fafc;color:#475569;font-weight:800}
@media (max-width:390px){.client-item-row{grid-template-columns:1fr 76px}.client-back-wrap,.client-line-total,.remove-line-btn{grid-column:auto}.client-line-total{text-align:left}.client-form-grid{grid-template-columns:1fr}}
.field-wide{grid-column:1 / -1}.client-edit-field{margin-top:10px}.client-edit-field textarea{width:100%;resize:vertical}

/* VO v10 master revenue dashboard */
.master-revenue-box{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:12px;
  margin:-2px 0 14px;
}
.revenue-kpi-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.revenue-kpi-card{
  background:linear-gradient(135deg,#eff6ff,#ffffff);
  border:1px solid #dbeafe;
  border-radius:18px;
  padding:12px;
  min-height:78px;
}
.revenue-kpi-card span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  line-height:1.3;
  margin-bottom:8px;
}
.revenue-kpi-card strong{
  display:block;
  color:#1d4ed8;
  font-size:22px;
  font-weight:1000;
  line-height:1.1;
  word-break:break-word;
}
.revenue-open-btn{
  width:100%;
  border:none;
  border-radius:16px;
  min-height:46px;
  background:#1d4ed8;
  color:#fff;
  font-weight:900;
  font-size:16px;
  margin-top:10px;
  cursor:pointer;
}
.revenue-sheet .revenue-panel{
  width:min(414px, calc(100% - 14px));
  border-radius:28px 28px 0 0;
  max-height:92vh;
}
.revenue-grip{
  width:56px;
  height:5px;
  border-radius:99px;
  background:#cbd5e1;
  margin:12px auto 0;
}
.revenue-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:18px 18px 10px;
}
.revenue-eyebrow{
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#94a3b8;
  font-size:12px;
  font-weight:1000;
  margin-bottom:8px;
}
.revenue-head h2{
  margin:0;
  color:#111827;
  font-size:25px;
  line-height:1.1;
  cursor:pointer;
  user-select:none;
  border-radius:12px;
  padding:2px 4px;
}
.revenue-head h2:active{
  background:#eef2ff;
}
.revenue-close{
  border-radius:999px;
  background:#f1f5f9;
}
.revenue-body{
  padding:0 18px 18px;
  overflow:auto;
}
.revenue-tabs{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:0;
  background:#f1f5f9;
  border-radius:18px;
  padding:6px;
  margin:8px 0 16px;
}
.revenue-tab{
  border:none;
  border-radius:14px;
  background:transparent;
  min-height:42px;
  color:#64748b;
  font-weight:1000;
  cursor:pointer;
}
.revenue-tab.active{
  background:#fff;
  color:#111827;
  box-shadow:0 8px 20px rgba(15,23,42,.08);
}
.revenue-control label{
  display:block;
  font-weight:1000;
  color:#334155;
  font-size:14px;
  margin-bottom:8px;
}
.revenue-date-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.revenue-date-grid span{
  display:block;
  color:#64748b;
  font-size:12px;
  font-weight:900;
  margin-bottom:6px;
}
.revenue-control input,.revenue-control select{
  width:100%;
  min-height:46px;
  border:1px solid #cbd5e1;
  border-radius:14px;
  padding:10px 12px;
  background:#fff;
  font:inherit;
  outline:none;
}
.revenue-result-card{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:8px;
  background:linear-gradient(135deg,#173274,#2554e6);
  color:#fff;
  border-radius:18px;
  padding:16px 14px;
  margin:16px 0;
  box-shadow:0 14px 28px rgba(37,84,230,.2);
  overflow:hidden;
}
.revenue-result-title{
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#bfdbfe;
  font-size:12px;
  font-weight:1000;
  line-height:1.25;
}
.revenue-period-label{
  font-size:17px;
  line-height:1.25;
  font-weight:1000;
  white-space:normal;
  overflow-wrap:anywhere;
}
.revenue-result-total-row{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  margin-top:2px;
}
.revenue-result-card strong{
  display:block;
  font-size:27px;
  line-height:1.05;
  font-weight:1000;
  white-space:normal;
  overflow-wrap:anywhere;
}
.revenue-result-card p{
  margin:0;
  font-size:12px;
  color:#dbeafe;
}
.revenue-list-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  color:#111827;
}
.revenue-list-head span{
  color:#64748b;
  font-size:12px;
  font-weight:800;
}
.revenue-orders-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.revenue-order-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px 12px;
  background:#fff;
}
.revenue-order-row b,.revenue-order-row span{
  display:block;
}
.revenue-order-row b{
  font-size:14px;
  color:#0f172a;
}
.revenue-order-row span{
  color:#64748b;
  font-size:12px;
  margin-top:3px;
}
.revenue-order-row strong{
  color:#1d4ed8;
  font-weight:1000;
  white-space:nowrap;
}
.revenue-empty{
  color:#64748b;
  font-size:14px;
  padding:8px 0 4px;
}

/* Force master status buttons into one compact row */
.master-toolbar .tab-row{
  display:grid !important;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:5px;
  margin-bottom:10px;
  flex-wrap:nowrap !important;
}
.master-toolbar .tab-row .tab-btn{
  min-width:0 !important;
  padding:10px 4px;
  border-radius:12px;
  font-size:12px;
  line-height:1.15;
  white-space:nowrap;
}

@media (max-width:390px){
  .revenue-kpi-card strong{font-size:19px}
  .revenue-kpi-card span{font-size:11px}
  .revenue-head h2{font-size:23px}
  .revenue-body{padding-left:16px;padding-right:16px}
}

/* VO v13 VIP + client deadline */
.master-action-row{
  display:grid;
  grid-template-columns:1fr 3fr;
  gap:8px;
  align-items:stretch;
  margin-top:10px;
}
.master-action-row .full-btn{
  width:100%;
  min-height:50px;
}
.vip-btn{
  border:none;
  border-radius:16px;
  background:#fef3c7;
  color:#92400e;
  font-weight:1000;
  font-size:16px;
  cursor:pointer;
  min-height:50px;
  box-shadow:none;
}
.vip-btn:hover{background:#fde68a}
.vip-list{display:flex;flex-direction:column;gap:8px}
.vip-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--line);
  background:#f8fafc;
  border-radius:16px;
  padding:10px 12px;
}
.vip-row b{display:block;font-size:15px}
.vip-row span{display:block;color:var(--muted);font-size:12px;margin-top:2px;font-weight:800}
.vip-row button{
  border:none;
  border-radius:12px;
  background:#fee2e2;
  color:#b91c1c;
  font-weight:900;
  padding:8px 10px;
  cursor:pointer;
}
.client-total-box span{
  line-height:1.25;
}

/* VO v14: đặt ngày mong muốn giao dưới Link ảnh */
.client-deadline-field{
  margin-top:10px;
}
.master-action-row{
  grid-template-columns:1fr 3fr !important;
}
.master-action-row #vipBtn{grid-column:1;grid-row:1;}
.master-action-row #addOrderBtn{grid-column:2;grid-row:1;}

/* VO v15: Thêm order 4/5 bên trái, VIP 1/5 bên phải */
.master-action-row{
  grid-template-columns:4fr 1fr !important;
}
.master-action-row #addOrderBtn{grid-column:1 !important;grid-row:1 !important;}
.master-action-row #vipBtn{grid-column:2 !important;grid-row:1 !important;}

/* VO v15 price table by logo */
.topbar{
  position:relative;
  padding-right:88px;
}
.price-logo-btn{
  position:absolute;
  right:4px;
  top:10px;
  width:64px;
  min-height:64px;
  border:none;
  border-radius:20px;
  background:#ffffff;
  color:#1d4ed8;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  cursor:pointer;
  padding:6px;
  font-size:10px;
  font-weight:1000;
  line-height:1;
}
.price-logo-btn img{
  width:34px;
  height:34px;
  border-radius:12px;
  object-fit:cover;
  display:block;
}
.price-logo-btn.master-active{
  outline:3px solid rgba(37,99,235,.18);
  background:linear-gradient(135deg,#eff6ff,#ffffff);
}
.price-panel{
  width:min(414px, calc(100% - 14px));
  max-height:94vh;
}
.price-toolbar{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:12px;
}
.price-toolbar button{
  border:none;
  border-radius:14px;
  background:#eef2ff;
  color:#1d4ed8;
  min-height:42px;
  font-weight:900;
  cursor:pointer;
}
.price-editor{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.price-size-card{
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:18px;
  padding:12px;
}
.price-size-head{
  display:grid;
  grid-template-columns:1fr 120px;
  gap:10px;
  align-items:end;
  margin-bottom:10px;
}
.price-size-head b{
  display:block;
  font-size:16px;
  font-weight:1000;
}
.price-size-head span{
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:800;
  margin-top:3px;
}
.price-size-head label,
.price-range-grid label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
}
.price-size-head input,
.price-range-grid input{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:10px 8px;
  outline:none;
  margin-top:5px;
  font-weight:800;
}
.price-range-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
}
.price-range-grid span{
  display:block;
  color:#64748b;
  font-size:11px;
  margin-bottom:2px;
}
@media (max-width:390px){
  .price-size-head{grid-template-columns:1fr;}
  .price-range-grid{grid-template-columns:1fr 1fr;}
}

/* Full editable lenticular price table */
.price-panel{
  width:min(1180px, calc(100% - 14px));
  max-height:96vh;
}
.price-table-card{
  border:1px solid #dbeafe;
  background:#ffffff;
  border-radius:18px;
  padding:12px;
  overflow:hidden;
}
.price-table-title{
  text-align:center;
  font-weight:1000;
  font-size:18px;
  color:#0f172a;
  margin-bottom:8px;
}
.price-table-title small{font-size:13px;color:#475569;}
.price-table-scroll{
  overflow:auto;
  border:1px solid #cbd5e1;
  border-radius:12px;
  background:#fff;
}
.price-edit-table{
  border-collapse:collapse;
  width:100%;
  min-width:980px;
  font-size:13px;
}
.price-edit-table th,
.price-edit-table td{
  border:1px solid #cbd5e1;
  padding:5px;
  text-align:center;
  vertical-align:middle;
}
.price-edit-table th{
  background:#f8fafc;
  font-weight:1000;
  color:#0f172a;
  white-space:nowrap;
}
.price-edit-table input,
.price-edit-table textarea{
  width:100%;
  border:1px solid transparent;
  border-radius:8px;
  background:#f8fafc;
  padding:8px 6px;
  outline:none;
  text-align:center;
  font-weight:800;
  color:#0f172a;
}
.price-edit-table textarea{
  resize:vertical;
  min-height:48px;
  font-size:12px;
  font-weight:700;
}
.price-edit-table input:focus,
.price-edit-table textarea:focus{
  border-color:#2563eb;
  background:#ffffff;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.price-label{color:#dc2626!important;background:#fff7ed!important;font-weight:1000!important;}
.price-special-row th{background:#fff7ed;}
.price-note-row th{background:#fefce8;}
.price-help{
  color:#64748b;
  font-size:12px;
  font-weight:800;
  line-height:1.45;
  margin-top:8px;
}
.compact-head{grid-template-columns:1fr!important;}
.client-item-row{grid-template-columns:1.1fr .55fr .75fr .8fr auto 32px;}
.client-frame:disabled{background:#e5e7eb!important;color:#64748b!important;}
@media (max-width:720px){
  .client-item-row{grid-template-columns:1fr 72px 92px;}
  .client-back-wrap,.client-line-total,.remove-line-btn{grid-column:auto;}
  .price-table-title{font-size:15px;}
}


/* compact price editor layout per user request */
.vip-discount-grid.four-cols{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
.price-table-card.simple-layout-card{
  padding:12px;
}
.price-top-controls{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:12px;
}
.price-top-field{
  display:block;
}
.price-top-field span{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#334155;
  margin-bottom:6px;
}
.price-select,
.price-extra-frame-single{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  padding:11px 12px;
  outline:none;
  font-weight:800;
  color:#0f172a;
}
.price-select:focus,
.price-extra-frame-single:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.price-top-field.disabled .price-extra-frame-single{
  background:#e5e7eb;
  color:#64748b;
}
.simple-table-scroll{
  overflow:auto;
}
.single-size-table{
  min-width:520px;
}
.single-size-table .price-back-col{
  min-width:180px;
  vertical-align:middle;
}
.single-size-table .price-back-single{
  height:52px;
}
@media (max-width:900px){
  .vip-discount-grid.four-cols{grid-template-columns:1fr 1fr!important;}
  .price-top-controls{grid-template-columns:1fr;}
}
@media (max-width:520px){
  .vip-discount-grid.four-cols{grid-template-columns:1fr!important;}
  .single-size-table{min-width:420px;}
}


/* mobile-friendly compact price editor */
.price-panel{
  width:min(560px, calc(100% - 18px))!important;
  max-height:92vh!important;
  border-radius:22px!important;
}
.price-panel .sheet-body{
  padding:10px 16px 12px!important;
}
.price-toolbar{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:8px!important;
  margin-bottom:10px!important;
}
.price-toolbar button{
  width:100%!important;
  min-height:42px!important;
  border-radius:14px!important;
}
.mobile-price-card{
  padding:10px!important;
  border-radius:16px!important;
}
.vip-discount-grid.four-cols{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:8px!important;
}
.vip-discount-grid.four-cols label{
  min-width:0!important;
}
.vip-discount-grid.four-cols span{
  white-space:nowrap!important;
  font-size:11px!important;
}
.vip-discount-grid.four-cols input{
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  padding:8px!important;
  border-radius:12px!important;
  box-sizing:border-box!important;
}
.mobile-price-table-card{
  padding:10px!important;
  border-radius:16px!important;
}
.mobile-price-controls{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:9px!important;
  margin-bottom:10px!important;
}
.price-fee-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.price-select,
.price-back-single,
.price-extra-frame-single{
  width:100%!important;
  min-width:0!important;
  height:46px!important;
  border:1px solid var(--line)!important;
  border-radius:14px!important;
  background:#fff!important;
  padding:10px 12px!important;
  outline:none!important;
  font-weight:900!important;
  color:#0f172a!important;
  box-sizing:border-box!important;
}
.price-top-field span{
  font-size:12px!important;
  font-weight:900!important;
  margin-bottom:5px!important;
}
.simple-table-scroll{
  overflow:visible!important;
  border-radius:14px!important;
}
.phone-size-table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  font-size:13px!important;
}
.phone-size-table th:first-child{
  width:38%!important;
}
.phone-size-table th,
.phone-size-table td{
  padding:4px!important;
}
.phone-size-table input.price-cell{
  height:38px!important;
  padding:7px 6px!important;
  border-radius:10px!important;
}
@media (max-width:520px){
  .price-panel{
    width:calc(100% - 12px)!important;
    max-height:94vh!important;
    border-radius:18px!important;
  }
  .price-panel .sheet-head{
    padding:14px 14px 8px!important;
  }
  .price-panel .sheet-head h2{
    font-size:22px!important;
  }
  .price-panel .sheet-body{
    padding:8px 12px 10px!important;
  }
  .price-toolbar{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .vip-discount-grid.four-cols{
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
  }
  .price-fee-row{
    grid-template-columns:1fr!important;
  }
  .phone-size-table{
    font-size:12px!important;
  }
  .phone-size-table th:first-child{
    width:42%!important;
  }
  .phone-size-table input.price-cell{
    height:36px!important;
  }
  #savePriceBtn{
    height:48px!important;
    border-radius:14px!important;
  }
}


/* tighter centered mobile price editor */
.price-panel{
  width:min(500px, calc(100% - 22px))!important;
  margin:auto!important;
}
.price-panel .sheet-head,
.price-panel .sheet-body,
.price-panel .sheet-foot{
  width:100%;
  box-sizing:border-box;
}
.price-editor{
  align-items:center!important;
}
.mobile-price-card,
.mobile-price-table-card,
.price-toolbar,
#savePriceBtn{
  width:min(100%, 440px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
.vip-discount-grid.four-cols{
  gap:6px!important;
}
.vip-discount-grid.four-cols input{
  height:36px!important;
  padding:6px 8px!important;
  font-size:12px!important;
}
.price-select,
.price-back-single,
.price-extra-frame-single{
  height:40px!important;
  padding:8px 10px!important;
  font-size:12px!important;
}
.price-fee-row{
  gap:6px!important;
}
.phone-size-table{
  width:88%!important;
  margin:0 auto!important;
  font-size:12px!important;
}
.phone-size-table th,
.phone-size-table td{
  padding:3px!important;
}
.phone-size-table input.price-cell{
  width:88%!important;
  margin:0 auto!important;
  height:32px!important;
  padding:5px 6px!important;
  font-size:12px!important;
}
.phone-size-table th:first-child{
  width:34%!important;
}
.price-top-field span,
.vip-discount-grid.four-cols span{
  font-size:11px!important;
}
#savePriceBtn{
  height:44px!important;
}
@media (max-width:520px){
  .price-panel{
    width:min(430px, calc(100% - 18px))!important;
    margin:auto!important;
  }
  .mobile-price-card,
  .mobile-price-table-card,
  .price-toolbar,
  #savePriceBtn{
    width:min(100%, 390px)!important;
  }
  .phone-size-table{
    width:84%!important;
  }
  .phone-size-table input.price-cell{
    width:84%!important;
    height:30px!important;
  }
  .vip-discount-grid.four-cols input{
    height:34px!important;
  }
  .price-select,
  .price-back-single,
  .price-extra-frame-single{
    height:38px!important;
  }
}


/* ultra compact price editor requested */
.price-panel{
  width:min(455px, calc(100% - 28px))!important;
  max-height:90vh!important;
  border-radius:18px!important;
}
.price-panel .sheet-head{
  padding:14px 16px 8px!important;
}
.price-panel .sheet-head h2{
  font-size:22px!important;
  line-height:1.05!important;
}
.price-panel .sheet-head p{
  font-size:12px!important;
  line-height:1.25!important;
  margin-top:6px!important;
}
.price-panel .sheet-body{
  padding:8px 12px 10px!important;
}
.price-panel .sheet-foot{
  padding:10px 12px 12px!important;
}
.price-toolbar,
.mobile-price-card,
.mobile-price-table-card,
#savePriceBtn{
  width:min(100%, 350px)!important;
}
.price-toolbar{
  gap:6px!important;
  margin-bottom:8px!important;
}
.price-toolbar button{
  min-height:36px!important;
  height:36px!important;
  font-size:13px!important;
  border-radius:12px!important;
  padding:6px 8px!important;
}
.mobile-price-card,
.mobile-price-table-card{
  padding:8px!important;
  border-radius:14px!important;
}
.vip-discount-grid.four-cols{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:4px!important;
}
.vip-discount-grid.four-cols span{
  font-size:9px!important;
  letter-spacing:-.2px!important;
}
.vip-discount-grid.four-cols input{
  height:28px!important;
  padding:3px 6px!important;
  font-size:12px!important;
  border-radius:9px!important;
}
.mobile-price-controls{
  gap:6px!important;
  margin-bottom:7px!important;
}
.price-fee-row{
  grid-template-columns:1fr 1fr!important;
  gap:5px!important;
}
.price-top-field span{
  font-size:10px!important;
  line-height:1.2!important;
  margin-bottom:4px!important;
}
.price-size-title{
  display:block!important;
  font-weight:900!important;
}
.price-size-title em{
  color:#dc2626!important;
  font-style:normal!important;
  font-weight:800!important;
  font-size:9px!important;
  line-height:1.15!important;
}
.price-select,
.price-back-single,
.price-extra-frame-single{
  height:32px!important;
  padding:5px 8px!important;
  font-size:12px!important;
  border-radius:10px!important;
}
.simple-table-scroll{
  width:100%!important;
  display:flex!important;
  justify-content:center!important;
}
.phone-size-table{
  width:72%!important;
  min-width:250px!important;
  max-width:290px!important;
  font-size:11px!important;
}
.phone-size-table th:first-child{
  width:38%!important;
}
.phone-size-table th,
.phone-size-table td{
  padding:2px!important;
}
.phone-size-table input.price-cell{
  width:76%!important;
  height:26px!important;
  padding:3px 5px!important;
  font-size:11px!important;
  border-radius:8px!important;
}
#savePriceBtn{
  height:38px!important;
  border-radius:12px!important;
  font-size:14px!important;
  padding:6px 10px!important;
}
@media (max-width:520px){
  .price-panel{
    width:min(390px, calc(100% - 26px))!important;
    max-height:91vh!important;
  }
  .price-panel .sheet-head{
    padding:12px 14px 7px!important;
  }
  .price-panel .sheet-head h2{
    font-size:21px!important;
  }
  .price-panel .sheet-head p{
    font-size:11px!important;
  }
  .price-panel .sheet-body{
    padding:7px 10px 8px!important;
  }
  .price-toolbar,
  .mobile-price-card,
  .mobile-price-table-card,
  #savePriceBtn{
    width:min(100%, 320px)!important;
  }
  .vip-discount-grid.four-cols{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:3px!important;
  }
  .vip-discount-grid.four-cols span{
    font-size:8px!important;
  }
  .vip-discount-grid.four-cols input{
    height:26px!important;
    padding:2px 5px!important;
    font-size:11px!important;
  }
  .price-fee-row{
    grid-template-columns:1fr 1fr!important;
    gap:4px!important;
  }
  .price-size-title em{
    font-size:8px!important;
  }
  .price-select,
  .price-back-single,
  .price-extra-frame-single{
    height:30px!important;
    font-size:11px!important;
  }
  .phone-size-table{
    width:70%!important;
    min-width:230px!important;
    max-width:270px!important;
    font-size:10.5px!important;
  }
  .phone-size-table input.price-cell{
    height:24px!important;
    font-size:10.5px!important;
  }
  #savePriceBtn{
    height:36px!important;
  }
}


/* client readonly price view */
.client-price-view .price-master-desc,
.client-price-view .price-toolbar,
.client-price-view .vip-discount-card,
.client-price-view .sheet-footer{
  display:none!important;
}
.client-price-view .sheet-body{
  border-top:0!important;
  padding-top:10px!important;
}
.client-price-view input[readonly]{
  pointer-events:none!important;
  caret-color:transparent!important;
  color:#0f172a!important;
  background:#f8fafc!important;
}
.client-price-view .price-panel{
  max-height:90vh!important;
}
.client-price-view .mobile-price-table-card{
  margin-top:0!important;
}

.client-size-note{
  margin:-2px 0 8px;
  font-size:11px;
  line-height:1.35;
  font-weight:800;
}
.client-size-note span{
  color:#dc2626;
}


/* client item two-row layout */
.client-items-wrap{gap:8px!important;}
.client-item-row{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  align-items:stretch!important;
  background:#f8fafc!important;
  border:1px solid var(--line)!important;
  border-radius:16px!important;
  padding:8px!important;
}
.client-item-top-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 52px 32px!important;
  gap:6px!important;
  align-items:center!important;
}
.client-frame-price-row{
  display:grid!important;
  grid-template-columns:auto 74px auto minmax(62px,1fr)!important;
  gap:6px!important;
  align-items:center!important;
}
.client-item-row select,
.client-item-row input{
  width:100%!important;
  box-sizing:border-box!important;
  min-width:0!important;
}
.client-item-row .client-size,
.client-item-row .client-qty,
.client-item-row .client-frame{
  height:40px!important;
  padding:8px 8px!important;
  border-radius:12px!important;
}
.client-back-wrap{
  justify-content:center!important;
  gap:4px!important;
  line-height:1.05!important;
  min-width:62px!important;
  white-space:normal!important;
}
.client-back-wrap input{
  width:14px!important;
  height:14px!important;
  flex:0 0 auto!important;
}
.client-frame-label{
  color:#334155;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.client-line-total{
  text-align:right!important;
  color:#2563eb!important;
  font-size:13px!important;
  font-weight:1000!important;
  white-space:nowrap!important;
  overflow:hidden;
  text-overflow:ellipsis;
}
.remove-line-btn{
  align-self:center!important;
}
@media (max-width:390px){
  .client-item-top-row{
    grid-template-columns:minmax(0,1fr) 48px 30px!important;
    gap:5px!important;
  }
  .client-frame-price-row{
    grid-template-columns:auto 62px auto minmax(52px,1fr)!important;
    gap:5px!important;
  }
  .client-back-wrap{font-size:10.5px!important;min-width:58px!important;}
  .client-frame-label{font-size:11px!important;}
  .client-line-total{font-size:12px!important;}
}

/* move back-side checkbox to second row after frame input */
.client-frame-price-row .client-back-wrap{
  justify-content:flex-start!important;
  min-width:58px!important;
  font-size:11px!important;
}
.client-frame-price-row .client-back-wrap input{
  width:13px!important;
  height:13px!important;
}
@media (max-width:390px){
  .client-frame-price-row .client-back-wrap{font-size:10px!important;min-width:52px!important;}
}


/* client order: make Size 2/3 and SL 1/3, keep delete button compact */
.client-item-top-row{
  grid-template-columns:minmax(0,2fr) minmax(76px,1fr) 32px!important;
}
.client-item-top-row .client-qty{
  min-width:0!important;
  text-align:center!important;
}
@media (max-width:390px){
  .client-item-top-row{
    grid-template-columns:minmax(0,2fr) minmax(68px,1fr) 30px!important;
  }
}
.client-shop-note-field{
  margin-top:12px;
}
.client-shop-note-field textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background:#fff;
  outline:none;
  resize:vertical;
  font:inherit;
  min-height:82px;
  box-sizing:border-box;
}
.client-shop-note-field span{
  font-weight:900;
}

.vip-action-row{
  display:grid;
  grid-template-columns:1fr 2fr;
  gap:10px;
  margin:14px 0 12px;
}
.vip-action-row .ghost-btn,
.vip-action-row .primary-btn{
  height:50px;
  border-radius:14px;
  font-weight:900;
}
.vip-action-row .ghost-btn{
  border:1px solid #d7e4fb;
  background:#eef4ff;
  color:#1d4ed8;
}
.vip-row{
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:10px;
  align-items:center;
}
.vip-row-info{
  min-width:0;
}
.vip-total-btn{
  border:0;
  background:#f1f5f9;
  color:#2563eb;
  font-weight:900;
  border-radius:12px;
  padding:10px 12px;
  white-space:nowrap;
  cursor:pointer;
}
.vip-total-btn:hover{
  background:#dbeafe;
}
@media (max-width:520px){
  .vip-row{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .vip-total-btn{
    grid-column:1 / 2;
    justify-self:start;
    padding:8px 10px;
  }
}
