/* ============================================
   RENS MOTOR - Main Stylesheet
   Theme: Luxury Automotive Dark
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@300;400;500;600;700&family=Barlow+Condensed:wght@400;600;700&display=swap');

:root {
  --primary: #c8a832;
  --primary-dark: #a88820;
  --primary-glow: rgba(200,168,50,0.3);
  --bg-dark: #0a0a0a;
  --bg-card: #141414;
  --bg-panel: #1a1a1a;
  --bg-hover: #222222;
  --border: rgba(255,255,255,0.08);
  --border-gold: rgba(200,168,50,0.3);
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ============================================
   TICKER
   ============================================ */
.ticker-wrap {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  height: 36px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.ticker-label {
  background: #000;
  color: var(--primary);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  z-index: 2;
  flex-shrink: 0;
}
.ticker-content {
  display: flex;
  align-items: center;
  height: 100%;
  overflow: hidden;
  flex: 1;
}
.ticker-text {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-item {
  color: #000;
  font-weight: 600;
  font-size: 13px;
  padding: 0 40px;
}
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.logo-text {
  line-height: 1;
}
.logo-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: 2px;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-btn:hover, .nav-btn.active {
  background: var(--bg-hover);
  color: var(--primary);
}
.nav-btn .nav-icon { font-size: 16px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
  padding: 6px 14px 6px 8px;
  cursor: pointer;
}
.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #000;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role {
  font-size: 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   MOBILE NAV DRAWER
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
}
.mobile-nav.open { display: block; }
.mobile-nav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.mobile-nav-panel {
  position: absolute;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-gold);
  padding: 24px 0;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--primary);
  background: rgba(200,168,50,0.05);
  border-left-color: var(--primary);
}
.mobile-nav-link .nav-icon { font-size: 18px; }

/* ============================================
   ADMIN SIDEBAR
   ============================================ */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-section { padding: 0 12px; margin-bottom: 8px; }
.sidebar-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 12px 6px;
  font-weight: 700;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-link.active {
  background: rgba(200,168,50,0.1);
  color: var(--primary);
  border-color: var(--border-gold);
}
.sidebar-link .s-icon { font-size: 16px; width: 20px; text-align: center; }

.admin-main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

/* ============================================
   PAGE SECTIONS
   ============================================ */
.page-section { display: none; }
.page-section.active { display: block; }

/* ============================================
   HERO / SLIDESHOW
   ============================================ */
.hero {
  position: relative;
  height: clamp(280px, 50vw, 560px);
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 32px;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  padding: 32px;
}
.hero-info { max-width: 500px; }
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: 2px;
  color: var(--text);
  line-height: 1;
}
.hero-price {
  color: var(--primary);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 700;
  margin-top: 8px;
}
.hero-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hero-tag {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text);
}
.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--transition);
}
.hero-dot.active { background: var(--primary); width: 24px; border-radius: 4px; }
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}
.hero-nav:hover { background: var(--primary); color: #000; }
.hero-prev { left: 16px; }
.hero-next { right: 16px; }

/* ============================================
   CARDS GRID
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--primary);
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px var(--border-gold);
}
.card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px; }
.card-brand {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 4px 0 8px;
  color: var(--text);
}
.card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.badge {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-glow); }
.btn-ghost {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-danger {
  background: rgba(231,76,60,0.15);
  color: var(--danger);
  border: 1px solid rgba(231,76,60,0.3);
}
.btn-danger:hover { background: rgba(231,76,60,0.25); }
.btn-success {
  background: rgba(46,204,113,0.15);
  color: var(--success);
  border: 1px solid rgba(46,204,113,0.3);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 6px; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--bg-dark); }

.img-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-dark);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-muted);
  flex-direction: column;
  gap: 8px;
}
.img-preview:hover { border-color: var(--primary); color: var(--primary); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-icon { font-size: 32px; }

/* 5-slot sparepart photo boxes */
.sp-photo-box {
  aspect-ratio: 1/1;
  background: var(--bg-dark);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  gap: 4px;
}
.sp-photo-box:hover { border-color: var(--primary); }
.sp-photo-box.has-photo { border-color: var(--primary); border-style: solid; }
.sp-photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-ph-num {
  position: absolute; top: 4px; left: 6px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: rgba(0,0,0,0.5); border-radius: 4px; padding: 1px 4px;
  z-index: 1;
}
.sp-photo-box.has-photo .sp-ph-num { color: #fff; }
.sp-ph-icon { font-size: 20px; color: var(--text-muted); }
.sp-photo-box.has-photo .sp-ph-icon { display: none; }

/* ============================================
   TABLE
   ============================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
thead th {
  background: var(--bg-panel);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:hover { background: var(--bg-hover); }
tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}
.td-img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; background: var(--bg-panel); }

/* ============================================
   STOCK CONTROL
   ============================================ */
.stock-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stock-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.stock-btn:hover { border-color: var(--primary); color: var(--primary); }
.stock-num {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}

/* ============================================
   PANELS & MODALS
   ============================================ */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--primary);
}
.modal-close {
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 30% 50%, rgba(200,168,50,0.05) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(200,168,50,0.03) 0%, transparent 50%),
              var(--bg-dark);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow), 0 0 60px rgba(200,168,50,0.05);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  letter-spacing: 4px;
  color: var(--primary);
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}
.login-car-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}
.login-error {
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border-gold); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============================================
   PROFIT/LOSS DISPLAY
   ============================================ */
