/* ============================================================
   admin.css — Abia Solo Business
   Admin Panel Styles
   ============================================================ */

:root {
  --black:      #0a0a0a;
  --charcoal:   #1a1a1a;
  --charcoal2:  #222222;
  --gold:       #c9a84c;
  --gold-light: #e8c96b;
  --offwhite:   #f5f0e8;
  --white:      #ffffff;
  --grey:       #888888;
  --grey-light: #cccccc;
  --danger:     #e74c3c;
  --success:    #2ecc71;
  --warning:    #f39c12;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body:    'Montserrat', sans-serif;
  --transition: all 0.25s ease;
  --radius: 4px;
  --radius-lg: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--black);
  color: var(--offwhite);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-heading); }

/* ── LOGIN OVERLAY ─────────────────────────────────────────── */
#login-overlay {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--charcoal);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
}
.login-logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--offwhite);
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}
.login-logo i { color: var(--gold); font-size: 1rem; }
.login-slogan {
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.login-box h2 {
  font-size: 1.4rem;
  color: var(--offwhite);
  margin-bottom: 1.5rem;
}
.login-box h2 span { color: var(--gold); }
.login-field {
  position: relative;
  margin-bottom: 1rem;
}
.login-field i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey);
}
.login-field input {
  width: 100%;
  background: var(--black);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  color: var(--offwhite);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s;
}
.login-field input:focus { border-color: var(--gold); }
.login-btn {
  width: 100%;
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.9rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  transition: var(--transition);
}
.login-btn:hover { background: var(--gold-light); }
.login-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  min-height: 1.2rem;
}
.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-8px); }
  40%, 80%  { transform: translateX(8px); }
}

/* ── LAYOUT ────────────────────────────────────────────────── */
#admin-app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--charcoal);
  border-right: 1px solid rgba(201,168,76,0.15);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: -var(--sidebar-w);
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--offwhite);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sidebar-logo i { color: var(--gold); }
.sidebar-subtitle {
  font-size: 0.65rem;
  color: var(--grey);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--grey);
  padding: 0.5rem 1.25rem;
  margin-top: 0.5rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--grey-light);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.sidebar-link i { width: 18px; text-align: center; }
.sidebar-link:hover { color: var(--offwhite); background: rgba(255,255,255,0.04); }
.sidebar-link.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(201,168,76,0.06);
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.2s;
}
.sidebar-user-avatar:hover { opacity: 0.8; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--offwhite); }
.sidebar-user-role { font-size: 0.7rem; color: var(--grey); }

/* ── MAIN ──────────────────────────────────────────────────── */
#admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--charcoal);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--offwhite);
}
.topbar-title span { color: var(--gold); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-lang-toggle {
  display: flex;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  overflow: hidden;
}
.topbar-lang-btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--grey);
  transition: var(--transition);
}
.topbar-lang-btn.active { background: var(--gold); color: var(--black); }

.topbar-logout {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--grey);
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: var(--transition);
}
.topbar-logout:hover { color: var(--danger); border-color: var(--danger); }
.topbar-menu-btn {
  display: none;
  color: var(--offwhite);
  font-size: 1.1rem;
}

/* ── CONTENT AREA ──────────────────────────────────────────── */
.admin-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── PANELS ────────────────────────────────────────────────── */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ── SECTION HEADER ────────────────────────────────────────── */
.panel-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}
.panel-header h2 {
  font-size: 1.8rem;
  color: var(--offwhite);
  margin-bottom: 0.25rem;
}
.panel-header h2 span { color: var(--gold); }
.panel-header p { color: var(--grey); font-size: 0.85rem; }

/* ── STAT CARDS ────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--charcoal);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: rgba(201,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}
.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}
.stat-label { font-size: 0.75rem; color: var(--grey); margin-top: 0.2rem; }

/* ── CATEGORY BREAKDOWN ────────────────────────────────────── */
.cat-breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.cat-stat {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.cat-stat-icon { font-size: 1.5rem; color: var(--gold); margin-bottom: 0.5rem; }
.cat-stat-count { font-family: var(--font-heading); font-size: 1.8rem; color: var(--offwhite); }
.cat-stat-name { font-size: 0.75rem; color: var(--grey); }

/* ── FORM ──────────────────────────────────────────────────── */
.admin-form {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-row.single { grid-template-columns: 1fr; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--grey);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--black);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  color: var(--offwhite);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.25s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--gold); }
.form-field textarea { resize: vertical; min-height: 90px; }
.form-field select option { background: var(--charcoal); }

