/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f6fa; color: #2d3748; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
input, textarea, select, button { font-family: inherit; font-size: 1rem; }

/* ===== NAVBAR ===== */
.navbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.nav-brand { font-size: 1.1rem; font-weight: 700; color: #1a202c; display: flex; align-items: center; gap: .5rem; }
.nav-logo { height: 32px; width: 32px; object-fit: cover; border-radius: 6px; }
.nav-links { display: flex; align-items: center; gap: .75rem; }
.nav-user { font-size: .875rem; color: #718096; }

/* ===== CONTAINER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: #1a202c; }

/* ===== AUTH ===== */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-card { background: #fff; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-icon { font-size: 3rem; }
.auth-logo h1 { font-size: 1.75rem; font-weight: 800; color: #1a202c; margin-top: .25rem; }
.auth-logo p { color: #718096; font-size: .9rem; }

/* ===== ALERTS ===== */
.alert { padding: .875rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-error { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: .375rem; font-size: .9rem; color: #4a5568; }
.form-group small { color: #718096; font-size: .78rem; display: block; margin-top: .2rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: .6rem .875rem; border: 1.5px solid #e2e8f0;
  border-radius: 8px; background: #fff; transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.1); }
.form-group textarea { resize: vertical; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid #e2e8f0; margin-top: 1.5rem; }
.small-label { font-size: .8rem; color: #718096; margin-bottom: .5rem; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: .375rem; padding: .55rem 1.1rem; border-radius: 8px; font-weight: 500; font-size: .875rem; cursor: pointer; border: none; transition: all .15s; white-space: nowrap; }
.btn-primary { background: #667eea; color: #fff; }
.btn-primary:hover { background: #5a6fd6; }
.btn-secondary { background: #edf2f7; color: #4a5568; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; border: 1.5px solid #e2e8f0; color: #4a5568; }
.btn-outline:hover { background: #f7fafc; }
.btn-danger { background: #fc8181; color: #fff; }
.btn-danger:hover { background: #f56565; }
.btn-warning { background: #f6ad55; color: #fff; }
.btn-warning:hover { background: #ed8936; }
.btn-success { background: #68d391; color: #fff; }
.btn-success:hover { background: #48bb78; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; padding: .75rem; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-super { background: #e9d8fd; color: #553c9a; }
.badge-success { background: #c6f6d5; color: #276749; }
.badge-danger { background: #fed7d7; color: #c53030; }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 12px; padding: 1.25rem; border: 1px solid #e2e8f0; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.stat-num { font-size: 2rem; font-weight: 800; color: #667eea; }
.stat-label { font-size: .85rem; color: #718096; margin-top: .25rem; }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-header h2 { font-size: 1.25rem; font-weight: 700; color: #1a202c; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: .875rem 1rem; text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: #718096; background: #f7fafc; border-bottom: 1px solid #e2e8f0; }
.table td { padding: .875rem 1rem; border-bottom: 1px solid #f0f0f0; font-size: .9rem; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafafa; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
code { background: #edf2f7; padding: .15rem .4rem; border-radius: 4px; font-size: .85rem; }

/* ===== CARD ===== */
.card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #1a202c; }

/* ===== PRODUCT GRID ADMIN ===== */
.product-grid-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.product-card-admin { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: box-shadow .2s; }
.product-card-admin:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.product-img-admin { position: relative; height: 160px; background: #f7fafc; }
.product-img-admin img { width: 100%; height: 100%; object-fit: cover; }
.no-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.5rem; color: #cbd5e0; }
.img-count { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: .15rem .4rem; border-radius: 10px; }
.product-info-admin { padding: .875rem; }
.product-info-admin h3 { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.product-price-admin { color: #667eea; font-weight: 700; font-size: 1rem; }
.product-size-admin { font-size: .8rem; color: #718096; margin-top: .2rem; }
.product-actions-admin { padding: .75rem; border-top: 1px solid #f0f0f0; display: flex; gap: .5rem; }

/* ===== IMAGE PREVIEW ===== */
.img-preview-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
.img-preview-item { position: relative; }
.img-preview-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 2px solid #e2e8f0; }
.img-delete-label { display: flex; align-items: center; gap: .25rem; font-size: .75rem; color: #e53e3e; margin-top: .3rem; cursor: pointer; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 4rem 2rem; background: #fff; border-radius: 12px; border: 2px dashed #e2e8f0; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { color: #718096; margin-bottom: 1.5rem; }

/* ===== STORE LINK ===== */
.store-link { color: #667eea; font-size: .85rem; }
.store-link-box { display: flex; align-items: center; gap: 1rem; background: #f7fafc; border-radius: 8px; padding: .75rem 1rem; }
.store-link-box code { flex: 1; font-size: .85rem; word-break: break-all; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .table-wrap { font-size: .8rem; }
}
