/* ─── SunaBoutique · CSS Global ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; background: #0E0E0E;
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow-x: hidden;
}
button, select, input, textarea { font-family: 'DM Sans', system-ui, sans-serif; }

/* ─── Mode bar ─── */
#mode-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: #0E0E0E; border-bottom: 1px solid #1F1F1F;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 52px;
}
#mode-bar .logo { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
#mode-bar .logo span { color: #F59148; }
#mode-bar .tabs { display: flex; gap: 4px; background: #1A1A1A; border-radius: 10px; padding: 3px; }
#mode-bar .tab {
  padding: 6px 18px; border: none; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; background: transparent; color: #888; text-decoration: none;
  display: inline-flex; align-items: center;
}
#mode-bar .tab.active { background: #fff; color: #0E0E0E; }
#mode-bar .badge { background: #1A1A1A; border: 1px solid #2A2A2A; border-radius: 20px; padding: 4px 12px; color: #888; font-size: 12px; }
#app-container { padding-top: 52px; }

/* ─── Mobile shell ─── */
#mobile-view {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 52px);
  background: radial-gradient(ellipse at 50% 0%, #1A0E06 0%, #0E0E0E 60%);
}
.phone-shell {
  width: 390px; min-height: 812px; border-radius: 48px; overflow: hidden;
  border: 10px solid #1F1F1F; position: relative;
  box-shadow: 0 0 0 1px #333, 0 40px 80px rgba(0,0,0,0.8), inset 0 0 0 1px #2A2A2A;
  background: #FFF8EC; display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 34px; background: #1F1F1F; border-radius: 0 0 20px 20px; z-index: 100;
}
.phone-status {
  height: 44px; flex-shrink: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; font-size: 13px; font-weight: 700; color: #1A1512;
}
.phone-body {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.phone-screen {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: #D4521A #FFF0E6;
}
.phone-screen::-webkit-scrollbar { width: 4px; }
.phone-screen::-webkit-scrollbar-track { background: #FFF0E6; }
.phone-screen::-webkit-scrollbar-thumb { background: #D4521A; border-radius: 2px; }
.phone-nav {
  flex-shrink: 0; background: #fff;
  border-top: 1px solid #EEE5D5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 0 12px;
}
.phone-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; padding: 6px 0; color: #6B5D54; font-size: 11px; font-weight: 500;
}
.phone-nav a.active { color: #F26A1F; font-weight: 700; }
.phone-nav a span.nav-icon { font-size: 22px; }

/* ─── Desktop shell ─── */
#desktop-view { display: none; min-height: calc(100vh - 52px); padding: 24px; background: #111; }
.desktop-window {
  width: 100%; max-width: 1440px; margin: 0 auto;
  border-radius: 12px; overflow: hidden;
  border: 1px solid #2A2A2A;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  background: #fff;
}
.desktop-titlebar {
  height: 36px; background: #E8E8E8; display: flex; align-items: center; padding: 0 16px; gap: 8px;
  border-bottom: 1px solid #CCC;
}
.dot { width: 13px; height: 13px; border-radius: 50%; }
.desktop-url { flex: 1; text-align: center; font-size: 12px; color: #888; font-family: 'Space Mono', monospace; }
.desktop-frame { height: calc(100vh - 52px - 36px - 48px); display: flex; overflow: hidden; }
.admin-sidebar {
  width: 232px; background: #061430; color: #fff; display: flex; flex-direction: column;
  flex-shrink: 0; overflow-y: auto;
}
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.admin-topbar {
  padding: 18px 24px; background: #fff; border-bottom: 1px solid #E4E8F0;
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.admin-content { flex: 1; overflow-y: auto; padding: 20px 24px; background: #F4F6FA; }
.sidebar-logo {
  padding: 18px 16px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .sb-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #F59148, #E57128);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-section { font-size: 9px; font-weight: 800; letter-spacing: 1.2px; opacity: 0.45; margin: 14px 0 4px 18px; }
.sidebar-link {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; margin: 1px 8px;
  border: none; background: transparent; color: rgba(255,255,255,0.7);
  border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer;
  text-decoration: none; width: calc(100% - 16px);
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); }
.sidebar-link.active { background: #1A3160; color: #fff; font-weight: 700; }
.sidebar-badge { background: #F59148; color: #fff; font-size: 9px; font-weight: 800; padding: 2px 5px; border-radius: 4px; }
.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px; margin-top: auto;
}
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 17px; background: #F59148;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

/* ─── Form inputs ─── */
.sb-input {
  width: 100%; border: 1.5px solid #EEE5D5; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; background: #fff; color: #1A1512;
  outline: none; transition: border-color 0.2s;
}
.sb-input:focus { border-color: #F26A1F; box-shadow: 0 0 0 3px rgba(242,106,31,0.12); }
.sb-select {
  width: 100%; border: 1.5px solid #EEE5D5; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; background: #fff; color: #1A1512;
  outline: none; cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%236B5D54' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: border-color 0.2s;
}
.sb-select:focus { border-color: #F26A1F; box-shadow: 0 0 0 3px rgba(242,106,31,0.12); }
.sb-label { font-size: 12px; font-weight: 700; color: #6B5D54; letter-spacing: 0.4px; margin-bottom: 6px; display: block; }
.sb-field { margin-bottom: 14px; }
.sb-qty-row { display: flex; align-items: center; border: 1.5px solid #EEE5D5; border-radius: 12px; overflow: hidden; background: #fff; }
.sb-qty-btn { width: 48px; height: 50px; border: none; background: #F5EFE4; font-size: 22px; font-weight: 700; cursor: pointer; color: #1A1512; }
.sb-qty-btn:hover { background: #EEE5D5; }
.sb-qty-val { flex: 1; text-align: center; font-size: 22px; font-weight: 800; color: #1A1512; border: none; outline: none; background: transparent; }
.pay-tag { flex: 1; height: 44px; border: 1.5px solid #EEE5D5; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: #6B5D54; transition: all 0.15s; }
.pay-tag.sel { border-color: #F26A1F; background: #FFF0E6; color: #F26A1F; }
.mode-btn { flex: 1; height: 54px; border-radius: 12px; border: 2px solid #EEE5D5; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-size: 11px; font-weight: 700; color: #6B5D54; transition: all 0.15s; }
.mode-btn.sel { border-color: #2B79E0; background: #EEF4FF; color: #2B79E0; }

/* ─── Admin UI components ─── */
.kpi-card { background: #fff; border-radius: 10px; padding: 16px 18px; border: 1px solid #E4E8F0; }
.kpi-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.admin-card { background: #fff; border-radius: 10px; border: 1px solid #E4E8F0; overflow: hidden; }
.admin-card-header { padding: 13px 18px; border-bottom: 1px solid #E4E8F0; display: flex; align-items: center; }
.admin-card-body { padding: 18px; }
.admin-table th { font-size: 10px; font-weight: 800; color: #6B7689; letter-spacing: 0.5px; padding: 8px 12px; border-bottom: 1px solid #E4E8F0; text-align: left; white-space: nowrap; }
.admin-table td { font-size: 12px; padding: 11px 12px; border-bottom: 1px solid #E4E8F0; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #F4F6FA; cursor: pointer; }
.badge-pill { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.admin-btn { border: none; border-radius: 7px; padding: 8px 14px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: 'DM Sans', sans-serif; }
.admin-btn-primary { background: #0B1E3F; color: #fff; }
.admin-btn-secondary { background: #fff; color: #0E1828; border: 1px solid #E4E8F0; }
.admin-select { border: 1px solid #E4E8F0; border-radius: 7px; padding: 7px 12px; font-size: 12px; background: #fff; cursor: pointer; font-family: 'DM Sans', sans-serif; }

/* ─── Shared components ─── */
.top-bar {
  background: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #EEE5D5;
}
.back-btn {
  background: #F5EFE4; border: none; width: 42px; height: 42px; border-radius: 21px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
  flex-shrink: 0;
}
.top-bar-title { font-size: 18px; font-weight: 800; color: #1A1512; }
.success-screen { text-align: center; padding: 60px 24px; }
.success-circle { width: 110px; height: 110px; border-radius: 55px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.toast-flash {
  background: #0F5A3D; color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 700; margin: 16px; display: flex; align-items: center; gap: 8px;
}

/* ─── Animations ─── */
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeIn  { from{opacity:0} to{opacity:1} }
@keyframes scaleIn { from{opacity:0;transform:scale(0.85)} to{opacity:1;transform:scale(1)} }
@keyframes liveBlip { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes waveBar { from{height:6px} to{height:32px} }
@keyframes pulse1 { 0%{transform:scale(0.8);opacity:0.5} 100%{transform:scale(1.5);opacity:0} }
@keyframes pulse2 { 0%{transform:scale(0.85);opacity:0.6} 100%{transform:scale(1.35);opacity:0} }
@keyframes barGrow { from{height:0} to{height:100%} }

.slide-up { animation: slideUp 0.35s ease forwards; }
.fade-in  { animation: fadeIn 0.25s ease forwards; }
.scale-in { animation: scaleIn 0.35s ease forwards; }
