:root {
  --bg: #0f1117; --bg2: #1a1d27; --bg3: #22263a;
  --border: #2e3250; --accent: #7c6af7; --accent2: #a78bfa;
  --accent-dim: rgba(124,106,247,0.15);
  --green: #22c55e; --red: #ef4444; --yellow: #f59e0b;
  --text: #e2e8f0; --text2: #94a3b8; --text3: #64748b;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Inter','Segoe UI',sans-serif; font-size: 15px; min-height: 100vh; }

/* NAV */
.navbar { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; align-items: center; gap: 6px; height: 56px; position: sticky; top: 0; z-index: 100; }
.navbar .logo { font-weight: 700; font-size: 17px; color: var(--accent2); text-decoration: none; margin-right: 12px; }
.navbar a { color: var(--text2); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 13px; transition: all .15s; }
.navbar a:hover, .navbar a.active { background: var(--accent-dim); color: var(--accent2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.cart-badge { position: relative; }
.cart-count { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.btn-logout { background: none; border: 1px solid var(--border); color: var(--text2); padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* LAYOUT */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text2); font-size: 14px; margin-bottom: 28px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: var(--green); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input.error, select.error { border-color: var(--red); }
.err { color: var(--red); font-size: 12px; margin-top: 4px; display: none; }
.err.show { display: block; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* CARDS */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--accent2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* PRODUCT GRID */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }
.product-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .2s; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,106,247,.15); }
.product-img { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 56px; background: var(--bg3); }
.product-info { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.product-category { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.product-price { font-size: 18px; font-weight: 700; color: var(--accent2); margin-bottom: 12px; }
.product-old-price { font-size: 12px; color: var(--text3); text-decoration: line-through; margin-left: 6px; }
.product-rating { font-size: 12px; color: var(--yellow); margin-bottom: 12px; }
.product-stock { font-size: 12px; margin-bottom: 10px; }
.in-stock { color: var(--green); }
.out-stock { color: var(--red); }
.mt-auto { margin-top: auto; }

/* BADGE */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: rgba(34,197,94,.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,.15); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-blue { background: var(--accent-dim); color: var(--accent2); }
.badge-gray { background: rgba(100,116,139,.15); color: var(--text3); }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: var(--bg3); color: var(--text2); font-weight: 600; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* CART */
.cart-item { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 60px; height: 60px; background: var(--bg3); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cart-item-price { color: var(--accent2); font-weight: 600; }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { border-color: var(--accent); color: var(--accent2); }
.qty-val { min-width: 24px; text-align: center; font-weight: 600; font-size: 14px; }

/* ORDER STEPS */
.steps { display: flex; align-items: center; margin-bottom: 32px; }
.step { display: flex; align-items: center; gap: 8px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step.done .step-num { background: var(--green); color: #fff; }
.step.active .step-num { background: var(--accent); color: #fff; }
.step.pending .step-num { background: var(--bg3); color: var(--text3); border: 1px solid var(--border); }
.step-label { font-size: 13px; }
.step.done .step-label { color: var(--green); }
.step.active .step-label { color: var(--accent2); font-weight: 600; }
.step.pending .step-label { color: var(--text3); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 10px; }

/* SUMMARY BOX */
.summary-box { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: sticky; top: 72px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; color: var(--text2); }
.summary-row.total { font-size: 16px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.summary-row.total span:last-child { color: var(--accent2); }

/* GRID 2 COL */
.grid-2 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media(max-width:768px) { .grid-2 { grid-template-columns: 1fr; } }

/* MISC */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 200px; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.alert-info { background: var(--accent-dim); border: 1px solid rgba(124,106,247,.3); color: var(--accent2); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 40px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: var(--accent2); }
.login-logo p { font-size: 13px; color: var(--text2); margin-top: 4px; }
.login-hint { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text3); }
