:root{
  --blue-900:#0f3b96;
  --blue-800:#1747a7;
  --blue-700:#1f5ed8;
  --blue-600:#2468f2;

  --bg:#edf2f7;
  --page-bg:#dfe6ee;
  --card:#ffffff;
  --text:#102347;
  --muted:#6e7b94;
  --border:#dce5f2;

  --pending-bg:#f6df9d;
  --pending-text:#8a6400;

  --shipped-bg:#cfe4ff;
  --shipped-text:#0f5eb8;

  --delivered-bg:#d8f1df;
  --delivered-text:#22844d;

  --cancelled-bg:#ffd8d8;
  --cancelled-text:#cb2a2a;

  --returned-bg:#efe2ff;
  --returned-text:#7a3fc0;

  --danger:#cb2a2a;
  --success:#22844d;
  --warning:#8a6400;
  --primary:#1f5ed8;

  --radius-sm:8px;
  --radius-md:10px;
  --radius-lg:12px;
  --radius-xl:16px;

  --shadow-sm:0 4px 14px rgba(11,44,110,0.06);
  --shadow-md:0 10px 24px rgba(11,44,110,0.10);
  --shadow-lg:0 18px 50px rgba(0,0,0,0.10);
}

*{
  box-sizing:border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body{
  margin:0;
  padding:0;
  background:var(--page-bg);
  font-family:Arial, Helvetica, sans-serif;
  color:var(--text);
}

img{
  max-width:100%;
  display:block;
}

button,
input,
select,
textarea{
  font:inherit;
}

a{
  color:inherit;
  text-decoration:none;
}

.app-shell{
  width:100%;
  max-width:430px;
  min-height:100vh;
  margin:0 auto;
  background:var(--bg);
  overflow:hidden;
  box-shadow:0 0 0 1px rgba(0,0,0,0.03);
}

.app-topbar{
  background:linear-gradient(180deg, #1c4daf 0%, #0f3b96 100%);
  color:#fff;
  padding:12px 14px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:sticky;
  top:0;
  z-index:20;
}

.app-topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1;
}

.app-menu-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,0.12);
  color:#fff;
  font-size:19px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.app-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex:1;
}

