/* =============================================
   TƏMİZ EV – Admin Panel Stylesheet
   ============================================= */

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

:root {
  --bg: #0f1117;
  --bg-2: #171a24;
  --bg-3: #1e2130;
  --card: #1e2130;
  --card-hover: #252840;
  --border: rgba(255,255,255,0.08);
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --red: #39c54e;
  --red-dark: #2eaa42;
  --green: #10b981;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --font: 'Inter', system-ui, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --radius: 12px;
  --transition: all 0.25s ease;
  --sidebar-width: 240px;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
input, textarea, select {
  font-family: var(--font);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(221,51,51,0.15);
}
textarea { resize: vertical; }
input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }
input[type="checkbox"] { width: auto; margin-right: 8px; }
select option { background: var(--bg-3); }

/* === LOGIN === */
#login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #0d1f0e 100%);
  z-index: 9999;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
  text-align: center;
}
.logo-t { color: var(--red); }
.logo-e { color: rgba(255,255,255,0.65); }
.login-card h2 {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.field-group { position: relative; margin-bottom: 16px; }
.field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field-group label i { margin-right: 6px; color: var(--red); }
.pass-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-2px);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.login-error {
  background: rgba(221,51,51,0.1);
  border: 1px solid rgba(221,51,51,0.3);
  color: #ff8080;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  margin-top: 8px;
}
.btn-login:hover {
  box-shadow: 0 8px 24px rgba(221,51,51,0.4);
  transform: translateY(-2px);
}
.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  opacity: 0.6;
}

/* === ADMIN LAYOUT === */
#admin-panel {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.sidebar-brand {
  padding: 24px 20px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-sub {
  font-size: 10px;
  font-weight: 600;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-item i { width: 18px; font-size: 15px; }
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(221,51,51,0.15), rgba(160,0,0,0.1));
  color: var(--red);
  border-left: 3px solid var(--red);
}
.nav-item.danger { color: #ff6b6b; }
.nav-item.danger:hover { background: rgba(255,51,51,0.08); }
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

/* === MAIN WRAP === */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === TOPBAR === */
.admin-topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: none;
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg-3); }
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-time {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* === CONTENT AREA === */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
}

/* === PAGES === */
.admin-page { display: none; }
.admin-page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.page-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === BUTTONS === */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(221,51,51,0.4); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--card-hover); }
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255,51,51,0.1);
  color: #ff6b6b;
  border: 1px solid rgba(255,51,51,0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(255,51,51,0.2); }
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.btn-icon:hover { color: var(--text); background: var(--card-hover); }
.btn-icon.danger:hover { color: #ff6b6b; border-color: rgba(255,51,51,0.3); }
.btn-icon.success:hover { color: var(--green); border-color: rgba(16,185,129,0.3); }

/* === STAT CARDS === */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.14); }
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.stat-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 13px; color: var(--text-muted); }

/* === DASH GRID === */
.dash-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.dash-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.dash-card h3 i { color: var(--red); }

.recent-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.recent-order-item:last-child { border-bottom: none; }
.service-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
}
.service-stat-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.service-stat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.filter-bar input { max-width: 300px; }
.filter-bar select { max-width: 200px; }

/* === TABLE === */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
thead th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-align: left;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--card-hover); }
tbody td { padding: 13px 16px; font-size: 14px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.status-Yeni { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-İşlənir { background: rgba(245,158,11,0.15); color: #fbbf24; }
.status-Tamamlandı { background: rgba(16,185,129,0.15); color: #34d399; }
.status-Ləğvedildi { background: rgba(239,68,68,0.15); color: #f87171; }

/* === CARDS GRID === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.admin-card:hover { border-color: rgba(255,255,255,0.14); transform: translateY(-2px); }
.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.admin-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.admin-card-actions { display: flex; gap: 6px; }
.admin-card-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  margin-bottom: 14px;
}
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}
.switch {
  position: relative;
  width: 36px;
  height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: var(--transition);
}
input:checked + .slider { background: var(--green); border-color: var(--green); }
input:checked + .slider::before { transform: translateX(16px); background: #fff; }

/* === GALLERY ADMIN === */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-admin-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}
.gallery-admin-item:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.14); }
.gallery-admin-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.gallery-admin-footer {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-caption { font-size: 13px; color: var(--text); font-weight: 500; }
.gallery-inactive { opacity: 0.4; }

/* === SETTINGS === */
.settings-form-wrap { max-width: 800px; }
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.settings-section h3 i { color: var(--red); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.settings-msg {
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.settings-msg.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.settings-msg.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 998;
  display: none;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: block; }
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}
.modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg-3); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-body .field-group { margin-bottom: 16px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.star-selector {
  display: flex;
  gap: 6px;
  font-size: 24px;
  cursor: pointer;
  margin: 6px 0;
}
.star-selector i { color: var(--bg-3); transition: var(--transition); }
.star-selector i.active { color: #f59e0b; }
.star-selector i:hover { color: #fbbf24; transform: scale(1.15); }

.img-preview {
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  border: 1px solid var(--border);
  max-height: 200px;
}
.img-preview img { width: 100%; height: 200px; object-fit: cover; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.success i { color: var(--green); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.error i { color: #f87171; }

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

/* === PRICING ADMIN CARD === */
.pricing-admin-items { margin-top: 10px; }
.pricing-admin-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.pricing-admin-item:last-child { border-bottom: none; }
.pricing-admin-item span:last-child { color: var(--text); font-weight: 600; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -240px; z-index: 990; transition: left 0.3s ease; }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 16px; }
  .filter-bar { flex-direction: column; }
  .filter-bar input, .filter-bar select { max-width: 100%; }
}
