:root{
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  color:#10241d;
  background:#edf4f0;
  --green:#0b5b3f;
  --green-dark:#06442f;
  --green-soft:#dff1e8;
  --green-pale:#eff8f3;
  --gold:#d8a62a;
  --red:#b73b35;
  --muted:#6a7a73;
  --line:#dbe6e0;
  --shadow:0 8px 26px rgba(28,68,52,.10);
}
*{box-sizing:border-box}
html,body{min-height:100%;overscroll-behavior-y:none}
body{margin:0;background:#edf4f0}
button,input,select,textarea{font:inherit}
button{touch-action:manipulation}
.hidden{display:none!important}

.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#0b5139,#153a30)}
.login-card{width:min(420px,100%);background:#fff;border-radius:24px;padding:28px;box-shadow:0 22px 70px #0005}
.login-card img{width:72px;height:72px;border-radius:18px}
.login-card h1{margin:14px 0 4px}
.login-card p{color:#63736c}
.login-card label{display:block;font-weight:700;margin:16px 0 6px}
.login-card input{width:100%;padding:14px;border:1px solid #c9d6d0;border-radius:12px;font-size:18px}
.login-card button,.primary{width:100%;border:0;border-radius:12px;background:var(--green);color:#fff;padding:14px;font-size:17px;font-weight:800;margin-top:18px}
.error{color:var(--red);margin-top:12px}

.app{min-height:100vh;padding-bottom:78px}
.app>header{position:sticky;top:0;z-index:30;background:var(--green);color:#fff;padding:16px 18px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 3px 14px #0003}
.app>header b{display:block;font-size:21px;letter-spacing:-.2px}
.app>header span{opacity:.8;font-size:13px}
.icon-button{background:#ffffff18;color:#fff;border:1px solid #ffffff55;border-radius:12px;padding:10px 13px}
main{padding:15px;max-width:1200px;margin:0 auto}

.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stat,.card{background:#fff;border-radius:18px;padding:17px;box-shadow:var(--shadow)}
.stat span{color:#65756e;font-size:14px}
.stat strong{display:block;font-size:29px;line-height:1.08;margin-top:8px;letter-spacing:-.8px}
.stat small{display:block;margin-top:14px;color:var(--green);font-size:12px;font-weight:700;text-align:left}
.stat small b{font-size:16px}
.stat-link{width:100%;border:1px solid transparent;text-align:left;cursor:pointer;transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.stat-link:active{transform:scale(.98)}
.stat-link:focus-visible{outline:3px solid #81c7a9;outline-offset:2px}
.card{margin-bottom:12px}
.card h3{margin:0 0 8px}
.subtle{color:#6b7a74;font-size:13px}
.badge{display:inline-block;padding:5px 9px;border-radius:999px;background:#e8efec;font-size:11px;font-weight:800}
.badge.green{background:#d7f2e2;color:#08643f}.badge.yellow{background:#fff0b9;color:#805c00}.badge.red{background:#ffd9d6;color:#921f18}
.list{display:grid;gap:10px}
.order-card{background:#fff;border-radius:17px;padding:15px;border-left:5px solid var(--green);box-shadow:var(--shadow)}
.order-card .row,.row{display:flex;justify-content:space-between;gap:12px;align-items:center}
.order-card button,.small-button{border:0;border-radius:10px;background:var(--green);color:#fff;padding:10px 12px;font-weight:750}
.small-button.secondary{background:#e4ece8;color:#153a30}.small-button.danger{background:var(--red)}
select,input,textarea{width:100%;padding:12px;border:1px solid #c9d6d0;border-radius:10px;background:#fff;font-size:16px}
textarea{min-height:90px}
.section-title{display:flex;justify-content:space-between;align-items:center;margin:8px 0 16px}
.section-title h2{margin:0;font-size:34px;letter-spacing:-1px}
.production-columns{display:grid;gap:14px}
.stage{background:#dfeae5;border-radius:16px;padding:12px}
.stage h3{margin:0 0 10px;text-transform:capitalize}
.file-link{display:block;background:#eef5f1;border-radius:10px;padding:10px;margin:7px 0;color:var(--green);text-decoration:none;font-weight:700}
.inventory-row{display:grid;grid-template-columns:1.2fr .7fr .7fr;gap:8px;align-items:center;border-bottom:1px solid #e1e8e4;padding:13px 0}
.inventory-row:last-child{border-bottom:0}
.inventory-row .status-text{display:inline-block;margin-top:5px;font-size:11px;font-weight:800;color:var(--muted)}
.inventory-in_stock .status-text{color:#087744}.inventory-check_stock .status-text{color:#9a6b00}.inventory-out_of_stock .status-text{color:#a72c25}
.more-grid{display:grid;gap:12px}
.action-card{background:#fff;border-radius:18px;padding:19px;border:0;text-align:left;font:inherit;box-shadow:var(--shadow)}
.action-card b{display:block;font-size:17px;margin-bottom:5px}.action-card span{color:var(--muted)}
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:7px;color:var(--muted);padding:42px 18px;background:#fff;border-radius:18px}

.filter-row{display:flex;gap:8px;overflow:auto;padding:2px 1px 12px;scrollbar-width:none}
.filter-row::-webkit-scrollbar{display:none}
.filter-chip{white-space:nowrap;border:1px solid #cddbd4;background:#fff;color:#496158;border-radius:999px;padding:9px 13px;font-size:13px;font-weight:750}
.filter-chip.active{border-color:var(--green);background:var(--green);color:#fff}

#bottomNav{position:fixed;bottom:0;left:0;right:0;z-index:35;background:#fff;border-top:1px solid #dce5e1;display:grid;grid-template-columns:repeat(5,1fr);padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -4px 18px rgba(0,0,0,.05)}
#bottomNav button{border:0;background:#fff;padding:14px 3px;color:#64736d;font-size:12px}
#bottomNav button.active{color:var(--green);font-weight:900;border-top:3px solid var(--green)}
.toast{position:fixed;left:16px;right:16px;bottom:90px;background:#142b23;color:#fff;padding:14px;border-radius:13px;z-index:60;box-shadow:0 10px 30px #0005}

.modal{position:fixed;inset:0;background:#0007;z-index:50;display:grid;place-items:end center}
.modal-card{background:#fff;width:100%;max-height:92vh;overflow:auto;border-radius:24px 24px 0 0;padding:20px;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
.modal-card .close{float:right;border:0;background:#eef1ef;border-radius:50%;width:38px;height:38px;font-size:22px}
.modal-card label{display:block;font-weight:700;margin:14px 0 6px}

/* Dashboard navigation cards */
.dashboard-grid .stat:nth-child(1),.dashboard-grid .stat:nth-child(8){border-top:4px solid #2a9b68}
.dashboard-grid .stat:nth-child(4){border-top:4px solid #e0a225}
.dashboard-grid .stat:nth-child(5){border-top:4px solid #d7792e}

/* Subpage headers */
.subpage-header,.chat-page-header{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;margin:0 0 14px}
.subpage-header h2,.chat-page-header h2{margin:0;font-size:25px;letter-spacing:-.5px}
.subpage-header p,.chat-page-header p{margin:2px 0 0;color:var(--muted);font-size:13px}
.back-button{border:0;background:#fff;color:var(--green);border-radius:999px;padding:9px 12px;font-weight:800;display:flex;align-items:center;gap:4px;box-shadow:0 3px 12px rgba(28,68,52,.08)}
.back-button span{font-size:25px;line-height:14px}
.round-icon-button{border:0;background:#fff;color:var(--green);border-radius:50%;width:42px;height:42px;font-size:21px;font-weight:800;box-shadow:0 3px 12px rgba(28,68,52,.10)}

/* Customer chat list */
.chat-screen{margin:-15px;min-height:calc(100vh - 145px);background:#f5faf7}
.customer-screen{padding:16px}
.chat-search-wrap{height:48px;background:#fff;border:1px solid var(--line);border-radius:15px;display:flex;align-items:center;gap:8px;padding:0 13px;box-shadow:0 3px 12px rgba(28,68,52,.06)}
.chat-search-wrap span{font-size:23px;color:#7c8b84}.chat-search-wrap input{border:0;padding:0;outline:0;background:transparent;height:100%}
.chat-filters{padding-top:12px}
.customer-list{background:#fff;border-radius:20px;overflow:hidden;box-shadow:var(--shadow)}
.customer-row{width:100%;border:0;background:#fff;display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px;text-align:left;border-bottom:1px solid #edf1ef}
.customer-row:last-child{border-bottom:0}.customer-row:active{background:#f0f8f4}
.avatar{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#c9efdb,#e8f8f0);color:var(--green-dark);font-weight:900;font-size:16px;flex:none}
.avatar.large{width:45px;height:45px}
.customer-copy{min-width:0;display:block}
.customer-line{display:flex;justify-content:space-between;gap:10px;align-items:center}
.customer-line b{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.customer-line time{color:#89958f;font-size:11px;white-space:nowrap}
.customer-preview{display:block;color:#5f7068;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}
.customer-meta{display:block;margin-top:6px}.customer-meta em{font-style:normal;text-transform:uppercase;font-size:10px;letter-spacing:.4px;color:#6a7c74;font-weight:800}.customer-meta .bot-off{color:var(--red)}
.unread-badge{min-width:25px;height:25px;padding:0 7px;border-radius:999px;background:#1b79d1;color:#fff;display:grid;place-items:center;font-size:12px;font-weight:900}.chevron{font-size:28px;color:#a5b0ab}

/* Conversation messaging UI */
.conversation-screen{display:flex;flex-direction:column;height:calc(100vh - 145px);background:#e9f1ed}
.conversation-header{flex:none;display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;gap:9px;align-items:center;padding:11px 12px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 3px 12px rgba(28,68,52,.08);z-index:3}
.back-round{box-shadow:none;background:#eef5f1;font-size:29px}.conversation-person{min-width:0}.conversation-person h2{font-size:17px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-person p{font-size:11px;color:var(--muted);margin:3px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.message-thread{flex:1;overflow:auto;padding:15px 11px 20px;background-color:#e8f0ec;background-image:radial-gradient(circle at 20% 20%,rgba(11,91,63,.035) 0 2px,transparent 2px),radial-gradient(circle at 80% 65%,rgba(216,166,42,.035) 0 2px,transparent 2px);background-size:26px 26px;scroll-behavior:smooth}
.date-divider{text-align:center;margin:12px 0}.date-divider span{display:inline-block;background:#d9e5df;color:#5b6b64;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:800;box-shadow:0 2px 6px rgba(0,0,0,.06)}
.message-row{display:flex;margin:5px 0}.message-row.incoming{justify-content:flex-start}.message-row.outgoing{justify-content:flex-end}
.message-bubble{position:relative;max-width:86%;padding:9px 11px 7px;border-radius:15px;background:#fff;box-shadow:0 2px 7px rgba(21,53,41,.08);word-break:break-word}
.message-row.incoming .message-bubble{border-bottom-left-radius:4px}.message-row.outgoing .message-bubble{background:#d8f2e4;border-bottom-right-radius:4px}
.message-sender{display:block;color:var(--green);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.35px;margin-bottom:3px}.message-row.incoming .message-sender{color:#6a756f}
.message-text{font-size:14px;line-height:1.42;padding-right:42px}.message-time{float:right;color:#7b8982;font-size:9px;margin-left:8px;margin-top:4px}.message-attachment{background:#f1f6f3;border-radius:10px;padding:8px;margin-top:6px;color:var(--green);font-size:12px;font-weight:700}
.conversation-toolbar{flex:none;background:#fff;border-top:1px solid var(--line);padding:10px 12px calc(10px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:10px;box-shadow:0 -3px 12px rgba(28,68,52,.07)}
.archive-note{min-width:0;display:flex;gap:8px;align-items:center;flex:1}.archive-note span{font-size:17px}.archive-note b{display:block;font-size:12px}.archive-note small{display:block;color:var(--muted);font-size:9px;margin-top:2px}
.bot-toggle{border:0;border-radius:12px;padding:10px 12px;color:#fff;font-weight:800;white-space:nowrap;font-size:12px}.bot-toggle.disable{background:var(--red)}.bot-toggle.enable{background:var(--green)}

.quote-card{position:relative}.quote-customer{font-weight:700;margin-top:8px}.quote-total{font-size:22px;font-weight:900;margin:12px 0 8px;color:var(--green-dark)}
.payment-pill{padding:5px 8px;border-radius:999px;background:#fff0b9;color:#805c00;font-size:10px;font-weight:900}.payment-pill.verified{background:#d7f2e2;color:#08643f}

@media(min-width:800px){
  main{max-width:1100px;margin:auto;padding:22px}
  .grid{grid-template-columns:repeat(4,1fr)}
  .production-columns{grid-template-columns:repeat(3,1fr)}
  #bottomNav{left:50%;transform:translateX(-50%);max-width:780px;border-radius:18px 18px 0 0}
  .modal{place-items:center}.modal-card{max-width:700px;border-radius:24px}
  .chat-screen{margin:0;min-height:calc(100vh - 190px);border-radius:22px;overflow:hidden;box-shadow:var(--shadow)}
  .conversation-screen{height:calc(100vh - 190px)}
  .message-bubble{max-width:68%}
}

.mobile-review-summary{display:flex;flex-direction:column;gap:5px;margin:10px 0 14px;padding:12px 14px;border:1px solid #efc6c1;border-radius:14px;background:#fff1ef;color:#8f302a}
.mobile-review-summary span{font-size:13px;color:#73504c}
.order-card.mobile-review-requested{border-left:6px solid #c8453d;background:#fff8f7}
.order-card.mobile-review-required{border-left:6px solid #d5a31e;background:#fffcf0}
.review-message{margin:10px 0;padding:10px;border-radius:10px;background:rgba(255,255,255,.8);font-size:13px;line-height:1.35;color:#6f332e}

/* v4.0.8 human review inbox */
.human-review-mobile-list { display:grid; gap:14px; }
.human-review-mobile { border-left:6px solid #d09a00; }
.human-review-mobile.resolved { border-left-color:#2ca66f; opacity:.88; }
.review-file-name { font-weight:800; overflow-wrap:anywhere; margin:12px 0 8px; }
.review-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.review-actions .small-button.primary { background:#087a52; color:#fff; border-color:#087a52; }
