:root{
  --maroon:#7a1a1a;
  --maroon2:#9b1c1c;
  --accent:#ff4d6d;
  --bg1:#fff1f5;
  --bg2:#f2f7ff;
  --glass: rgba(255,255,255,.55);
  --glass2: rgba(255,255,255,.3);
  --border: rgba(122,26,26,.2);
  --text:#1b1c20;
  --muted:#5e6068;
  --shadow: 0 20px 60px rgba(20,20,30,.15);
  --r12: 12px;
  --r16: 16px;
  --r22: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", "Noto Sans", sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 10% 10%, rgba(255,77,109,.25), transparent 60%),
    radial-gradient(900px 500px at 90% 20%, rgba(122,26,26,.18), transparent 55%),
    radial-gradient(900px 500px at 40% 90%, rgba(32,110,255,.18), transparent 55%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

a{color:inherit}
.muted{color:var(--muted)}

/* Topbar */
.topbar{
  position: sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,.35);
  border-bottom: 1px solid rgba(255,255,255,.6);
}
.topbar__inner{
  max-width: 1180px;
  margin:0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}
.brand{display:flex; align-items:center; gap:10px; text-decoration:none}
.brand__logo{width:36px; height:36px; object-fit:contain; border-radius:12px}
.brand__name{font-weight:900; letter-spacing:.2px}

.nav{display:flex; gap:8px; flex:1; flex-wrap:wrap}
.nav__link{
  text-decoration:none;
  padding:8px 10px;
  border-radius:999px;
  font-weight:700;
  color: rgba(27,28,32,.86);
  transition: background .15s ease, transform .15s ease;
}
.nav__link:hover{background: rgba(255,255,255,.55)}
.nav__link:active{background: rgba(122,26,26,.12); transform: translateY(0)}

.topbar__right{display:flex; align-items:center; gap:10px; margin-left:auto}
.userchip{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.5);
  border:1px solid rgba(122,26,26,.18);
}
.userchip__dot{width:10px; height:10px; border-radius:999px; background: var(--accent); box-shadow:0 0 0 4px rgba(255,77,109,.2)}
.userchip__name{font-weight:800; font-size:12px; line-height:1.1}
.userchip__role{font-size:11px; color:var(--muted)}

/* Layout */
.page{max-width:1180px; margin:0 auto; padding:18px 16px 64px}
.hero{display:flex; justify-content:space-between; align-items:flex-end; gap:14px; margin: 6px 0 16px}
.hero__title{font-size:28px; margin:0}
.hero__sub{margin:8px 0 0 0}

