
:root{--bg:#f5f7fb;--card:#fff;--ink:#172033;--muted:#64748b;--line:#e5eaf2;--blue:#2384ee;--blue2:#1678ff;--navy:#0f172a;--green:#16a34a;--orange:#d97706;--red:#dc2626;--shadow:0 10px 28px rgba(15,23,42,.06);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0;background:var(--bg);min-height:100vh}button,input,select,textarea{font:inherit}.hidden{display:none!important}.muted{color:var(--muted)}.small{font-size:12px}.auth-view{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 0,#183861 0,#111b31 32%,#08101f 75%)}.auth-card{width:min(470px,100%);background:#111c30;border:1px solid #24344f;border-radius:20px;padding:28px;color:#eef6ff;box-shadow:0 28px 80px rgba(0,0,0,.38)}.brand{display:flex;align-items:center;gap:11px}.brand-center{justify-content:center;margin-bottom:20px}.brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#2384ee,#69b4ff);display:grid;place-items:center;color:#fff;font-weight:900;font-size:21px;box-shadow:0 8px 24px rgba(35,132,238,.3)}.brand-name{font-size:20px;font-weight:900;letter-spacing:.08em}.brand-sub{font-size:10px;color:#8ca3c2;letter-spacing:.18em}.auth-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:#0a1425;border-radius:12px;padding:5px;margin-bottom:18px}.auth-tab{border:0;background:transparent;color:#8193ad;padding:9px;border-radius:8px;cursor:pointer;font-weight:700;font-size:12px}.auth-tab.active{background:#1c2b44;color:#6db5ff}.auth-form{display:grid;gap:12px}.auth-form label,.card label{display:grid;gap:7px;font-size:12px;font-weight:700;color:inherit}.auth-form input{background:#0a1425;border:1px solid #2a3b58;color:#f8fafc}.auth-form input:focus{border-color:#60a5fa;box-shadow:0 0 0 3px rgba(96,165,250,.12)}input,select,textarea{width:100%;border:1px solid #d9e0ea;border-radius:9px;background:#fff;padding:10px 11px;color:#172033;outline:none;transition:.16s}textarea{resize:vertical}input:focus,select:focus,textarea:focus{border-color:#5ba5f2;box-shadow:0 0 0 3px rgba(35,132,238,.09)}.check{display:flex!important;grid-template-columns:auto 1fr!important;align-items:center;gap:8px!important}.check input{width:auto}.auth-status{text-align:center;color:#8092ae;font-size:11px;margin-top:16px}.btn{border:0;border-radius:9px;padding:10px 14px;font-weight:800;cursor:pointer;transition:.16s}.btn:hover{transform:translateY(-1px)}.btn:disabled{opacity:.55;cursor:not-allowed;transform:none}.primary{background:linear-gradient(135deg,#2384ee,#1678ff);color:white;box-shadow:0 6px 18px rgba(35,132,238,.18)}.secondary{background:#eef4fb;color:#2764d8;border:1px solid #dbe7f7}.ghost{background:transparent;color:#b8c5d8;border:1px solid #2b3a50}.danger{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}.success{background:#ecfdf3;color:#15803d;border:1px solid #bbf7d0}.wide{width:100%}.big{padding:13px 18px}.inline-actions{display:flex;gap:8px;flex-wrap:wrap}.app{min-height:100vh;display:flex}.sidebar{position:fixed;inset:0 auto 0 0;width:248px;background:#101b2f;color:#e6eef9;border-right:1px solid #1d2c44;padding:20px 14px;display:flex;flex-direction:column;z-index:50}.sidebar>.brand{padding:4px 10px 20px}.nav{display:grid;gap:5px}.nav-btn{display:flex;align-items:center;gap:12px;border:0;background:transparent;color:#a7b7cc;border-radius:9px;padding:11px 12px;text-align:left;font-weight:700;cursor:pointer}.nav-btn:hover{background:#17263d;color:#e9f3ff}.nav-btn.active{background:#1d3658;color:#68b4ff;box-shadow:inset 3px 0 #4ba5ff}.nav-btn span{width:21px;text-align:center}.nav-sep{height:1px;background:#22324a;margin:8px}.sidebar-bottom{margin-top:auto;display:grid;gap:10px}.server-badge{font-size:11px;font-weight:800;color:#86efac;padding:10px;text-align:center}.dot{display:inline-block;width:7px;height:7px;background:#22c55e;border-radius:50%;margin-right:6px;box-shadow:0 0 0 4px rgba(34,197,94,.09)}.main{margin-left:248px;width:calc(100% - 248px);min-width:0}.topbar{height:78px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 26px;position:sticky;top:0;z-index:30}.topbar h1{margin:0;font-size:21px}.topbar-actions{display:flex;align-items:center;gap:10px}.wallet-chip,.user-chip{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:11px;padding:8px 12px;background:#fbfcfe}.wallet-chip{flex-direction:column;align-items:flex-end;gap:0}.wallet-chip span,.user-chip small{font-size:10px;color:var(--muted)}.wallet-chip strong{color:#1678ff}.user-chip>span{width:32px;height:32px;border-radius:9px;background:#e8f2ff;color:#1678ff;display:grid;place-items:center;font-weight:900}.user-chip div{display:grid}.icon-btn{width:38px;height:38px;border-radius:9px;border:1px solid var(--line);background:white;color:#516079;font-size:18px;cursor:pointer}.content{padding:24px}.page{display:none}.page.active{display:block}.card{background:var(--card);border:1px solid var(--line);border-radius:15px;padding:20px;box-shadow:var(--shadow)}.card h2{margin:0 0 8px}.card p{margin:4px 0}.narrow{max-width:760px}.grid-2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px}.order-grid{grid-template-columns:minmax(560px,1.4fr) minmax(320px,.8fr)}.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}.section-head h2{font-size:20px}.section-head p{font-size:12px;color:var(--muted)}.quote-badge{background:#eaf4ff;color:#1678ff;padding:8px 12px;border-radius:10px;font-weight:900}.count-badge{color:#2384ee;font-weight:800}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.span-2{grid-column:1/-1}.field-note{align-self:end;padding:11px;border-radius:9px;background:#f8fafc;color:#64748b;font-size:12px}.dynamic-fields{display:grid;grid-template-columns:1fr 1fr;gap:13px}.dynamic-fields .span-2{grid-column:1/-1}.advanced-box{border:1px solid var(--line);border-radius:11px;margin-top:16px;background:#fbfcfe}.advanced-box summary{cursor:pointer;padding:12px 14px;font-weight:800;color:#31405a}.advanced-box[open] summary{border-bottom:1px solid var(--line)}.pad-top{padding-top:12px}.advanced-box .form-grid{padding:0 14px 14px}.summary-box{background:#f7faff;border:1px solid #e0ebf8;color:#31405a;border-radius:10px;padding:12px 13px;margin:16px 0;font-size:13px}.service-detail-card{min-height:370px}.detail-id{color:#8a96aa;font-size:11px;font-weight:800;letter-spacing:.08em}.detail-id b{color:#1678ff;font-size:20px;margin-left:6px}.detail-meta{color:#2384ee;font-weight:700;margin:8px 0 18px}.detail-info{line-height:1.7;color:#40516b;font-size:13px;white-space:pre-line}.toolbar{display:flex;gap:10px;align-items:center;margin-bottom:14px}.search{max-width:440px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:11px}.table-wrap table{border-collapse:collapse;width:100%;min-width:850px;background:white}th,td{padding:10px 11px;border-bottom:1px solid #edf0f4;text-align:left;font-size:12px;vertical-align:middle}th{position:sticky;top:0;background:#f8fafc;color:#65758b;font-size:10px;text-transform:uppercase;letter-spacing:.04em;z-index:1}tr:last-child td{border-bottom:0}tbody tr:hover{background:#fbfdff}.link-cell{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status{display:inline-flex;padding:4px 8px;border-radius:99px;font-weight:800;font-size:10px}.status.green{background:#ecfdf3;color:#15803d}.status.orange{background:#fff7ed;color:#c2410c}.status.red{background:#fff1f2;color:#be123c}.status.blue{background:#eff6ff;color:#1d4ed8}.status.gray{background:#f1f5f9;color:#64748b}.row-actions{display:flex;gap:5px;flex-wrap:wrap}.row-actions .btn{padding:6px 8px;font-size:10px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}.stat-card{background:white;border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;justify-content:space-between;align-items:center;color:#5c6b81}.stat-card strong{font-size:22px;color:#1d2d49}.safety-box,.warning-box{border-radius:10px;padding:12px;margin:12px 0 16px;font-size:12px}.safety-box{background:#eff6ff;border:1px solid #dbeafe;color:#1d4ed8}.warning-box{background:#fffbeb;border:1px solid #fde68a;color:#a16207}.deposit-current{margin-top:16px;border-top:1px solid var(--line);padding-top:16px;line-height:1.7}.status-line{padding:11px 12px;border:1px solid var(--line);background:#f8fafc;border-radius:9px}.toast-host{position:fixed;right:18px;top:18px;z-index:500;display:grid;gap:8px}.toast{max-width:380px;background:#172033;color:#f8fafc;padding:12px 14px;border-radius:11px;box-shadow:0 14px 38px rgba(0,0,0,.22);font-size:13px;animation:toastIn .18s ease-out}.toast.error{background:#7f1d1d}.toast.success{background:#14532d}@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.58);display:grid;place-items:center;padding:20px;z-index:400}.modal{width:min(620px,100%);max-height:85vh;overflow:auto;background:white;border-radius:16px;padding:20px;box-shadow:0 25px 80px rgba(0,0,0,.28)}.modal h3{margin-top:0}.modal-pre{white-space:pre-wrap;background:#f8fafc;border:1px solid var(--line);border-radius:9px;padding:12px;font:12px ui-monospace,SFMono-Regular,Consolas,monospace}.qr-image{display:block;max-width:360px;width:100%;margin:12px auto;border-radius:12px}.mobile-only{display:none}@media(max-width:1100px){.order-grid,.grid-2{grid-template-columns:1fr}.service-detail-card{min-height:0}.stats-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.mobile-only{display:block}.sidebar{transform:translateX(-100%);transition:.2s}.sidebar.open{transform:none}.main{margin-left:0;width:100%}.topbar{padding:0 14px}.content{padding:14px}.user-chip{display:none}.topbar h1{font-size:18px}.form-grid,.dynamic-fields{grid-template-columns:1fr}.span-2,.dynamic-fields .span-2{grid-column:auto}.toolbar{align-items:stretch;flex-direction:column}.search{max-width:none}.stats-grid{grid-template-columns:1fr 1fr}.card{padding:15px}.auth-card{padding:20px}.wallet-chip{padding:6px 9px}}


.chat-launcher{position:fixed;right:24px;bottom:24px;width:58px;height:58px;border:0;border-radius:50%;background:linear-gradient(135deg,#1b74e4,#3f9cff);color:#fff;box-shadow:0 12px 32px rgba(27,116,228,.35);font-size:25px;z-index:250;cursor:pointer}.chat-launcher b{position:absolute;right:-2px;top:-2px;min-width:20px;height:20px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;display:grid;place-items:center;border:2px solid #fff}.customer-chat{position:fixed;right:24px;bottom:94px;width:min(380px,calc(100vw - 28px));height:560px;background:#fff;border:1px solid #dce4ef;border-radius:18px;box-shadow:0 22px 70px rgba(15,23,42,.26);z-index:249;display:grid;grid-template-rows:auto 1fr auto auto;overflow:hidden}.customer-chat-head{padding:13px 15px;background:#fff;border-bottom:1px solid #e8edf3;display:flex;align-items:center;justify-content:space-between}.customer-chat-head>div{display:grid;gap:3px}.customer-chat-head small{color:#75869d}.customer-chat-head i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#22c55e;margin-right:4px}.customer-chat-head button{border:0;background:transparent;font-size:24px;color:#7b8798;cursor:pointer}.customer-chat-messages{padding:15px;overflow:auto;background:linear-gradient(#fbfdff,#fff);display:flex;flex-direction:column;gap:8px}.cmsg{display:flex;justify-content:flex-start}.cmsg.me{justify-content:flex-end}.cmsg>div{max-width:78%;padding:9px 12px;background:#e9edf3;border-radius:18px 18px 18px 5px;font-size:13px;line-height:1.4}.cmsg.me>div{background:#1b74e4;color:#fff;border-radius:18px 18px 5px 18px}.cmsg small{display:block;font-size:9px;opacity:.66;margin-top:4px}.c-order-chip{display:block;margin-top:6px;font-size:10px;font-weight:800}.customer-chat-actions{padding:7px 10px;border-top:1px solid #edf0f4;display:flex;gap:6px;overflow:auto}.customer-chat-actions button{border:1px solid #d6e6fb;background:#eef6ff;color:#2266bc;border-radius:14px;padding:6px 9px;font-weight:700;font-size:10px;white-space:nowrap;cursor:pointer}.customer-chat-composer{padding:10px;display:grid;grid-template-columns:auto 1fr auto;gap:7px;border-top:1px solid #e8edf3}.customer-chat-composer textarea{border:0;background:#f1f3f6;border-radius:20px;padding:10px 13px;resize:none;min-height:38px;max-height:100px;font:inherit;outline:none}.customer-chat-composer button{width:38px;height:38px;border:0;border-radius:50%;background:#eef5ff;color:#1b74e4;font-size:18px;font-weight:900;cursor:pointer}@media(max-width:600px){.chat-launcher{right:15px;bottom:15px}.customer-chat{right:14px;bottom:82px;height:min(560px,calc(100vh - 110px))}}

.announcement-stack{display:grid;gap:8px;margin-bottom:14px}.announcement-banner{display:flex;align-items:flex-start;gap:10px;padding:11px 13px;border-radius:11px;border:1px solid #cfe2ff;background:#eff6ff;color:#1e40af}.announcement-banner.warning{border-color:#fde68a;background:#fffbeb;color:#92400e}.announcement-banner.success{border-color:#bbf7d0;background:#f0fdf4;color:#166534}.announcement-banner b{margin-right:5px}.announcement-banner small{margin-left:auto;opacity:.7;white-space:nowrap}.live-activity-card{margin-top:18px}.live-pill{display:inline-flex;align-items:center;gap:6px;font-weight:900;color:#15803d;font-size:11px}.live-pill i{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.1)}.live-activity-feed{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.activity-item{border:1px solid var(--line);border-radius:12px;padding:11px;background:#fbfdff;display:grid;gap:4px}.activity-item b{color:#1f2d46}.activity-item small{color:#77869b}.activity-meta{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#52647c}.popular-badge{display:inline-flex;margin-left:6px;padding:2px 6px;border-radius:999px;background:#fff7ed;color:#c2410c;font-size:9px;font-weight:900;vertical-align:middle}.service-popularity{font-size:10px;color:#64748b;margin-top:3px}@media(max-width:900px){.live-activity-feed{grid-template-columns:1fr}.announcement-banner{flex-wrap:wrap}.announcement-banner small{margin-left:0;width:100%}}

.activity-toast{position:fixed;right:24px;bottom:92px;z-index:80;display:flex;align-items:center;gap:11px;width:min(390px,calc(100vw - 32px));padding:13px 15px;border:1px solid #d7e3f4;border-radius:14px;background:rgba(255,255,255,.98);box-shadow:0 16px 45px rgba(15,35,70,.18);transform:translateY(18px);opacity:0;pointer-events:none;transition:.28s ease}.activity-toast.show{transform:translateY(0);opacity:1}.activity-toast-icon{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#eaf2ff;color:#1678ff;font-weight:900;font-size:18px}.activity-toast b{display:block;color:#17263e;font-size:13px;line-height:1.35}.activity-toast small{display:block;margin-top:3px;color:#7b899d;font-size:10px}@media(max-width:640px){.activity-toast{right:16px;bottom:84px}}

.offline-demo-badge{position:fixed;right:12px;bottom:12px;z-index:99999;background:#111827;color:#fff;padding:7px 10px;border-radius:999px;font:700 11px/1.2 Arial;box-shadow:0 4px 18px #0003;opacity:.88}

/* R7.5 optimized Credit purchase */
.credit-quote{margin:12px 0 14px;padding:12px 13px;border:1px solid #dbe7f7;background:#f7faff;border-radius:11px;display:grid;gap:8px}.credit-quote>div{display:flex;justify-content:space-between;gap:12px;align-items:center}.credit-quote span{color:#64748b;font-size:12px}.credit-quote b{color:#26364d}.credit-quote strong{color:#1678ff;font-size:18px}.credit-quote small{color:#7a899e;border-top:1px dashed #d8e2ef;padding-top:8px}.payment-summary{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px}.payment-summary span{display:block;border:1px solid #e1e7ef;background:#f8fbff;border-radius:9px;padding:9px 10px}.payment-summary small{display:block;color:#7a899e;font-weight:700}.payment-summary b,.payment-summary strong{display:block;margin-top:3px}.payment-summary strong{color:#1678ff}@media(max-width:640px){.payment-summary{grid-template-columns:1fr}.credit-quote>div{align-items:flex-start;flex-direction:column;gap:3px}}

/* R7.8: language selector is part of the layout, never floating over actions */
.lang-switch{position:static;min-width:46px;height:36px;padding:0 11px;border:1px solid #d7dfeb;border-radius:10px;background:#0f172a;color:#fff;font-weight:800;cursor:pointer;box-shadow:none;flex:0 0 auto}
.lang-switch:hover{filter:brightness(1.12)}
.auth-card{position:relative}
.auth-card-tools{display:flex;justify-content:flex-end;margin-bottom:2px}
.topbar-actions{display:flex;align-items:center;gap:9px}
@media(max-width:760px){.topbar-actions .lang-switch{height:34px;min-width:42px;padding:0 9px}.wallet-chip{max-width:150px}}


/* ========================================================================
   R7.9 · Professional responsive system
   ======================================================================== */
html,body{max-width:100%;overflow-x:hidden}
button,.btn,.icon-btn,.lang-switch,input,select,textarea{touch-action:manipulation}
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(6,13,26,.46);backdrop-filter:blur(2px);z-index:45}
body.drawer-open{overflow:hidden}
.topbar-title{min-width:0;flex:1}
.topbar-title h1,.topbar-title #pageSubtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media(max-width:1024px){
  .mobile-only{display:inline-grid;place-items:center}
  .sidebar{width:min(86vw,320px);height:100dvh;transform:translateX(-105%);transition:transform .22s ease;box-shadow:18px 0 45px rgba(0,0,0,.2);z-index:50}
  .sidebar.open{transform:translateX(0)}
  .sidebar-overlay.show{display:block}
  .main{margin-left:0;width:100%}
  .nav{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding-right:3px}
  .nav-btn{min-height:44px}
  .topbar{padding:0 16px}
  .order-grid,.grid-2{grid-template-columns:1fr}
  .service-detail-card{min-height:0}
}

@media(max-width:900px){
  .table-wrap{overflow:visible;border:0;background:transparent}
  .table-wrap .responsive-table{display:block!important;width:100%!important;min-width:0!important;background:transparent}
  .responsive-table thead{display:none}
  .responsive-table tbody{display:grid;gap:10px;width:100%}
  .responsive-table tbody tr{display:block;width:100%;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 3px 12px rgba(15,23,42,.05);overflow:hidden}
  .responsive-table tbody tr:hover{background:#fff}
  .responsive-table tbody td{display:grid;grid-template-columns:minmax(104px,34%) minmax(0,1fr);align-items:start;gap:10px;width:100%!important;max-width:none!important;min-width:0!important;padding:10px 12px;border-bottom:1px solid #edf0f4;white-space:normal!important;word-break:break-word;overflow-wrap:anywhere;line-height:1.35;text-align:left!important}
  .responsive-table tbody td:last-child{border-bottom:0}
  .responsive-table tbody td::before{content:attr(data-label);color:#7a899e;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.035em;line-height:1.35}
  .responsive-table tbody td[data-label=""],.responsive-table tbody td.mobile-wide-cell{display:block}
  .responsive-table tbody td[data-label=""]::before,.responsive-table tbody td.mobile-wide-cell::before{display:none}
  .responsive-table .row-actions{justify-content:flex-end;gap:6px}
  .responsive-table .row-actions .btn{min-height:38px;padding:8px 10px;font-size:11px}
  .link-cell{max-width:none;white-space:normal;overflow-wrap:anywhere}
}

@media(max-width:760px){
  .topbar{height:auto;min-height:68px;padding:9px 12px;gap:8px}
  .topbar-title h1{font-size:17px}
  .topbar-title #pageSubtitle{font-size:10px;max-width:150px}
  .topbar-actions{gap:6px;flex:0 0 auto}
  .topbar-actions .lang-switch,.topbar-actions .icon-btn{width:38px;min-width:38px;height:38px;padding:0}
  .wallet-chip{padding:6px 8px;min-width:0;border-radius:9px}
  .wallet-chip span{display:none}
  .wallet-chip strong{font-size:11px;white-space:nowrap}
  .user-chip{display:none}
  .content{padding:12px}
  .card{padding:14px;border-radius:12px}
  .section-head{gap:10px;flex-direction:column;align-items:stretch}
  .section-head .quote-badge,.section-head .count-badge{align-self:flex-start}
  .form-grid,.dynamic-fields{grid-template-columns:1fr}
  .span-2,.dynamic-fields .span-2{grid-column:auto}
  .toolbar{align-items:stretch;flex-direction:column}
  .toolbar input,.toolbar select,.toolbar button{width:100%;max-width:none;min-height:44px}
  .stats-grid{grid-template-columns:1fr 1fr;gap:9px}
  .inline-actions{display:grid;grid-template-columns:1fr 1fr}
  .inline-actions>*{min-height:42px}
  .deposit-current .inline-actions{grid-template-columns:1fr}
  .payment-summary{grid-template-columns:1fr}
  .modal-backdrop{align-items:end;padding:0}
  .modal{width:100%;max-height:88dvh;border-radius:18px 18px 0 0;padding:16px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
  .toast-host{left:12px;right:12px;top:12px}
  .toast{max-width:none;width:100%}
  .offline-demo-badge{left:50%;right:auto;transform:translateX(-50%);bottom:max(8px,env(safe-area-inset-bottom));font-size:9px;white-space:nowrap;max-width:92vw;overflow:hidden;text-overflow:ellipsis}
}

@media(max-width:600px){
  .chat-launcher{right:14px;bottom:max(14px,env(safe-area-inset-bottom));width:54px;height:54px}
  .customer-chat{left:0;right:0;bottom:0;width:100%;height:min(78dvh,640px);border-radius:18px 18px 0 0;border-left:0;border-right:0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
  .customer-chat-messages{padding:12px}
  .customer-chat-actions{padding:7px 8px}
  .customer-chat-composer{padding:9px}
  .activity-toast{left:12px;right:12px;bottom:82px;max-width:none}
}

@media(max-width:480px){
  .topbar{padding:8px 9px}
  #menuBtn{width:38px;flex:0 0 38px}
  .topbar-title #pageSubtitle{display:none}
  .topbar-actions{gap:4px}
  .wallet-chip{padding:5px 7px}
  .wallet-chip strong{font-size:10px}
  .stats-grid{grid-template-columns:1fr}
  .responsive-table tbody td{grid-template-columns:1fr;gap:4px;padding:9px 11px}
  .responsive-table tbody td::before{font-size:9px}
  .responsive-table .row-actions{justify-content:stretch}
  .responsive-table .row-actions .btn{flex:1 1 120px}
  .inline-actions{grid-template-columns:1fr}
  .auth-view{padding:12px}
  .auth-card{padding:18px 14px;border-radius:16px}
}

.auto-sync-pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;background:#effcf6;color:#087f5b;border:1px solid #a7e6cf;padding:7px 10px;font-size:11px;font-weight:900;white-space:nowrap}.auto-sync-pill i{width:8px;height:8px;border-radius:50%;background:#17a56b;box-shadow:0 0 0 4px rgba(23,165,107,.12)}@media(max-width:560px){.auto-sync-pill{font-size:10px;padding:6px 8px}}


/* ========================================================================
   R8.4 · Fixed navigation shell hardening
   Desktop sidebar stays pinned; tablet/mobile uses a fixed drawer.
   ======================================================================== */
.sidebar{height:100dvh;overflow:hidden}
.sidebar .nav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-right:3px;scrollbar-gutter:stable}
.sidebar .sidebar-bottom{flex:0 0 auto}
@media(min-width:1025px){
  .sidebar{position:fixed!important;left:0;top:0;bottom:0;transform:none!important}
  .main{margin-left:248px!important;width:calc(100% - 248px)!important}
}
@media(max-width:1024px){
  .sidebar{position:fixed!important;left:0;top:0;bottom:0;margin:0;height:100dvh}
  .main{margin-left:0!important;width:100%!important}
}


/* ========================================================================
   R8.8 · Customer sidebar visual refinement
   Visual-only upgrade. Navigation width, routing and page layout are unchanged.
   ======================================================================== */
.sidebar{
  background:
    radial-gradient(circle at 16% 2%,rgba(66,153,255,.10),transparent 27%),
    linear-gradient(180deg,#0f1b30 0%,#0d1729 100%);
  border-right:1px solid rgba(148,163,184,.14);
  box-shadow:10px 0 34px rgba(15,23,42,.10);
  padding:18px 14px 16px;
}
.sidebar>.brand{
  position:relative;
  gap:12px;
  margin:0 2px 12px;
  padding:10px 9px 20px;
  border-bottom:1px solid rgba(148,163,184,.12);
}
.sidebar>.brand::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:-1px;
  height:1px;
  background:linear-gradient(90deg,rgba(72,154,255,.58),rgba(72,154,255,0));
}
.sidebar .brand-mark{
  width:44px;
  height:44px;
  border-radius:13px;
  background:linear-gradient(145deg,#4d9cff 0%,#2f80ed 100%);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 10px 24px rgba(26,117,226,.28),inset 0 1px rgba(255,255,255,.18);
  font-size:20px;
  letter-spacing:0;
}
.sidebar .brand-name{
  color:#f8fbff;
  font-size:19px;
  line-height:1.1;
  letter-spacing:.075em;
}
.sidebar .brand-sub{
  margin-top:5px;
  color:#7591b8;
  font-size:8.5px;
  font-weight:700;
  letter-spacing:.20em;
}
.sidebar .nav{
  gap:6px;
  padding:3px 1px 8px;
}
.sidebar .nav-btn{
  position:relative;
  width:100%;
  min-height:48px;
  gap:12px;
  padding:10px 12px;
  border:1px solid transparent;
  border-radius:11px;
  color:#afbed3;
  font-size:14px;
  font-weight:700;
  letter-spacing:.005em;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.sidebar .nav-btn:hover{
  background:rgba(255,255,255,.045);
  border-color:rgba(148,163,184,.10);
  color:#eef6ff;
  transform:translateX(1px);
}
.sidebar .nav-btn.active{
  background:linear-gradient(90deg,rgba(49,126,225,.25),rgba(42,100,177,.16));
  border-color:rgba(84,154,244,.20);
  color:#75baff;
  box-shadow:inset 3px 0 #4ba5ff,0 8px 22px rgba(5,16,34,.12);
}
.sidebar .nav-btn.active::after{
  content:"";
  position:absolute;
  right:10px;
  width:5px;
  height:5px;
  border-radius:50%;
  background:#58aaff;
  box-shadow:0 0 0 4px rgba(88,170,255,.08);
}
.sidebar .nav-icon{
  width:22px;
  height:22px;
  flex:0 0 22px;
  display:grid;
  place-items:center;
  color:#7895bc;
}
.sidebar .nav-icon svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sidebar .nav-btn:hover .nav-icon{color:#a9cfff}
.sidebar .nav-btn.active .nav-icon{color:#58aaff}
.sidebar .nav-label{min-width:0;line-height:1.25}
.sidebar .nav-sep{
  height:1px;
  margin:9px 10px;
  background:linear-gradient(90deg,rgba(148,163,184,.17),rgba(148,163,184,.04));
}
.sidebar .sidebar-bottom{
  gap:9px;
  padding:10px 1px 4px;
  border-top:1px solid rgba(148,163,184,.10);
}
.sidebar .server-badge{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:34px;
  margin:0 2px;
  padding:8px 10px;
  border:1px solid rgba(34,197,94,.13);
  border-radius:10px;
  background:rgba(34,197,94,.055);
  color:#72e6a2;
  font-size:10px;
  font-weight:800;
  letter-spacing:.025em;
}
.sidebar .server-badge .dot{
  width:7px;
  height:7px;
  margin:0;
  background:#1fd17a;
  box-shadow:0 0 0 4px rgba(31,209,122,.09),0 0 12px rgba(31,209,122,.36);
}
.sidebar .sidebar-logout{
  min-height:43px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  border:1px solid rgba(148,163,184,.20);
  border-radius:11px;
  background:rgba(255,255,255,.018);
  color:#c6d2e2;
  font-size:12px;
  font-weight:800;
  letter-spacing:.035em;
  box-shadow:none;
}
.sidebar .sidebar-logout:hover{
  transform:none;
  background:rgba(255,255,255,.055);
  border-color:rgba(148,163,184,.30);
  color:#f3f7fc;
}
.sidebar .logout-icon{
  width:17px;
  height:17px;
  display:grid;
  place-items:center;
  color:#7895bc;
}
.sidebar .logout-icon svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.sidebar .nav::-webkit-scrollbar{width:5px}
.sidebar .nav::-webkit-scrollbar-track{background:transparent}
.sidebar .nav::-webkit-scrollbar-thumb{background:rgba(148,163,184,.18);border-radius:999px}
.sidebar .nav::-webkit-scrollbar-thumb:hover{background:rgba(148,163,184,.28)}

@media(max-width:1024px){
  .sidebar{padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(14px,env(safe-area-inset-bottom))}
  .sidebar .nav-btn{min-height:50px;font-size:14px}
  .sidebar>.brand{padding-top:8px}
}

/* ========================================================================
   R8.10 - Desktop customer sidebar polish
   Fixes legacy span width + stretched grid rows without changing sidebar width.
   ======================================================================== */
.sidebar .nav{
  align-content:start;
  grid-auto-rows:max-content;
  gap:4px;
}
.sidebar .nav-btn{
  min-height:46px;
  justify-content:flex-start;
  padding:10px 12px;
}
.sidebar .nav-btn .nav-label{
  width:auto!important;
  flex:1 1 auto;
  min-width:0;
  text-align:left!important;
  white-space:nowrap;
  line-height:1.2;
  overflow:visible;
}
.sidebar .nav-sep{
  margin:8px 9px;
}
@media(min-width:761px){
  .sidebar .nav{
    padding-top:5px;
    padding-bottom:8px;
  }
  .sidebar .nav-btn{
    min-height:46px;
    font-size:14px;
    border-radius:10px;
  }
  .sidebar .nav-icon{
    margin-right:1px;
  }
}

/* ========================================================================
   R8.12 - Customer readability + scheduling alignment polish
   Keeps existing page structure and business logic unchanged.
   ======================================================================== */
@media(min-width:761px){
  .card{font-size:14px}
  .card label{font-size:13px;line-height:1.35}
  .section-head h2{font-size:21px}
  .section-head p{font-size:13px;line-height:1.45}
  input,select,textarea{font-size:14px}
  .field-note{font-size:13px;line-height:1.4}
  .summary-box{font-size:14px;line-height:1.45}
  .detail-id{font-size:12px}
  .detail-meta{font-size:14px;line-height:1.45}
  .detail-info{font-size:14px;line-height:1.75}

  .advanced-box summary{
    padding:13px 14px;
    font-size:14px;
  }
  .advanced-box .form-grid{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:12px 14px;
    padding:14px;
    align-items:end;
  }
  .advanced-box .check.span-2{
    grid-column:auto;
    min-height:42px;
    padding:0 2px;
    align-self:end;
  }
  .advanced-box .check{
    font-size:13px;
    font-weight:800;
  }
  .advanced-box .check input{
    width:16px;
    height:16px;
    margin:0;
  }
  .advanced-box #startWrap,
  .advanced-box #repeatRunsWrap,
  .advanced-box #intervalWrap{
    min-width:0;
  }
  .advanced-box #timezone{
    min-height:42px;
  }
}

@media(max-width:760px){
  .card label{font-size:13px}
  .section-head p,.field-note,.summary-box,.detail-info{font-size:13px}
  input,select,textarea{font-size:14px}
  .advanced-box .form-grid{gap:11px;padding:12px 13px 14px}
  .advanced-box .check.span-2{grid-column:auto}
}

/* 1DG R11: order quick search and schedule clarity */
#orderQuickSearch{margin-top:7px}.order-quick-results{max-height:340px;overflow:auto;border:1px solid #b9d5f7;background:#fff;border-radius:12px;box-shadow:0 12px 32px #102c5130;margin-top:7px;position:relative;z-index:25}.order-quick-item{display:block;width:100%;padding:11px 13px;border:0;border-bottom:1px solid #e9eef5;background:#fff;text-align:left;color:#172033;cursor:pointer}.order-quick-item:hover,.order-quick-item:focus{background:#eff6ff}.order-quick-item b{display:block;font-size:12px}.order-quick-item small{display:block;color:#64748b;margin-top:5px}.order-quick-empty{padding:14px;color:#64748b}.schedule-help{margin:12px 0 3px;font-size:12px;line-height:1.6;color:#64748b}.advanced-box .check{border:1px solid #dbe7f5;border-radius:10px;background:#f8fbff;padding:10px 12px}.advanced-box .check input{accent-color:#2384ee}

/* R14: match supplied scheduling screenshot. Scope only to scheduling block. */
#orderAdvanced.schedule-reference{background:#f8fafc;border:1px solid #dce5f2;border-radius:12px;margin-top:28px;overflow:hidden}
#orderAdvanced.schedule-reference>summary{display:list-item;list-style:none;padding:13px 14px;color:#243653;font-size:14px;font-weight:800;border-bottom:1px solid #e1e8f2;cursor:pointer}
#orderAdvanced.schedule-reference>summary::-webkit-details-marker{display:none}
#orderAdvanced.schedule-reference:not([open])>summary{border-bottom:0}
#orderAdvanced.schedule-reference .schedule-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 14px;padding:0 14px 14px;align-items:end}
#orderAdvanced.schedule-reference .schedule-check{grid-column:1/-1;display:flex!important;min-height:21px;padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:transparent!important;align-items:center;gap:8px;font-size:12px;font-weight:700;line-height:1.3}
#orderAdvanced.schedule-reference .schedule-check input{width:14px;height:14px;margin:0;accent-color:#3b70f4;flex:none}
#orderAdvanced.schedule-reference .schedule-grid>label:not(.schedule-check){font-size:12px;font-weight:700;gap:7px;min-width:0}
#orderAdvanced.schedule-reference .schedule-grid>label:not(.schedule-check) input,#orderAdvanced.schedule-reference .schedule-grid>label:not(.schedule-check) select{width:100%;height:40px;padding:8px 12px;border:1px solid #d2dced;border-radius:9px;background:#fff;font-size:13px}
#orderAdvanced.schedule-reference .schedule-grid>label:first-child{margin-top:2px}
#orderAdvanced.schedule-reference .schedule-grid>label:nth-child(4){margin-top:1px}
#orderAdvanced.schedule-reference .schedule-grid>label.hidden{display:none!important}
@media(max-width:600px){#orderAdvanced.schedule-reference .schedule-grid{grid-template-columns:1fr}#orderAdvanced.schedule-reference .schedule-check{grid-column:1/-1}}


/* R28: Compact scrollable category dropdown, no internal search */
#orderCategory{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;left:0;bottom:0}


/* R29 - Customer service list: single page title, compact toolbar */
#page-services .card{padding:18px 20px}
#page-services .services-compact-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
#page-services .services-compact-meta .count-badge{white-space:nowrap}
#page-services .toolbar{margin-bottom:12px}
#page-services .table-wrap{min-height:120px}
@media(max-width:760px){#page-services .card{padding:14px}#page-services .services-compact-meta{align-items:flex-start}}


/* R32: Restore approved R29 order layout without altering APIs or business logic */
#page-order .r32-quick-search{margin-bottom:12px}
#page-order .r32-quick-search>label{min-width:0}
#page-order #orderCategory{display:none!important}
#page-order #orderAdvanced.schedule-reference{margin-top:28px}
#page-order #orderAdvanced.schedule-reference .schedule-grid{gap:12px 14px;padding:12px 14px 14px;align-items:start}
#page-order #orderAdvanced.schedule-reference .schedule-check{grid-column:1/-1;min-height:20px;align-self:auto}
#page-order #orderAdvanced.schedule-reference .schedule-grid>label.hidden{display:none!important}
@media(max-width:600px){#page-order #orderAdvanced.schedule-reference .schedule-grid{grid-template-columns:1fr}}

/* R34: one native category selector, no secondary JS-generated picker */
#page-order #orderCategory{display:block!important;position:static!important;width:100%!important;height:43px!important;opacity:1!important;pointer-events:auto!important;left:auto!important;bottom:auto!important;appearance:auto!important}
/* R34: schedule and repeat match the approved clean layout. */
#page-order #orderAdvanced.schedule-reference>summary{display:block;list-style:none;padding:13px 15px;font-size:14px}
#page-order #orderAdvanced.schedule-reference>summary::before{content:'▼ ';font-size:12px}
#page-order #orderAdvanced.schedule-reference .schedule-layout{padding:13px 14px 14px;display:flex;flex-direction:column;gap:11px}
#page-order #orderAdvanced.schedule-reference .schedule-check{display:flex!important;align-items:center;gap:8px;min-height:20px;font-size:12px;font-weight:700;padding:0!important;margin:0!important;background:transparent!important;border:0!important}
#page-order #orderAdvanced.schedule-reference .schedule-check input{width:15px;height:15px;accent-color:#4d71f4;margin:0}
#page-order #orderAdvanced.schedule-reference .schedule-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
#page-order #orderAdvanced.schedule-reference .schedule-fields>label{display:flex;flex-direction:column;gap:7px;min-width:0;font-size:12px;font-weight:700}
#page-order #orderAdvanced.schedule-reference .schedule-fields>label.hidden{display:none!important}
#page-order #orderAdvanced.schedule-reference .schedule-fields input,#page-order #orderAdvanced.schedule-reference .schedule-fields select{height:41px;width:100%;background:#fff;border:1px solid #d2dced;border-radius:9px;padding:8px 12px;font-size:13px}
#page-order #orderAdvanced.schedule-reference .schedule-fields:has(>label.hidden:only-child){display:none}
@media(max-width:600px){#page-order #orderAdvanced.schedule-reference .schedule-fields{grid-template-columns:1fr}}


/* R37 - Customer design system. Existing brand, navigation and functionality retained. */
:root{--ui-control-h:43px;--ui-radius:11px;--ui-gap:16px;--ui-text:13px;--ui-heading:20px;--ui-border:#dce4ef;--ui-card-shadow:0 5px 20px rgba(15,35,70,.045)}
body{font-size:var(--ui-text);line-height:1.5;-webkit-font-smoothing:antialiased}
.main{min-width:0}.content{width:100%;max-width:1680px;margin-inline:auto;padding:22px 24px 34px}
.topbar{height:72px;padding-inline:24px}.topbar h1{font-size:20px;line-height:1.3;letter-spacing:-.025em}
.topbar-title #pageSubtitle{font-size:11px;line-height:1.35;margin-top:3px}
.sidebar{padding:18px 12px}.sidebar>.brand{padding:5px 10px 18px}.nav{gap:4px}.nav-btn{min-height:42px;padding:10px 12px;font-size:13px}
.page>.card,.page>.grid-2>.card,.page>.stats-grid+.card{min-width:0}
.card{border-radius:13px;padding:20px 22px;box-shadow:var(--ui-card-shadow)}
.card h2,.section-head h2{font-size:var(--ui-heading);line-height:1.35;letter-spacing:-.025em}
.section-head{margin-bottom:17px;align-items:flex-start}.section-head p{font-size:12px;line-height:1.45;margin-top:5px;color:var(--muted)}
label,.card label,.auth-form label{font-size:12px;line-height:1.4;gap:7px;font-weight:700}
input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:13px;line-height:1.45;border-radius:10px;border-color:var(--ui-border);min-width:0}
input:not([type=checkbox]):not([type=radio]),select{min-height:var(--ui-control-h)}
textarea{min-height:78px;padding:11px 12px}
input[type=checkbox],input[type=radio]{accent-color:#347bf5}
.btn{font-size:12px;line-height:1.4;min-height:39px;padding:9px 14px;border-radius:10px}
.btn.big{min-height:45px;font-size:13px}
.form-grid,.dynamic-fields{gap:14px 14px}.grid-2{gap:18px}.order-grid{grid-template-columns:minmax(0,1.55fr) minmax(290px,.75fr)}
#page-order .r32-quick-search{margin-bottom:15px}
#page-order #orderQuickSearch{min-height:44px}
#page-order #orderCategory{min-height:43px!important;height:43px!important}
#page-order .field-note{min-height:43px;display:flex;align-items:center}
#page-order #orderAdvanced.schedule-reference{margin-top:20px;margin-bottom:4px;border-radius:12px}
#page-order #orderAdvanced.schedule-reference>summary{padding:12px 15px;font-size:13px;line-height:1.4}
#page-order #orderAdvanced.schedule-reference>summary::before{content:none!important}
#page-order #orderAdvanced.schedule-reference .schedule-layout{padding:13px 15px 15px;gap:12px}
#page-order #orderAdvanced.schedule-reference .schedule-fields{gap:12px 14px}
#page-order #orderAdvanced.schedule-reference .schedule-fields input,#page-order #orderAdvanced.schedule-reference .schedule-fields select{min-height:42px;height:42px}
#page-order .summary-box{margin:14px 0 12px;padding:11px 13px}
.service-detail-card{min-height:290px}.detail-info{font-size:13px;line-height:1.65;overflow-wrap:anywhere}
.toolbar{gap:10px;flex-wrap:wrap;margin-bottom:13px}.toolbar .search{flex:1 1 280px;max-width:460px}.toolbar select{width:auto;min-width:170px;max-width:320px}
.table-wrap{border-radius:10px;max-width:100%}.table-wrap table{width:100%}
th,td{padding:11px 12px;font-size:12px;line-height:1.4}th{font-size:10px;letter-spacing:.035em}
.stats-grid{gap:13px}.stat-card{min-height:92px;padding:16px;border-radius:12px}.stat-card strong{font-size:21px}
.modal{max-width:min(640px,calc(100vw - 28px))}.wallet-chip,.user-chip{border-radius:10px}
/* Keep customer pages consistent without affecting the floating support chat. */
#page-services .card{padding:19px 21px}#page-services .services-compact-meta{margin-bottom:13px}
@media(max-width:1180px){.content{padding:18px}.order-grid{grid-template-columns:minmax(0,1.2fr) minmax(270px,.8fr)}.card{padding:18px}}
@media(max-width:1024px){.order-grid{grid-template-columns:minmax(0,1fr)}.sidebar{padding:18px 12px}.main{width:100%;margin-left:0}}
@media(max-width:760px){:root{--ui-control-h:44px;--ui-heading:18px}.content{padding:12px 12px 26px}.topbar{height:auto;min-height:64px;padding:9px 12px}.topbar h1{font-size:17px}.card,#page-services .card{padding:15px;border-radius:12px}.section-head{margin-bottom:14px}.grid-2{gap:12px}.form-grid,.dynamic-fields{gap:12px}.toolbar{flex-direction:column;align-items:stretch}.toolbar .search,.toolbar select{width:100%;max-width:none;flex:auto}.stats-grid{gap:9px}.stat-card{min-height:84px;padding:12px}.stat-card strong{font-size:18px}.btn{min-height:42px}.table-wrap{max-width:100%}#page-order #orderAdvanced.schedule-reference{margin-top:17px}}
@media(max-width:440px){.content{padding-inline:9px}.card,#page-services .card{padding:13px}.section-head h2{font-size:18px}.quote-badge{padding:7px 9px;font-size:12px}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#page-order #orderAdvanced.schedule-reference .schedule-fields{grid-template-columns:1fr}}