.profit { color: var(--success) !important; }
.loss { color: var(--danger) !important; }
.in-badge {
  background: rgba(46,204,113,0.1);
  color: var(--success);
  border: 1px solid rgba(46,204,113,0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.out-badge {
  background: rgba(231,76,60,0.1);
  color: var(--danger);
  border: 1px solid rgba(231,76,60,0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { margin: 0; }
.filter-group input,
.filter-group select { width: auto; }

/* ============================================
   CHART CONTAINER
   ============================================ */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}
.chart-wrap canvas { max-height: 300px; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state-text { font-size: 16px; }

/* ============================================
   TOAST
   ============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  min-width: 250px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease;
  border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
  position: relative;
  display: inline-block;
}
.search-box input {
  padding-left: 36px;
  width: 220px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .header-nav { display: none; }
  .user-pill { display: none; }
  
  .sidebar { display: none; }
  .admin-main { padding: 16px; }
  
  .form-row { grid-template-columns: 1fr; }
  
  .cards-grid { grid-template-columns: 1fr 1fr; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  .filter-bar { flex-direction: column; }
  .filter-group input,
  .filter-group select { width: 100%; }
  
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  
  .hero-overlay { padding: 16px; }
  .hero-dots { bottom: 8px; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; align-self: flex-end; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  table { min-width: 500px; font-size: 12px; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gold { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.loading { opacity: 0.5; pointer-events: none; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Status dots */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-available { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-sold { background: var(--danger); }
.status-reserved { background: var(--warning); }

/* Toolbar Database Sparepart — stack di mobile */
@media (max-width: 700px) {
  .admin-sp-toolbar {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   ROLE-BASED RESTRICTIONS (ADMIN)
   Lapisan pertahanan CSS — selalu jalan biarpun JS gagal
   ============================================ */

/* Sembunyikan kontainer field harga beli & deskripsi internal untuk admin */
body.role-admin .form-group:has(#sp-buy-price),
body.role-admin .form-group:has(#sp-direct-buy),
body.role-admin .form-group:has(#sp-direct-sell),
body.role-admin .form-group:has(#trx-buy-price),
body.role-admin #sp-internal-desc-wrap,
body.role-admin .form-group:has(#sp-direct-internal-desc) {
  display: none !important;
}

/* Harga jual untuk admin tampil tapi read-only (visual) — readonly attr di-set oleh JS */
body.role-admin #sp-sell-price,
body.role-admin #trx-sell-price {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Sembunyikan tombol Contact di navbar saat login admin */
body.role-admin [data-section="contact"] {
  display: none !important;
}
