/* Admin panel styles — only loaded on /admin routes */

/* === LOGIN === */

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  background: var(--bg-card);
  border: 1px solid #222;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.admin-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.accent-text {
  background: linear-gradient(135deg, #00e676, #00bcd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === ADMIN LAYOUT === */

.admin-wrap {
  min-height: 100vh;
  background: var(--bg);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1a1a1a;
}

.admin-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-section-header h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid #333;
  padding: 2px 10px;
  border-radius: 100px;
}

/* === BUTTONS (admin-scoped) === */

.btn-primary {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
  background: linear-gradient(135deg, #00e676, #00bcd4);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-full { width: 100%; justify-content: center; }

.btn-ghost {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid #2a2a2a;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--fg); border-color: #444; }

/* === TABLE === */

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid #1a1a1a;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #1a1a1a;
}

.admin-table td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #111;
  color: var(--fg);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.admin-thumb {
  width: 56px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.no-img {
  color: var(--fg-subtle);
}

.admin-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* === BADGES === */

.cat-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-elevated);
  border: 1px solid #2a2a2a;
  color: var(--fg-muted);
}

.grade-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}

.grade-badge.grade-A, .grade-badge.grade-A\\+ {
  color: #00e676;
  background: rgba(0,230,118,0.12);
}

.grade-badge.grade-B {
  color: #00bcd4;
  background: rgba(0,188,212,0.12);
}

.grade-badge.grade-C {
  color: #ffc107;
  background: rgba(255,193,7,0.12);
}

.stock-badge {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.stock-badge.in-stock { color: #00e676; background: rgba(0,230,118,0.12); }
.stock-badge.out-stock { color: var(--fg-subtle); background: #111; }

/* === ACTION BUTTONS === */

.action-cell { white-space: nowrap; }

.btn-edit, .btn-delete {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid #2a2a2a;
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  margin-right: 6px;
}

.btn-edit { color: var(--fg-muted); }
.btn-edit:hover { color: var(--fg); border-color: #444; background: #1a1a1a; }

.btn-delete { color: #ef5350; }
.btn-delete:hover { background: rgba(239,83,80,0.1); border-color: rgba(239,83,80,0.3); }

/* === MODAL === */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  z-index: 200;
  overflow-y: auto;
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  background: var(--bg-card);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  margin: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid #1a1a1a;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  font-size: 1.1rem;
  color: var(--fg-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--fg); }

/* === FORM === */

form { padding: 24px 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group.full {
  grid-column: 1 / -1;
}

.field-group label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-group input,
.field-group select,
.field-group textarea {
  background: var(--bg-elevated);
  border: 1px solid #2a2a2a;
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color 0.2s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: rgba(0,230,118,0.4);
}

.field-group input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
}

.field-group select option {
  background: var(--bg-card);
}

.field-group textarea { resize: vertical; min-height: 80px; }

.admin-thumb-preview {
  width: 80px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  display: block;
}

.keep-image-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-top: 6px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.form-error {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #ef5350;
}

.form-error.hidden { display: none; }
