/* === ODEREASE DESIGN SYSTEM === */
/* Inspired by E.LAND Brand Identity - Red #E30019 + Black + White */

:root {
  --red: #E30019;
  --red-hover: #c90016;
  --red-light: #fff0f2;
  --black: #1D1E1E;
  --black2: #2a2b2b;
  --white: #FFFFFF;
  --gray50: #fafafa;
  --gray100: #f5f5f5;
  --gray200: #eeeeee;
  --gray300: #e0e0e0;
  --gray400: #bdbdbd;
  --gray500: #9e9e9e;
  --gray600: #757575;
  --gray700: #616161;
  --gray800: #424242;
  --success: #2e7d32;
  --warning: #f57f17;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--gray50); color: var(--black); line-height: 1.6; min-height: 100vh; padding-bottom: 72px; }
a { color: var(--red); text-decoration: none; }

/* ===== TOAST ===== */
#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; padding: 12px 28px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: #fff; display: none;
  box-shadow: var(--shadow-lg); animation: toastIn .3s ease;
}
#toast.success { background: var(--success); }
#toast.error { background: var(--red); }
#toast.info { background: #1565c0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--black); padding: 20px;
}
.login-box {
  background: #fff; border-radius: var(--radius-lg);
  padding: 48px 36px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}
.login-brand {
  font-size: 32px; font-weight: 800; letter-spacing: 4px;
  color: var(--red); margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--gray500); margin-bottom: 32px; letter-spacing: 1px; }
.login-error { display: none; background: var(--red-light); color: var(--red); padding: 10px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.login-hint { margin-top: 20px; font-size: 11px; color: var(--gray400); }

/* ===== HEADER ===== */
header {
  background: var(--black); color: #fff;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 32px; height: 32px; background: var(--red); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: 2px; }
.badge {
  font-size: 10px; background: rgba(255,255,255,0.1);
  padding: 2px 8px; border-radius: 10px; color: var(--gray400);
}
.nav-item {
  padding: 4px 14px; border-radius: 6px; font-size: 13px;
  cursor: pointer; transition: all .2s; color: var(--gray400);
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active { color: #fff; background: var(--red); }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 12px; color: var(--gray400); }
.logout-btn { font-size: 12px; color: var(--gray500); cursor: pointer; transition: color .2s; }
.logout-btn:hover { color: var(--red); }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--gray200);
  z-index: 100; padding: 4px 0; justify-content: space-around;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.mnav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 12px; font-size: 10px; color: var(--gray500);
  cursor: pointer; transition: color .2s;
}
.mnav-item.active { color: var(--red); }
.mnav-item svg { margin-bottom: 0; }

/* ===== MAIN ===== */
main { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ===== PAGE ===== */
.page { display: none; }
.page.active { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); }}

/* ===== SECTION TITLE ===== */
.section-title { font-size: 18px; font-weight: 700; margin: 20px 0 16px; }
.section-title:first-child { margin-top: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 24px; border-radius: var(--radius);
  border: none; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s; font-family: var(--font);
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray300); color: var(--gray700); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ===== FORM ===== */
.fg { margin-bottom: 14px; }
.fi {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray300);
  border-radius: var(--radius); font-size: 14px; font-family: var(--font);
  background: #fff; transition: border-color .2s;
}
.fi:focus { outline: none; border-color: var(--red); }
select.fi { appearance: auto; cursor: pointer; }
textarea.fi { resize: vertical; min-height: 80px; }

/* ===== CARD ===== */
.card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
  margin-bottom: 16px; border: 1px solid var(--gray200);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar .fi { width: auto; min-width: 120px; padding: 8px 12px; }