/* Glass card */
.card{
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
  border-radius: var(--r22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card--padded{padding:16px}

.toolbar{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(122,26,26,.22);
  background: rgba(255,255,255,.55);
  outline:none;
}
.input:focus{border-color: rgba(122,26,26,.5); box-shadow:0 0 0 4px rgba(122,26,26,.15)}

.btn{
  appearance:none;
  border: 1px solid rgba(122,26,26,.25);
  background: rgba(255,255,255,.55);
  color: var(--text);
  padding: 9px 14px;
  min-height: 40px;
  font-size: 13px;
  line-height: 1;
  border-radius: 12px;
  font-weight: 800;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space: nowrap;
  user-select:none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:focus-visible{outline: 3px solid rgba(122,26,26,.28); outline-offset: 2px}

@media (hover: hover){
  .btn:hover{transform: translateY(-1px); filter: brightness(1.02)}
}
.btn:active{
  transform: translateY(1px) scale(.99);
  background: rgba(122,26,26,.12);
  border-color: rgba(122,26,26,.35);
  filter: brightness(.98);
}
.btn--primary{background: linear-gradient(135deg, var(--maroon2), var(--maroon)); color:white; border-color: rgba(122,26,26,.3)}
.btn--primary:active{background: linear-gradient(135deg, #6b1515, #861a1a)}
.btn--danger{background: linear-gradient(135deg, #ff3b6e, #b4122a); color:white; border-color: rgba(255,59,110,.25)}
.btn--danger:active{background: linear-gradient(135deg, #e53262, #a10e24)}
.btn--ghost{background: rgba(255,255,255,.25)}
.btn--ghost:active{background: rgba(255,255,255,.45)}

/* Make action buttons inside tables more compact on desktop */
@media (min-width: 900px){
  .table .btn{min-height: 34px; padding: 7px 10px; font-size: 12px; border-radius: 10px}
}

/* Icon button (hamburger / close) */
.iconbtn{
  appearance:none;
  width: 40px;
  height: 40px;
  padding: 0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  border: 1px solid rgba(122,26,26,.22);
  background: rgba(255,255,255,.55);
  color: rgba(122,26,26,.95);
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, filter .15s ease;
}
.iconbtn:focus-visible{outline: 3px solid rgba(122,26,26,.28); outline-offset: 2px}
@media (hover: hover){
  .iconbtn:hover{transform: translateY(-1px); filter: brightness(1.02)}
}
.iconbtn:active{transform: translateY(1px) scale(.99); background: rgba(122,26,26,.12); border-color: rgba(122,26,26,.35); filter: brightness(.98)}

.burger{display:inline-flex; align-items:center; justify-content:center; width:18px; height:12px; position:relative}
.burger::before,.burger::after,.burger span{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:2px;
  border-radius:999px;
  background: rgba(122,26,26,.9);
}
.burger::before{top:0}
.burger span{top:5px}
.burger::after{bottom:0}

.grid{display:grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap:12px}

.product{overflow:hidden; display:flex; flex-direction:column; min-height: 250px; text-decoration:none}
.product__img{width:100%; height:120px; object-fit:cover; background: linear-gradient(135deg, rgba(255,77,109,.25), rgba(122,26,26,.15))}
.product__body{padding:12px; display:flex; flex-direction:column; gap:8px; flex:1}
.product__title{margin:0; font-weight:900; font-size:14px}
.product__meta{display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px}
.product__desc{color:rgba(27,28,32,.82); font-size:12px; line-height:1.45; margin:0; flex:1}
.product__footer{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:8px}
.badge{font-size:11px; padding:6px 8px; border-radius:999px; background: rgba(255,255,255,.55); border:1px solid rgba(122,26,26,.18)}

.section{margin-top:16px}
.section__title{margin:0 0 10px 0; font-size:16px}

.table{width:100%; border-collapse:collapse; overflow:hidden; border-radius:16px}
.table th,.table td{padding:10px 10px; text-align:left; border-bottom:1px solid rgba(122,26,26,.12); font-size:13px}
.table th{font-size:12px; text-transform:uppercase; letter-spacing:.06em; color: rgba(27,28,32,.7)}
.table tr:hover td{background: rgba(255,255,255,.45)}

.footer{
  margin-top:22px;
  padding:16px;
  background: rgba(255,255,255,.25);
  border-top:1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.footer__inner{max-width:1180px; margin:0 auto; display:flex; gap:16px; align-items:flex-start; justify-content:space-between; flex-wrap:wrap}
.footer__brand{font-weight:950}
.footer__contact a{color: var(--maroon2)}
.footer__bottom{max-width:1180px; margin:10px auto 0; text-align:center}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background: rgba(10,10,20,.35);
  z-index:50;
}
.modal.is-open{display:flex}
.modal__panel{
  width: min(920px, 100%);
  max-height: min(86vh, 800px);
  overflow:auto;
  padding:14px;
}
.modal__header{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.modal__title{font-weight:950}

.form{display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px}
.field{display:flex; flex-direction:column}
.form__row{grid-column: span 2}
.label{font-size:12px; font-weight:900; margin:0 0 6px 2px}
.textarea{min-height:110px; resize:vertical}

.kpi{display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:12px}
.kpi__item{padding:14px}
.kpi__title{font-size:12px; color:var(--muted); margin:0}
.kpi__value{font-size:20px; font-weight:950; margin:6px 0 0 0}

.split{display:grid; grid-template-columns: 1.2fr .8fr; gap:12px; align-items:start}

.chartbox{position:relative;height:260px;width:100%}
.chartbox canvas{width:100% !important;height:100% !important}

.stack{display:flex;flex-direction:column;gap:10px}
.nowrap{white-space:nowrap}
.pillbox{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.pill{padding:8px 10px;border-radius:999px;background: rgba(255,255,255,.55);border:1px solid rgba(122,26,26,.18);font-size:12px}
.pre{white-space:pre-line;line-height:1.55;font-size:13px;color: rgba(27,28,32,.88)}
.skeleton{color:var(--muted)}
.thumb{width:70px;height:44px;border-radius:12px;object-fit:cover;border:1px solid rgba(122,26,26,.18)}
.price-row{display:grid;grid-template-columns:minmax(90px, 140px) minmax(140px, 1fr) minmax(120px, 180px) 44px;gap:8px;align-items:center}
.list-row{display:grid;grid-template-columns:1fr 44px;gap:8px;align-items:center}

.toast{
  position: fixed;
  bottom:16px;
  left:50%;
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.7);
  background: rgba(255,255,255,.8);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events:none;
  transition: .25s ease;
}
.toast.is-show{opacity:1; transform: translateX(-50%) translateY(-4px)}
.toast--danger{border-color: rgba(255,59,110,.35)}
.toast--success{border-color: rgba(40,180,120,.35)}

/* Floating WhatsApp button */
.wa-float{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: #25D366;
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: var(--shadow);
  text-decoration:none;
  z-index: 20;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, filter .15s ease;
}
.wa-float svg{width: 26px; height: 26px; fill: currentColor}
@media (hover: hover){
  .wa-float:hover{transform: translateY(-1px); filter: brightness(1.03)}
}
.wa-float:active{transform: translateY(1px) scale(.99); filter: brightness(.98)}
@media print{.wa-float{display:none}}

/* Drawer (Hamburger) */
.navtoggle{display:none}

.drawer{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 45;
}
.drawer.is-open{display:block}

.drawer__overlay{
  position: absolute;
  inset: 0;
  background: rgba(10,10,20,.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.drawer__panel{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 88vw);
  padding: 14px;
  overflow: auto;

  background: rgba(255,255,255,.72);
  border-left: 1px solid rgba(122,26,26,.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  transform: translateX(100%);
  transition: transform .22s ease;

  display:flex;
  flex-direction:column;
  gap: 12px;
}
.drawer.is-open .drawer__panel{transform: translateX(0)}

.drawer__head{display:flex; align-items:center; justify-content:space-between; gap:10px}
.drawer__nav{display:flex; flex-direction:column; gap:10px}
.drawer__nav .nav__link{
  display:block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(122,26,26,.14);
}
@media (hover: hover){
  .drawer__nav .nav__link:hover{background: rgba(255,255,255,.78)}
}
.drawer__nav .nav__link:active{background: rgba(122,26,26,.12); border-color: rgba(122,26,26,.25); transform:none}

.drawer__user{padding: 2px 0}
.userchip--drawer{border-radius: 16px; width: 100%; justify-content:flex-start}

@media (prefers-reduced-motion: reduce){
  .drawer__panel{transition:none}
}

/* Mobile & Tablet UX (Hamburger drawer) */
@media (max-width: 1024px), (pointer: coarse){
  body{background-attachment: scroll}
  .topbar__inner{padding: 12px 14px; flex-wrap:nowrap}
  .brand__logo{width:34px; height:34px}
  .brand__name{font-size:15px}
  .userchip{padding:6px 8px}

  .nav--desktop{display:none}
  .navtoggle{display:inline-flex}

  /* Keep header clean on smaller screens (menu + auth moved to drawer) */
  .topbar__right .userchip,
  .topbar__right .btn{display:none}
}

@media (max-width: 480px){
  .brand__name{display:none}
  .userchip__role{display:none}
}

/* Touch devices: avoid hover "jump" */
@media (hover: none){
  .btn:hover{transform:none}
  .nav__link:hover{background: rgba(255,255,255,.35)}
}


/* Responsive */
@media (max-width: 1100px){
  .grid{grid-template-columns: repeat(3, minmax(0, 1fr))}
  .kpi{grid-template-columns:repeat(2, minmax(0, 1fr))}
  .split{grid-template-columns: 1fr}
}
@media (max-width: 640px){
  .chartbox{height:220px}
  .price-row{grid-template-columns: 1fr}

  .grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .hero{flex-direction:column; align-items:flex-start}
  .form{grid-template-columns: 1fr}
  .form__row{grid-column: span 1}
}
