:root {
  --bg: #f4eadf;
  --cream: #fff8ef;
  --card: #ffffff;
  --ink: #191411;
  --muted: #4f4238;
  --line: #e5d8cc;
  --soft: #fbf4ed;
  --brown: #7a4d2a;
  --brown-dark: #4f2f1d;
  --brown-soft: #ead9c8;
  --tan: #b7895f;
  --green: #0f8b5f;
  --orange: #b76a18;
  --red: #c73535;
  --blue: #2563eb;
  --purple: #5b55d7;
  --dock-h: 76px;
  --shadow: 0 16px 44px rgba(79, 47, 29, 0.1);
  font-family: "Poppins", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(180deg, var(--cream) 0%, var(--bg) 42%, var(--bg) 100%); }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; transition: 160ms ease; }
button:active { transform: scale(0.98); }
.app { width: min(100%, 1080px); margin: 0 auto; min-height: 100vh; padding: 14px 12px calc(var(--dock-h) + 18px); }
.client-app { padding-bottom: 18px; }
.topbar { position: sticky; top: 0; z-index: 20; padding: 10px 0 14px; background: linear-gradient(180deg, rgba(255, 248, 239, 0.98), rgba(255, 248, 239, 0.88), rgba(255, 248, 239, 0)); backdrop-filter: blur(18px); }
.brand-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 4px; min-height: 46px; }
.approval-header { grid-template-columns: minmax(0, 1fr); }
.back-btn { width: 42px; height: 42px; border-radius: 999px; background: #fffaf4; color: var(--brown-dark); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(79, 47, 29, 0.06); }
.back-btn svg { width: 20px; height: 20px; }
.back-btn.disabled { opacity: 0.38; pointer-events: none; }
.page-heading { min-width: 0; display: grid; align-content: center; }
.page-heading h2 { margin: 0; font-family: "Montserrat", "Poppins", sans-serif; font-size: clamp(18px, 4.8vw, 26px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; color: var(--brown-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-heading p { display: none; }
.page { display: none; animation: show 0.18s ease both; }
.page.active { display: block; }
@keyframes show { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.dock { position: fixed; left: 10px; right: 10px; bottom: 10px; height: var(--dock-h); z-index: 80; background: rgba(255, 248, 239, 0.92); border: 1px solid rgba(122, 77, 42, 0.18); border-radius: 28px; backdrop-filter: blur(24px); box-shadow: 0 18px 50px rgba(79, 47, 29, 0.18); display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; max-width: 720px; margin: 0 auto; }
.dock button { min-width: 0; border-radius: 21px; background: transparent; color: var(--brown-dark); display: grid; place-items: center; gap: 3px; font-size: 10px; font-weight: 600; font-family: "Poppins", sans-serif; }
.dock button svg { width: 19px; height: 19px; }
.dock button.active { background: var(--brown-dark); color: #fff; }
.btn { border-radius: 999px; padding: 11px 14px; background: #fffaf4; color: var(--brown-dark); border: 1px solid var(--line); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 22px rgba(79, 47, 29, 0.06); min-height: 42px; white-space: nowrap; }
.btn.primary { background: var(--brown-dark); color: #fff; border-color: var(--brown-dark); }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn.full { width: 100%; }
.btn.flat { box-shadow: none; background: var(--soft); }
.icon-round, .stat-icon { display: inline-grid; place-items: center; background: transparent; color: var(--brown-dark); flex: 0 0 auto; }
.icon-round { width: 20px; height: 20px; border-radius: 0; }
.icon-round svg { width: 18px; height: 18px; }
.stat-icon { width: 22px; height: 22px; border-radius: 0; }
.stat-icon svg { width: 18px; height: 18px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; align-items: center; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.card-head { padding: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fffaf4; }
.card-head h3 { margin: 0; font-family: "Montserrat", "Poppins", sans-serif; font-size: 15px; font-weight: 600; letter-spacing: -0.025em; }
.card-head p, .menu-card p, .activity-item p { display: none; }
.card-body { padding: 15px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: linear-gradient(145deg, #fff, var(--cream)); border: 1px solid var(--line); border-radius: 21px; padding: 14px; box-shadow: 0 10px 28px rgba(79, 47, 29, 0.06); display: grid; gap: 10px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat small { display: block; color: var(--brown-dark); font-size: 11px; font-weight: 600; }
.stat strong { display: block; font-family: "Montserrat", "Poppins", sans-serif; font-size: 26px; line-height: 1; font-weight: 600; letter-spacing: -0.045em; }
.job-list, .activity-list { display: grid; gap: 10px; }
.job-card, .activity-item, .menu-card { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.04); text-align: left; min-width: 0; }
.job-card.active { border-color: var(--brown); box-shadow: 0 18px 42px rgba(122, 77, 42, 0.14); }
.job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.row-with-icon { display: flex; gap: 9px; align-items: center; min-width: 0; }
.job-card h4, .menu-card h4, .activity-item h4 { margin: 0; font-family: "Montserrat", "Poppins", sans-serif; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; color: var(--ink); }
.job-card p { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; background: #f6eee6; color: var(--brown-dark); flex: 0 0 auto; }
.tag.pending { background: #fff4e5; color: var(--orange); }
.tag.production { background: #eef2ff; color: var(--purple); }
.tag.qc { background: #edf7ff; color: #0f70a8; }
.tag.dispatched { background: #eef0f2; color: #111827; }
.tag.route { background: #eaf1ff; color: var(--blue); }
.tag.delivered { background: #e7f6ef; color: var(--green); }
.tag.rejected { background: #fdecec; color: var(--red); }
.progress { height: 8px; background: #eef0f3; border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brown-dark), var(--tan)); border-radius: inherit; transition: width 0.2s ease; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail { background: #fffaf4; border: 1px solid #eadfd3; border-radius: 17px; padding: 11px; min-width: 0; }
.detail small { display: block; color: var(--brown-dark); font-size: 10.5px; font-weight: 600; margin-bottom: 6px; }
.detail strong { display: block; font-size: 12.5px; line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.art-preview { min-height: 220px; border-radius: 22px; background: linear-gradient(135deg, rgba(79, 47, 29, 0.88), rgba(122, 77, 42, 0.62)), radial-gradient(circle at 25% 18%, rgba(255, 248, 239, 0.65), transparent 32%), linear-gradient(135deg, #4f2f1d, #b7895f); display: grid; place-items: center; overflow: hidden; margin-bottom: 12px; padding: 18px; }
.mock-product { width: 142px; height: 168px; border-radius: 34px 34px 20px 20px; background: #fff; border: 1px solid #d7dae0; position: relative; box-shadow: 0 25px 54px rgba(0, 0, 0, 0.25); }
.print-area { position: absolute; left: 29px; right: 29px; top: 64px; height: 62px; border: 2px dashed var(--brown-dark); border-radius: 12px; display: grid; place-items: center; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; color: var(--brown-dark); }
.art-preview img { max-width: 100%; max-height: 340px; border-radius: 18px; box-shadow: 0 18px 48px rgba(0,0,0,.24); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
.section-title h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.025em; }
.collapse-body { display: none; margin-top: 12px; }
.collapse.open .collapse-body { display: block; animation: drop 0.16s ease both; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.form-grid { display: grid; gap: 10px; }
.input, .select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 13px; outline: none; color: var(--ink); font-size: 13px; }
textarea { min-height: 100px; resize: vertical; }
.file-drop { border: 1px dashed #b79a82; background: #fffaf4; color: var(--brown-dark); border-radius: 17px; padding: 16px; text-align: center; font-size: 13px; }
.upload-note { color: var(--brown-dark); font-size: 12px; line-height: 1.45; }
.route-map { height: 185px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(90deg, transparent 24px, rgba(16, 17, 20, 0.045) 25px), linear-gradient(0deg, transparent 24px, rgba(16, 17, 20, 0.045) 25px), #fbfcfd; background-size: 50px 50px; position: relative; overflow: hidden; margin-bottom: 12px; }
.route-line { position: absolute; left: 32px; right: 32px; top: 92px; height: 6px; border-radius: 999px; background: #dfe3e9; }
.route-line span { display: block; height: 100%; width: 66%; border-radius: inherit; background: linear-gradient(90deg, var(--brown-dark), var(--tan)); }
.pin, .van { position: absolute; top: 78px; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; color: #fff; background: var(--brown-dark); }
.pin svg, .van svg { width: 17px; height: 17px; }
.pin.start { left: 18px; }
.pin.end { right: 18px; background: var(--tan); }
.van { top: 70px; left: 62%; width: 42px; height: 42px; border-radius: 15px; background: #fff; border: 1px solid #101114; color: #101114; }
.scanner { border-radius: 22px; background: linear-gradient(145deg, var(--brown-dark), #25160f); color: #fff; padding: 16px; overflow: hidden; }
.scan-box { height: 130px; border: 1px dashed rgba(255, 255, 255, 0.44); border-radius: 18px; display: grid; place-items: center; text-align: center; color: rgba(255, 255, 255, 0.72); font-size: 13px; line-height: 1.4; margin: 12px 0; }
.scan-result { display: none; background: rgba(15, 139, 95, 0.14); color: #a7f3d0; border-radius: 14px; padding: 10px 12px; font-size: 12px; line-height: 1.4; }
.client-panel { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--tan); }
.client-head { padding: 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.client-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.client-head small { display: block; margin-top: 4px; color: var(--brown-dark); font-size: 11px; }
.client-body { padding: 15px; }
.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10, 11, 14, 0.42); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: 170ms ease; }
.modal-backdrop.show, .drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.modal { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 100; max-height: calc(100vh - 24px); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 28px 84px rgba(15, 23, 42, 0.24); transform: translateY(110%); opacity: 0; pointer-events: none; transition: 210ms ease; }
.modal.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
.modal-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.modal-body { padding: 16px; }
#emailConfirmText { margin-top: 0; color: var(--brown-dark); font-size: 13px; line-height: 1.5; }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; height: min(86vh, 760px); background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -24px 84px rgba(15, 23, 42, 0.22); transform: translateY(105%); transition: 210ms ease; display: flex; flex-direction: column; }
.drawer.show { transform: translateY(0); }
.drawer-head { padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.025em; }
.drawer-head p { margin:4px 0 0; color:var(--brown-dark); font-size:12px; }
.drawer-body { padding: 16px; overflow-y: auto; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--dock-h) + 20px); z-index: 150; background: #101114; color: #fff; border-radius: 999px; padding: 13px 16px; font-size: 13px; font-weight: 600; text-align: center; opacity: 0; transform: translateY(14px); pointer-events: none; transition: 220ms ease; }
.client-app .toast { bottom: 20px; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (min-width: 820px) {
  .app { padding-left: 22px; padding-right: 22px; }
  .dock { left: 50%; right: auto; transform: translateX(-50%); width: min(720px, calc(100% - 20px)); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal { left: 50%; right: auto; bottom: 32px; width: min(680px, calc(100% - 32px)); transform: translate(-50%, 110%); }
  .modal.show { transform: translate(-50%, 0); }
  .drawer { left: auto; width: 520px; height: 100vh; border-radius: 28px 0 0 28px; transform: translateX(105%); }
  .drawer.show { transform: translateX(0); }
  .toast { left: 50%; right: auto; width: 420px; transform: translate(-50%, 14px); }
  .toast.show { transform: translate(-50%, 0); }
}
@media (max-width: 430px) {
  .brand-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; }
  .back-btn { width: 38px; height: 38px; }
  .btn { padding: 10px 12px; font-size: 12.5px; }
  .grid.two, .detail-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .card-head { align-items: flex-start; flex-direction: column; }
  .card-head .btn { width: 100%; }
  .dock button span { display: none; }
}
