@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');
:root{--green:#064e3b;--green2:#047857;--amber:#c0843e;--ink:#10231d;--muted:#64748b;--line:#e2e8e4;--bg:#f4f7f4;--white:#fff;--red:#b91c1c}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:'DM Sans',system-ui,sans-serif;font-size:14px}button,input,textarea,select{font:inherit}button,a{touch-action:manipulation}a{color:inherit;text-decoration:none}.topbar,.customer-head{height:72px;position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 max(18px,calc((100vw - 1440px)/2));gap:12px}.brand{display:flex;align-items:center;gap:11px}.brand-icon{height:42px;width:42px;border-radius:14px;display:grid;place-items:center;background:var(--green);color:white;font-size:21px}.brand b{font-size:18px;letter-spacing:-.5px;display:block}.brand small{font-size:9px;letter-spacing:1.6px;color:var(--muted);display:block;margin-top:2px}.top-right{display:flex;gap:12px;align-items:center}.muted,.subtext{color:var(--muted)}.shell{max-width:1480px;margin:auto;padding:22px;display:grid;grid-template-columns:230px minmax(0,1fr);gap:22px}.sidebar,.card,.stat{background:#fff;border:1px solid var(--line);border-radius:17px}.sidebar{padding:13px;height:max-content;position:sticky;top:92px}.eyebrow{font-size:10px;letter-spacing:1.8px;font-weight:800;color:#94a3b8;padding:12px}.nav{display:block;width:100%;text-align:left;padding:12px;border:0;border-radius:11px;background:transparent;color:#475569;font-weight:700;cursor:pointer;margin:2px 0}.nav:hover,.nav.active{background:var(--green);color:white}.nav.link{margin-top:8px}.subscription{margin-top:18px;padding:13px;background:#ecfdf5;border:1px solid #d1fae5;border-radius:12px;color:#065f46;font-size:12px;line-height:1.6}.main{min-width:0}.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:20px}.kicker{font-size:10px;text-transform:uppercase;letter-spacing:2px;font-weight:800;color:var(--green2)}h1{font-size:clamp(25px,3vw,34px);letter-spacing:-1.2px;margin:6px 0;font-weight:800}h2{font-size:18px;margin:0;letter-spacing:-.3px}h3{font-size:14px;margin:0}.subtext{margin:0;line-height:1.6}.grid{display:grid;gap:14px}.stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:16px}.stat{padding:17px}.stat label{display:block;color:var(--muted);font-size:12px}.stat strong{display:block;font-size:22px;letter-spacing:-.7px;margin-top:8px}.card{padding:20px;margin-bottom:16px}.row{display:flex;align-items:center;justify-content:space-between;gap:12px}.row-start{display:flex;align-items:flex-start;gap:12px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 14px;border:1px solid transparent;border-radius:10px;font-weight:800;cursor:pointer;text-align:center}.btn.primary{background:var(--green2);color:white}.btn.primary:hover{background:var(--green)}.btn.outline{background:#fff;border-color:#d7dfd9;color:#334155}.btn.danger{background:#fee2e2;color:#991b1b}.btn.small{font-size:12px;padding:7px 9px}.btn:disabled{opacity:.45;cursor:not-allowed}.field{width:100%;padding:11px 12px;border:1px solid #d6dfd8;border-radius:10px;background:#fff;outline:none;margin-top:6px}.field:focus{border-color:#10b981;box-shadow:0 0 0 3px #10b9811c}label.form-label{display:block;font-size:12px;font-weight:800;margin:12px 0;color:#334155}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.pill{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:11px;font-weight:800;background:#f1f5f9;color:#475569}.pill.green{background:#d1fae5;color:#065f46}.pill.amber{background:#fef3c7;color:#92400e}.pill.red{background:#fee2e2;color:#991b1b}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:650px}th,td{text-align:left;border-bottom:1px solid #edf0ed;padding:12px 10px;vertical-align:middle}th{font-size:10px;color:#64748b;text-transform:uppercase;letter-spacing:.7px}td{font-size:13px}.loading{padding:40px;text-align:center;color:var(--muted)}.alert{padding:14px;border-radius:12px;background:#fffbeb;border:1px solid #fde68a;color:#92400e;margin-bottom:16px;line-height:1.5}.toast{position:fixed;z-index:99;bottom:20px;right:20px;max-width:min(400px,calc(100vw - 40px));background:#0f172a;color:white;border-radius:12px;padding:13px 16px;box-shadow:0 12px 40px #0f172a30}.hidden{display:none!important}.login-wrap{min-height:calc(100vh - 72px);display:grid;place-items:center;padding:20px}.login-card{width:min(420px,100%)}.menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.product-card{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff}.product-card img{height:120px;width:100%;object-fit:cover;background:#e2e8e4}.product-card .body{padding:12px}.product-card h3{margin-bottom:6px}.order-card{border:1px solid var(--line);border-radius:14px;padding:15px;background:#fff}.order-card.timer-green{border-left:5px solid #10b981}.order-card.timer-yellow{border-left:5px solid #f59e0b}.order-card.timer-red{border-left:5px solid #ef4444}.customer-main{max-width:1100px;margin:auto;padding:22px}.customer-head{padding-inline:max(16px,calc((100vw - 1100px)/2))}.customer-hero{padding:24px 0 14px}.category-row{display:flex;gap:8px;overflow:auto;padding:14px 0}.category{border:1px solid var(--line);border-radius:999px;background:#fff;padding:9px 13px;white-space:nowrap;font-weight:800}.category.active{background:var(--green);color:white}.cart-dock{position:fixed;z-index:30;bottom:14px;left:14px;right:14px;max-width:480px;margin:auto}.cart-dock button{width:100%;padding:15px;box-shadow:0 12px 32px #064e3b33;justify-content:space-between}.modal-backdrop{position:fixed;z-index:50;inset:0;background:#0f172a88;display:grid;place-items:center;padding:15px}.modal{background:#fff;border-radius:18px;padding:20px;width:min(560px,100%);max-height:90vh;overflow:auto;box-shadow:0 30px 80px #0003}.modal h2{font-size:21px}.receipt{font-family:ui-monospace,monospace;max-width:320px;margin:18px auto;padding:16px;border:1px dashed #999;background:#fff;color:#111}.qr-box{display:flex;align-items:center;justify-content:center;min-height:130px;border:1px dashed var(--line);border-radius:12px;padding:12px}.bar{height:8px;border-radius:99px;background:#edf2ee;overflow:hidden}.bar span{display:block;height:100%;background:#059669}.mobile-nav{display:none}@media(max-width:1000px){.shell{grid-template-columns:1fr;padding:14px}.sidebar{position:static;display:flex;gap:5px;overflow:auto;align-items:center}.sidebar .eyebrow,.subscription{display:none}.nav{white-space:nowrap;width:auto;margin:0}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:560px){.topbar,.customer-head{height:64px;padding-inline:12px}.shell{padding:12px}.sidebar{border-radius:12px;padding:6px}.nav{font-size:11px;padding:10px 9px}.page-head{display:block}.page-head>.btn{margin-top:12px}.stats{gap:8px}.stat{padding:12px}.stat strong{font-size:18px}.card{padding:14px}.form-grid{grid-template-columns:1fr}.customer-main{padding:14px}.product-card img{height:105px}.product-card .body{padding:9px}.product-card h3{font-size:13px}.btn{padding:10px}.customer-head .btn{font-size:11px;padding:8px}.brand b{font-size:16px}.muted{font-size:11px}}.receipt-print-host{display:none}
@media print{
 @page{size:58mm auto;margin:2mm}
 html,body{width:58mm!important;min-width:58mm!important;margin:0!important;padding:0!important;background:#fff!important;color:#000!important}
 body>*:not(.receipt-print-host){display:none!important}
 .receipt-print-host{display:block!important;width:54mm!important;margin:0!important;padding:0!important;background:#fff!important;color:#000!important}
 .receipt-print{display:block!important;visibility:visible!important;width:54mm!important;max-width:54mm!important;margin:0!important;padding:0!important;border:0!important;background:#fff!important;color:#000!important;font:10px/1.35 ui-monospace,SFMono-Regular,Consolas,monospace!important;overflow-wrap:anywhere}
 .receipt-print *{visibility:visible!important;box-sizing:border-box!important}
 .receipt-print .rp-store{font-size:15px;line-height:1.25;display:block;margin-bottom:2px}
 .receipt-print .rp-title{font-weight:800;margin-top:5px;font-size:11px}
 .receipt-print hr{border:0;border-top:1px dashed #000;margin:6px 0}
 .receipt-print .rp-item{margin:5px 0;break-inside:avoid}
 .receipt-print .rp-name{font-weight:600}
 .receipt-print .rp-money{text-align:right}
 .receipt-print .rp-muted{font-size:9px;color:#222}
 .receipt-print .rp-row{display:flex;justify-content:space-between;gap:5px;margin:3px 0}
 .receipt-print .rp-total{font-size:12px;font-weight:900;border-top:1px dashed #000;padding-top:5px;margin-top:5px}
 .receipt-print .rp-status{font-size:12px;font-weight:900;text-align:center;border:1px solid #000;padding:4px;margin:7px 0}
 .receipt-print .rp-footer{font-size:9px;margin-top:5px}
 .no-print{display:none!important}
}

/* ThreeAPOS customer menu — premium responsive refresh */
body.customer{--customer-ink:#17221e;--customer-muted:#77817c;--customer-line:#e8ece8;--customer-surface:#fff;--customer-canvas:#f7f8f6;background:var(--customer-canvas);color:var(--customer-ink);font-family:Inter,'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;padding-bottom:calc(92px + env(safe-area-inset-bottom))}
.customer .customer-head{height:76px;background:rgba(255,255,255,.92);backdrop-filter:blur(18px);border-bottom:1px solid rgba(22,34,28,.07);padding-inline:max(20px,calc((100vw - 1180px)/2));}
.customer .brand{gap:12px;min-width:0}.customer .brand-icon{width:46px;height:46px;flex:0 0 46px;border-radius:16px;background:linear-gradient(145deg,var(--brand,#0f766e),#143c33);box-shadow:0 7px 18px color-mix(in srgb,var(--brand,#0f766e) 24%,transparent);overflow:hidden}.customer .brand b{font-size:16px;letter-spacing:-.45px;color:#18251f}.customer .brand small{font-size:9px;letter-spacing:1.25px;color:#849089;font-weight:800}.customer .admin-link{border-radius:999px;font-size:12px;padding:10px 15px;background:#fff;border-color:#e6eae6}
.customer-main{max-width:1180px;padding:28px 24px 56px}
.customer-hero{position:relative;isolation:isolate;overflow:hidden;padding:clamp(24px,5vw,52px);border-radius:30px;background:radial-gradient(ellipse at 90% 8%,color-mix(in srgb,var(--brand,#0f766e) 24%,transparent),transparent 35%),linear-gradient(120deg,#10251f,#173b30 62%,#1c4b3b);color:#fff;box-shadow:0 20px 55px rgba(14,45,34,.13);min-height:270px}
.customer-hero:after{content:'✳';position:absolute;right:5%;bottom:-70px;font-size:clamp(180px,28vw,330px);line-height:1;color:rgba(255,255,255,.045);z-index:-1;transform:rotate(-14deg)}
.customer-hero .kicker{color:#a9d6bd;letter-spacing:2.2px;font-size:10px}.customer-hero h1{font-size:clamp(30px,5vw,52px)!important;line-height:1.08;letter-spacing:-1.8px;max-width:700px;margin:14px 0 13px;color:#fff}.customer-hero h1 span{color:#c5e8d2!important}.customer-hero .subtext{max-width:550px;color:#d0ded6;font-size:14px;line-height:1.75}.customer-hero .row{align-items:end;flex-wrap:wrap;max-width:640px;margin-top:24px!important}.customer-hero .form-label{color:#eef7f0;min-width:min(100%,240px);font-size:11px}.customer-hero .field{background:rgba(255,255,255,.97);border:1px solid rgba(255,255,255,.28);border-radius:13px;min-height:46px;color:#20352b}.customer-hero .pill.green{background:rgba(190,242,208,.14);color:#d8f9e2;border:1px solid rgba(200,245,214,.2);padding:8px 12px}
.menu-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:30px 0 10px}.menu-toolbar h2{font-size:22px;letter-spacing:-.7px}.menu-toolbar p{font-size:12px;color:var(--customer-muted);margin:5px 0 0}.menu-search{width:min(340px,100%);position:relative}.menu-search:before{content:'⌕';position:absolute;left:15px;top:50%;transform:translateY(-55%);font-size:25px;color:#7a8780;pointer-events:none}.menu-search input{width:100%;height:48px;border:1px solid #e4e9e4;background:#fff;border-radius:15px;padding:0 15px 0 44px;outline:none;box-shadow:0 4px 16px rgba(20,35,27,.025)}.menu-search input:focus{border-color:var(--brand,#0f766e);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand,#0f766e) 12%,transparent)}
.category-row{gap:9px;padding:14px 0 20px;scrollbar-width:none;overscroll-behavior-x:contain}.category-row::-webkit-scrollbar{display:none}.category{border:1px solid #e7ebe7;border-radius:999px;background:#fff;color:#69756e;padding:11px 17px;font-size:12px;font-weight:800;transition:background .18s,border-color .18s,transform .18s}.category:active{transform:scale(.97)}.category.active{background:var(--brand,#0f766e);border-color:var(--brand,#0f766e);color:#fff;box-shadow:0 6px 16px color-mix(in srgb,var(--brand,#0f766e) 20%,transparent)}
.menu-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 16px}.menu-section-heading strong{font-size:15px;letter-spacing:-.3px}.menu-section-heading span{font-size:11px;color:#89938d}
.customer .menu-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.customer .product-card{border:1px solid #e9ede9;border-radius:22px;overflow:hidden;background:#fff;box-shadow:0 5px 18px rgba(26,41,32,.035);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;min-width:0}.customer .product-card:hover{transform:translateY(-3px);box-shadow:0 15px 34px rgba(26,41,32,.09);border-color:#d9e4dc}.customer .product-image-wrap{position:relative;aspect-ratio:1.45;overflow:hidden;background:#edf1ed}.customer .product-card img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .35s ease;background:#edf1ed}.customer .product-card:hover img{transform:scale(1.04)}.customer .product-card .body{padding:16px}.customer .product-card h3{font-size:15px;line-height:1.35;letter-spacing:-.25px;color:#1c2a22;min-height:20px;margin:0 0 6px}.customer .product-card .product-description{font-size:11px;color:#87918b;line-height:1.5;min-height:16px;margin:0 0 13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.customer .product-card .product-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}.customer .product-price{font-size:14px;color:#172b21;letter-spacing:-.3px;font-weight:900;white-space:nowrap}.customer .product-add{width:39px;height:39px;flex:0 0 39px;border:0;border-radius:13px;background:var(--brand,#0f766e);color:white;font-size:23px;font-weight:500;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 14px color-mix(in srgb,var(--brand,#0f766e) 20%,transparent)}.customer .product-add:disabled{box-shadow:none;background:#d8ded9}.customer .product-category{display:inline-flex;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#f2f6f2;border-radius:999px;padding:5px 8px;font-size:9px;font-weight:800;color:#65746a;margin-bottom:9px}.customer .empty-menu{grid-column:1/-1;text-align:center;padding:48px 20px;background:#fff;border:1px dashed #dfe6df;border-radius:22px;color:#758078}.customer .empty-menu .empty-icon{font-size:30px;margin-bottom:10px}.customer .empty-menu strong{display:block;color:#26372d;font-size:15px;margin-bottom:5px}
.customer .cart-dock{left:16px;right:16px;bottom:calc(14px + env(safe-area-inset-bottom));max-width:500px}.customer .cart-dock button{border-radius:18px;background:linear-gradient(110deg,var(--brand,#0f766e),color-mix(in srgb,var(--brand,#0f766e) 70%,#122f26));padding:17px 19px;box-shadow:0 14px 35px color-mix(in srgb,var(--brand,#0f766e) 30%,transparent);font-size:13px}.customer .modal-backdrop{backdrop-filter:blur(6px);background:rgba(9,20,14,.56);padding:14px}.customer .modal{border-radius:26px;padding:24px;border:1px solid rgba(255,255,255,.65);box-shadow:0 30px 100px rgba(0,0,0,.2)}.customer .modal h2{font-size:22px;letter-spacing:-.7px}.customer .modal .field{border-radius:13px;min-height:44px}.customer .modal .btn.primary{border-radius:13px;min-height:46px;background:var(--brand,#0f766e)}.customer .modal .btn.outline{border-radius:12px}.customer .loading{display:flex;flex-direction:column;align-items:center;gap:9px;padding:80px 20px}.customer .loading-orb{width:44px;height:44px;border-radius:15px;display:grid;place-items:center;background:#e0f1e5;color:#176247;font-size:23px}.customer .loading small{color:#89948d}.customer #statusBox .card{border-radius:20px;border-color:#e7ece7;box-shadow:0 6px 24px rgba(20,35,27,.04)}
@media(min-width:1180px){.customer .product-image-wrap{aspect-ratio:1.55}.customer .product-card .body{padding:18px}}
@media(max-width:850px){.customer-main{padding:20px 18px 48px}.customer .menu-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.customer-hero{border-radius:25px}.customer .product-image-wrap{aspect-ratio:1.35}}
@media(max-width:560px){body.customer{padding-bottom:calc(100px + env(safe-area-inset-bottom))}.customer .customer-head{height:68px;padding-inline:14px}.customer .brand-icon{height:40px;width:40px;flex-basis:40px;border-radius:13px}.customer .brand b{font-size:14px}.customer .brand small{font-size:8px;letter-spacing:.7px}.customer .admin-link{padding:8px 10px;font-size:10px}.customer-main{padding:15px 13px 38px}.customer-hero{padding:25px 21px 22px;border-radius:23px;min-height:0}.customer-hero h1{font-size:32px!important;letter-spacing:-1.1px;margin-top:12px}.customer-hero .subtext{font-size:12px}.customer-hero .row{gap:10px}.customer-hero .form-label{width:100%;min-width:0}.customer-hero .pill.green{font-size:10px}.menu-toolbar{align-items:stretch;flex-direction:column;gap:14px;margin-top:25px}.menu-toolbar h2{font-size:20px}.menu-search{width:100%}.menu-search input{height:46px}.category-row{margin-right:-13px;padding:13px 13px 18px 0;gap:7px}.category{padding:10px 14px;font-size:11px}.menu-section-heading{margin-bottom:12px}.customer .menu-grid{gap:10px}.customer .product-card{border-radius:17px}.customer .product-image-wrap{aspect-ratio:1.05}.customer .product-card .body{padding:11px}.customer .product-card h3{font-size:13px;min-height:35px}.customer .product-card .product-description{font-size:10px;min-height:15px;margin-bottom:10px}.customer .product-category{font-size:8px;padding:4px 7px;margin-bottom:7px}.customer .product-price{font-size:12px}.customer .product-add{width:35px;height:35px;flex-basis:35px;border-radius:12px}.customer .cart-dock{left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom))}.customer .cart-dock button{padding:15px;border-radius:16px;font-size:12px}.customer .modal{padding:19px;border-radius:22px}.customer .modal h2{font-size:19px}}
@media(max-width:360px){.customer .menu-grid{gap:8px}.customer .product-card .body{padding:9px}.customer .product-price{font-size:11px}.customer .product-add{width:32px;height:32px;flex-basis:32px}.customer .brand small{letter-spacing:.3px}}
@media(prefers-reduced-motion:reduce){.customer *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Responsive POS improvements for tablets and phones */
@media (min-width:561px) and (max-width:1100px){.shell{grid-template-columns:1fr;padding:16px;gap:14px}.sidebar{position:sticky;top:64px;z-index:15;display:flex;gap:6px;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}.sidebar .eyebrow,.subscription{display:none}.nav{flex:0 0 auto;width:auto;padding:12px 14px}.topbar{padding-inline:16px}.main{min-width:0}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}button,.btn{min-height:42px}}
@media(max-width:560px){.shell{padding:10px;gap:10px}.sidebar{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity}.nav{scroll-snap-align:start;flex:0 0 auto}.topbar{padding-inline:10px}.top-right{gap:6px}.form-grid{grid-template-columns:1fr}.table-wrap{border-radius:12px}input,select,textarea{max-width:100%;min-width:0}button,.btn{min-height:44px}}


/* ThreeAPOS v9: authenticated app shell and polished responsive experience */
body.app-booting .topbar,body.app-booting .shell{visibility:hidden}
body.login-mode{min-height:100vh;background:radial-gradient(ellipse at 12% 8%,rgba(20,184,166,.16),transparent 38%),radial-gradient(ellipse at 90% 92%,rgba(192,132,62,.13),transparent 34%),#f4f7f6}
body.login-mode .topbar,body.login-mode .sidebar{display:none!important}
body.login-mode .shell{display:block;max-width:none;width:100%;margin:0;padding:0}
body.login-mode .main{min-height:100vh;width:100%;display:flex;align-items:center;justify-content:center;padding:24px}
.login-wrap{width:100%;min-height:calc(100vh - 48px);display:flex;align-items:center;justify-content:center;padding:12px}
.login-card{width:min(100%,440px);padding:clamp(24px,5vw,42px);border-radius:24px;box-shadow:0 24px 70px rgba(15,45,36,.10);border:1px solid rgba(226,232,228,.9);background:rgba(255,255,255,.96)}
.login-card .brand-icon{width:48px;height:48px;border-radius:16px;background:linear-gradient(145deg,var(--green),var(--green2));box-shadow:0 8px 20px rgba(6,78,59,.18)}
.login-card .field{width:100%;min-height:48px;border:1px solid #dbe5df;border-radius:12px;padding:12px 14px;background:#fbfdfc;outline:none;transition:border-color .18s,box-shadow .18s}
.login-card .field:focus{border-color:var(--green2);box-shadow:0 0 0 4px rgba(4,120,87,.12)}
.login-card .form-label{display:block;margin-top:18px;font-weight:700;color:#334155}
.login-card .btn{min-height:48px;border-radius:12px;justify-content:center}
.login-card h1{letter-spacing:-.8px}
.error-note{padding:12px;border-radius:10px;background:#fff1f2;color:#9f1239;border:1px solid #fecdd3;overflow-wrap:anywhere}
body.app-mode .topbar{box-shadow:0 2px 14px rgba(15,45,36,.035)}
body.app-mode .shell{align-items:start;gap:20px;padding-top:20px}
body.app-mode .sidebar{box-shadow:0 6px 24px rgba(15,45,36,.035)}
body.app-mode .nav{min-height:42px;transition:background .15s,color .15s}
body.app-mode .card,body.app-mode .stat{box-shadow:0 4px 18px rgba(15,45,36,.025)}
body.app-mode .page-head h1{letter-spacing:-.8px}
body.app-mode button,body.app-mode .btn{touch-action:manipulation}
@media(min-width:1001px){body.app-mode .sidebar{max-height:calc(100vh - 112px);overflow-y:auto;scrollbar-width:thin}body.app-mode .main{padding-bottom:36px}}
@media(max-width:1000px){body.app-mode .shell{padding:12px;gap:14px}body.app-mode .sidebar{position:sticky;top:72px;z-index:18;box-shadow:0 6px 18px rgba(15,45,36,.06);border-radius:14px}body.app-mode .nav{min-height:44px}}
@media(max-width:560px){body.login-mode .main{padding:12px}body.login-mode .login-wrap{min-height:100svh;padding:8px}body.login-mode .login-card{padding:24px 20px;border-radius:20px}body.app-mode .topbar{height:62px;padding-inline:12px}body.app-mode .brand{gap:8px}body.app-mode .brand-icon{width:36px;height:36px;border-radius:11px;font-size:17px}body.app-mode .brand b{font-size:15px}body.app-mode .brand small{font-size:8px;letter-spacing:1px}body.app-mode .top-right{gap:6px}body.app-mode #tenantName{max-width:34vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}body.app-mode #logoutBtn{min-height:38px;padding:8px 10px}body.app-mode .shell{padding:8px;gap:10px}body.app-mode .sidebar{top:62px;padding:6px;gap:4px}body.app-mode .nav{padding:10px 11px;font-size:12px;min-height:42px}body.app-mode .main{min-width:0}body.app-mode .page-head h1{font-size:24px}body.app-mode .table-wrap{max-width:100%;overflow-x:auto}body.app-mode .stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.login-card .field,.nav{transition:none}}

/* 3APOS premium coffee-shop refresh */
:root{--green:#123b72;--green2:#087cf0;--amber:#d6a66a;--ink:#101828;--bg:#f5f7fb;--line:#e7ebf2}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(180deg,#f8faff 0%,#f3f6fb 100%);letter-spacing:-.01em}
.topbar{background:rgba(255,255,255,.92);backdrop-filter:blur(16px);border-bottom-color:#e8edf5;box-shadow:0 4px 24px rgba(16,24,40,.035)}
.brand-icon,.login-card .brand-icon{overflow:hidden;background:#fff;border:1px solid #e6edf8;box-shadow:0 8px 24px rgba(8,124,240,.12);padding:2px}
.brand b{font-weight:850;letter-spacing:-.7px}.brand small{font-weight:800}
.sidebar{border-color:#e8edf5;box-shadow:0 10px 35px rgba(16,24,40,.045);border-radius:20px;padding:12px}
.nav{border-radius:12px;padding:12px 13px;transition:background .18s ease,transform .18s ease}.nav:hover{background:#edf5ff;color:#075fc0;transform:translateX(2px)}.nav.active{background:linear-gradient(135deg,#087cf0,#1556b8);box-shadow:0 8px 18px rgba(8,124,240,.2)}
.card,.stat{border-radius:20px;border-color:#e8edf5;box-shadow:0 8px 30px rgba(16,24,40,.035);transition:box-shadow .2s ease,transform .2s ease}.stat:hover{box-shadow:0 14px 36px rgba(16,24,40,.075);transform:translateY(-2px)}
h1{letter-spacing:-1.3px;font-weight:850}.kicker{color:#087cf0}.btn{border-radius:12px;transition:transform .16s ease,box-shadow .16s ease}.btn:active{transform:scale(.98)}.btn.primary{background:linear-gradient(135deg,#087cf0,#1556b8);box-shadow:0 6px 15px rgba(8,124,240,.16)}.btn.primary:hover{background:linear-gradient(135deg,#086bd0,#124a9c)}.field{border-color:#dfe6f0;border-radius:12px;min-height:44px}.field:focus{border-color:#1685f7;box-shadow:0 0 0 4px #1685f71a}
.product-card{border-color:#e8edf5;border-radius:18px;box-shadow:0 7px 24px rgba(16,24,40,.035);transition:transform .18s ease,box-shadow .18s ease}.product-card:hover{transform:translateY(-3px);box-shadow:0 14px 32px rgba(16,24,40,.09)}.product-card img{background:#f0f4fa}.category.active{background:linear-gradient(135deg,#087cf0,#1556b8)}.cart-dock button{background:linear-gradient(110deg,#087cf0,#1556b8)!important;box-shadow:0 14px 34px #087cf044!important}
@media(max-width:560px){.topbar{box-shadow:0 4px 18px rgba(16,24,40,.04)}.card,.stat{border-radius:16px}.brand-icon{width:38px;height:38px}.nav.active{box-shadow:0 5px 12px #087cf033}}

/* ThreeAPOS Coffee Bean Premium UI — overrides previous blue/green theme */
:root{--green:#3b2418;--green2:#6f432b;--amber:#c58b50;--ink:#2b1b14;--muted:#806e60;--line:#e7d8c6;--bg:#f6efe5;--white:#fffaf3;--coffee-espresso:#2b1b14;--coffee-bean:#5a3825;--coffee-latte:#f3e6d0;--coffee-caramel:#c58b50}
body{background:linear-gradient(180deg,#faf5ed 0%,#f3e8d9 100%);color:var(--ink);font-family:Inter,'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
.topbar{background:rgba(255,250,243,.96);border-bottom-color:#e7d8c6;box-shadow:0 4px 22px rgba(43,27,20,.06)}
.brand b{color:#2b1b14}.brand small{color:#8c705b}.brand-icon,.login-card .brand-icon{background:#2b1b14;border:1px solid #6f432b;color:#f3e6d0;box-shadow:0 8px 20px rgba(43,27,20,.16)}
.shell{grid-template-columns:246px minmax(0,1fr);gap:24px;padding-top:24px}
.sidebar{background:linear-gradient(180deg,#302016 0%,#24170f 100%);border:1px solid #503522;border-radius:20px;padding:14px;box-shadow:0 14px 34px rgba(43,27,20,.13)}
.sidebar .eyebrow{color:#c5a98e}.sidebar .nav{color:#e8d8c5;border-radius:12px;padding:12px 13px;font-weight:650}.sidebar .nav:hover{background:#4b3020;color:#fff6e9;transform:translateX(2px)}.sidebar .nav.active{background:linear-gradient(135deg,#a66b3f,#704327);color:#fffaf3;box-shadow:0 7px 18px rgba(0,0,0,.22)}.sidebar .subscription{background:#3b281b;border-color:#68482d;color:#f1d7b7}.sidebar .subscription b{color:#fff0dc}
.main{min-width:0}.kicker{color:#8b552f}.page-head{margin-bottom:22px}.page-head h1{color:#2b1b14;letter-spacing:-1px}.subtext,.muted{color:#806e60}
.card,.stat{background:rgba(255,250,243,.96);border:1px solid #e7d8c6;border-radius:18px;box-shadow:0 7px 24px rgba(65,42,25,.045)}.stat{padding:20px}.stat label{color:#806e60}.stat strong{color:#3b2418}.card h2,.card h3{color:#3b2418}
.btn.primary{background:linear-gradient(135deg,#8a5938,#5a3825);color:#fffaf3;box-shadow:0 5px 13px rgba(90,56,37,.17)}.btn.primary:hover{background:linear-gradient(135deg,#704327,#3b2418)}.btn.outline{background:#fffaf3;border-color:#d9c3aa;color:#5a3825}.btn.danger{background:#fce8e3;color:#9b3325}.field{background:#fffdf9;border-color:#ddcbb6;color:#2b1b14}.field:focus{border-color:#c58b50;box-shadow:0 0 0 4px rgba(197,139,80,.17)}
th{color:#8b7561}th,td{border-bottom-color:#efe4d7}.pill{background:#eee2d3;color:#63452e}.pill.green{background:#e2ead9;color:#36562d}.pill.amber{background:#f8e6c8;color:#8b552f}.pill.red{background:#f8dfd8;color:#963b2b}
.product-card,.order-card{background:#fffaf3;border-color:#e7d8c6;border-radius:16px}.product-card:hover{box-shadow:0 14px 30px rgba(65,42,25,.12)}.product-card img{background:#ead9c4}.category{background:#fffaf3;border-color:#e0ccb5;color:#5a3825}.category.active{background:linear-gradient(135deg,#8a5938,#5a3825);color:#fffaf3}.cart-dock button{background:linear-gradient(110deg,#8a5938,#5a3825)!important;box-shadow:0 14px 32px rgba(90,56,37,.3)!important}
.order-card.timer-green{border-left-color:#7b965c}.order-card.timer-yellow{border-left-color:#c58b50}.order-card.timer-red{border-left-color:#b94b36}.bar{background:#eadfce}.bar span{background:#8a5938}.toast{background:#2b1b14;color:#fffaf3}.modal{background:#fffaf3;border:1px solid #e7d8c6}.login-wrap{background:radial-gradient(ellipse at 10% 8%,rgba(197,139,80,.2),transparent 38%),radial-gradient(ellipse at 90% 92%,rgba(90,56,37,.13),transparent 36%),#f6efe5}.login-card{background:rgba(255,250,243,.98);border-color:#e7d8c6;box-shadow:0 24px 70px rgba(43,27,20,.12)}
/* Desktop cashier layout: product catalog left, cart right; collapses gracefully on smaller screens */
.cashier-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(310px,.85fr);gap:16px;align-items:start}.cashier-products{min-width:0}.cashier-cart{position:sticky;top:92px;min-width:0}.cashier-products .menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cashier-cart .card{margin-bottom:0}
@media(min-width:1001px){body.app-mode .sidebar{top:92px;max-height:calc(100vh - 116px)}body.app-mode .shell{grid-template-columns:246px minmax(0,1fr)}}
@media(max-width:1000px){.shell{grid-template-columns:minmax(0,1fr);gap:14px;padding:14px}.sidebar{background:#302016;position:sticky;top:72px;z-index:18}.sidebar .nav{flex:0 0 auto}.cashier-layout{grid-template-columns:minmax(0,1fr)}.cashier-cart{position:static}.cashier-products .menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.shell{padding:10px;gap:10px}.sidebar{top:62px;border-radius:14px}.sidebar .nav{font-size:11px;padding:10px 11px}.topbar{background:rgba(255,250,243,.98)}.stats{gap:8px}.stat{padding:13px}.card{padding:14px}.cashier-products .menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-head h1{font-size:24px}}

/* Coffee shop theme enforcement + income summary */
:root{--green:#5a3825!important;--green2:#8b572f!important;--amber:#c58b50!important;--ink:#2b1b14!important;--muted:#806e60!important;--line:#e7d8c6!important;--bg:#f6efe5!important;--white:#fffaf3!important}
body.app-mode{background:radial-gradient(ellipse at top right,#f3e2ca 0,transparent 42%),var(--bg);color:var(--ink)}
body.app-mode .topbar{background:rgba(255,250,243,.96);border-color:#e7d8c6}
body.app-mode .brand-icon{background:linear-gradient(145deg,#9b653c,#4a2d1c)}
body.app-mode .sidebar{background:linear-gradient(180deg,#302016,#24170f);border:1px solid #503522;box-shadow:0 14px 34px rgba(43,27,20,.13)}
body.app-mode .sidebar .eyebrow{color:#c5a98e}
body.app-mode .sidebar .nav{color:#e8d8c5;border-radius:12px}
body.app-mode .sidebar .nav:hover{background:#4b3020;color:#fff6e9}
body.app-mode .sidebar .nav.active{background:linear-gradient(135deg,#a66b3f,#704327);color:#fffaf3;box-shadow:0 7px 18px rgba(0,0,0,.22)}
body.app-mode .sidebar .subscription{background:#3b281b;border-color:#68482d;color:#f1d7b7}
body.app-mode .card,body.app-mode .stat{background:rgba(255,250,243,.96);border-color:#e7d8c6;box-shadow:0 8px 26px rgba(74,45,28,.055)}
body.app-mode .btn.primary{background:linear-gradient(135deg,#a66b3f,#704327);color:#fffaf3}
body.app-mode .kicker{color:#8b572f}
.income-balance{background:linear-gradient(135deg,#fffaf3,#f1e1cb)!important;border-color:#d9b88f!important}
.income-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:18px}
.income-grid>div{padding:16px;border:1px solid #e7d2b8;border-radius:14px;background:rgba(255,255,255,.6)}
.income-grid label,.income-grid small{display:block;color:#806e60;font-size:12px}
.income-grid strong{display:block;font-size:clamp(18px,2vw,25px);color:#3b2418;margin:8px 0}
.income-note{font-size:11px;line-height:1.6;color:#806e60;margin:14px 0 0}
@media(max-width:560px){.income-grid{grid-template-columns:1fr}.income-grid>div{padding:13px}}

/* v16 coffee theme for customer menu + revenue chart */
:root{--green:#5a3825!important;--green2:#8b572f!important;--brand:#8b572f!important;--amber:#c58b50!important;--ink:#2b1b14!important;--muted:#806e60!important;--line:#e7d8c6!important;--bg:#f6efe5!important;--white:#fffaf3!important}
body.customer{background:#f6efe5;color:#2b1b14}
.customer .customer-head{background:rgba(255,250,243,.96);border-bottom:1px solid #e5d3bf;box-shadow:0 4px 20px rgba(43,27,20,.04)}
.customer .customer-head .brand-icon{background:linear-gradient(145deg,#a66b3f,#4a2d1c);color:#fffaf3}
.customer .customer-hero{background:radial-gradient(ellipse at 82% 12%,rgba(197,139,80,.32),transparent 34%),linear-gradient(125deg,#2b1b14,#5a3825 62%,#754b2e);color:#fffaf3;box-shadow:0 18px 40px rgba(43,27,20,.16)}
.customer .customer-hero .subtext{color:#ead9c5}
.customer .customer-hero .field{color:#3b281b;border-color:#d8b995}
.customer .customer-hero .pill.green{background:#f2e1cb;color:#5a3825;border-color:#dfbd95}
.customer .menu-toolbar p{color:#806e60}
.customer .menu-search input{background:#fffaf3;border-color:#e2cfb9;color:#2b1b14}
.customer .category{background:#fffaf3;border-color:#e2cfb9;color:#5a3825}
.customer .category.active{background:linear-gradient(135deg,#a66b3f,#5a3825)!important;color:#fffaf3!important;border-color:#8b572f}
.customer .product-card{background:#fffaf3;border-color:#e7d8c6;box-shadow:0 8px 24px rgba(74,45,28,.06)}
.customer .product-image-wrap{background:#ead9c4}
.customer .product-card h3,.customer .product-price{color:#2b1b14}
.customer .product-category{background:#f0e0cc;color:#80512f}
.customer .product-add{background:linear-gradient(145deg,#a66b3f,#5a3825)!important;box-shadow:0 6px 14px rgba(90,56,37,.22)!important}
.customer .cart-dock button,.customer .modal .btn.primary{background:linear-gradient(110deg,#a66b3f,#5a3825)!important}
.customer .loading-orb{background:#ead9c4;color:#5a3825}
.income-chart-card{background:linear-gradient(135deg,#fffaf3,#f4e8d8)!important;border-color:#e7d3ba!important}
.income-chart{width:100%;overflow:hidden;margin-top:18px;min-height:190px}.income-svg{display:block;width:100%;height:auto;overflow:visible}.chart-gridline{stroke:#e6d7c5;stroke-width:1}.chart-label,.chart-y-label{fill:#806e60;font-size:11px}.chart-line{fill:none;stroke:#a66b3f;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}.chart-area{fill:rgba(197,139,80,.18)}.chart-dot{fill:#fffaf3;stroke:#8b572f;stroke-width:3}.chart-empty{display:grid;place-items:center;min-height:180px;color:#806e60;font-size:13px}.chart-legend{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:8px;color:#806e60;font-size:11px}.chart-legend span{display:flex;align-items:center;gap:7px}.chart-legend i{display:inline-block;width:9px;height:9px;border-radius:50%;background:#a66b3f}
@media(max-width:560px){.income-chart{margin-top:10px}.chart-label,.chart-y-label{font-size:10px}.chart-legend{align-items:flex-start;flex-direction:column}}


/* v17: use the supplied 3APOS logo instead of the text brand tagline */
.brand-logo-only{display:flex;align-items:center;justify-content:flex-start;min-width:0}
.brand-logo-only .brand-full-logo{display:block;width:auto;height:auto;max-width:190px;max-height:54px;object-fit:contain}
.topbar .brand-logo-only{padding:0;margin:0}
.topbar .brand-logo-only .brand-full-logo{max-width:172px;max-height:48px}
.login-brand{justify-content:center;margin:0 auto 8px!important}
.login-brand .brand-full-logo{max-width:min(240px,100%);max-height:92px}
@media(max-width:560px){.topbar .brand-logo-only .brand-full-logo{max-width:138px;max-height:42px}.login-brand .brand-full-logo{max-width:210px;max-height:82px}}

/* ThreeAPOS mobile responsive layer (v18) */
html{max-width:100%;overflow-x:hidden;scroll-behavior:smooth}body{min-width:320px;overflow-x:hidden;-webkit-text-size-adjust:100%;padding-bottom:env(safe-area-inset-bottom)}img,svg,video,canvas{max-width:100%}.brand-full-logo{max-width:min(180px,45vw);height:auto;object-fit:contain}.main{min-width:0}.card,.stat,.order-card{min-width:0}.table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-wrap table{min-width:620px}.field,select.field,textarea.field{max-width:100%;min-width:0}.btn{min-height:40px}.form-label{display:block;min-width:0}.form-label .field{width:100%;margin-top:6px}.income-svg{width:100%;height:auto;display:block}.modal-backdrop{padding:12px;overflow:auto}.modal{max-width:min(560px,100%);max-height:calc(100dvh - 24px);overflow:auto}.qr-box img,.qr-box canvas{max-width:100%;height:auto}
@media(max-width:900px){.topbar,.customer-head{height:auto;min-height:60px;padding:10px 14px;gap:8px}.brand-full-logo{max-width:145px;max-height:42px}.top-right{gap:6px;min-width:0}.top-right #tenantName{max-width:40vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.shell{display:block;padding:12px;max-width:100%}.sidebar{position:sticky;top:0;z-index:19;margin:0 -12px 12px;border-radius:0 0 14px 14px;padding:8px;background:rgba(255,255,255,.97);backdrop-filter:blur(12px);display:flex;gap:7px;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}.sidebar .eyebrow,.sidebar .subscription{display:none}.sidebar .nav{flex:0 0 auto;width:auto;min-height:40px;padding:9px 12px;margin:0;border-radius:10px}.main{padding:0;min-width:0}.page-head{align-items:flex-start;gap:12px;flex-wrap:wrap}.grid.stats{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid[style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important}.income-chart-card{overflow:hidden}.row{gap:10px;flex-wrap:wrap}.row>*{min-width:0}.card{padding:15px;border-radius:14px}.table-wrap table{min-width:640px}.login-wrap{padding:14px;min-height:calc(100dvh - 60px)}.login-card{width:min(100%,420px)}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:520px){body{font-size:13px}.topbar,.customer-head{padding:9px 11px;min-height:56px}.brand-full-logo{max-width:118px;max-height:36px}.top-right #tenantName{font-size:11px;max-width:32vw}.top-right .btn{padding:7px 9px;font-size:12px}.shell{padding:9px}.sidebar{margin:0 -9px 10px;padding:7px}.sidebar .nav{font-size:12px;padding:9px 10px;min-height:38px}.page-head h1{font-size:24px;line-height:1.15}.page-head .subtext{font-size:12px}.grid.stats{gap:8px}.stat{padding:12px}.stat strong{font-size:20px;overflow-wrap:anywhere}.card{padding:12px;margin-bottom:10px}.card h2{font-size:17px}.form-grid{grid-template-columns:minmax(0,1fr)!important}.menu-grid{grid-template-columns:minmax(0,1fr)!important}.btn{padding:9px 11px}.btn.small{padding:7px 9px;min-height:34px}.field{padding:11px 12px}.income-chart-card .row{align-items:flex-start}.chart-legend{flex-wrap:wrap;gap:8px}.modal{padding:14px}.login-card{padding:22px 17px}.login-brand .brand-full-logo{max-width:190px;max-height:70px}.rp-store{overflow-wrap:anywhere}}
@media(hover:none){.btn,.nav,button,a{ -webkit-tap-highlight-color:transparent }}

/* ThreeAPOS mobile navigation fix v19: use a slide-out drawer instead of a horizontal nav bar. */
@media(max-width:760px){
  .mobile-nav-toggle{display:inline-flex!important;align-items:center;justify-content:center;min-height:38px;margin-right:auto;white-space:nowrap;flex:0 0 auto}
  .topbar,body.app-mode .topbar{display:flex!important;align-items:center;gap:10px;position:sticky;top:0;z-index:1000}
  .topbar .brand{flex:0 1 auto;min-width:0}
  .top-right{margin-left:auto;display:flex;align-items:center;gap:6px;min-width:0}
  .top-right #tenantName{max-width:28vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .shell,body.app-mode .shell{display:block!important;grid-template-columns:minmax(0,1fr)!important;width:100%;max-width:100%;padding:10px!important}
  .sidebar,body.app-mode .sidebar{display:flex!important;flex-direction:column!important;align-items:stretch!important;position:fixed!important;z-index:1001!important;top:0!important;bottom:0!important;left:0!important;right:auto!important;width:min(82vw,300px)!important;max-width:300px!important;height:100vh!important;height:100dvh!important;max-height:none!important;margin:0!important;border-radius:0 18px 18px 0!important;overflow-x:hidden!important;overflow-y:auto!important;white-space:normal!important;transform:translateX(-110%)!important;transition:transform .22s ease!important;box-shadow:12px 0 36px rgba(0,0,0,.25)!important;padding:18px 12px 28px!important;gap:5px!important}
  .sidebar.mobile-nav-open,body.app-mode .sidebar.mobile-nav-open{transform:translateX(0)!important}
  .sidebar .eyebrow,body.app-mode .sidebar .eyebrow,.sidebar .subscription,body.app-mode .sidebar .subscription{display:block!important}
  .sidebar .nav,body.app-mode .sidebar .nav{display:flex!important;flex:0 0 auto!important;width:100%!important;min-height:42px!important;margin:0!important;white-space:normal!important;text-align:left!important}
  .main,body.app-mode .main{width:100%;max-width:100%;min-width:0;padding:0!important}
  #mobileNavBackdrop{touch-action:manipulation}
}
@media(min-width:761px){.mobile-nav-toggle{display:none!important}#mobileNavBackdrop{display:none!important}}


/* ThreeAPOS v22 — tablet-first workspace refinement
   Optimized for 7–13 inch touch devices in portrait and landscape. */
@media (min-width: 761px) and (max-width: 1100px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14px; }
  .topbar, body.app-mode .topbar {
    min-height: 66px; padding: 10px 18px; gap: 12px;
  }
  .brand-full-logo { max-width: 150px; max-height: 42px; object-fit: contain; }
  .top-right { gap: 8px; }
  .shell, body.app-mode .shell {
    display: grid !important;
    grid-template-columns: 184px minmax(0, 1fr) !important;
    align-items: start; gap: 16px; padding: 16px !important;
    max-width: 100%; width: 100%;
  }
  .sidebar, body.app-mode .sidebar {
    position: sticky !important; top: 78px !important; z-index: 20 !important;
    display: flex !important; flex-direction: column !important;
    align-items: stretch !important; width: auto !important; max-width: none !important;
    height: auto !important; max-height: calc(100dvh - 94px) !important;
    overflow-x: hidden !important; overflow-y: auto !important;
    white-space: normal !important; transform: none !important;
    transition: none !important; border-radius: 16px !important;
    padding: 10px !important; gap: 4px !important; box-shadow: none !important;
    margin: 0 !important;
  }
  .sidebar .eyebrow, body.app-mode .sidebar .eyebrow { display: block !important; padding: 10px 9px; }
  .sidebar .subscription, body.app-mode .sidebar .subscription { display: block !important; }
  .sidebar .nav, body.app-mode .sidebar .nav {
    display: flex !important; align-items: center; width: 100% !important;
    min-height: 46px !important; padding: 11px 10px !important; margin: 1px 0 !important;
    white-space: normal !important; text-align: left !important; line-height: 1.3;
    border-radius: 10px !important; flex: 0 0 auto !important;
  }
  .main, body.app-mode .main { min-width: 0; width: 100%; padding: 0 !important; }
  .page-head { align-items: center; margin-bottom: 16px; gap: 12px; }
  .page-head h1 { font-size: clamp(24px, 2.7vw, 31px); }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
  .stat { min-width: 0; padding: 15px; }
  .stat strong { font-size: clamp(20px, 2.4vw, 27px); overflow-wrap: anywhere; }
  .card { padding: 16px; margin-bottom: 12px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 590px; }
  button, .btn, .nav, input, select, textarea { touch-action: manipulation; }
  button, .btn { min-height: 44px; }
  .field, input, select, textarea { min-height: 44px; font-size: 15px; }
  .modal { width: min(720px, calc(100vw - 40px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
}
/* Tablet portrait: reclaim width while keeping a stable, familiar navigation rail. */
@media (min-width: 761px) and (max-width: 900px) and (orientation: portrait) {
  .shell, body.app-mode .shell { grid-template-columns: 156px minmax(0, 1fr) !important; gap: 12px; padding: 12px !important; }
  .sidebar, body.app-mode .sidebar { padding: 7px !important; }
  .sidebar .nav, body.app-mode .sidebar .nav { padding: 10px 8px !important; font-size: 12px; }
  .sidebar .subscription, body.app-mode .sidebar .subscription { padding: 9px; font-size: 11px; }
  .grid.stats { gap: 8px; }
  .stat, .card { padding: 12px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
}
/* Wide tablet / landscape: denser dashboard without tiny controls. */
@media (min-width: 901px) and (max-width: 1100px) {
  .shell, body.app-mode .shell { grid-template-columns: 196px minmax(0, 1fr) !important; gap: 18px; }
  .grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (hover: none) and (min-width: 761px) {
  .nav, button, .btn { -webkit-tap-highlight-color: transparent; }
  .nav:active, button:active, .btn:active { transform: scale(.99); }
}

/* Password visibility toggle for login, optimized for touch devices */
.password-input-wrap{position:relative;display:block;width:100%}.password-input-wrap>.field{padding-right:54px!important}.password-toggle{position:absolute;right:6px;top:calc(50% + 3px);transform:translateY(-50%);width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:10px;background:transparent;color:#64748b;cursor:pointer;touch-action:manipulation}.password-toggle:hover,.password-toggle:focus-visible{background:#eaf4ee;color:#065f46;outline:2px solid #a7f3d0;outline-offset:1px}.password-toggle .eye-icon{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}@media(max-width:560px){.password-toggle{width:44px;height:44px}}