.search-box { flex: 1; min-width: 160px; }
.search-box .fi { width: 100%; }
.cart-badge {
  position: relative; cursor: pointer; padding: 8px;
  color: var(--gray600); transition: color .2s;
}
.cart-badge:hover { color: var(--red); }
.cart-count {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff; border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: all .2s;
  border: 1px solid var(--gray200); box-shadow: var(--shadow);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-img {
  width: 100%; height: 220px; object-fit: cover;
  background: var(--gray200);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray400); font-size: 40px; font-weight: 300;
}
.product-body { padding: 14px 16px 16px; }
.product-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.product-meta { font-size: 12px; color: var(--gray500); margin-bottom: 4px; }
.product-price { font-size: 20px; font-weight: 700; color: var(--red); }
.product-price .unit { font-size: 13px; font-weight: 400; }
.product-tags { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; text-transform: uppercase;
}
.tag-new { background: #e3f2fd; color: #1565c0; }
.tag-hot { background: #fff3e0; color: #e65100; }
.tag-main { background: var(--red-light); color: var(--red); }
.tag-classic { background: var(--gray100); color: var(--gray700); }

/* ===== ORDER CARD ===== */
.order-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 12px;
  border: 1px solid var(--gray200); cursor: pointer; transition: all .2s;
}
.order-card:hover { border-color: var(--gray300); }
.order-head { display: flex; justify-content: space-between; align-items: center; }
.order-id { font-weight: 600; font-size: 13px; color: var(--gray600); }
.order-status {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
}
.order-status-pending { background: #fff8e1; color: #f57f17; }
.order-status-confirmed { background: #e3f2fd; color: #1565c0; }
.order-status-shipped { background: #f3e5f5; color: #7b1fa2; }
.order-status-completed { background: #e8f5e9; color: #2e7d32; }
.order-body { margin-top: 8px; }
.order-items { font-size: 13px; color: var(--gray600); line-height: 1.8; }
.order-total { font-weight: 700; margin-top: 8px; font-size: 16px; }
.order-date { font-size: 12px; color: var(--gray400); margin-top: 4px; }
.order-deposit { font-size: 12px; color: var(--red); font-weight: 600; }
.order-pay-btn { margin-top: 10px; }

/* ===== DASHBOARD HERO ===== */
.db-hero {
  background: linear-gradient(135deg, var(--black) 0%, var(--black2) 100%);
  color: #fff; padding: 32px; border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.db-hero h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.db-hero p { font-size: 14px; color: var(--gray400); margin-bottom: 20px; }
.db-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.db-stat {
  background: rgba(255,255,255,0.06); padding: 16px; border-radius: var(--radius);
  text-align: center;
}
.db-stat-num { font-size: 28px; font-weight: 700; }
.db-stat-label { font-size: 12px; color: var(--gray400); margin-top: 2px; }

/* ===== ADMIN ===== */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.admin-stat-card {
  background: #fff; border: 1px solid var(--gray200);
  padding: 20px; border-radius: var(--radius-lg); text-align: center;
  box-shadow: var(--shadow);
}
.admin-stat-num { font-size: 30px; font-weight: 700; color: var(--black); }
.admin-stat-label { font-size: 13px; color: var(--gray500); margin-top: 4px; }
.admin-stat-sub { font-size: 11px; color: var(--gray400); margin-top: 2px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--gray200); font-weight: 600; color: var(--gray600); font-size: 12px; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray100); }

.admin-products-toolbar { margin-bottom: 12px; }

/* ===== PRODUCT ADMIN CARD ===== */
.prod-admin-card {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; background: #fff;
  border: 1px solid var(--gray200); border-radius: var(--radius);
  margin-bottom: 8px; transition: all .2s;
}
.prod-admin-card:hover { border-color: var(--gray300); }
.prod-admin-img {
  width: 60px; height: 60px; border-radius: var(--radius);
  background: var(--gray200); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--gray400);
  overflow: hidden;
}
.prod-admin-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-admin-info { flex: 1; min-width: 0; }
.prod-admin-name { font-weight: 600; font-size: 14px; }
.prod-admin-meta { font-size: 12px; color: var(--gray500); }
.prod-admin-actions { display: flex; gap: 6px; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg);
  max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  padding: 20px 24px 0; font-size: 18px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close { font-size: 24px; color: var(--gray400); cursor: pointer; transition: color .2s; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--gray200);
  display: flex; justify-content: space-between; align-items: center;
}

/* ===== CART ITEMS ===== */
.cart-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--gray100);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 14px; }
.cart-item-sku { font-size: 12px; color: var(--gray500); }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--gray300); background: #fff;
  cursor: pointer; font-size: 16px; display: flex;
  align-items: center; justify-content: center;
}
.cart-item-qty button:hover { border-color: var(--red); color: var(--red); }
.cart-item-price { font-weight: 700; color: var(--red); min-width: 80px; text-align: right; }
.cart-item-remove { color: var(--gray400); cursor: pointer; padding: 4px; }
.cart-item-remove:hover { color: var(--red); }

/* ===== FLEX ===== */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.text-center { text-align: center; }
.text-muted { color: var(--gray500); font-size: 13px; }
.loading { text-align: center; padding: 60px 20px; color: var(--gray500); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray500); }
.deposit-hint { font-size: 12px; color: var(--gray500); }

/* ===== DETAIL MODAL ===== */
.detail-img {
  width: 100%; height: 250px; background: var(--gray200);
  border-radius: var(--radius); margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--gray400); overflow: hidden;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-desc { font-size: 14px; color: var(--gray600); margin-bottom: 12px; line-height: 1.7; }
.detail-select { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* ===== RESPONSIVE ===== */
@media(max-width: 768px) {
  .header-center { display: none; }
  .mobile-nav { display: flex; }
  body { padding-bottom: 64px; }
  .header-inner { padding: 0 14px; }
  main { padding: 14px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .product-img { height: 160px; }
  .db-hero { padding: 20px; }
  .db-hero h2 { font-size: 20px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .fi { min-width: auto; }
  .search-box { min-width: auto; }
  .filter-group { flex-wrap: nowrap; }
  .filter-group .fi { flex: 1; }
  .prod-admin-card { flex-wrap: wrap; }
  .prod-admin-actions { width: 100%; justify-content: flex-end; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 6px 8px; }
}

@media(max-width: 400px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-img { height: 130px; }
  .product-body { padding: 10px 12px; }
  .product-name { font-size: 13px; }
  .product-price { font-size: 16px; }
}
