:root{
  --bg:#f3f4f6;
  --card:#ffffff;
  --border:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
  --primary:#2563eb;
  --primary2:#1d4ed8;
  --success:#16a34a;
  --danger:#dc2626;
  --shadow:0 6px 18px rgba(17,24,39,.06);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;background:var(--bg);color:var(--text)}
a{color:inherit}

.app{display:flex;height:100vh;overflow:hidden}

/* SIDEBAR */
.sidebar{
  width:240px;background:var(--card);border-right:1px solid var(--border);
  transition:width .25s ease;display:flex;flex-direction:column;flex:0 0 auto
}
.sidebar.collapsed{width:68px}
.sidebar .head{
  padding:14px 14px;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;gap:10px
}
.brand{font-weight:800;letter-spacing:.2px;white-space:nowrap}
.iconbtn{
  border:1px solid var(--border);background:#fff;border-radius:12px;
  padding:8px 10px;cursor:pointer
}
.iconbtn:active{transform:scale(.98)}

.sidebar .menu{padding:10px;display:flex;flex-direction:column;gap:8px}
.navlink{
  display:flex;align-items:center;gap:12px;
  padding:10px 12px;border-radius:14px;text-decoration:none
}
.navlink:hover{background:#f9fafb}
.navlink.active{background:rgba(37,99,235,.12);border:1px solid rgba(37,99,235,.25)}
.navtext{white-space:nowrap}

/* MAIN */
.main{
  flex:1;display:flex;flex-direction:column;min-width:0;
  padding:16px;gap:12px;overflow:hidden
}
.h1{font-size:20px;font-weight:800;margin:0}
.row{display:flex;gap:12px;min-width:0;overflow:hidden}

/* KATEGORI */
.kategori{
  display:flex;gap:10px;overflow:auto;padding-bottom:6px;
  -webkit-overflow-scrolling:touch
}
.kbtn{
  flex:0 0 auto;
  border:1px solid var(--border);background:var(--card);
  padding:10px 14px;border-radius:999px;cursor:pointer;
  font-weight:600
}
.kbtn.active{background:var(--primary);border-color:var(--primary);color:#fff}

/* PRODUK GRID */
.produk{
  flex:1;
  overflow:auto;
  min-height:0;

  display:grid;
  gap:12px;

  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:260px;

  align-content:start;
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:12px;

  display:flex;
  flex-direction:column;
  gap:10px;

  cursor:pointer;
  user-select:none;

  height:100%;

  text-align:center;
  align-items:center;
}
/* PRODUCT IMAGE */

.pimg{
  width:100%;
  height:140px;
  overflow:hidden;
  border-radius:12px;
  background:#f3f4f6;
}

.pimg img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.card:active{transform:scale(.99)}
.pname{font-weight:800}
.pmeta{font-size:12px;color:var(--muted);margin-top:-6px}
.price{font-weight:900}

.card button{
margin-top:auto;
}
/* CART */
.cart{
  width:360px;background:var(--card);border-left:1px solid var(--border);
  display:flex;flex-direction:column;flex:0 0 auto
}
.cart .wrap{padding:16px;display:flex;flex-direction:column;height:100%;gap:10px}
.cart .items{flex:1;overflow:auto;min-height:0;-webkit-overflow-scrolling:touch}
.cartitem{
  border:1px solid var(--border);border-radius:14px;padding:10px;
  display:flex;justify-content:space-between;gap:10px;margin-bottom:10px
}
.cartitem b{display:block}
.cartitem small{color:var(--muted)}
.qty{display:flex;align-items:center;gap:8px}
.qbtn{
  width:34px;height:34px;border-radius:12px;border:1px solid var(--border);
  background:#fff;cursor:pointer
}
.total{border-top:1px solid var(--border);padding-top:12px;font-size:20px;font-weight:900}
.btn{
  border:none;
  border-radius:14px;
  padding:12px 14px;
  color:#fff;
  font-weight:800;
  cursor:pointer;
  background:var(--success);

  width:100%;
}
.btn:active{transform:scale(.99)}

/* RESPONSIVE */
@media (max-width:1100px){
  .produk{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cart{width:320px}
}
@media (max-width:900px){
  .produk{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sidebar{width:200px}
}

.modal{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.4);
display:none;
align-items:center;
justify-content:center;
z-index:1000;
}

.modal-box{
background:white;
padding:20px;
border-radius:16px;
width:360px;
max-width:90%;
}

.modal-header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:10px;
}

.modal-close{
border:none;
background:#ef4444;
color:white;
width:28px;
height:28px;
border-radius:8px;
cursor:pointer;
}

.modal-actions{
display:flex;
gap:10px;
margin-top:15px;
}

.btn-cancel{
flex:1;
background:#9ca3af;
color:white;
border:none;
padding:10px;
border-radius:10px;
cursor:pointer;
}

.kitchen-container{
padding:20px;
}

.kitchen-title{
font-size:28px;
font-weight:700;
margin-bottom:20px;
}

.kitchen-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
gap:16px;
margin-top:20px;
}

.kcard{
background:white;
padding:16px;
border-radius:12px;
box-shadow:0 2px 6px rgba(0,0,0,0.1);
}

.status-pending{
border-left:6px solid orange;
}

.status-processing{
border-left:6px solid blue;
}

.status-ready{
border-left:6px solid green;
}

.khead{
display:flex;
justify-content:space-between;
margin-bottom:6px;
}

.kcustomer{
font-size:13px;
color:#777;
margin-bottom:10px;
}

.kitem{
margin-bottom:6px;
}

.ktop{
font-size:12px;
color:#999;
margin-left:10px;
}

.kactions{
margin-top:12px;
}

.orders-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
gap:20px;
}

.order-card{
background:#fff;
border-radius:14px;
padding:16px;
box-shadow:0 4px 10px rgba(0,0,0,0.1);
}

.order-card.pending{
border-left:6px solid orange;
}

.order-card.processing{
border-left:6px solid blue;
}

.order-card.ready{
border-left:6px solid green;
}

.order-head{
display:flex;
justify-content:space-between;
font-weight:700;
margin-bottom:8px;
}

.customer{
font-size:13px;
opacity:.7;
margin-bottom:10px;
}

.item{
margin-bottom:6px;
}

.top{
font-size:12px;
opacity:.8;
padding-left:10px;
}

.actions{
margin-top:10px;
display:flex;
gap:10px;
}

.actions button{
flex:1;
padding:8px;
border:none;
border-radius:8px;
background:#111;
color:white;
cursor:pointer;
}

.modal-box input,
.modal-box select{
width:100%;
padding:10px;
margin:6px 0 14px 0;
border-radius:8px;
border:1px solid #ddd;
}