/* ============================
   ADMIN PANEL STYLES
   ============================ */

:root {
  --brown:     #3D1F0D;
  --teal:      #1B4A47;
  --teal-light:#2A6B66;
  --red:       #8B1A1A;
  --red-light: #A52020;
  --gold:      #C9A84C;
  --gold-light:#E2C26A;
  --cream:     #F5F0E8;
  --white:     #FFFFFF;
  --dark:      #0D0D0D;
  --dark2:     #141414;
  --dark3:     #1A1A1A;
  --dark4:     #222222;
  --gray:      #888888;
  --gray-light:#CCCCCC;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', sans-serif;
  --radius:    12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-body); background: var(--dark); color: var(--cream); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); outline: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 3px; }

/* ========== LOGIN ========== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(27,74,71,0.2) 0%, var(--dark) 70%);
  padding: 2rem;
}
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-logo {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--dark);
  margin: 0 auto 1.5rem;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 0.25rem;
}
.login-card > p { color: var(--gray); font-size: 0.85rem; margin-bottom: 2rem; }
.form-error { color: #ff6b6b; font-size: 0.85rem; margin-top: 0.75rem; }

/* ========== LAYOUT ========== */
.admin-dashboard {
  display: flex;
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ========== SIDEBAR ========== */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--dark2);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 1.5rem;
}
.sidebar-logo .logo-af {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--dark);
}
.sidebar-logo span:last-child {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--gray);
  font-size: 0.875rem;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--cream); }
.nav-item.active { background: rgba(201,168,76,0.12); color: var(--gold); }
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-external { margin-top: 1rem; }
.sidebar-logout {
  background: transparent;
  color: var(--gray);
  font-size: 0.8rem;
  padding: 0.6rem;
  border-radius: 8px;
  text-align: left;
  margin-top: 1rem;
  transition: color 0.2s;
}
.sidebar-logout:hover { color: var(--red-light); }

/* ========== MAIN ========== */
.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-panel h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--cream);
  margin-bottom: 2rem;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.panel-header h1 { margin-bottom: 0; }

/* ========== STATS DASHBOARD ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s;
}
.stat-card:hover { border-color: rgba(201,168,76,0.3); transform: translateY(-3px); }
.stat-icon { font-size: 2rem; }
.stat-card h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
}
.stat-card p { color: var(--gray); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.recent-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 1.2rem;
}

/* ========== FORMS ========== */
.item-form {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}
.item-form h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--cream);
  font-size: 0.9rem;
  transition: border-color 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}
.form-group select option { background: var(--dark3); }
.form-group textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; }
.form-check input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; }
.form-check label { font-size: 0.9rem; color: var(--gray-light); cursor: pointer; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
.file-upload-area {
  position: relative;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.3s;
  cursor: pointer;
}
.file-upload-area:hover { border-color: rgba(201,168,76,0.4); }
.file-upload-area input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}
.file-upload-area span { color: var(--gray); font-size: 0.85rem; }
.file-info { font-size: 0.8rem; color: var(--teal-light); margin-top: 0.5rem; }

/* ========== BUTTONS ========== */
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: var(--dark);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 25px;
  transition: transform 0.3s, box-shadow 0.3s;
  border: none;
  display: inline-block;
  cursor: pointer;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(201,168,76,0.3); }
.btn-secondary {
  background: transparent;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 25px;
  border: 1px solid rgba(201,168,76,0.4);
  transition: all 0.3s;
  display: inline-block;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(201,168,76,0.1); }
.btn-danger {
  background: transparent;
  color: var(--red-light);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(139,26,26,0.4);
  transition: all 0.3s;
}
.btn-danger:hover { background: rgba(139,26,26,0.1); }
.btn-edit {
  background: rgba(42,107,102,0.15);
  color: var(--teal-light);
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(42,107,102,0.3);
  transition: all 0.3s;
}
.btn-edit:hover { background: rgba(42,107,102,0.25); }
.full-width { width: 100%; }

/* ========== ITEMS LIST ========== */
.items-list { display: flex; flex-direction: column; gap: 1rem; }
.item-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: border-color 0.3s;
}
.item-row:hover { border-color: rgba(255,255,255,0.12); }
.item-row-thumb {
  width: 70px; height: 70px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--teal), var(--brown));
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  overflow: hidden;
}
.item-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-row-info { flex: 1; }
.item-row-info h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--cream);
  margin-bottom: 0.25rem;
}
.item-row-info p { color: var(--gray); font-size: 0.8rem; }
.item-row-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.4rem; }
.meta-badge {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-weight: 600;
}
.meta-gold { background: rgba(201,168,76,0.15); color: var(--gold); }
.meta-teal { background: rgba(42,107,102,0.15); color: var(--teal-light); }
.meta-red { background: rgba(139,26,26,0.15); color: var(--red-light); }
.item-row-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}
.item-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray);
}
.empty-state span { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state p { font-size: 0.9rem; }

/* ========== CONTACT MESSAGES ========== */
.contact-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s;
}
.contact-row:hover { border-color: rgba(255,255,255,0.12); }
.contact-row-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.contact-row-name { font-weight: 600; color: var(--cream); }
.contact-row-date { font-size: 0.75rem; color: var(--gray); }
.contact-row-subject {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.contact-row-msg { color: var(--gray-light); font-size: 0.875rem; line-height: 1.6; }
.contact-row-contact { display: flex; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.contact-row-contact a {
  font-size: 0.8rem;
  color: var(--teal-light);
  transition: color 0.2s;
}
.contact-row-contact a:hover { color: var(--gold); }

/* ========== SUBSCRIBER ROW ========== */
.subscriber-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subscriber-row span { color: var(--cream); font-size: 0.9rem; }
.subscriber-row small { color: var(--gray); font-size: 0.75rem; }

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--cream);
  padding: 0.875rem 2rem;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: #4ecdc4; }
.toast.error { border-color: var(--red-light); }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .admin-sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .item-row { flex-wrap: wrap; }
}
