/* ===============================
   CosRent Light Store UI (Full)
   =============================== */

/* ---- Theme Tokens ---- */
:root{
  --bg:#f6f8fb;
  --surface:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --primary:#ff7f50;     /* coral-ish */
  --primary-2:#ff966f;
  --accent:#2563eb;
  --border:#e5e7eb;
  --chip:#f1f5f9;
  --ok:#16a34a;
  --warn:#f59e0b;
  --danger:#ef4444;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --header-h: 64px; /* tinggi header untuk subnav sticky */
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font: 16px/1.6 system-ui, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

/* ---- Header ---- */
.topbar{background:#0f172a;color:#e5e7eb;font-size:13px}
.topbar .inner{
  max-width:1200px;margin:auto;padding:6px 20px;
  display:flex;gap:12px;align-items:center;justify-content:flex-end
}

.header{
  position:sticky; top:0; z-index:50; background:var(--surface);
  border-bottom:1px solid var(--border);
}
.header .inner{
  max-width:1200px;margin:auto;padding:14px 20px;
  display:flex;align-items:center;gap:16px;justify-content:space-between;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px}
.brand a{text-decoration:none;color:var(--text)}
.nav{display:flex;align-items:center;gap:14px}
.nav a{text-decoration:none;color:var(--text)}
.nav a:hover{color:var(--accent)}
.nav form{margin:0}

/* ---- Layout / Typography ---- */
.container{max-width:1200px;margin:auto;padding:28px 20px}
h1{font-size:28px;margin:10px 0 16px}
h2{font-size:22px;margin:8px 0 12px}
h3{font-size:18px;margin:6px 0 10px}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.muted{ color: var(--muted); font-size:14px }
.text-sm{ font-size:14px }
.text-xs{ font-size:12px }

/* ---- Buttons & Inputs ---- */
.btn{
  display:inline-block;padding:10px 14px;border-radius:10px;border:0;cursor:pointer;
  background:linear-gradient(180deg,var(--primary),var(--primary-2));
  color:#fff; font-weight:700; box-shadow:0 8px 18px rgba(255,127,80,.25);
}
.btn:hover{filter:brightness(1.05)}
.btn:focus-visible{outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px}
.btn[disabled], .btn:disabled{opacity:.6; cursor:not-allowed; box-shadow:none}
.btn-outline{background:transparent;color:var(--text);border:1px solid var(--border);box-shadow:none}
.btn-outline:hover{ background:#f8fafc }
.btn-muted{background:#f3f4f6;color:#111827}
.btn-secondary{
  background:linear-gradient(180deg,#2563eb,#1d4ed8);
  color:#fff; border:1px solid #1e40af; border-radius:10px;
  box-shadow:0 10px 24px rgba(29,78,216,.20); font-weight:700;
}
.btn-secondary:hover{ filter:brightness(1.05) }

.input, select, textarea{
  width:100%;padding:11px 12px;border-radius:10px;border:1px solid var(--border);
  background:#fff;color:var(--text);outline:none;
}
.input:focus, select:focus, textarea:focus{border-color:#cbd5e1; box-shadow:0 0 0 3px rgba(37,99,235,.12)}

/* ---- Chips / Badges ---- */
.chips{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0 18px}
.chip{
  display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;
  background:var(--chip);border:1px solid var(--border);color:#0f172a;font-size:13px;cursor:pointer
}
.chip.active{background:#fff;border-color:#cbd5e1;box-shadow:var(--shadow)}
.badge{
  display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border-radius:999px;
  background:#eef2ff;border:1px solid #e2e8f0;color:#334155;font-size:12px
}
.badge.ok{background:#ecfdf5;color:#065f46;border-color:#d1fae5}
.badge.warn{background:#fff7ed;color:#92400e;border-color:#ffedd5}
.badge.sold{background:#fee2e2;color:#7f1d1d;border-color:#fecaca}

/* ---- Cards / Grid ---- */
.grid{display:grid;gap:22px}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:1024px){ .grid-4{grid-template-columns:repeat(3,1fr)} }
@media (max-width:768px){ .grid-4{grid-template-columns:repeat(2,1fr)} }
@media (max-width:520px){ .grid-4{grid-template-columns:1fr} }

.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:14px;padding:16px;box-shadow:var(--shadow);
}

.kpi{display:flex;gap:10px;align-items:center}

/* ---- Product Card ---- */
.item-card{display:flex;flex-direction:column;gap:10px}
.item-media{
  position:relative;overflow:hidden;border-radius:12px;border:1px solid var(--border);
  aspect-ratio: 4/3;background:#f8fafc
}
.item-media img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .25s ease}
.item-media:hover img{transform:scale(1.035)}
.item-title{font-weight:800}
.item-price{font-weight:800;color:#111827}

/* ---- Hero ---- */
.hero{
  display:grid;grid-template-columns:1.2fr .8fr;gap:24px;align-items:center;margin:18px 0 28px;
}
.hero-card{
  background:linear-gradient(160deg,#fff,#fff 60%,#fef3c7 100%);
  border:1px solid var(--border);border-radius:16px;padding:24px;box-shadow:var(--shadow)
}
.hero h1{font-size:34px;margin:0 0 10px}
.hero p{color:#334155;margin:0 0 16px}
.hero .hero-cta{display:flex;gap:10px;flex-wrap:wrap}
.hero-media{border-radius:16px;border:1px solid var(--border);overflow:hidden;background:#f1f5f9;aspect-ratio: 4/3}

/* ---- Toast / Empty ---- */
.toast{background:#fff;border:1px solid #dbe2ea;border-left:4px solid var(--accent);border-radius:10px;padding:10px 12px;margin:12px 0}
.empty{text-align:center;padding:36px;border:1px dashed var(--border);border-radius:14px;background:#fff}

/* =====================================================
   ADMIN: Sub Navigation (Modern Pills)
   ===================================================== */
.admin-subnav{
  position: sticky; top: var(--header-h); z-index: 40;
  display:flex; gap:12px; overflow:auto; -webkit-overflow-scrolling:touch;
  padding:8px 2px 14px; margin:2px 0 18px;
}
.admin-subnav .pill,
.admin-subnav .pill:hover{ text-decoration:none }
.admin-subnav .pill{
  display:inline-flex; align-items:center; gap:10px; white-space:nowrap;
  padding:10px 14px; border-radius:14px;
  background:linear-gradient(180deg,#ffffff,#f9fafb);
  color:#0f172a; border:1px solid #e5e7eb;
  box-shadow:0 8px 18px rgba(2,6,23,.06);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.admin-subnav .pill:hover{
  transform: translateY(-2px);
  box-shadow:0 12px 26px rgba(2,6,23,.08);
}
.admin-subnav .pill.active{
  background:linear-gradient(180deg,#fff,#eef2ff);
  border-color:#c7d2fe;
  box-shadow:0 10px 24px rgba(37,99,235,.10);
}
.admin-subnav .pill .ic{
  display:grid; place-items:center;
  width:26px; height:26px; border-radius:9px;
  background:#eef2ff; color:#2563eb; flex:none;
  border:1px solid #e0e7ff;
}
.admin-subnav .pill.active .ic{
  background:#dbeafe; color:#1d4ed8; border-color:#bfdbfe;
}
.admin-subnav .pill .txt{font-weight:600}

/* =====================================================
   ADMIN: KPI Cards (Modern Stats)
   ===================================================== */
.stat-grid{
  display:grid; gap:16px; margin:8px 0 18px;
  grid-template-columns:repeat(6,minmax(0,1fr));
}
@media (max-width:1200px){ .stat-grid{grid-template-columns:repeat(4,1fr)} }
@media (max-width:900px){  .stat-grid{grid-template-columns:repeat(3,1fr)} }
@media (max-width:640px){  .stat-grid{grid-template-columns:repeat(2,1fr)} }

.stat{
  position:relative; background:#fff; border:1px solid var(--border);
  border-radius:14px; padding:16px 14px 14px; box-shadow:var(--shadow);
  display:flex; flex-direction:column; align-items:flex-start; min-height:92px;
}
.stat-value{font-size:26px; font-weight:800; line-height:1; margin-top:12px}
.stat-label{margin-top:6px; color:#475569; font-weight:600}

/* Icon chip (tone variants) */
.stat-icon{
  position:absolute; right:12px; top:12px; width:34px; height:34px;
  border-radius:10px; display:grid; place-items:center; border:1px solid #e5e7eb;
}
.stat-icon.primary{ color:#1d4ed8; background:#eef2ff; border-color:#c7d2fe }
.stat-icon.indigo{  color:#4338ca; background:#eef2ff; border-color:#c7d2fe }
.stat-icon.emerald{ color:#047857; background:#ecfdf5; border-color:#bbf7d0 }
.stat-icon.amber{   color:#92400e; background:#fff7ed; border-color:#fed7aa }
.stat-icon.sky{     color:#0369a1; background:#e0f2fe; border-color:#bae6fd }
.stat-icon.teal{    color:#115e59; background:#ccfbf1; border-color:#99f6e4 }
.stat-icon.rose{    color:#9f1239; background:#ffe4e6; border-color:#fecdd3 }

/* =====================================================
   ADMIN: Table (optional lists)
   ===================================================== */
.table{
  width:100%; border-collapse:separate; border-spacing:0; background:#fff;
  border:1px solid var(--border); border-radius:12px; overflow:hidden; box-shadow:var(--shadow)
}
.table th, .table td{ padding:12px 14px; text-align:left; border-bottom:1px solid var(--border) }
.table th{ background:#f8fafc; font-weight:700; color:#111827 }
.table tr:last-child td{ border-bottom:0 }
.table tbody tr:hover{ background:#f9fafb }