/* Checkboxes */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--grey-light);
  cursor: pointer;
  user-select: none;
}
.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.size-check {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--grey-light);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.size-check:hover { border-color: var(--gold); }
.size-check input { width: 14px; height: 14px; accent-color: var(--gold); }

/* Image upload */
.img-upload-area {
  border: 2px dashed rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s;
  background: var(--black);
  position: relative;
}
.img-upload-area:hover { border-color: var(--gold); }
.img-upload-area i { font-size: 2rem; color: rgba(201,168,76,0.5); margin-bottom: 0.75rem; display: block; }
.img-upload-area p { font-size: 0.82rem; color: var(--grey); }
.img-upload-area input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.img-preview {
  margin-top: 0.75rem;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: var(--radius);
  display: none;
}
.img-url-input {
  margin-top: 0.75rem;
}

/* Form buttons */
.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-submit {
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-submit:hover { background: var(--gold-light); }
.btn-cancel {
  color: var(--grey);
  font-size: 0.82rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-cancel:hover { border-color: var(--grey); color: var(--offwhite); }

/* ── TABLE ─────────────────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.table-search {
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 0.55rem 0.9rem;
  color: var(--offwhite);
  font-size: 0.82rem;
  outline: none;
  min-width: 220px;
  transition: border-color 0.25s;
}
.table-search:focus { border-color: var(--gold); }
.table-count { font-size: 0.78rem; color: var(--grey); margin-left: auto; }

.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th {
  background: var(--charcoal2);
  color: var(--grey);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  color: var(--offwhite);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.table-thumb {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.table-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  width: 44px; height: 44px;
  background: var(--charcoal2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 1.1rem;
}

.badge-stock-in  { color: var(--success); font-size: 0.72rem; font-weight: 700; }
.badge-stock-out { color: var(--danger);  font-size: 0.72rem; font-weight: 700; }
.badge-yes { color: var(--gold);  font-size: 0.72rem; }
.badge-no  { color: var(--grey);  font-size: 0.72rem; }

.table-actions { display: flex; gap: 0.4rem; }
.btn-edit, .btn-delete {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: var(--transition);
}
.btn-edit { border: 1px solid rgba(201,168,76,0.3); color: var(--gold); }
.btn-edit:hover { background: var(--gold); color: var(--black); }
.btn-delete { border: 1px solid rgba(231,76,60,0.3); color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: #fff; }

/* ── ORDERS ────────────────────────────────────────────────── */
.orders-note {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--grey-light);
  margin-bottom: 2rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.orders-note i { color: var(--gold); margin-top: 0.1rem; flex-shrink: 0; }

.status-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.status-pending   { background: rgba(243,156,18,0.15); color: var(--warning); }
.status-confirmed { background: rgba(201,168,76,0.15); color: var(--gold); }
.status-delivered { background: rgba(46,204,113,0.12); color: var(--success); }

/* ── MODAL ─────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
#modal-overlay.open { display: flex; }
.modal-box {
  background: var(--charcoal);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  background: var(--charcoal);
  z-index: 1;
}
.modal-header h3 {
  font-size: 1.3rem;
  color: var(--offwhite);
}
.modal-header h3 span { color: var(--gold); }
.modal-close {
  color: var(--grey);
  font-size: 1rem;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.5rem; }

/* ── TOAST ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--charcoal2);
  border-left: 3px solid var(--gold);
  color: var(--offwhite);
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 300px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--gold); }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .cat-breakdown { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }
  #sidebar.open { transform: translateX(0); }
  #admin-main { margin-left: 0; }
  .topbar-menu-btn { display: block; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 1.25rem 1rem; }
}