.app-brand-logo{
  width:40px;
  height:40px;
  border-radius:50%;
  background:#fff;
  overflow:hidden;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.app-brand-logo img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.app-brand-text{
  min-width:0;
}

.app-brand-title{
  font-size:22px;
  font-weight:700;
  line-height:1.05;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.app-brand-subtitle{
  font-size:12px;
  opacity:0.95;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.app-topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.app-icon-btn{
  width:30px;
  height:30px;
  border:none;
  background:transparent;
  color:#fff;
  font-size:19px;
  position:relative;
}

.app-icon-badge{
  position:absolute;
  top:-3px;
  right:-2px;
  min-width:17px;
  height:17px;
  border-radius:999px;
  background:#ff5b36;
  color:#fff;
  font-size:10px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
  border:2px solid #1847a7;
}

.app-content{
  padding:12px;
}

.app-page-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.app-page-title{
  margin:0;
  font-size:15px;
  font-weight:700;
  color:#253963;
}

.app-filter-btn{
  height:34px;
  padding:0 12px;
  border:1px solid #cad5e6;
  background:#fff;
  border-radius:10px;
  color:#2358b7;
  font-size:14px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:7px;
}

.app-search-wrap{
  position:relative;
  margin-bottom:12px;
}

.app-search-icon{
  position:absolute;
  left:11px;
  top:50%;
  transform:translateY(-50%);
  color:#8a96aa;
  font-size:15px;
  pointer-events:none;
}

.app-search-input{
  width:100%;
  height:38px;
  border:1px solid #d2ddeb;
  border-radius:9px;
  background:#fff;
  padding:0 12px 0 34px;
  font-size:14px;
  color:#56647d;
}

.app-tabs-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  -ms-overflow-style:none;
  margin-bottom:12px;
}

.app-tabs-scroll::-webkit-scrollbar{
  display:none;
}

.app-tabs{
  display:flex;
  min-width:max-content;
}

.app-tab{
  height:34px;
  padding:0 16px;
  border:1px solid #d6e0ed;
  border-right:none;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  font-size:13px;
  font-weight:700;
}

.app-tab:first-child{
  border-radius:10px 0 0 10px;
}

.app-tab:last-child{
  border-right:1px solid #d6e0ed;
  border-radius:0 10px 10px 0;
}

.app-tab.active{
  background:#1f5ed8;
  color:#fff;
}

.app-tab.pending{ color:#eb8a00; }
.app-tab.shipped{ color:#2055b6; }
.app-tab.delivered{ color:#17946e; }
.app-tab.cancelled{ color:#ca3737; }
.app-tab.returned{ color:#7b43bf; }

.app-empty-state,
.app-loading-state{
  background:#fff;
  border:1px dashed #ccd8e8;
  border-radius:14px;
  padding:26px 14px;
  text-align:center;
  color:#667891;
  font-size:14px;
}

.app-loading-state{
  border-style:solid;
}

.is-dormant{
  pointer-events:none;
  user-select:none;
}

@media (min-width: 768px){
  body{
    padding:20px 0;
  }

  .app-shell{
    min-height:calc(100vh - 40px);
    border-radius:22px;
    overflow:hidden;
    box-shadow:var(--shadow-lg);
  }
}

.app-tab{
  cursor:pointer;
  transition:background .2s ease, color .2s ease;
}

.app-tab.active{
  background:#1f5ed8;
  color:#fff;
}

.app-tab.pending.active,
.app-tab.shipped.active,
.app-tab.delivered.active,
.app-tab.cancelled.active,
.app-tab.returned.active{
  color:#fff;
}


.filter-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.35);
  opacity:0;
  visibility:hidden;
  transition:.25s ease;
  z-index:60;
}

.filter-sheet{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  max-width:430px;
  margin:0 auto;
  background:#fff;
  border-radius:18px 18px 0 0;
  transform:translateY(100%);
  transition:.28s ease;
  z-index:70;
  max-height:85vh;
  display:flex;
  flex-direction:column;
  box-shadow:0 -10px 30px rgba(0,0,0,0.16);
}

.filter-sheet.active{
  transform:translateY(0);
}

.filter-overlay.active{
  opacity:1;
  visibility:visible;
}

.filter-sheet-handle{
  width:48px;
  height:5px;
  border-radius:999px;
  background:#d6deea;
  margin:10px auto 8px;
}

.filter-sheet-header,
.filter-sheet-footer{
  padding:14px 14px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.filter-sheet-header{
  border-bottom:1px solid #e6edf7;
}

.filter-sheet-header h2{
  margin:0;
  font-size:16px;
  color:#20365f;
}

.filter-close-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:10px;
  background:#f1f5fb;
  color:#284a88;
  font-size:16px;
}

.filter-sheet-body{
  padding:14px;
  overflow:auto;
}

.filter-group{
  margin-bottom:14px;
}

.filter-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.filter-group label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin-bottom:6px;
  color:#31476f;
}

.filter-group input,
.filter-group select{
  width:100%;
  height:42px;
  border:1px solid #d1dceb;
  border-radius:10px;
  background:#fff;
  padding:0 12px;
  color:#34445f;
}

.filter-group input:focus,
.filter-group select:focus{
  outline:none;
  border-color:#9db7ea;
  box-shadow:0 0 0 3px rgba(31, 94, 216, 0.08);
}

.filter-sheet-footer{
  border-top:1px solid #e6edf7;
}

.filter-secondary-btn,
.filter-primary-btn{
  flex:1;
  height:44px;
  border:none;
  border-radius:12px;
  font-weight:700;
}

.filter-secondary-btn{
  background:#eef3fb;
  color:#23467f;
}

.filter-primary-btn{
  background:#1f5ed8;
  color:#fff;
}












.app-form-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  box-shadow:var(--shadow-sm);
}

.app-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.app-form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.app-form-group{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.app-form-group label{
  font-size:13px;
  font-weight:700;
  color:#31476f;
}

.app-input,
.app-select,
.app-textarea{
  width:100%;
  border:1px solid #d2ddeb;
  border-radius:10px;
  background:#fff;
  color:#34445f;
  font-size:14px;
}

.app-input,
.app-select{
  height:42px;
  padding:0 12px;
}

.app-textarea{
  min-height:110px;
  padding:12px;
  resize:vertical;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus{
  outline:none;
  border-color:#9db7ea;
  box-shadow:0 0 0 3px rgba(31, 94, 216, 0.08);
}

.app-form-note{
  font-size:12px;
  color:var(--muted);
  margin-top:-4px;
}

.app-form-actions{
  display:flex;
  gap:10px;
}

.app-btn{
  height:44px;
  border:none;
  border-radius:12px;
  padding:0 16px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
}

.app-btn-primary{
  background:#1f5ed8;
  color:#fff;
}

.app-btn-secondary{
  background:#eef3fb;
  color:#23467f;
}

.app-alert{
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  display:none;
}

.app-alert.show{
  display:block;
}

.app-alert-success{
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}

.app-alert-error{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fca5a5;
}

@media (max-width: 640px){
  .app-form-row{
    grid-template-columns:1fr;
  }

  .app-form-actions{
    flex-direction:column;
  }

  .app-btn{
    width:100%;
  }
}




.order-item-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.order-item-row{
  border:1px solid var(--border);
  background:#f8fbff;
  border-radius:12px;
  padding:12px;
}

.order-item-row-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.order-item-row-title{
  font-size:13px;
  font-weight:700;
  color:#27406b;
}

.order-remove-item-btn{
  height:32px;
  border:none;
  border-radius:10px;
  padding:0 12px;
  background:#fee2e2;
  color:#991b1b;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}

.order-add-item-btn{
  width:100%;
  height:44px;
  border:1px dashed #9db7ea;
  border-radius:12px;
  background:#eef4ff;
  color:#1f5ed8;
  font-weight:700;
  cursor:pointer;
}

.app-input[readonly]{
  background:#f8fafc;
  color:#64748b;
}

.app-field-error{
  font-size:12px;
  color:#b91c1c;
  margin-top:5px;
}

.app-divider{
  height:1px;
  background:#e7eef8;
  margin:4px 0 2px;
}

.app-radio-group{
  display:flex;
  gap:16px;
  margin-top:6px;
}

.app-radio{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:14px;
  color:#2c3e50;
  cursor:pointer;
}

.app-radio input{
  accent-color:#1f5ed8;
  cursor:pointer;
}





body.app-menu-open{
  overflow:hidden;
}

.app-menu-overlay{
  position:fixed;
  inset:0;
  background:rgba(5,16,40,.42);
  opacity:0;
  visibility:hidden;
  transition:opacity .24s ease, visibility .24s ease;
  z-index:80;
}

.app-menu-overlay.active{
  opacity:1;
  visibility:visible;
}

.app-sidebar{
  position:fixed;
  top:0;
  bottom:0;
  left:50%;
  width:82%;
  max-width:340px;
  transform:translateX(-135%);
  background:#fff;
  z-index:90;
  border-radius:0 24px 24px 0;
  box-shadow:20px 0 45px rgba(5,16,40,.24);
  overflow:hidden;
  transition:transform .28s ease;
  display:flex;
  flex-direction:column;
}

.app-sidebar.active{
  transform:translateX(-50%);
}

.app-sidebar-header{
  background:linear-gradient(180deg, #1c4daf 0%, #0f3b96 100%);
  color:#fff;
  padding:12px 14px 16px;
}

.app-sidebar-handle{
  width:42px;
  height:4px;
  border-radius:999px;
  background:rgba(255,255,255,.42);
  margin:0 auto 14px;
}

.app-sidebar-profile{
  display:grid;
  grid-template-columns:48px 1fr 38px;
  gap:12px;
  align-items:center;
}

.app-sidebar-avatar{
  width:48px;
  height:48px;
  border-radius:16px;
  background:#fff;
  color:#1f5ed8;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:20px;
}

.app-sidebar-profile-text{
  min-width:0;
}

.app-sidebar-name{
  font-size:16px;
  font-weight:800;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.app-sidebar-role{
  font-size:12px;
  opacity:.95;
  margin-top:3px;
}

.app-sidebar-email{
  font-size:11px;
  opacity:.82;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.app-sidebar-close{
  width:38px;
  height:38px;
  border:none;
  border-radius:13px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:18px;
}

.app-sidebar-nav{
  padding:12px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.app-sidebar-link{
  min-height:50px;
  border:1px solid #e1e9f5;
  background:#fff;
  border-radius:15px;
  padding:10px 12px;
  display:grid;
  grid-template-columns:34px 1fr 18px;
  align-items:center;
  gap:10px;
  color:#102347;
  box-shadow:0 4px 14px rgba(11,44,110,.04);
}

.app-sidebar-link.active{
  background:#eef4ff;
  border-color:#bcd2ff;
  color:#1f5ed8;
}

.app-sidebar-link.danger{
  color:#cb2a2a;
  background:#fff7f7;
}

.app-sidebar-link-icon{
  width:34px;
  height:34px;
  border-radius:12px;
  background:#edf4ff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:17px;
}

.app-sidebar-link.danger .app-sidebar-link-icon{
  background:#fee2e2;
}

.app-sidebar-link-text{
  font-size:14px;
  font-weight:800;
}

.app-sidebar-link-arrow{
  color:#8a96aa;
  font-size:22px;
  line-height:1;
}

@media(min-width:768px){
 .app-sidebar{
  position:fixed;
  top:0;
  bottom:0;
  left:0;
  width:82%;
  max-width:340px;
  background:#fff;
  z-index:90;
  border-radius:0 24px 24px 0;
  box-shadow:20px 0 45px rgba(5,16,40,.24);
  overflow:hidden;
  transition:transform .28s ease;
  display:flex;
  flex-direction:column;

  transform:translateX(-110%);
}

.app-sidebar.active{
  transform:translateX(0);
}
}



















/* FINAL MENU FIX — keep sidebar fully hidden until menu button is clicked */
.app-menu-overlay{
  position:fixed !important;
  inset:0 !important;
  background:rgba(5,16,40,.42) !important;
  opacity:0 !important;
  visibility:hidden !important;
  pointer-events:none !important;
  transition:opacity .24s ease, visibility .24s ease !important;
  z-index:9998 !important;
}

.app-menu-overlay.active{
  opacity:1 !important;
  visibility:visible !important;
  pointer-events:auto !important;
}

.app-sidebar{
  position:fixed !important;
  top:0 !important;
  bottom:0 !important;
  left:0 !important;
  width:82% !important;
  max-width:340px !important;
  background:#fff !important;
  z-index:9999 !important;
  border-radius:0 24px 24px 0 !important;
  box-shadow:20px 0 45px rgba(5,16,40,.24) !important;
  overflow:hidden !important;
  transition:transform .28s ease !important;
  display:flex !important;
  flex-direction:column !important;

  transform:translate3d(-105%,0,0) !important;
}

.app-sidebar.active{
  transform:translate3d(0,0,0) !important;
}

body.app-menu-open{
  overflow:hidden !important;
}




/* Success Popup Modal */
.success-popup-overlay{
  position:fixed;
  inset:0;
  background:rgba(5,16,40,.50);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:9998;
  transition:.25s ease;
}

.success-popup-overlay.active{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.success-popup{
  position:fixed;
  left:50%;
  top:50%;
  width:calc(100% - 34px);
  max-width:390px;
  background:#fff;
  border-radius:22px;
  padding:22px 16px 16px;
  transform:translate(-50%, -45%) scale(.96);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:9999;
  box-shadow:0 22px 60px rgba(5,16,40,.25);
  transition:.25s ease;
  text-align:center;
}

.success-popup.active{
  transform:translate(-50%, -50%) scale(1);
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.success-popup-icon{
  width:66px;
  height:66px;
  border-radius:999px;
  background:#d8f1df;
  color:#22844d;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:34px;
  font-weight:800;
  margin:0 auto 14px;
}

.success-popup-title{
  margin:0 0 8px;
  font-size:20px;
  font-weight:800;
  color:#102347;
}

.success-popup-message{
  margin:0 0 18px;
  color:#6e7b94;
  font-size:14px;
  line-height:1.45;
}

.success-popup-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.success-popup-btn{
  height:46px;
  border:none;
  border-radius:14px;
  font-weight:800;
  font-size:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.success-popup-btn.primary{
  background:#1f5ed8;
  color:#fff;
}

.success-popup-btn.secondary{
  background:#eef3fb;
  color:#23467f;
}

@media(min-width:420px){
  .success-popup-actions{
    grid-template-columns:1fr 1fr;
  }
}




.app-sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
  height:calc(100% - 98px);
  padding-bottom:14px;
}

.app-sidebar-links-top{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.app-sidebar-links-bottom{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.app-sidebar-footer{
  padding:10px 8px 4px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  color:#7b879c;
}




/* Prevent mobile browser auto-zoom on form focus */
input,
select,
textarea,
button {
  font-size: 16px;
}

/* Make sure your custom form fields also obey it */
.app-input,
.app-select,
.app-textarea {
  font-size: 16px;
}

/* Prevent iOS from auto resizing text strangely */
html {
  -webkit-text-size-adjust: 100%;
}

/* Helps mobile layout stay stable */
body {
  overflow-x: hidden;
}



.order-items-head,
.order-item-line,
.order-item-row-display{
  display:grid;
  grid-template-columns:52px minmax(0, 1fr) 46px minmax(76px, 86px) minmax(82px, 96px);
  gap:8px;
  align-items:center;
}

.order-items-head{
  color:#8a96aa;
  font-size:12px;
  font-weight:800;
  padding:0 0 10px;
  border-bottom:1px solid #edf2f8;
}

.order-item-line,
.order-item-row-display{
  padding:12px 0;
  border-bottom:1px solid #edf2f8;
}

.order-item-line:last-child,
.order-item-row-display:last-child{
  border-bottom:none;
}

.order-item-name,
.order-item-sub{
  min-width:0;
  overflow-wrap:anywhere;
}

.order-item-price,
.order-item-total,
.order-item-qty{
  min-width:0;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media(max-width:430px){
  .order-items-head,
  .order-item-line,
  .order-item-row-display{
    grid-template-columns:52px minmax(0, 1fr) 38px 76px 84px;
    gap:6px;
  }

  .order-items-head{
    font-size:11px;
  }

  .order-item-price,
  .order-item-total,
  .order-item-qty{
    font-size:13px;
  }
}

@media(max-width:380px){
  .order-items-head,
  .order-item-line,
  .order-item-row-display{
    grid-template-columns:44px minmax(0, 1fr) 34px 68px 76px;
    gap:5px;
  }

  .order-item-price,
  .order-item-total,
  .order-item-qty{
    font-size:12px;
  }
}

