/* ============================================
   GASHAM - QR POS | Creative Modern Design
   Mobile-first, professional, production-ready
   ============================================ */

:root {
  --accent: #007aff;
  --accent2: #5856d6;
  --gradient: linear-gradient(135deg, #007aff 0%, #5ac8fa 50%, #5856d6 100%);
  --gradient2: linear-gradient(135deg, #34c759, #30d158);
  --success: #34c759;
  --danger: #ff3b30;
  --warning: #ff9f0a;
  --bg: #f2f2f7;
  --bg2: #ffffff;
  --card: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.45);
  --text: #1c1c1e;
  --text2: #636366;
  --text3: #aeaeb2;
  --border: rgba(60, 60, 67, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --primary: #007aff;
  --primary-light: rgba(0, 122, 255, 0.1);
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-glass: rgba(255, 255, 255, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --trans: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --trans-fast: all 0.15s ease;
}

[data-theme="dark"] {
  --bg: #0a0a1a;
  --bg2: #1a1a2e;
  --card: rgba(26, 26, 46, 0.88);
  --glass: rgba(26, 26, 46, 0.4);
  --text: #f5f5f7;
  --text2: #98989d;
  --text3: #636366;
  --border: rgba(255, 255, 255, 0.04);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
  --primary-light: rgba(0, 122, 255, 0.15);
  --bg-card: rgba(26, 26, 46, 0.88);
  --bg-glass: rgba(26, 26, 46, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; -webkit-tap-highlight-color: transparent; }
input { font-family: inherit; font-size: 16px; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* === LOADING === */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#loading-screen.fade-out { opacity: 0; visibility: hidden; }
.loader { text-align: center; }
.loader-ring { width: 52px; height: 52px; margin: 0 auto 16px; border: 3px solid var(--border); border-top-color: var(--accent); border-left-color: var(--accent2); border-radius: 50%; animation: spin 0.7s cubic-bezier(0.6, 0, 0.4, 1) infinite; }
.loader-g { font-size: 32px; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 2px; }
.loader-sub { font-size: 12px; color: var(--text2); margin-top: 4px; letter-spacing: 4px; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === TOAST === */
#toast-container {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 10000;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: 400px; margin: 0 auto;
}
.toast {
  background: var(--bg2); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 12px; animation: tIn 0.35s cubic-bezier(0.32, 0.72, 0, 1); pointer-events: all;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.toast-message { flex: 1; font-size: 13px; font-weight: 500; }
.toast-close { flex-shrink: 0; color: var(--text3); font-size: 18px; line-height: 1; }
@keyframes tIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.removing { animation: tOut 0.25s ease forwards; }
@keyframes tOut { to { transform: translateX(100%); opacity: 0; } }

/* === SCAN OVERLAY === */
#scan-overlay {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 8000; text-align: center; animation: soIn 0.35s ease;
}
#scan-overlay.fade-out { animation: soOut 0.3s ease forwards; }
.so-icon {
  width: 80px; height: 80px; margin: 0 auto 12px;
  background: var(--gradient2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #fff; font-weight: bold;
  box-shadow: 0 0 60px rgba(52, 199, 89, 0.5), 0 8px 32px rgba(52, 199, 89, 0.3);
  animation: soPop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.so-text { font-size: 15px; font-weight: 600; color: var(--success); }
@keyframes soIn { 0%{transform:translate(-50%,-50%) scale(0);opacity:0} 60%{transform:translate(-50%,-50%) scale(1.15)} 100%{transform:translate(-50%,-50%) scale(1);opacity:1} }
@keyframes soOut { to{opacity:0;transform:translate(-50%,-50%) scale(0.85)} }
@keyframes soPop { 0%{transform:scale(0)} 60%{transform:scale(1.2)} 100%{transform:scale(1)} }

/* === APP === */
#app { min-height: 100vh; display: flex; flex-direction: column; width: 100%; }

/* === HEADER === */
.header {
  position: sticky; top: 0; z-index: 100;
  background: transparent;
  padding: 16px; width: 100%; display: flex; align-items: center; justify-content: space-between;
  min-height: 56px;
}
.header-left { display: flex; align-items: center; flex: 1; }
.brand {
  font-size: 22px; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: 1.2px; line-height: 1;
}
.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text2);
  transition: all 0.2s ease; cursor: pointer;
}
.btn-icon:hover { background: var(--primary-light); color: var(--accent); }
.btn-icon:active { transform: scale(0.9); }
a.btn-icon { text-decoration: none; }
.admin-btn svg { transition: transform 0.3s ease; }
.admin-btn:hover svg { transform: rotate(90deg); }

/* === HERO / NEW ORDER === */
.hero { padding: 18px 16px 8px; max-width: 800px; margin: 0 auto; width: 100%; }
.btn-hero {
  width: 100%; padding: 24px 20px; border-radius: var(--radius-lg);
  background: var(--gradient); color: #fff;
  font-size: 21px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 10px 40px rgba(0, 122, 255, 0.35);
  transition: var(--trans); position: relative; overflow: hidden;
  border: none; cursor: pointer;
}
.btn-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 100%); pointer-events: none; }
.btn-hero:hover { box-shadow: 0 14px 48px rgba(0, 122, 255, 0.45); transform: translateY(-1px); }
.btn-hero:active { transform: scale(0.97); box-shadow: 0 6px 24px rgba(0, 122, 255, 0.25); }
.btn-hero svg { flex-shrink: 0; }

/* === CART PANEL === */
#cart-section {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
  background: var(--card); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.06);
  padding-bottom: var(--safe-b);
  animation: cUp 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  max-height: 50vh; display: flex; flex-direction: column;
}
@keyframes cUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cart-head {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cart-head h3 { font-size: 15px; font-weight: 700; flex: 1; }
.cart-edit-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--accent);
  border: none; cursor: pointer;
  transition: all 0.2s ease; flex-shrink: 0;
}
.cart-edit-btn:hover { background: var(--accent); color: #fff; }
.cart-edit-btn:active { transform: scale(0.9); }
.cart-edit-btn svg { display: block; }
.cart-badge {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 20px; line-height: 1.5; letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,122,255,0.3);
}
.modal-head-actions { display: flex; align-items: center; gap: 6px; }
.btn-icon-sm {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--accent);
  border: none; cursor: pointer; transition: var(--trans-fast);
}
.btn-icon-sm:hover { background: var(--accent); color: #fff; }
.btn-icon-sm:active { transform: scale(0.9); }
.btn-icon-sm svg { display: block; }
.cart-body { flex: 1; overflow-y: auto; padding: 4px 20px; scrollbar-width: thin; }
.cart-empty { text-align: center; padding: 16px; color: var(--text3); font-size: 14px; font-weight: 500; }
.cart-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border); animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.cart-item:last-child { border-bottom: none; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-price { font-size: 12px; color: var(--text2); }
.ci-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ci-qty { font-weight: 700; min-width: 22px; text-align: center; font-size: 14px; }
.ci-total { font-weight: 800; color: var(--accent); min-width: 62px; text-align: right; font-size: 14px; }
.btn-qty {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  background: var(--primary-light); color: var(--accent);
  transition: var(--trans-fast); border: 1px solid transparent;
}
.btn-qty:hover { background: rgba(0,122,255,0.18); }
.btn-qty:active { background: var(--accent); color: #fff; transform: scale(0.88); }
.cart-foot { padding: 12px 20px 16px; border-top: 1px solid var(--border); flex-shrink: 0; background: rgba(0,0,0,0.02); }
[data-theme="dark"] .cart-foot { background: rgba(255,255,255,0.02); }
.cart-row { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; color: var(--text2); }
.cart-row.total { font-size: 20px; font-weight: 800; color: var(--accent); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.btn-confirm {
  width: 100%; padding: 16px; margin-top: 10px;
  background: var(--gradient2); color: #fff;
  border-radius: 14px; font-size: 17px; font-weight: 700; letter-spacing: 0.3px;
  box-shadow: 0 6px 24px rgba(52, 199, 89, 0.3);
  transition: var(--trans); position: relative; overflow: hidden;
}
.btn-confirm:hover { box-shadow: 0 8px 32px rgba(52, 199, 89, 0.4); transform: translateY(-1px); }
.btn-confirm:active { transform: scale(0.97); box-shadow: 0 3px 12px rgba(52, 199, 89, 0.2); }

/* === HISTORY === */
.history-wrap { padding: 16px 16px 32px; max-width: 800px; margin: 0 auto; width: 100%; }
.history-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.history-head h2 { font-size: 18px; font-weight: 700; }
.hist-badge {
  background: var(--accent2); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
}
.history-list { display: flex; flex-direction: column; gap: 10px; }

.order-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: var(--trans); position: relative; overflow: hidden;
}
.order-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient); opacity: 0;
  transition: var(--trans);
}
.order-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.order-card:hover::before { opacity: 1; }
.order-card:active { transform: scale(0.985); }
.oc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.oc-num { font-size: 16px; font-weight: 700; }
.oc-time { font-size: 12px; color: var(--text2); margin-top: 1px; }
.oc-total { font-size: 20px; font-weight: 800; color: var(--accent); }
.oc-meta { display: flex; gap: 12px; font-size: 13px; color: var(--text2); align-items: center; }
.oc-status { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.oc-status.done { background: rgba(52,199,89,0.15); color: var(--success); }

/* === EMPTY === */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state svg { opacity: 0.2; margin-bottom: 8px; }
.empty-state p { font-size: 15px; color: var(--text3); }
.empty-state .sub { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* === MODALS === */
.modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-bd { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-content {
  position: relative; background: var(--card); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-lg); width: 100%; max-width: 420px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: mIn 0.35s cubic-bezier(0.25,0.1,0.25,1);
}
@keyframes mIn { from{opacity:0;transform:scale(0.9) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.btn-x { font-size: 24px; color: var(--text3); line-height: 1; padding: 0; }
.btn-x:active { color: var(--text); }
.modal-body { padding: 16px 20px; }
.modal.sm .modal-content { max-width: 360px; }

/* Scanner */
.scanner-wrap { padding: 14px; }
.scanner-view { position: relative; width: 100%; aspect-ratio: 1; background: #0a0a1a; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.scanner-view #scanner-el { width: 100%; height: 100%; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 10%; z-index: 2; border: 2px solid rgba(255,255,255,0.4); border-radius: 16px; pointer-events: none; box-shadow: 0 0 30px rgba(255,255,255,0.05); }
.scan-c { position: absolute; width: 20px; height: 20px; border-color: #5ac8fa; border-style: solid; }
.scan-c.tl { top:-2px; left:-2px; border-width:3px 0 0 3px; border-radius:8px 0 0 0; }
.scan-c.tr { top:-2px; right:-2px; border-width:3px 3px 0 0; border-radius:0 8px 0 0; }
.scan-c.bl { bottom:-2px; left:-2px; border-width:0 0 3px 3px; border-radius:0 0 0 8px; }
.scan-c.br { bottom:-2px; right:-2px; border-width:0 3px 3px 0; border-radius:0 0 8px 0; }
.scan-line { position:absolute;left:12%;right:12%;height:2px;background:#5ac8fa;box-shadow:0 0 16px #5ac8fa, 0 0 32px rgba(90,200,250,0.3);animation:sL 2s ease-in-out infinite;z-index:3;pointer-events:none; }
@keyframes sL { 0%{top:22%} 50%{top:78%} 100%{top:22%} }
.scan-ctrls { display:flex;gap:8px;justify-content:center;margin-bottom:4px; }
.scan-hint { text-align:center; font-size:12px; color:var(--text2); }

/* Review */
.rv-item { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); font-size:14px; }
.rv-item:last-child { border-bottom:none; }
.rv-qty { font-size:13px; color:var(--text2); }
.rv-amt { text-align:right; }
.rv-unit { display:block; font-size:12px; color:var(--text2); }
.rv-total-item { font-weight:700; color:var(--accent); }
.rv-total { font-size:20px; font-weight:800; text-align:right; margin-top:12px; padding-top:12px; border-top:2px solid var(--border); color:var(--accent); }
.rv-meta { font-size:13px; color:var(--text2); margin-bottom:12px; display:flex; align-items:center; flex-wrap:wrap; gap:4px; }

/* Admin Login Modal */
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  background: var(--gradient); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 24px rgba(0,122,255,0.2);
}
.auth-brand { text-align: center; }

.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-group input {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); color: var(--text); font-size: 16px; outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,122,255,0.12); }
.btn-primary {
  background: var(--accent); color: #fff; padding: 12px 20px;
  border-radius: var(--radius); font-size: 16px; font-weight: 600;
  transition: all 0.2s; width: 100%;
}
.btn-primary:active { transform: scale(0.97); }
.error-msg { color: var(--danger); font-size: 13px; text-align: center; margin: 0 0 8px; }

/* === RESPONSIVE === */
@media (min-width: 600px) {
  .hero { padding: 24px 24px 12px; }
  .history-wrap { padding: 16px 24px 32px; }
  .header { padding: 16px; min-height: 56px; }

}
@media (min-width: 768px) {
  .hero { padding: 32px 40px 16px; display: flex; justify-content: center; }
  .hero .btn-hero { max-width: 480px; }
  .history-wrap { padding: 20px 40px 40px; }
  .history-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .btn-hero { padding: 28px 32px; font-size: 22px; border-radius: 28px; }
  .header { padding: 20px; min-height: 64px; }
  .header-left { flex: 1; }
  .brand { font-size: 26px; letter-spacing: 1.5px; }
  .btn-icon { width: 40px; height: 40px; border-radius: 12px; }
  .order-card { padding: 18px 20px; border-radius: 18px; }
}
@media (min-width: 1024px) {
  .hero { padding: 48px 56px 24px; }
  .hero .btn-hero { max-width: 520px; padding: 32px 40px; font-size: 26px; }
  .history-wrap { padding: 24px 56px 56px; max-width: 1100px; }
  .history-list { grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
  .brand { font-size: 36px; letter-spacing: 2.5px; }
}

/* === USER PANEL IMPROVEMENTS === */

/* History grid */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Order card improvements */
.order-card {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.order-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.order-card-number {
  font-size: 16px;
  font-weight: 700;
}
.order-card-time {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
}
.order-card-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}
.order-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text2);
}
.order-card-status.completed {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(52,199,89,0.12);
  color: var(--success);
}

/* Review modal items */
.review-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.review-item:last-child {
  border-bottom: none;
}
.review-item-qty {
  font-size: 13px;
  color: var(--text2);
  margin-left: 4px;
}
.review-item-amounts {
  text-align: right;
}
.review-item-unit {
  display: block;
  font-size: 12px;
  color: var(--text2);
}
.review-item-total {
  font-weight: 700;
  color: var(--accent);
}
.review-meta {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.review-items {
  border-top: 1px solid var(--border);
  padding-top: 4px;
}
.review-total {
  font-size: 20px;
  font-weight: 800;
  text-align: right;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  color: var(--accent);
}

/* Cart section */
.cart-body {
  max-height: 240px;
  overflow-y: auto;
}

/* Hero button large touch target */
.btn-hero {
  min-height: 56px;
}

/* Better empty state */
.empty-state svg {
  opacity: 0.3;
  margin-bottom: 8px;
}

/* Responsive grid */
@media (min-width: 600px) {
  .history-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .hero { display: flex; justify-content: center; }
  .hero .btn-hero { max-width: 420px; }
}

@media (min-width: 900px) {
  .hero { padding: 40px 48px 20px; display: flex; justify-content: center; }
  .hero .btn-hero { max-width: 500px; padding: 30px 36px; font-size: 24px; gap: 16px; border-radius: 32px; box-shadow: 0 12px 48px rgba(0,122,255,0.35); }
  .hero .btn-hero:hover { box-shadow: 0 16px 56px rgba(0,122,255,0.5); transform: translateY(-2px); }
  .hero .btn-hero svg { width: 28px; height: 28px; }
  .history-wrap { max-width: 960px; margin: 0 auto; padding: 20px 48px 48px; }
  .history-list { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
  
  .header { max-width: 100%; margin: 0 auto; padding: 24px; min-height: 72px; }
  .header-left { flex: 1; }
  .header-right { gap: 12px; flex-shrink: 0; }
  .brand { font-size: 32px; letter-spacing: 2px; }
  .btn-icon { width: 48px; height: 48px; border-radius: 14px; }
  .btn-icon svg { width: 24px; height: 24px; }
  .header-right .btn-icon { background: var(--primary-light); border-radius: 14px; transition: all 0.25s ease; }
  .header-right .btn-icon:hover { background: var(--accent); color: #fff; transform: scale(1.08); box-shadow: 0 4px 16px rgba(0,122,255,0.3); }

  .order-card { padding: 20px 22px; border-radius: 20px; transition: var(--trans); }
  .order-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
  .order-card::before { height: 4px; }
  .order-card:active { transform: scale(0.98); }
  .order-card .oc-num { font-size: 18px; }
  .order-card .oc-total { font-size: 22px; }

  .history-list .order-card:first-child {
    background: linear-gradient(135deg, var(--bg2), var(--primary-light));
    border-color: var(--accent);
  }
  [data-theme="dark"] .history-list .order-card:first-child {
    background: linear-gradient(135deg, var(--bg2), rgba(0,122,255,0.08));
  }
}

@supports (padding: max(0px)) {
  .header {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}
